8153737: Unsupported Module
Reviewed-by: alanb, mchung, psandoz
This commit is contained in:
parent
ec2d388659
commit
25b68378f6
@ -31,7 +31,6 @@
|
||||
|
||||
package sun.nio.ch;
|
||||
|
||||
import sun.misc.*;
|
||||
import java.io.IOException;
|
||||
import java.io.FileDescriptor;
|
||||
import java.util.Iterator;
|
||||
|
@ -36,7 +36,6 @@ import java.io.FileDescriptor;
|
||||
import java.nio.channels.*;
|
||||
import java.nio.channels.spi.*;
|
||||
import java.util.*;
|
||||
import sun.misc.*;
|
||||
|
||||
class KQueueSelectorImpl
|
||||
extends SelectorImpl
|
||||
|
@ -86,8 +86,7 @@ module java.base {
|
||||
// see JDK-8044773
|
||||
exports jdk.net;
|
||||
|
||||
// These will move to a jdk.internal module via JEP-260
|
||||
exports sun.misc;
|
||||
// This will move to a jdk.internal module via JEP-260
|
||||
exports sun.reflect;
|
||||
|
||||
|
||||
@ -173,6 +172,7 @@ module java.base {
|
||||
java.xml,
|
||||
jdk.charsets,
|
||||
jdk.scripting.nashorn,
|
||||
jdk.unsupported,
|
||||
jdk.vm.ci;
|
||||
exports jdk.internal.perf to
|
||||
java.desktop,
|
||||
@ -180,6 +180,8 @@ module java.base {
|
||||
jdk.jvmstat;
|
||||
exports jdk.internal.ref to
|
||||
java.desktop;
|
||||
exports jdk.internal.vm.annotation to
|
||||
jdk.unsupported;
|
||||
exports jdk.internal.util.jar to
|
||||
jdk.jartool;
|
||||
exports jdk.internal.vm to
|
||||
|
@ -1,362 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.misc;
|
||||
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.Dictionary;
|
||||
import java.util.Enumeration;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/**
|
||||
* Caches the collision list.
|
||||
*/
|
||||
class CacheEntry {
|
||||
int hash;
|
||||
Object key;
|
||||
CacheEntry next;
|
||||
SoftReference<Object> value;
|
||||
|
||||
public CacheEntry() {
|
||||
value = null;
|
||||
}
|
||||
|
||||
public CacheEntry(Object o) {
|
||||
value = new SoftReference<>(o);
|
||||
}
|
||||
|
||||
public Object get() {
|
||||
return value.get();
|
||||
}
|
||||
|
||||
public void setThing(Object thing) {
|
||||
value = new SoftReference<>(thing);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Cache class. Maps keys to values. Any object can be used as
|
||||
* a key and/or value. This is very similar to the Hashtable
|
||||
* class, except that after putting an object into the Cache,
|
||||
* it is not guaranteed that a subsequent get will return it.
|
||||
* The Cache will automatically remove entries if memory is
|
||||
* getting tight and if the entry is not referenced from outside
|
||||
* the Cache.<p>
|
||||
*
|
||||
* To sucessfully store and retrieve objects from a hash table the
|
||||
* object used as the key must implement the hashCode() and equals()
|
||||
* methods.<p>
|
||||
*
|
||||
* This example creates a Cache of numbers. It uses the names of
|
||||
* the numbers as keys:
|
||||
* <pre>
|
||||
* Cache numbers = new Cache();
|
||||
* numbers.put("one", new Integer(1));
|
||||
* numbers.put("two", new Integer(1));
|
||||
* numbers.put("three", new Integer(1));
|
||||
* </pre>
|
||||
* To retrieve a number use:
|
||||
* <pre>
|
||||
* Integer n = (Integer)numbers.get("two");
|
||||
* if (n != null) {
|
||||
* System.out.println("two = " + n);
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @see java.lang.Object#hashCode
|
||||
* @see java.lang.Object#equals
|
||||
* @deprecated Consider {@link java.util.LinkedHashMap} for LRU caches.
|
||||
*/
|
||||
@Deprecated
|
||||
public
|
||||
class Cache extends Dictionary<Object, Object> {
|
||||
/**
|
||||
* The hash table data.
|
||||
*/
|
||||
private CacheEntry table[];
|
||||
|
||||
/**
|
||||
* The total number of entries in the hash table.
|
||||
*/
|
||||
private int count;
|
||||
|
||||
/**
|
||||
* Rehashes the table when count exceeds this threshold.
|
||||
*/
|
||||
private int threshold;
|
||||
|
||||
/**
|
||||
* The load factor for the hashtable.
|
||||
*/
|
||||
private float loadFactor;
|
||||
|
||||
private void init(int initialCapacity, float loadFactor) {
|
||||
if ((initialCapacity <= 0) || (loadFactor <= 0.0)) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.loadFactor = loadFactor;
|
||||
table = new CacheEntry[initialCapacity];
|
||||
threshold = (int) (initialCapacity * loadFactor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new, empty Cache with the specified initial
|
||||
* capacity and the specified load factor.
|
||||
* @param initialCapacity the initial number of buckets
|
||||
* @param loadFactor a number between 0.0 and 1.0, it defines
|
||||
* the threshold for rehashing the Cache into
|
||||
* a bigger one.
|
||||
* @exception IllegalArgumentException If the initial capacity
|
||||
* is less than or equal to zero.
|
||||
* @exception IllegalArgumentException If the load factor is
|
||||
* less than or equal to zero.
|
||||
*/
|
||||
public Cache (int initialCapacity, float loadFactor) {
|
||||
init(initialCapacity, loadFactor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new, empty Cache with the specified initial
|
||||
* capacity.
|
||||
* @param initialCapacity the initial number of buckets
|
||||
*/
|
||||
public Cache (int initialCapacity) {
|
||||
init(initialCapacity, 0.75f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new, empty Cache. A default capacity and load factor
|
||||
* is used. Note that the Cache will automatically grow when it gets
|
||||
* full.
|
||||
*/
|
||||
public Cache () {
|
||||
try {
|
||||
init(101, 0.75f);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
// This should never happen
|
||||
throw new Error("panic");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements contained within the Cache.
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the Cache contains no elements.
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return count == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an enumeration of the Cache's keys.
|
||||
* @see Cache#elements
|
||||
* @see Enumeration
|
||||
*/
|
||||
public synchronized Enumeration<Object> keys() {
|
||||
return new CacheEnumerator(table, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an enumeration of the elements. Use the Enumeration methods
|
||||
* on the returned object to fetch the elements sequentially.
|
||||
* @see Cache#keys
|
||||
* @see Enumeration
|
||||
*/
|
||||
public synchronized Enumeration<Object> elements() {
|
||||
return new CacheEnumerator(table, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the object associated with the specified key in the Cache.
|
||||
* @param key the key in the hash table
|
||||
* @return the element for the key or null if the key
|
||||
* is not defined in the hash table.
|
||||
* @see Cache#put
|
||||
*/
|
||||
public synchronized Object get(Object key) {
|
||||
CacheEntry tab[] = table;
|
||||
int hash = key.hashCode();
|
||||
int index = (hash & 0x7FFFFFFF) % tab.length;
|
||||
for (CacheEntry e = tab[index]; e != null; e = e.next) {
|
||||
if ((e.hash == hash) && e.key.equals(key)) {
|
||||
return e.get();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rehashes the contents of the table into a bigger table.
|
||||
* This is method is called automatically when the Cache's
|
||||
* size exceeds the threshold.
|
||||
*/
|
||||
protected void rehash() {
|
||||
int oldCapacity = table.length;
|
||||
CacheEntry oldTable[] = table;
|
||||
|
||||
int newCapacity = oldCapacity * 2 + 1;
|
||||
CacheEntry newTable[] = new CacheEntry[newCapacity];
|
||||
|
||||
threshold = (int) (newCapacity * loadFactor);
|
||||
table = newTable;
|
||||
|
||||
// System.out.println("rehash old=" + oldCapacity + ", new=" +
|
||||
// newCapacity + ", thresh=" + threshold + ", count=" + count);
|
||||
|
||||
for (int i = oldCapacity; i-- > 0;) {
|
||||
for (CacheEntry old = oldTable[i]; old != null;) {
|
||||
CacheEntry e = old;
|
||||
old = old.next;
|
||||
if (e.get() != null) {
|
||||
int index = (e.hash & 0x7FFFFFFF) % newCapacity;
|
||||
e.next = newTable[index];
|
||||
newTable[index] = e;
|
||||
} else
|
||||
count--; /* remove entries that have disappeared */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts the specified element into the Cache, using the specified
|
||||
* key. The element may be retrieved by doing a get() with the same
|
||||
* key. The key and the element cannot be null.
|
||||
* @param key the specified hashtable key
|
||||
* @param value the specified element
|
||||
* @return the old value of the key, or null if it did not have one.
|
||||
* @exception NullPointerException If the value of the specified
|
||||
* element is null.
|
||||
* @see Cache#get
|
||||
*/
|
||||
public synchronized Object put(Object key, Object value) {
|
||||
// Make sure the value is not null
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
// Makes sure the key is not already in the cache.
|
||||
CacheEntry tab[] = table;
|
||||
int hash = key.hashCode();
|
||||
int index = (hash & 0x7FFFFFFF) % tab.length;
|
||||
CacheEntry ne = null;
|
||||
for (CacheEntry e = tab[index]; e != null; e = e.next) {
|
||||
if ((e.hash == hash) && e.key.equals(key)) {
|
||||
Object old = e.get();
|
||||
e.setThing(value);
|
||||
return old;
|
||||
} else if (e.get() == null)
|
||||
ne = e; /* reuse old flushed value */
|
||||
}
|
||||
|
||||
if (count >= threshold) {
|
||||
// Rehash the table if the threshold is exceeded
|
||||
rehash();
|
||||
return put(key, value);
|
||||
}
|
||||
// Creates the new entry.
|
||||
if (ne == null) {
|
||||
ne = new CacheEntry ();
|
||||
ne.next = tab[index];
|
||||
tab[index] = ne;
|
||||
count++;
|
||||
}
|
||||
ne.hash = hash;
|
||||
ne.key = key;
|
||||
ne.setThing(value);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the element corresponding to the key. Does nothing if the
|
||||
* key is not present.
|
||||
* @param key the key that needs to be removed
|
||||
* @return the value of key, or null if the key was not found.
|
||||
*/
|
||||
public synchronized Object remove(Object key) {
|
||||
CacheEntry tab[] = table;
|
||||
int hash = key.hashCode();
|
||||
int index = (hash & 0x7FFFFFFF) % tab.length;
|
||||
for (CacheEntry e = tab[index], prev = null; e != null; prev = e, e = e.next) {
|
||||
if ((e.hash == hash) && e.key.equals(key)) {
|
||||
if (prev != null) {
|
||||
prev.next = e.next;
|
||||
} else {
|
||||
tab[index] = e.next;
|
||||
}
|
||||
count--;
|
||||
return e.get();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A Cache enumerator class. This class should remain opaque
|
||||
* to the client. It will use the Enumeration interface.
|
||||
*/
|
||||
class CacheEnumerator implements Enumeration<Object> {
|
||||
boolean keys;
|
||||
int index;
|
||||
CacheEntry table[];
|
||||
CacheEntry entry;
|
||||
|
||||
CacheEnumerator (CacheEntry table[], boolean keys) {
|
||||
this.table = table;
|
||||
this.keys = keys;
|
||||
this.index = table.length;
|
||||
}
|
||||
|
||||
public boolean hasMoreElements() {
|
||||
while (index >= 0) {
|
||||
while (entry != null)
|
||||
if (entry.get() != null)
|
||||
return true;
|
||||
else
|
||||
entry = entry.next;
|
||||
while (--index >= 0 && (entry = table[index]) == null) ;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object nextElement() {
|
||||
while (index >= 0) {
|
||||
if (entry == null)
|
||||
while (--index >= 0 && (entry = table[index]) == null) ;
|
||||
if (entry != null) {
|
||||
CacheEntry e = entry;
|
||||
entry = e.next;
|
||||
if (e.get() != null)
|
||||
return keys ? e.key : e.get();
|
||||
}
|
||||
}
|
||||
throw new NoSuchElementException("CacheEnumerator");
|
||||
}
|
||||
|
||||
}
|
@ -25,8 +25,6 @@
|
||||
|
||||
package sun.nio.ch;
|
||||
|
||||
import sun.misc.*;
|
||||
|
||||
|
||||
/**
|
||||
* Manipulates a native array of pollfd structs.
|
||||
|
@ -29,7 +29,6 @@ import java.io.IOException;
|
||||
import java.nio.channels.*;
|
||||
import java.nio.channels.spi.*;
|
||||
import java.util.*;
|
||||
import sun.misc.*;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -25,8 +25,6 @@
|
||||
|
||||
package sun.nio.ch;
|
||||
|
||||
import sun.misc.*;
|
||||
|
||||
|
||||
/**
|
||||
* Manipulates a native array of pollfd structs on Solaris:
|
||||
|
@ -27,6 +27,8 @@ module java.desktop {
|
||||
requires public java.datatransfer;
|
||||
requires public java.xml;
|
||||
requires java.prefs;
|
||||
// 8147544
|
||||
requires jdk.unsupported;
|
||||
|
||||
exports java.applet;
|
||||
exports java.awt;
|
||||
|
@ -24,6 +24,8 @@
|
||||
*/
|
||||
|
||||
module java.logging {
|
||||
// 8153158
|
||||
requires jdk.unsupported;
|
||||
exports java.util.logging;
|
||||
provides jdk.internal.logger.DefaultLoggerFinder with
|
||||
sun.util.logging.internal.LoggingProviderImpl;
|
||||
|
@ -27,6 +27,8 @@ module java.management {
|
||||
requires public java.rmi;
|
||||
requires java.logging;
|
||||
requires java.naming;
|
||||
// 8147553
|
||||
requires jdk.unsupported;
|
||||
|
||||
exports java.lang.management;
|
||||
exports javax.management;
|
||||
|
@ -26,6 +26,8 @@
|
||||
module jdk.crypto.pkcs11 {
|
||||
// Depends on SunEC provider for EC related functionality
|
||||
requires jdk.crypto.ec;
|
||||
// 8153371
|
||||
requires jdk.unsupported;
|
||||
provides java.security.Provider with sun.security.pkcs11.SunPKCS11;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
module jdk.httpserver {
|
||||
requires java.logging;
|
||||
// 8153372
|
||||
requires jdk.unsupported;
|
||||
exports com.sun.net.httpserver;
|
||||
exports com.sun.net.httpserver.spi;
|
||||
uses com.sun.net.httpserver.spi.HttpServerProvider;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 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
|
||||
@ -23,43 +23,8 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.misc;
|
||||
|
||||
/**
|
||||
* The CRC-16 class calculates a 16 bit cyclic redundancy check of a set
|
||||
* of bytes. This error detecting code is used to determine if bit rot
|
||||
* has occurred in a byte stream.
|
||||
*/
|
||||
|
||||
public class CRC16 {
|
||||
|
||||
/** value contains the currently computed CRC, set it to 0 initally */
|
||||
public int value;
|
||||
|
||||
public CRC16() {
|
||||
value = 0;
|
||||
}
|
||||
|
||||
/** update CRC with byte b */
|
||||
public void update(byte aByte) {
|
||||
int a, b;
|
||||
|
||||
a = (int) aByte;
|
||||
for (int count = 7; count >=0; count--) {
|
||||
a = a << 1;
|
||||
b = (a >>> 8) & 1;
|
||||
if ((value & 0x8000) != 0) {
|
||||
value = ((value << 1) + b) ^ 0x1021;
|
||||
} else {
|
||||
value = (value << 1) + b;
|
||||
}
|
||||
}
|
||||
value = value & 0xffff;
|
||||
return;
|
||||
}
|
||||
|
||||
/** reset CRC value to 0 */
|
||||
public void reset() {
|
||||
value = 0;
|
||||
}
|
||||
module jdk.unsupported {
|
||||
exports sun.misc;
|
||||
//exports sun.reflect;
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
* @bug 8054386
|
||||
* @summary java debugging test for CDS
|
||||
* @modules jdk.jdi
|
||||
* java.base/sun.misc
|
||||
* java.management
|
||||
* jdk.jartool/sun.tools.jar
|
||||
* @library /lib/testlibrary
|
||||
|
@ -26,7 +26,6 @@
|
||||
* @bug 8054386
|
||||
* @summary java debugging test for CDS
|
||||
* @modules jdk.jdi
|
||||
* java.base/sun.misc
|
||||
* java.management
|
||||
* jdk.jartool/sun.tools.jar
|
||||
* @library /lib/testlibrary
|
||||
|
@ -26,7 +26,6 @@
|
||||
* @bug 8054386
|
||||
* @summary java debugging test for CDS
|
||||
* @modules jdk.jdi
|
||||
* java.base/sun.misc
|
||||
* java.management
|
||||
* jdk.jartool/sun.tools.jar
|
||||
* @library /lib/testlibrary
|
||||
|
@ -29,7 +29,6 @@
|
||||
* 4947220 7018606 7034570 4244896 5049299 8003488 8054494 8058464
|
||||
* 8067796
|
||||
* @summary Basic tests for Process and Environment Variable code
|
||||
* @modules java.base/sun.misc
|
||||
* @run main/othervm/timeout=300 Basic
|
||||
* @run main/othervm/timeout=300 -Djdk.lang.Process.launchMechanism=fork Basic
|
||||
* @author Martin Buchholz
|
||||
|
@ -25,7 +25,6 @@
|
||||
* @test
|
||||
* @bug 8072611
|
||||
* @summary ProcessBuilder Redirect to file appending on Windows should work with long file names
|
||||
* @modules java.base/sun.misc
|
||||
* @author Thomas Stuefe
|
||||
*/
|
||||
|
||||
|
@ -37,7 +37,8 @@ import org.testng.annotations.Test;
|
||||
/*
|
||||
* @test
|
||||
* @library /test/lib/share/classes
|
||||
* @modules jdk.management
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* jdk.management
|
||||
* @run testng Basic
|
||||
* @summary Basic tests for ProcessHandler
|
||||
* @author Roger Riggs
|
||||
|
@ -49,7 +49,8 @@ import org.testng.annotations.Test;
|
||||
* @test
|
||||
* @bug 8077350 8081566 8081567 8098852 8136597
|
||||
* @library /test/lib/share/classes
|
||||
* @modules jdk.management
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* jdk.management
|
||||
* @build jdk.test.lib.Platform jdk.test.lib.Utils
|
||||
* @run testng InfoTest
|
||||
* @summary Functions of ProcessHandle.Info
|
||||
|
@ -39,7 +39,8 @@ import org.testng.TestNG;
|
||||
/*
|
||||
* @test
|
||||
* @library /test/lib/share/classes
|
||||
* @modules jdk.management
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* jdk.management
|
||||
* @build jdk.test.lib.Platform jdk.test.lib.Utils
|
||||
* @run testng OnExitTest
|
||||
* @summary Functions of Process.onExit and ProcessHandle.onExit
|
||||
|
@ -45,7 +45,8 @@ import org.testng.annotations.Test;
|
||||
/*
|
||||
* @test
|
||||
* @library /test/lib/share/classes
|
||||
* @modules jdk.management
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* jdk.management
|
||||
* @build jdk.test.lib.Utils
|
||||
* @run testng/othervm TreeTest
|
||||
* @summary Test counting and JavaChild.spawning and counting of Processes.
|
||||
|
@ -24,7 +24,7 @@
|
||||
/* @test
|
||||
* @bug 8046903
|
||||
* @summary VM anonymous class members can't be statically invocable
|
||||
* @modules java.base/sun.misc java.base/jdk.internal.org.objectweb.asm
|
||||
* @modules java.base/jdk.internal.misc java.base/jdk.internal.org.objectweb.asm
|
||||
* @run junit test.java.lang.invoke.VMAnonymousClass
|
||||
*/
|
||||
package test.java.lang.invoke;
|
||||
@ -34,7 +34,7 @@ import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.reflect.Field;
|
||||
import org.junit.Test;
|
||||
import sun.misc.Unsafe;
|
||||
import jdk.internal.misc.Unsafe;
|
||||
import jdk.internal.org.objectweb.asm.*;
|
||||
import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
@ -43,17 +43,17 @@ public class VMAnonymousClass {
|
||||
VMAnonymousClass test = new VMAnonymousClass();
|
||||
test.testJavaLang();
|
||||
test.testJavaUtil();
|
||||
test.testSunMisc();
|
||||
test.testJdkInternalMisc();
|
||||
test.testJavaLangInvoke();
|
||||
System.out.println("TEST PASSED");
|
||||
}
|
||||
|
||||
// Test VM anonymous classes from different packages
|
||||
// (see j.l.i.InvokerBytecodeGenerator::isStaticallyInvocable).
|
||||
@Test public void testJavaLang() throws Throwable { test("java/lang"); }
|
||||
@Test public void testJavaUtil() throws Throwable { test("java/util"); }
|
||||
@Test public void testSunMisc() throws Throwable { test("sun/misc"); }
|
||||
@Test public void testJavaLangInvoke() throws Throwable { test("java/lang/invoke"); }
|
||||
@Test public void testJavaLang() throws Throwable { test("java/lang"); }
|
||||
@Test public void testJavaUtil() throws Throwable { test("java/util"); }
|
||||
@Test public void testJdkInternalMisc() throws Throwable { test("jdk/internal/misc"); }
|
||||
@Test public void testJavaLangInvoke() throws Throwable { test("java/lang/invoke"); }
|
||||
|
||||
private static Unsafe unsafe = getUnsafe();
|
||||
|
||||
|
@ -5,5 +5,4 @@ modules = \
|
||||
java.security.jgss/sun.security.krb5.internal \
|
||||
java.security.jgss/sun.security.krb5.internal.ktab \
|
||||
java.base/sun.net.spi.nameservice \
|
||||
java.base/sun.security.util \
|
||||
java.base/sun.misc
|
||||
java.base/sun.security.util
|
||||
|
@ -5,5 +5,4 @@ modules = \
|
||||
java.security.jgss/sun.security.krb5.internal \
|
||||
java.security.jgss/sun.security.krb5.internal.ktab \
|
||||
java.base/sun.net.spi.nameservice \
|
||||
java.base/sun.security.util \
|
||||
java.base/sun.misc
|
||||
java.base/sun.security.util
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../SSLEngine ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLEngineService SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLEngineExplorer SSLv2Hello,SSLv3
|
||||
* @run main/othervm SSLEngineExplorer SSLv3
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../SSLEngine ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLEngineService SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLEngineExplorerMatchedSNI www.example.com
|
||||
* www\.example\.com
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../SSLEngine ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLEngineService SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLEngineExplorerUnmatchedSNI www.example.com
|
||||
* www\.example\.org
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../SSLEngine ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLEngineService SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLEngineExplorerWithCli
|
||||
*/
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../SSLEngine ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLEngineService SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLEngineExplorerWithSrv
|
||||
*/
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLSocketExplorer SSLv2Hello,SSLv3
|
||||
* @run main/othervm SSLSocketExplorer SSLv3
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLSocketExplorerFailure SSLv2Hello,SSLv3
|
||||
* @run main/othervm SSLSocketExplorerFailure SSLv3
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLSocketExplorerMatchedSNI www.example.com
|
||||
* www\.example\.com
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLSocketExplorerUnmatchedSNI www.example.com
|
||||
* www\.example\.org
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLSocketExplorerWithCliSNI
|
||||
*/
|
||||
|
@ -31,7 +31,6 @@
|
||||
* @bug 7068321
|
||||
* @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
|
||||
* @library ../templates
|
||||
* @modules java.base/sun.misc
|
||||
* @build SSLCapabilities SSLExplorer
|
||||
* @run main/othervm SSLSocketExplorerWithSrvSNI
|
||||
*/
|
||||
|
@ -24,8 +24,7 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8015081
|
||||
* @modules java.base/sun.misc
|
||||
* java.management
|
||||
* @modules java.management
|
||||
* java.security.jgss
|
||||
* @compile Subject.java
|
||||
* @compile SubjectNullTests.java
|
||||
|
@ -24,7 +24,8 @@
|
||||
/* @test
|
||||
* @bug 6565543
|
||||
* @summary Minimal test for unsafe.copyMemory() and unsafe.setMemory()
|
||||
* @modules java.base/sun.nio.ch java.base/sun.misc
|
||||
* @modules java.base/sun.nio.ch
|
||||
* jdk.unsupported
|
||||
* @key randomness
|
||||
*/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @bug 4495577
|
||||
* @summary Ensure that sun.misc.Unsafe cannot (easily)
|
||||
* be accessed from user code
|
||||
* @modules java.base/sun.misc
|
||||
* @modules jdk.unsupported
|
||||
*/
|
||||
|
||||
|
||||
|
@ -44,6 +44,7 @@ import sun.misc.SignalHandler;
|
||||
/*
|
||||
* @test
|
||||
* @library /test/lib/share/classes
|
||||
* @modules jdk.unsupported
|
||||
* @build jdk.test.lib.Platform jdk.test.lib.Utils
|
||||
* @run testng/othervm -Xrs -DXrs=true SunMiscSignalTest
|
||||
* @run testng/othervm SunMiscSignalTest
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 7194897
|
||||
* @summary JSR 292: Cannot create more than 16 instances of an anonymous class
|
||||
* @modules java.base/sun.misc
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @library /lib/testlibrary
|
||||
* @author Robert Field
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import sun.misc.Unsafe;
|
||||
import jdk.internal.misc.Unsafe;
|
||||
|
||||
public class ManyNewInstanceAnonTest {
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
modules java.base/jdk.internal.misc \
|
||||
java.base/sun.misc \
|
||||
java.base/sun.net.spi.nameservice \
|
||||
java.base/sun.security.util \
|
||||
java.security.jgss/sun.security.jgss \
|
||||
|
@ -30,7 +30,6 @@
|
||||
* java.base/sun.security.util
|
||||
* java.base/sun.security.provider
|
||||
* java.base/sun.security.x509
|
||||
* java.base/sun.misc
|
||||
* @compile -XDignore.symbol.file PKCS8Test.java
|
||||
* @run main PKCS8Test
|
||||
*/
|
||||
|
@ -25,8 +25,7 @@
|
||||
* @test
|
||||
* @bug 8011867
|
||||
* @summary Accept unknown PKCS #9 attributes
|
||||
* @modules java.base/sun.misc
|
||||
* java.base/sun.security.pkcs
|
||||
* @modules java.base/sun.security.pkcs
|
||||
* java.base/sun.security.util
|
||||
*/
|
||||
|
||||
|
@ -30,8 +30,7 @@ import jdk.testlibrary.JarUtils;
|
||||
* @bug 8024302 8026037
|
||||
* @summary The test signs and verifies a jar file with -tsacert option
|
||||
* @library /lib/testlibrary
|
||||
* @modules java.base/sun.misc
|
||||
* java.base/sun.security.pkcs
|
||||
* @modules java.base/sun.security.pkcs
|
||||
* java.base/sun.security.timestamp
|
||||
* java.base/sun.security.util
|
||||
* java.base/sun.security.x509
|
||||
|
@ -24,8 +24,7 @@
|
||||
# @test
|
||||
# @bug 6543842 6543440 6939248 8009636 8024302
|
||||
# @summary checking response of timestamp
|
||||
# @modules java.base/sun.misc
|
||||
# java.base/sun.security.pkcs
|
||||
# @modules java.base/sun.security.pkcs
|
||||
# java.base/sun.security.timestamp
|
||||
# java.base/sun.security.x509
|
||||
# java.base/sun.security.util
|
||||
@ -95,8 +94,7 @@ $KT -alias tsbad3 -certreq | \
|
||||
$KT -alias ca -gencert -ext eku:critical=cs | \
|
||||
$KT -alias tsbad3 -importcert
|
||||
|
||||
EXTRAOPTS="-XaddExports:java.base/sun.misc=ALL-UNNAMED \
|
||||
-XaddExports:java.base/sun.security.pkcs=ALL-UNNAMED \
|
||||
EXTRAOPTS="-XaddExports:java.base/sun.security.pkcs=ALL-UNNAMED \
|
||||
-XaddExports:java.base/sun.security.timestamp=ALL-UNNAMED \
|
||||
-XaddExports:java.base/sun.security.x509=ALL-UNNAMED \
|
||||
-XaddExports:java.base/sun.security.util=ALL-UNNAMED"
|
||||
|
@ -24,8 +24,7 @@
|
||||
/* @test
|
||||
* @bug 4118818
|
||||
* @summary allow null X.500 Names
|
||||
* @modules java.base/sun.misc
|
||||
* java.base/sun.security.util
|
||||
* @modules java.base/sun.security.util
|
||||
* java.base/sun.security.x509
|
||||
*/
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class AddExportsTest {
|
||||
boolean compiled = CompilerUtils.compile(
|
||||
SRC_DIR.resolve(TEST1_MODULE),
|
||||
MODS_DIR.resolve(TEST1_MODULE),
|
||||
"-XaddExports:java.base/sun.misc=m1");
|
||||
"-XaddExports:java.base/jdk.internal.misc=m1");
|
||||
assertTrue(compiled, "module " + TEST1_MODULE + " did not compile");
|
||||
|
||||
// javac -d upgrademods/java.transaction src/java.transaction/**
|
||||
@ -118,16 +118,16 @@ public class AddExportsTest {
|
||||
|
||||
|
||||
/**
|
||||
* Run class path application that uses sun.misc.Unsafe
|
||||
* Run class path application that uses jdk.internal.misc.Unsafe
|
||||
*/
|
||||
public void testUnnamedModule() throws Exception {
|
||||
|
||||
// java -XaddExports:java.base/sun.misc=ALL-UNNAMED \
|
||||
// java -XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED \
|
||||
// -cp mods/$TESTMODULE jdk.test.UsesUnsafe
|
||||
|
||||
String classpath = MODS_DIR.resolve(TEST1_MODULE).toString();
|
||||
int exitValue
|
||||
= executeTestJava("-XaddExports:java.base/sun.misc=ALL-UNNAMED",
|
||||
= executeTestJava("-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED",
|
||||
"-cp", classpath,
|
||||
TEST1_MAIN_CLASS)
|
||||
.outputTo(System.out)
|
||||
@ -139,16 +139,16 @@ public class AddExportsTest {
|
||||
|
||||
|
||||
/**
|
||||
* Run named module that uses sun.misc.Unsafe
|
||||
* Run named module that uses jdk.internal.misc.Unsafe
|
||||
*/
|
||||
public void testNamedModule() throws Exception {
|
||||
|
||||
// java -XaddExports:java.base/sun.misc=test \
|
||||
// java -XaddExports:java.base/jdk.internal.misc=test \
|
||||
// -mp mods -m $TESTMODULE/$MAIN_CLASS
|
||||
|
||||
String mid = TEST1_MODULE + "/" + TEST1_MAIN_CLASS;
|
||||
int exitValue =
|
||||
executeTestJava("-XaddExports:java.base/sun.misc=" + TEST1_MODULE,
|
||||
executeTestJava("-XaddExports:java.base/jdk.internal.misc=" + TEST1_MODULE,
|
||||
"-mp", MODS_DIR.toString(),
|
||||
"-m", mid)
|
||||
.outputTo(System.out)
|
||||
@ -240,13 +240,13 @@ public class AddExportsTest {
|
||||
public Object[][] badValues() {
|
||||
return new Object[][]{
|
||||
|
||||
{ "java.base/sun.misc", null }, // missing target
|
||||
{ "java.base/sun.misc=sun.monkey", null }, // unknown target
|
||||
{ "java.monkey/sun.monkey=ALL-UNNAMED", null }, // unknown module
|
||||
{ "java.base/sun.monkey=ALL-UNNAMED", null }, // unknown package
|
||||
{ "java.monkey/sun.monkey=ALL-UNNAMED", null }, // unknown module/package
|
||||
{ "java.base=ALL-UNNAMED", null }, // missing package
|
||||
{ "java.base/=ALL-UNNAMED", null } // missing package
|
||||
{ "java.base/jdk.internal.misc", null }, // missing target
|
||||
{ "java.base/jdk.internal.misc=sun.monkey", null }, // unknown target
|
||||
{ "java.monkey/sun.monkey=ALL-UNNAMED", null }, // unknown module
|
||||
{ "java.base/sun.monkey=ALL-UNNAMED", null }, // unknown package
|
||||
{ "java.monkey/sun.monkey=ALL-UNNAMED", null }, // unknown module/package
|
||||
{ "java.base=ALL-UNNAMED", null }, // missing package
|
||||
{ "java.base/=ALL-UNNAMED", null } // missing package
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
package jdk.test1;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import sun.misc.Unsafe;
|
||||
import jdk.internal.misc.Unsafe;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
@ -103,9 +103,10 @@ public class LimitModsTest {
|
||||
public void testWithAddMods() throws Exception {
|
||||
int exitValue;
|
||||
|
||||
// java -limitmods java.base -addmods java.logging -listmods
|
||||
// java -limitmods java.base -addmods java.logging,jdk.unsupported -listmods
|
||||
exitValue = executeTestJava("-limitmods", "java.base",
|
||||
"-addmods", "java.logging",
|
||||
"-addmods",
|
||||
"java.logging,jdk.unsupported", // TODO: add bug No.
|
||||
"-listmods")
|
||||
.outputTo(System.out)
|
||||
.errorTo(System.out)
|
||||
|
Loading…
Reference in New Issue
Block a user