--- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java Thu Nov 06 15:12:17 2014 -0800
@@ -29,12 +29,10 @@
import java.io.File;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
import java.net.URL;
import java.security.AccessController;
import java.security.AccessControlContext;
import java.security.CodeSource;
-import java.security.Policy;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
@@ -54,7 +52,6 @@
import sun.misc.CompoundEnumeration;
import sun.misc.Resource;
import sun.misc.URLClassPath;
-import sun.misc.VM;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
import sun.reflect.misc.ReflectUtil;
@@ -268,8 +265,8 @@
// The packages defined in this class loader. Each package name is mapped
// to its corresponding Package object.
- // @GuardedBy("itself")
- private final HashMap<String, Package> packages = new HashMap<>();
+ private final ConcurrentHashMap<String, Package> packages
+ = new ConcurrentHashMap<>();
private static Void checkCreateClassLoader() {
SecurityManager security = System.getSecurityManager();
@@ -1575,17 +1572,17 @@
String implVendor, URL sealBase)
throws IllegalArgumentException
{
- synchronized (packages) {
- Package pkg = getPackage(name);
- if (pkg != null) {
- throw new IllegalArgumentException(name);
- }
- pkg = new Package(name, specTitle, specVersion, specVendor,
- implTitle, implVersion, implVendor,
- sealBase, this);
- packages.put(name, pkg);
- return pkg;
+ Package pkg = getPackage(name);
+ if (pkg != null) {
+ throw new IllegalArgumentException(name);
}
+ pkg = new Package(name, specTitle, specVersion, specVendor,
+ implTitle, implVersion, implVendor,
+ sealBase, this);
+ if (packages.putIfAbsent(name, pkg) != null) {
+ throw new IllegalArgumentException(name);
+ }
+ return pkg;
}
/**
@@ -1601,26 +1598,13 @@
* @since 1.2
*/
protected Package getPackage(String name) {
- Package pkg;
- synchronized (packages) {
- pkg = packages.get(name);
- }
+ Package pkg = packages.get(name);
if (pkg == null) {
if (parent != null) {
pkg = parent.getPackage(name);
} else {
pkg = Package.getSystemPackage(name);
}
- if (pkg != null) {
- synchronized (packages) {
- Package pkg2 = packages.get(name);
- if (pkg2 == null) {
- packages.put(name, pkg);
- } else {
- pkg = pkg2;
- }
- }
- }
}
return pkg;
}
@@ -1635,22 +1619,18 @@
* @since 1.2
*/
protected Package[] getPackages() {
- Map<String, Package> map;
- synchronized (packages) {
- map = new HashMap<>(packages);
- }
Package[] pkgs;
if (parent != null) {
pkgs = parent.getPackages();
} else {
pkgs = Package.getSystemPackages();
}
+
+ Map<String, Package> map = packages;
if (pkgs != null) {
+ map = new HashMap<>(packages);
for (Package pkg : pkgs) {
- String pkgName = pkg.getName();
- if (map.get(pkgName) == null) {
- map.put(pkgName, pkg);
- }
+ map.putIfAbsent(pkg.getName(), pkg);
}
}
return map.values().toArray(new Package[map.size()]);
--- a/jdk/src/java.base/share/classes/java/lang/Package.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/Package.java Thu Nov 06 15:12:17 2014 -0800
@@ -26,27 +26,21 @@
package java.lang;
import java.lang.reflect.AnnotatedElement;
-import java.io.InputStream;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.net.MalformedURLException;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.util.jar.Attributes;
import java.util.jar.Attributes.Name;
-import java.util.jar.JarException;
import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
import sun.net.www.ParseUtil;
import sun.reflect.CallerSensitive;
@@ -538,17 +532,15 @@
* Returns the loaded system package for the specified name.
*/
static Package getSystemPackage(String name) {
- synchronized (pkgs) {
- Package pkg = pkgs.get(name);
- if (pkg == null) {
- name = name.replace('.', '/').concat("/");
- String fn = getSystemPackage0(name);
- if (fn != null) {
- pkg = defineSystemPackage(name, fn);
- }
+ Package pkg = pkgs.get(name);
+ if (pkg == null) {
+ name = name.replace('.', '/').concat("/");
+ String fn = getSystemPackage0(name);
+ if (fn != null) {
+ pkg = defineSystemPackage(name, fn);
}
- return pkg;
}
+ return pkg;
}
/*
@@ -557,74 +549,98 @@
static Package[] getSystemPackages() {
// First, update the system package map with new package names
String[] names = getSystemPackages0();
- synchronized (pkgs) {
- for (String name : names) {
+ for (String name : names) {
+ if (!pkgs.containsKey(name)) {
defineSystemPackage(name, getSystemPackage0(name));
}
- return pkgs.values().toArray(new Package[pkgs.size()]);
}
+ return pkgs.values().toArray(new Package[pkgs.size()]);
}
private static Package defineSystemPackage(final String iname,
final String fn)
{
- return AccessController.doPrivileged(new PrivilegedAction<Package>() {
- public Package run() {
- String name = iname;
- // Get the cached code source url for the file name
- URL url = urls.get(fn);
- if (url == null) {
- // URL not found, so create one
- File file = new File(fn);
- try {
- url = ParseUtil.fileToEncodedURL(file);
- } catch (MalformedURLException e) {
- }
- if (url != null) {
- urls.put(fn, url);
- // If loading a JAR file, then also cache the manifest
- if (file.isFile()) {
- mans.put(fn, loadManifest(fn));
- }
- }
- }
- // Convert to "."-separated package name
- name = name.substring(0, name.length() - 1).replace('/', '.');
- Package pkg;
- Manifest man = mans.get(fn);
- if (man != null) {
- pkg = new Package(name, man, url, null);
- } else {
- pkg = new Package(name, null, null, null,
- null, null, null, null, null);
- }
- pkgs.put(name, pkg);
- return pkg;
- }
- });
+ // Convert to "."-separated package name
+ String name = iname.substring(0, iname.length() - 1).replace('/', '.');
+ // Creates a cached manifest for the file name, allowing
+ // only-once, lazy reads of manifest from jar files
+ CachedManifest cachedManifest = createCachedManifest(fn);
+ pkgs.putIfAbsent(name, new Package(name, cachedManifest.getManifest(),
+ cachedManifest.getURL(), null));
+ // Ensure we only expose one Package object
+ return pkgs.get(name);
}
- /*
- * Returns the Manifest for the specified JAR file name.
- */
- private static Manifest loadManifest(String fn) {
- try (FileInputStream fis = new FileInputStream(fn);
- JarInputStream jis = new JarInputStream(fis, false))
- {
- return jis.getManifest();
- } catch (IOException e) {
- return null;
+ private static CachedManifest createCachedManifest(String fn) {
+ if (!manifests.containsKey(fn)) {
+ manifests.putIfAbsent(fn, new CachedManifest(fn));
}
+ return manifests.get(fn);
}
// The map of loaded system packages
- private static Map<String, Package> pkgs = new HashMap<>(31);
+ private static final ConcurrentHashMap<String, Package> pkgs
+ = new ConcurrentHashMap<>();
+
+ // Maps each directory or zip file name to its corresponding manifest, if
+ // it exists
+ private static final ConcurrentHashMap<String, CachedManifest> manifests
+ = new ConcurrentHashMap<>();
+
+ private static class CachedManifest {
+ private static final Manifest EMPTY_MANIFEST = new Manifest();
+ private final String fileName;
+ private final URL url;
+ private volatile Manifest manifest;
+
+ CachedManifest(final String fileName) {
+ this.fileName = fileName;
+ this.url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
+ public URL run() {
+ final File file = new File(fileName);
+ if (file.isFile()) {
+ try {
+ return ParseUtil.fileToEncodedURL(file);
+ } catch (MalformedURLException e) {
+ }
+ }
+ return null;
+ }
+ });
+ }
- // Maps each directory or zip file name to its corresponding url
- private static Map<String, URL> urls = new HashMap<>(10);
+ public URL getURL() {
+ return url;
+ }
- // Maps each code source url for a jar file to its manifest
- private static Map<String, Manifest> mans = new HashMap<>(10);
+ public Manifest getManifest() {
+ if (url == null) {
+ return EMPTY_MANIFEST;
+ }
+ Manifest m = manifest;
+ if (m != null) {
+ return m;
+ }
+ synchronized (this) {
+ m = manifest;
+ if (m != null) {
+ return m;
+ }
+ m = AccessController.doPrivileged(new PrivilegedAction<Manifest>() {
+ public Manifest run() {
+ try (FileInputStream fis = new FileInputStream(fileName);
+ JarInputStream jis = new JarInputStream(fis, false)) {
+ return jis.getManifest();
+ } catch (IOException e) {
+ return null;
+ }
+ }
+ });
+ manifest = m = (m == null ? EMPTY_MANIFEST : m);
+ }
+ return m;
+ }
+ }
private static native String getSystemPackage0(String name);
private static native String[] getSystemPackages0();
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java Thu Nov 06 15:12:17 2014 -0800
@@ -1388,16 +1388,26 @@
Object a4, Object a5, Object a6, Object a7,
Object a8, Object a9)
{ return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
+
+ private static final int ARRAYS_COUNT = 11;
+
private static MethodHandle[] makeArrays() {
- ArrayList<MethodHandle> mhs = new ArrayList<>();
- for (;;) {
- MethodHandle mh = findCollector("array", mhs.size(), Object[].class);
- if (mh == null) break;
+ MethodHandle[] mhs = new MethodHandle[MAX_ARITY + 1];
+ for (int i = 0; i < ARRAYS_COUNT; i++) {
+ MethodHandle mh = findCollector("array", i, Object[].class);
mh = makeIntrinsic(mh, Intrinsic.NEW_ARRAY);
- mhs.add(mh);
+ mhs[i] = mh;
}
- assert(mhs.size() == 11); // current number of methods
- return mhs.toArray(new MethodHandle[MAX_ARITY+1]);
+ assert(assertArrayMethodCount(mhs));
+ return mhs;
+ }
+
+ private static boolean assertArrayMethodCount(MethodHandle[] mhs) {
+ assert(findCollector("array", ARRAYS_COUNT, Object[].class) == null);
+ for (int i = 0; i < ARRAYS_COUNT; i++) {
+ assert(mhs[i] != null);
+ }
+ return true;
}
// filling versions of the above:
@@ -1449,15 +1459,22 @@
private static final int FILL_ARRAYS_COUNT = 11; // current number of fillArray methods
private static MethodHandle[] makeFillArrays() {
- ArrayList<MethodHandle> mhs = new ArrayList<>();
- mhs.add(null); // there is no empty fill; at least a0 is required
- for (;;) {
- MethodHandle mh = findCollector("fillArray", mhs.size(), Object[].class, Integer.class, Object[].class);
- if (mh == null) break;
- mhs.add(mh);
+ MethodHandle[] mhs = new MethodHandle[FILL_ARRAYS_COUNT];
+ mhs[0] = null; // there is no empty fill; at least a0 is required
+ for (int i = 1; i < FILL_ARRAYS_COUNT; i++) {
+ MethodHandle mh = findCollector("fillArray", i, Object[].class, Integer.class, Object[].class);
+ mhs[i] = mh;
}
- assert(mhs.size() == FILL_ARRAYS_COUNT);
- return mhs.toArray(new MethodHandle[0]);
+ assert(assertFillArrayMethodCount(mhs));
+ return mhs;
+ }
+
+ private static boolean assertFillArrayMethodCount(MethodHandle[] mhs) {
+ assert(findCollector("fillArray", FILL_ARRAYS_COUNT, Object[].class, Integer.class, Object[].class) == null);
+ for (int i = 1; i < FILL_ARRAYS_COUNT; i++) {
+ assert(mhs[i] != null);
+ }
+ return true;
}
private static Object copyAsPrimitiveArray(Wrapper w, Object... boxes) {
@@ -1472,9 +1489,6 @@
static MethodHandle varargsArray(int nargs) {
MethodHandle mh = Lazy.ARRAYS[nargs];
if (mh != null) return mh;
- mh = findCollector("array", nargs, Object[].class);
- if (mh != null) mh = makeIntrinsic(mh, Intrinsic.NEW_ARRAY);
- if (mh != null) return Lazy.ARRAYS[nargs] = mh;
mh = buildVarargsArray(Lazy.MH_fillNewArray, Lazy.MH_arrayIdentity, nargs);
assert(assertCorrectArity(mh, nargs));
mh = makeIntrinsic(mh, Intrinsic.NEW_ARRAY);
--- a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java Thu Nov 06 15:12:17 2014 -0800
@@ -122,18 +122,18 @@
AccessController.doPrivileged(
new PrivilegedAction<Void>() {
public Void run() {
- ThreadGroup tg = Thread.currentThread().getThreadGroup();
- for (ThreadGroup tgn = tg;
- tgn != null;
- tg = tgn, tgn = tg.getParent());
- Thread sft = new Thread(tg, proc, "Secondary finalizer");
- sft.start();
- try {
- sft.join();
- } catch (InterruptedException x) {
- /* Ignore */
- }
- return null;
+ ThreadGroup tg = Thread.currentThread().getThreadGroup();
+ for (ThreadGroup tgn = tg;
+ tgn != null;
+ tg = tgn, tgn = tg.getParent());
+ Thread sft = new Thread(tg, proc, "Secondary finalizer");
+ sft.start();
+ try {
+ sft.join();
+ } catch (InterruptedException x) {
+ Thread.currentThread().interrupt();
+ }
+ return null;
}});
}
@@ -146,6 +146,7 @@
forkSecondaryFinalizer(new Runnable() {
private volatile boolean running;
public void run() {
+ // in case of recursive call to run()
if (running)
return;
final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
@@ -168,6 +169,7 @@
forkSecondaryFinalizer(new Runnable() {
private volatile boolean running;
public void run() {
+ // in case of recursive call to run()
if (running)
return;
final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
@@ -189,6 +191,7 @@
super(g, "Finalizer");
}
public void run() {
+ // in case of recursive call to run()
if (running)
return;
--- a/jdk/src/java.base/share/classes/java/net/SocketImpl.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/net/SocketImpl.java Thu Nov 06 15:12:17 2014 -0800
@@ -446,6 +446,7 @@
serverSocketOptions.add(StandardSocketOptions.SO_RCVBUF);
serverSocketOptions.add(StandardSocketOptions.SO_REUSEADDR);
+ serverSocketOptions.add(StandardSocketOptions.IP_TOS);
};
/**
--- a/jdk/src/java.base/share/classes/java/nio/file/Files.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java Thu Nov 06 15:12:17 2014 -0800
@@ -303,7 +303,7 @@
* is a {@link java.nio.channels.FileChannel}.
*
* <p> <b>Usage Examples:</b>
- * <pre>
+ * <pre>{@code
* Path path = ...
*
* // open file for reading
@@ -314,9 +314,10 @@
* WritableByteChannel wbc = Files.newByteChannel(path, EnumSet.of(CREATE,APPEND));
*
* // create file with initial permissions, opening it for both reading and writing
- * {@code FileAttribute<Set<PosixFilePermission>> perms = ...}
- * SeekableByteChannel sbc = Files.newByteChannel(path, EnumSet.of(CREATE_NEW,READ,WRITE), perms);
- * </pre>
+ * FileAttribute<Set<PosixFilePermission>> perms = ...
+ * SeekableByteChannel sbc =
+ * Files.newByteChannel(path, EnumSet.of(CREATE_NEW,READ,WRITE), perms);
+ * }</pre>
*
* @param path
* the path to the file to open or create
@@ -1702,7 +1703,8 @@
* Alternatively, suppose we want to read file's POSIX attributes without
* following symbolic links:
* <pre>
- * PosixFileAttributes attrs = Files.readAttributes(path, PosixFileAttributes.class, NOFOLLOW_LINKS);
+ * PosixFileAttributes attrs =
+ * Files.readAttributes(path, PosixFileAttributes.class, NOFOLLOW_LINKS);
* </pre>
*
* @param <A>
@@ -2840,6 +2842,8 @@
* @return a new buffered writer, with default buffer size, to write text
* to the file
*
+ * @throws IllegalArgumentException
+ * if {@code options} contains an invalid combination of options
* @throws IOException
* if an I/O error occurs opening or creating the file
* @throws UnsupportedOperationException
@@ -2880,6 +2884,8 @@
* @return a new buffered writer, with default buffer size, to write text
* to the file
*
+ * @throws IllegalArgumentException
+ * if {@code options} contains an invalid combination of options
* @throws IOException
* if an I/O error occurs opening or creating the file
* @throws UnsupportedOperationException
@@ -2891,7 +2897,9 @@
*
* @since 1.8
*/
- public static BufferedWriter newBufferedWriter(Path path, OpenOption... options) throws IOException {
+ public static BufferedWriter newBufferedWriter(Path path, OpenOption... options)
+ throws IOException
+ {
return newBufferedWriter(path, StandardCharsets.UTF_8, options);
}
@@ -3273,6 +3281,8 @@
*
* @return the path
*
+ * @throws IllegalArgumentException
+ * if {@code options} contains an invalid combination of options
* @throws IOException
* if an I/O error occurs writing to or creating the file
* @throws UnsupportedOperationException
@@ -3330,6 +3340,8 @@
*
* @return the path
*
+ * @throws IllegalArgumentException
+ * if {@code options} contains an invalid combination of options
* @throws IOException
* if an I/O error occurs writing to or creating the file, or the
* text cannot be encoded using the specified charset
@@ -3376,6 +3388,8 @@
*
* @return the path
*
+ * @throws IllegalArgumentException
+ * if {@code options} contains an invalid combination of options
* @throws IOException
* if an I/O error occurs writing to or creating the file, or the
* text cannot be encoded as {@code UTF-8}
@@ -3452,7 +3466,7 @@
final Iterator<Path> delegate = ds.iterator();
// Re-wrap DirectoryIteratorException to UncheckedIOException
- Iterator<Path> it = new Iterator<Path>() {
+ Iterator<Path> iterator = new Iterator<Path>() {
@Override
public boolean hasNext() {
try {
@@ -3471,7 +3485,9 @@
}
};
- return StreamSupport.stream(Spliterators.spliteratorUnknownSize(it, Spliterator.DISTINCT), false)
+ Spliterator<Path> spliterator =
+ Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT);
+ return StreamSupport.stream(spliterator, false)
.onClose(asUncheckedRunnable(ds));
} catch (Error|RuntimeException e) {
try {
@@ -3572,7 +3588,9 @@
{
FileTreeIterator iterator = new FileTreeIterator(start, maxDepth, options);
try {
- return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT), false)
+ Spliterator<FileTreeWalker.Event> spliterator =
+ Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT);
+ return StreamSupport.stream(spliterator, false)
.onClose(iterator::close)
.map(entry -> entry.file());
} catch (Error|RuntimeException e) {
@@ -3685,7 +3703,9 @@
{
FileTreeIterator iterator = new FileTreeIterator(start, maxDepth, options);
try {
- return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT), false)
+ Spliterator<FileTreeWalker.Event> spliterator =
+ Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT);
+ return StreamSupport.stream(spliterator, false)
.onClose(iterator::close)
.filter(entry -> matcher.test(entry.file(), entry.attributes()))
.map(entry -> entry.file());
--- a/jdk/src/java.base/share/classes/java/nio/file/package-info.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/nio/file/package-info.java Thu Nov 06 15:12:17 2014 -0800
@@ -86,8 +86,8 @@
* <p> Unless otherwise noted, passing a {@code null} argument to a constructor
* or method of any class or interface in this package will cause a {@link
* java.lang.NullPointerException NullPointerException} to be thrown. Additionally,
- * invoking a method with a collection containing a {@code null} element will
- * cause a {@code NullPointerException}, unless otherwise specified. </p>
+ * invoking a method with an array or collection containing a {@code null} element
+ * will cause a {@code NullPointerException}, unless otherwise specified. </p>
*
* <p> Unless otherwise noted, methods that attempt to access the file system
* will throw {@link java.nio.file.ClosedFileSystemException} when invoked on
--- a/jdk/src/java.base/share/classes/jdk/net/Sockets.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/jdk/net/Sockets.java Thu Nov 06 15:12:17 2014 -0800
@@ -276,6 +276,7 @@
set = new HashSet<>();
set.add(StandardSocketOptions.SO_RCVBUF);
set.add(StandardSocketOptions.SO_REUSEADDR);
+ set.add(StandardSocketOptions.IP_TOS);
set = Collections.unmodifiableSet(set);
options.put(ServerSocket.class, set);
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java Thu Nov 06 15:12:17 2014 -0800
@@ -1608,7 +1608,7 @@
private static String getCompatibleSigAlgName(String keyAlgName)
throws Exception {
if ("DSA".equalsIgnoreCase(keyAlgName)) {
- return "SHA1WithDSA";
+ return "SHA256WithDSA";
} else if ("RSA".equalsIgnoreCase(keyAlgName)) {
return "SHA256WithRSA";
} else if ("EC".equalsIgnoreCase(keyAlgName)) {
@@ -1628,10 +1628,8 @@
if (keysize == -1) {
if ("EC".equalsIgnoreCase(keyAlgName)) {
keysize = 256;
- } else if ("RSA".equalsIgnoreCase(keyAlgName)) {
- keysize = 2048;
} else {
- keysize = 1024;
+ keysize = 2048; // RSA and DSA
}
}
--- a/jdk/src/java.management/share/classes/com/sun/jmx/defaults/JmxProperties.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/defaults/JmxProperties.java Thu Nov 06 15:12:17 2014 -0800
@@ -205,28 +205,4 @@
*/
public static final Logger MISC_LOGGER =
Logger.getLogger(MISC_LOGGER_NAME);
-
- /**
- * Logger name for SNMP.
- */
- public static final String SNMP_LOGGER_NAME =
- "javax.management.snmp";
-
- /**
- * Logger for SNMP.
- */
- public static final Logger SNMP_LOGGER =
- Logger.getLogger(SNMP_LOGGER_NAME);
-
- /**
- * Logger name for SNMP Adaptor.
- */
- public static final String SNMP_ADAPTOR_LOGGER_NAME =
- "javax.management.snmp.daemon";
-
- /**
- * Logger for SNMP Adaptor.
- */
- public static final Logger SNMP_ADAPTOR_LOGGER =
- Logger.getLogger(SNMP_ADAPTOR_LOGGER_NAME);
}
--- a/jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Main.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner/Main.java Thu Nov 06 15:12:17 2014 -0800
@@ -2358,7 +2358,7 @@
if (sigalg == null) {
if (keyAlgorithm.equalsIgnoreCase("DSA"))
- signatureAlgorithm = "SHA1withDSA";
+ signatureAlgorithm = "SHA256withDSA";
else if (keyAlgorithm.equalsIgnoreCase("RSA"))
signatureAlgorithm = "SHA256withRSA";
else if (keyAlgorithm.equalsIgnoreCase("EC"))
--- a/jdk/test/ProblemList.txt Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/ProblemList.txt Thu Nov 06 15:12:17 2014 -0800
@@ -138,9 +138,6 @@
# 8058492
java/lang/management/ThreadMXBean/FindDeadlocks.java generic-all
-# 8058506
-java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java generic-all
-
############################################################################
# jdk_jmx
@@ -285,6 +282,9 @@
# 8058616
com/sun/jdi/RedefinePop.sh generic-all
+# 8061114
+com/sun/jdi/Redefine-g.sh generic-all
+
############################################################################
# jdk_util
@@ -318,4 +318,7 @@
# 8057732
sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java generic-all
+# 8060736
+sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all
+
############################################################################
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/ClassLoader/GetSystemPackage.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,249 @@
+/*
+ * 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 8060130
+ * @library /lib/testlibrary
+ * @build package2.Class2 GetSystemPackage jdk.testlibrary.*
+ * @summary Test if getSystemPackage() return consistent values for cases
+ * where a manifest is provided or not and ensure only jars on
+ * bootclasspath gets resolved via Package.getSystemPackage
+ * @run main GetSystemPackage
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+import jdk.testlibrary.ProcessTools;
+
+public class GetSystemPackage {
+
+ static final String testClassesDir = System.getProperty("test.classes", ".");
+ static final File tmpFolder = new File(testClassesDir);
+ static final String manifestTitle = "Special JAR";
+
+ public static void main(String ... args) throws Exception {
+ if (args.length == 0) {
+ buildJarsAndInitiateSystemPackageTest();
+ return;
+ }
+ switch (args[0]) {
+ case "system-manifest":
+ verifyPackage(true, true);
+ break;
+ case "system-no-manifest":
+ verifyPackage(false, true);
+ break;
+ case "non-system-manifest":
+ verifyPackage(true, false);
+ break;
+ case "non-system-no-manifest":
+ default:
+ verifyPackage(false, false);
+ break;
+ }
+ }
+
+ private static void buildJarsAndInitiateSystemPackageTest()
+ throws Exception
+ {
+ Manifest m = new Manifest();
+ // not setting MANIFEST_VERSION prevents META-INF/MANIFEST.MF from
+ // getting written
+ m.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
+ m.getMainAttributes().put(Attributes.Name.SPECIFICATION_TITLE,
+ manifestTitle);
+
+ buildJar("manifest.jar", m);
+ buildJar("no-manifest.jar", null);
+
+ runSubProcess("System package with manifest improperly resolved.",
+ "-Xbootclasspath/p:" + testClassesDir + "/manifest.jar",
+ "GetSystemPackage", "system-manifest");
+
+ runSubProcess("System package from directory improperly resolved.",
+ "-Xbootclasspath/p:" + testClassesDir, "GetSystemPackage",
+ "system-no-manifest");
+
+ runSubProcess("System package with no manifest improperly resolved",
+ "-Xbootclasspath/p:" + testClassesDir + "/no-manifest.jar",
+ "GetSystemPackage", "system-no-manifest");
+
+ runSubProcess("Classpath package with manifest improperly resolved",
+ "-cp", testClassesDir + "/manifest.jar", "GetSystemPackage",
+ "non-system-manifest");
+
+ runSubProcess("Classpath package with no manifest improperly resolved",
+ "-cp", testClassesDir + "/no-manifest.jar", "GetSystemPackage",
+ "non-system-no-manifest");
+
+ }
+
+ private static void buildJar(String name, Manifest man) throws Exception {
+ JarBuilder jar = new JarBuilder(tmpFolder, name, man);
+ jar.addClassFile("package2/Class2.class",
+ testClassesDir + "/package2/Class2.class");
+ jar.addClassFile("GetSystemPackage.class",
+ testClassesDir + "/GetSystemPackage.class");
+ jar.addClassFile("GetSystemPackageClassLoader.class",
+ testClassesDir + "/GetSystemPackageClassLoader.class");
+ jar.build();
+ }
+
+ private static void runSubProcess(String messageOnError, String ... args)
+ throws Exception
+ {
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
+ int res = pb.directory(tmpFolder).inheritIO().start().waitFor();
+ if (res != 0) {
+ throw new RuntimeException(messageOnError);
+ }
+ }
+
+ private static void verifyPackage(boolean hasManifest,
+ boolean isSystemPackage) throws Exception
+ {
+ Class c = Class.forName("package2.Class2");
+ Package pkg = c.getPackage();
+ if (pkg == null || pkg != Package.getPackage("package2") ||
+ !"package2".equals(pkg.getName())) {
+ fail("package2 not found via Package.getPackage()");
+ }
+
+ String specificationTitle = pkg.getSpecificationTitle();
+ if (!"package2".equals(pkg.getName())) {
+ fail("Invalid package for Class2");
+ }
+
+ if (hasManifest && (specificationTitle == null
+ || !manifestTitle.equals(specificationTitle))) {
+ fail("Invalid manifest for package " + pkg.getName());
+ }
+ if (!hasManifest && specificationTitle != null) {
+ fail("Invalid manifest for package " + pkg.getName() + ": was " +
+ specificationTitle + " expected: null");
+ }
+
+ // force the use of a classloader with no parent, then retrieve the
+ // package in a way that bypasses the classloader pkg maps
+ GetSystemPackageClassLoader classLoader =
+ new GetSystemPackageClassLoader();
+ Package systemPkg = classLoader.getSystemPackage("package2");
+
+ if (findPackage("java.lang") == null) {
+ fail("java.lang not found via Package.getPackages()");
+ }
+ Package foundPackage = findPackage("package2");
+ if (isSystemPackage) {
+ if (systemPkg == null) {
+ fail("System package could not be found via getSystemPackage");
+ }
+ if (foundPackage != systemPkg || systemPkg != pkg) {
+ fail("Inconsistent package found via Package.getPackages()");
+ }
+ } else {
+ if (systemPkg != null) {
+ fail("Non-system package could be found via getSystemPackage");
+ }
+ if (foundPackage == null) {
+ fail("Non-system package not found via Package.getPackages()");
+ }
+ }
+ }
+
+ private static Package findPackage(String name) {
+ Package[] packages = Package.getPackages();
+ for (Package p : packages) {
+ System.out.println(p);
+ if (p.getName().equals(name)) {
+ return p;
+ }
+ }
+ return null;
+ }
+
+ private static void fail(String message) {
+ throw new RuntimeException(message);
+ }
+}
+
+/*
+ * This classloader bypasses the system classloader to give as direct access
+ * to Package.getSystemPackage() as possible
+ */
+class GetSystemPackageClassLoader extends ClassLoader {
+
+ public GetSystemPackageClassLoader() {
+ super(null);
+ }
+
+ public Package getSystemPackage(String name) {
+ return super.getPackage(name);
+ }
+}
+
+/*
+ * Helper class for building jar files
+ */
+class JarBuilder {
+
+ private JarOutputStream os;
+
+ public JarBuilder(File tmpFolder, String jarName, Manifest manifest)
+ throws FileNotFoundException, IOException
+ {
+ File jarFile = new File(tmpFolder, jarName);
+ if (manifest != null) {
+ this.os = new JarOutputStream(new FileOutputStream(jarFile),
+ manifest);
+ } else {
+ this.os = new JarOutputStream(new FileOutputStream(jarFile));
+ }
+ }
+
+ public void addClassFile(String pathFromRoot, String file)
+ throws IOException
+ {
+ byte[] buf = new byte[1024];
+ try (FileInputStream in = new FileInputStream(file)) {
+ JarEntry entry = new JarEntry(pathFromRoot);
+ os.putNextEntry(entry);
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ os.write(buf, 0, len);
+ }
+ os.closeEntry();
+ }
+ }
+
+ public void build() throws IOException {
+ os.close();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/System/finalization/FinInterrupt.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,41 @@
+/*
+ * 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 4354680
+ * @summary runFinalization() should not clear or ignore interrupt bit
+ * @run main FinInterrupt
+ */
+
+public class FinInterrupt {
+ public static void main(String[] args) throws Exception {
+ Thread.currentThread().interrupt();
+ System.runFinalization();
+ if (Thread.interrupted()) {
+ System.out.println("Passed: interrupt bit was still set.");
+ } else {
+ throw new AssertionError("interrupt bit was cleared");
+ }
+ }
+}
--- a/jdk/test/java/lang/Thread/ThreadStateController.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/java/lang/Thread/ThreadStateController.java Thu Nov 06 15:12:17 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -27,6 +27,8 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.LockSupport;
+import jdk.testlibrary.LockFreeLogManager;
+
/**
* ThreadStateController allows a thread to request this thread to transition
* to a specific thread state. The {@linkplain #transitionTo request} is
@@ -94,8 +96,12 @@
private static final int S_TERMINATE = 8;
// for debugging
- private AtomicInteger iterations = new AtomicInteger();
- private AtomicInteger interrupted = new AtomicInteger();
+ private final AtomicInteger iterations = new AtomicInteger();
+ private final AtomicInteger interrupted = new AtomicInteger();
+
+ private final LockFreeLogManager logManager = new LockFreeLogManager();
+
+ @Override
public void run() {
// this thread has started
while (!done) {
@@ -119,13 +125,13 @@
break;
}
case S_BLOCKED: {
- System.out.format("%d: %s is going to block (interations %d)%n",
- getId(), getName(), iterations.get());
+ log("%d: %s is going to block (iterations %d)%n",
+ getId(), getName(), iterations.get());
stateChange(nextState);
// going to block on lock
synchronized (lock) {
- System.out.format("%d: %s acquired the lock (interations %d)%n",
- getId(), getName(), iterations.get());
+ log("%d: %s acquired the lock (iterations %d)%n",
+ getId(), getName(), iterations.get());
try {
// this thread has escaped the BLOCKED state
// release the lock and a short wait before continue
@@ -139,13 +145,13 @@
}
case S_WAITING: {
synchronized (lock) {
- System.out.format("%d: %s is going to waiting (interations %d interrupted %d)%n",
- getId(), getName(), iterations.get(), interrupted.get());
+ log("%d: %s is going to waiting (iterations %d interrupted %d)%n",
+ getId(), getName(), iterations.get(), interrupted.get());
try {
stateChange(nextState);
lock.wait();
- System.out.format("%d: %s wakes up from waiting (interations %d interrupted %d)%n",
- getId(), getName(), iterations.get(), interrupted.get());
+ log("%d: %s wakes up from waiting (iterations %d interrupted %d)%n",
+ getId(), getName(), iterations.get(), interrupted.get());
} catch (InterruptedException e) {
// ignore
interrupted.incrementAndGet();
@@ -155,13 +161,13 @@
}
case S_TIMED_WAITING: {
synchronized (lock) {
- System.out.format("%d: %s is going to timed waiting (interations %d interrupted %d)%n",
- getId(), getName(), iterations.get(), interrupted.get());
+ log("%d: %s is going to timed waiting (iterations %d interrupted %d)%n",
+ getId(), getName(), iterations.get(), interrupted.get());
try {
stateChange(nextState);
lock.wait(10000);
- System.out.format("%d: %s wakes up from timed waiting (interations %d interrupted %d)%n",
- getId(), getName(), iterations.get(), interrupted.get());
+ log("%d: %s wakes up from timed waiting (iterations %d interrupted %d)%n",
+ getId(), getName(), iterations.get(), interrupted.get());
} catch (InterruptedException e) {
// ignore
interrupted.incrementAndGet();
@@ -170,23 +176,23 @@
break;
}
case S_PARKED: {
- System.out.format("%d: %s is going to park (interations %d)%n",
- getId(), getName(), iterations.get());
+ log("%d: %s is going to park (iterations %d)%n",
+ getId(), getName(), iterations.get());
stateChange(nextState);
LockSupport.park();
break;
}
case S_TIMED_PARKED: {
- System.out.format("%d: %s is going to timed park (interations %d)%n",
- getId(), getName(), iterations.get());
+ log("%d: %s is going to timed park (iterations %d)%n",
+ getId(), getName(), iterations.get());
long deadline = System.currentTimeMillis() + 10000*1000;
stateChange(nextState);
LockSupport.parkUntil(deadline);
break;
}
case S_SLEEPING: {
- System.out.format("%d: %s is going to sleep (interations %d interrupted %d)%n",
- getId(), getName(), iterations.get(), interrupted.get());
+ log("%d: %s is going to sleep (iterations %d interrupted %d)%n",
+ getId(), getName(), iterations.get(), interrupted.get());
try {
stateChange(nextState);
Thread.sleep(1000000);
@@ -219,8 +225,8 @@
if (newState == nextState) {
state = nextState;
phaser.arrive();
- System.out.format("%d: state change: %s %s%n",
- getId(), toStateName(nextState), phaserToString(phaser));
+ log("%d: state change: %s %s%n",
+ getId(), toStateName(nextState), phaserToString(phaser));
return;
}
@@ -270,12 +276,12 @@
private void nextState(int s) throws InterruptedException {
final long id = Thread.currentThread().getId();
- System.out.format("%d: wait until the thread transitions to %s %s%n",
- id, toStateName(s), phaserToString(phaser));
+ log("%d: wait until the thread transitions to %s %s%n",
+ id, toStateName(s), phaserToString(phaser));
this.newState = s;
int phase = phaser.arrive();
- System.out.format("%d: awaiting party arrive %s %s%n",
- id, toStateName(s), phaserToString(phaser));
+ log("%d: awaiting party arrive %s %s%n",
+ id, toStateName(s), phaserToString(phaser));
for (;;) {
// when this thread has changed its state before it waits or parks
// on a lock, a potential race might happen if it misses the notify
@@ -301,20 +307,22 @@
}
try {
phaser.awaitAdvanceInterruptibly(phase, 100, TimeUnit.MILLISECONDS);
- System.out.format("%d: arrived at %s %s%n",
- id, toStateName(s), phaserToString(phaser));
+ log("%d: arrived at %s %s%n",
+ id, toStateName(s), phaserToString(phaser));
return;
} catch (TimeoutException ex) {
// this thread hasn't arrived at this phase
- System.out.format("%d: Timeout: %s%n", id, phaser);
+ log("%d: Timeout: %s%n", id, phaser);
}
}
}
+
private String phaserToString(Phaser p) {
return "[phase = " + p.getPhase() +
" parties = " + p.getRegisteredParties() +
" arrived = " + p.getArrivedParties() + "]";
}
+
private String toStateName(int state) {
switch (state) {
case S_RUNNABLE:
@@ -337,4 +345,20 @@
return "unknown " + state;
}
}
+
+ private void log(String msg, Object ... params) {
+ logManager.log(msg, params);
+ }
+
+ /**
+ * Waits for the controller to complete the test run and returns the
+ * generated log
+ * @return The controller log
+ * @throws InterruptedException
+ */
+ public String getLog() throws InterruptedException {
+ this.join();
+
+ return logManager.toString();
+ }
}
--- a/jdk/test/java/lang/Thread/ThreadStateTest.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/java/lang/Thread/ThreadStateTest.java Thu Nov 06 15:12:17 2014 -0800
@@ -30,6 +30,8 @@
* Thread.getState().
*
* @author Mandy Chung
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
* @build ThreadStateTest ThreadStateController
* @run main/othervm -Xmixed ThreadStateTest
*/
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java Thu Nov 06 15:12:17 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -31,6 +31,8 @@
* @author Mandy Chung
*
* @library ../../Thread
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
* @build ThreadMXBeanStateTest ThreadStateController
* @run main ThreadMXBeanStateTest
*/
@@ -44,15 +46,17 @@
private static final ThreadMXBean tm = ManagementFactory.getThreadMXBean();
static class Lock {
- private String name;
+ private final String name;
Lock(String name) {
this.name = name;
}
+ @Override
public String toString() {
return name;
}
}
- private static Lock globalLock = new Lock("my lock");
+
+ private static final Lock globalLock = new Lock("my lock");
public static void main(String[] argv) throws Exception {
// Force thread state initialization now before the test
@@ -109,7 +113,7 @@
thread.checkThreadState(TERMINATED);
try {
- thread.join();
+ System.out.println(thread.getLog());
} catch (InterruptedException e) {
e.printStackTrace();
System.out.println("TEST FAILED: Unexpected exception.");
--- a/jdk/test/java/sql/testng/util/TestPolicy.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/java/sql/testng/util/TestPolicy.java Thu Nov 06 15:12:17 2014 -0800
@@ -35,6 +35,7 @@
import java.util.Enumeration;
import java.util.PropertyPermission;
import java.util.StringJoiner;
+import java.util.logging.LoggingPermission;
/*
* Simple Policy class that supports the required Permissions to validate the
@@ -57,7 +58,8 @@
* Policy used by the JDBC tests Possible values are: all (ALLPermissions),
* setLog (SQLPemission("setLog"), deregisterDriver
* (SQLPermission("deregisterDriver") (SQLPermission("deregisterDriver"),
- * and setSyncFactory(SQLPermission(setSyncFactory),
+ * setSyncFactory(SQLPermission(setSyncFactory), and also
+ * LoggerPermission("control", null) when setting a Level
*
* @param policy Permissions to set
*/
@@ -79,6 +81,11 @@
setMinimalPermissions();
permissions.add(new SQLPermission("setSyncFactory"));
break;
+ case "setSyncFactoryLogger":
+ setMinimalPermissions();
+ permissions.add(new SQLPermission("setSyncFactory"));
+ permissions.add(new LoggingPermission("control", null));
+ break;
default:
setMinimalPermissions();
}
--- a/jdk/test/javax/naming/spi/providers/InitialContextTest.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/javax/naming/spi/providers/InitialContextTest.java Thu Nov 06 15:12:17 2014 -0800
@@ -68,10 +68,9 @@
Path dst = tmp.resolve("Test.java");
Files.copy(src, dst);
- javac(tmp, dst);
+ Path build = Files.createDirectory(tmp.resolve("build"));
- Path build = Files.createDirectory(tmp.resolve("build"));
- Files.copy(tmp.resolve("Test.class"), build.resolve("Test.class"));
+ javac(build, dst);
Map<String, String> props
= singletonMap(Context.INITIAL_CONTEXT_FACTORY, factoryClassFqn);
@@ -107,13 +106,13 @@
Path dst1 = createFactoryFrom(templatesHome().resolve("factory.template"),
factoryClassFqn, tmp);
- javac(tmp, dst);
+ Path build = Files.createDirectory(tmp.resolve("build"));
+
+ javac(build, dst);
Path explodedJar = Files.createDirectory(tmp.resolve("exploded-jar"));
javac(explodedJar, dst1);
jar(tmp.resolve("test.jar"), explodedJar);
- Path build = Files.createDirectory(tmp.resolve("build"));
- Files.copy(tmp.resolve("Test.class"), build.resolve("Test.class"));
Files.copy(tmp.resolve("test.jar"), build.resolve("test.jar"));
Map<String, String> props
@@ -191,7 +190,9 @@
Path dst1 = createFactoryFrom(templatesHome().resolve("broken_factory.template"),
factoryClassFqn, tmp);
- javac(tmp, dst);
+ Path build = Files.createDirectory(tmp.resolve("build"));
+
+ javac(build, dst);
Path explodedJar = Files.createDirectory(tmp.resolve("exploded-jar"));
Path services = Files.createDirectories(explodedJar.resolve("META-INF")
@@ -208,15 +209,12 @@
javac(explodedJar, dst1);
jar(tmp.resolve("test.jar"), explodedJar);
- Path build = Files.createDirectory(tmp.resolve("build"));
- Files.copy(tmp.resolve("Test.class"), build.resolve("Test.class"));
Files.copy(tmp.resolve("test.jar"), build.resolve("test.jar"));
- Map<String, String> props = new HashMap<>();
- props.put("java.ext.dirs", build.toString());
- props.put(Context.INITIAL_CONTEXT_FACTORY, factoryClassFqn);
+ Map<String, String> props
+ = singletonMap(Context.INITIAL_CONTEXT_FACTORY, factoryClassFqn);
- Result r = java(props, singleton(build), "Test");
+ Result r = java(props, asList(build.resolve("test.jar"), build), "Test");
if (r.exitValue == 0 || !verifyOutput(r.output, factoryClassFqn))
throw new RuntimeException(r.output);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/spi/SyncFactoryExceptionTests.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,113 @@
+/*
+ * 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 test.rowset.spi;
+
+import java.sql.SQLException;
+import javax.sql.rowset.spi.SyncFactoryException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SyncFactoryExceptionTests extends BaseTest {
+
+ /*
+ * Create SyncFactoryException with no-arg constructor
+ */
+ @Test
+ public void test01() {
+ SyncFactoryException ex = new SyncFactoryException();
+ assertTrue(ex.getMessage() == null
+ && ex.getSQLState() == null
+ && ex.getCause() == null
+ && ex.getErrorCode() == 0);
+ }
+
+ /*
+ * Create SyncFactoryException with message
+ */
+ @Test
+ public void test02() {
+ SyncFactoryException ex = new SyncFactoryException(reason);
+ assertTrue(ex.getMessage().equals(reason)
+ && ex.getSQLState() == null
+ && ex.getCause() == null
+ && ex.getErrorCode() == 0);
+ }
+
+ /*
+ * Validate that the ordering of the returned Exceptions is correct using
+ * for-each loop
+ */
+ @Test
+ public void test03() {
+ SyncFactoryException ex = new SyncFactoryException("Exception 1");
+ ex.initCause(t1);
+ SyncFactoryException ex1 = new SyncFactoryException("Exception 2");
+ SyncFactoryException ex2 = new SyncFactoryException("Exception 3");
+ ex2.initCause(t2);
+ ex.setNextException(ex1);
+ ex.setNextException(ex2);
+ int num = 0;
+ for (Throwable e : ex) {
+ assertTrue(msgs[num++].equals(e.getMessage()));
+ }
+ }
+
+ /*
+ * Validate that the ordering of the returned Exceptions is correct using
+ * traditional while loop
+ */
+ @Test
+ public void test04() {
+ SQLException ex = new SyncFactoryException("Exception 1");
+ ex.initCause(t1);
+ SyncFactoryException ex1 = new SyncFactoryException("Exception 2");
+ SyncFactoryException ex2 = new SyncFactoryException("Exception 3");
+ ex2.initCause(t2);
+ ex.setNextException(ex1);
+ ex.setNextException(ex2);
+ int num = 0;
+ while (ex != null) {
+ assertTrue(msgs[num++].equals(ex.getMessage()));
+ Throwable c = ex.getCause();
+ while (c != null) {
+ assertTrue(msgs[num++].equals(c.getMessage()));
+ c = c.getCause();
+ }
+ ex = ex.getNextException();
+ }
+ }
+
+ /*
+ * Serialize a SyncFactoryException and make sure you can read it back properly
+ */
+ @Test
+ public void test05() throws Exception {
+ SyncFactoryException e = new SyncFactoryException(reason);
+ SyncFactoryException ex1 = createSerializedException(e);
+ assertTrue(ex1.getMessage().equals(reason)
+ && ex1.getSQLState() == null
+ && ex1.getCause() == null
+ && ex1.getErrorCode() == 0);
+ }
+}
--- a/jdk/test/javax/sql/testng/test/rowset/spi/SyncFactoryPermissionsTests.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/javax/sql/testng/test/rowset/spi/SyncFactoryPermissionsTests.java Thu Nov 06 15:12:17 2014 -0800
@@ -27,13 +27,13 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
import javax.sql.rowset.spi.SyncFactory;
+import javax.sql.rowset.spi.SyncFactoryException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import util.BaseTest;
+import util.StubContext;
import util.TestPolicy;
public class SyncFactoryPermissionsTests extends BaseTest {
@@ -41,6 +41,7 @@
Context ctx;
private static Policy policy;
private static SecurityManager sm;
+ private final Logger alogger = Logger.getLogger(this.getClass().getName());
/*
* Install a SeeurityManager along with a base Policy to allow testNG to run
@@ -67,13 +68,7 @@
public SyncFactoryPermissionsTests() {
policy = Policy.getPolicy();
sm = System.getSecurityManager();
-
- try {
- ctx = new InitialContext();
- } catch (NamingException ex) {
- Logger.getLogger(SyncFactoryPermissionsTests.class.getName()).
- log(Level.SEVERE, null, ex);
- }
+ ctx = new StubContext();
}
/*
@@ -87,12 +82,20 @@
}
/*
+ * Validate that a SyncFactoryException is thrown if the Logger is null
+ */
+ @Test(expectedExceptions = SyncFactoryException.class)
+ public void test00() throws SyncFactoryException {
+ Logger l = SyncFactory.getLogger();
+ }
+
+ /*
* Validate that setJNDIContext succeeds if SQLPermission("setSyncFactory")
* has been granted
*/
@Test
- public void test1() throws Exception {
- Policy.setPolicy(new TestPolicy("setSyncFactory"));
+ public void test01() throws Exception {
+ setPolicy(new TestPolicy("setSyncFactory"));
SyncFactory.setJNDIContext(ctx);
}
@@ -100,8 +103,77 @@
* Validate that setJNDIContext succeeds if AllPermissions has been granted
*/
@Test
- public void test2() throws Exception {
+ public void test02() throws Exception {
setPolicy(new TestPolicy("all"));
SyncFactory.setJNDIContext(ctx);
}
+
+ /*
+ * Validate that AccessControlException is thrown if
+ * SQLPermission("setSyncFactory") has not been granted
+ */
+ @Test(expectedExceptions = AccessControlException.class)
+ public void test03() throws Exception {
+ setPolicy(new TestPolicy());
+ SyncFactory.setLogger(alogger);
+ }
+
+ /*
+ * Validate that setLogger succeeds if SQLPermission("setSyncFactory")
+ * has been granted
+ */
+ @Test
+ public void test04() throws Exception {
+ setPolicy(new TestPolicy("setSyncFactory"));
+ SyncFactory.setLogger(alogger);
+ }
+
+ /*
+ * Validate that setLogger succeeds if AllPermissions has been granted
+ */
+ @Test
+ public void test05() throws Exception {
+ setPolicy(new TestPolicy("all"));
+ SyncFactory.setLogger(alogger);
+ }
+
+ /*
+ * Validate that AccessControlException is thrown if
+ * SQLPermission("setSyncFactory") has not been granted
+ */
+ @Test(expectedExceptions = AccessControlException.class)
+ public void test06() throws Exception {
+ setPolicy(new TestPolicy());
+ SyncFactory.setLogger(alogger, Level.INFO);
+ }
+
+ /*
+ * Validate that AccessControlException is thrown if
+ * SQLPermission("setSyncFactory") and LoggingPermission("control", null)
+ * have not been granted
+ */
+ @Test(expectedExceptions = AccessControlException.class)
+ public void test07() throws Exception {
+ setPolicy(new TestPolicy("setSyncFactory"));
+ SyncFactory.setLogger(alogger, Level.INFO);
+ }
+
+ /*
+ * Validate that setLogger succeeds if SQLPermission("setSyncFactory")
+ * has been granted
+ */
+ @Test
+ public void test08() throws Exception {
+ setPolicy(new TestPolicy("setSyncFactoryLogger"));
+ SyncFactory.setLogger(alogger, Level.INFO);
+ }
+
+ /*
+ * Validate that setLogger succeeds if AllPermissions has been granted
+ */
+ @Test
+ public void test09() throws Exception {
+ setPolicy(new TestPolicy("all"));
+ SyncFactory.setLogger(alogger, Level.INFO);
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/spi/SyncFactoryTests.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,220 @@
+/*
+ * 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 test.rowset.spi;
+
+import com.sun.rowset.providers.RIOptimisticProvider;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.naming.Context;
+import javax.sql.rowset.spi.SyncFactory;
+import javax.sql.rowset.spi.SyncFactoryException;
+import javax.sql.rowset.spi.SyncProvider;
+import static org.testng.Assert.*;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import util.PropertyStubProvider;
+import util.StubSyncProvider;
+import util.StubContext;
+
+//com.sun.jndi.ldap.LdapCtxFactory
+public class SyncFactoryTests {
+ private static String origFactory;
+
+ private final String stubProvider = "util.StubSyncProvider";
+ private final String propertyStubProvider = "util.PropertyStubProvider";
+ private final Logger alogger = Logger.getLogger(this.getClass().getName());
+ // Initial providers including those set via a property
+ List<String> initialProviders;
+ // All providers including those specifically registered
+ List<String> allProviders;
+ private Context ctx= null;
+
+ public SyncFactoryTests() {
+
+ // Add a provider via a property
+ System.setProperty("rowset.provider.classname", propertyStubProvider);
+ initialProviders = Arrays.asList(
+ "com.sun.rowset.providers.RIOptimisticProvider",
+ "com.sun.rowset.providers.RIXMLProvider",
+ propertyStubProvider);
+ allProviders = new ArrayList<>();
+ allProviders.addAll(initialProviders);
+ allProviders.add(stubProvider);
+ ctx = new StubContext();
+ }
+
+ @BeforeMethod
+ public void setUpMethod() throws Exception {
+ // Make sure the provider provider that is registered is removed
+ // before each run
+ SyncFactory.unregisterProvider(stubProvider);
+ }
+
+ /*
+ * Validate a non-null factory is returned
+ */
+ @Test
+ public void test() throws SyncFactoryException {
+ SyncFactory syncFactory = SyncFactory.getSyncFactory();
+ assertTrue(syncFactory != null);
+ }
+
+ /*
+ * Check that the correct SyncProvider is returned for the specified
+ * providerID for the provider registered via a property
+ */
+ @Test
+ public void test00() throws SyncFactoryException {
+ SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
+ assertTrue(p instanceof PropertyStubProvider);
+ }
+
+ /*
+ * Check that the correct SyncProvider is returned for the specified
+ * providerID
+ */
+ @Test
+ public void test01() throws SyncFactoryException {
+ SyncFactory.registerProvider(stubProvider);
+ SyncProvider p = SyncFactory.getInstance(stubProvider);
+ assertTrue(p instanceof StubSyncProvider);
+ }
+
+ /*
+ * Check that the Default SyncProvider is returned if an empty String is
+ * passed or if an invalid providerID is specified
+ */
+ @Test
+ public void test02() throws SyncFactoryException {
+ SyncProvider p = SyncFactory.getInstance("");
+ assertTrue(p instanceof RIOptimisticProvider);
+ // Attempt to get an invalid provider and get the default provider
+ p = SyncFactory.getInstance("util.InvalidSyncProvider");
+ assertTrue(p instanceof RIOptimisticProvider);
+ }
+
+ /*
+ * Validate that a SyncFactoryException is thrown if the ProviderID is null
+ */
+ @Test(expectedExceptions = SyncFactoryException.class)
+ public void test03() throws SyncFactoryException {
+ SyncProvider p = SyncFactory.getInstance(null);
+ }
+
+ /*
+ * Validate that a SyncFactoryException is thrown if the Logger is null
+ */
+ @Test(expectedExceptions = SyncFactoryException.class,enabled=true)
+ public void test04() throws SyncFactoryException {
+ Logger l = SyncFactory.getLogger();
+ }
+
+ /*
+ * Validate that the correct logger is returned by getLogger
+ */
+ @Test
+ public void test05() throws SyncFactoryException {
+ SyncFactory.setLogger(alogger);
+ Logger l = SyncFactory.getLogger();
+ assertTrue(l.equals(alogger));
+ }
+
+ /*
+ * Validate that the correct logger is returned by getLogger
+ */
+ @Test
+ public void test06() throws SyncFactoryException {
+ SyncFactory.setLogger(alogger, Level.INFO);
+ Logger l = SyncFactory.getLogger();
+ assertTrue(l.equals(alogger));
+ }
+
+ /*
+ * Validate that a driver that is registered is returned by
+ * getRegisteredProviders and if it is unregistered, that it is
+ * not returned by getRegisteredProviders
+ */
+ @Test
+ public void test07() throws SyncFactoryException {
+
+ // Validate that only the default providers and any specified via
+ // a System property are available
+ validateProviders(initialProviders);
+
+ // Register a provider and make sure it is avaiable
+ SyncFactory.registerProvider(stubProvider);
+ validateProviders(allProviders);
+
+ // Check that if a provider is unregistered, it does not show as
+ // registered
+ SyncFactory.unregisterProvider(stubProvider);
+ validateProviders(initialProviders);
+ }
+
+ /*
+ * Validate that setJNDIContext throws a SyncFactoryException if the
+ * context is null
+ */
+ @Test(expectedExceptions = SyncFactoryException.class, enabled=true)
+ public void test08() throws Exception {
+ SyncFactory.setJNDIContext(null);
+ }
+
+ /*
+ * Validate that setJNDIContext succeeds
+ */
+ @Test(enabled=true)
+ public void test09() throws Exception {
+ SyncFactory.setJNDIContext(ctx);
+ }
+
+ /*
+ * Utility method to validate the expected providers are regsitered
+ */
+ private void validateProviders(List<String> expectedProviders)
+ throws SyncFactoryException {
+ List<String> results = new ArrayList<>();
+ Enumeration<SyncProvider> providers = SyncFactory.getRegisteredProviders();
+
+ while (providers.hasMoreElements()) {
+ SyncProvider p = providers.nextElement();
+ results.add(p.getProviderID());
+ }
+ assertTrue(expectedProviders.containsAll(results)
+ && results.size() == expectedProviders.size());
+ }
+
+ /*
+ * Utility method to dump out SyncProvider info for a registered provider
+ */
+ private void showImpl(SyncProvider impl) {
+ System.out.println("Provider implementation:"
+ + "\nVendor: " + impl.getVendor()
+ + "\nVersion: " + impl.getVersion()
+ + "\nProviderID: " + impl.getProviderID());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/spi/SyncProviderExceptionTests.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,187 @@
+/*
+ * 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 test.rowset.spi;
+
+import com.sun.rowset.internal.SyncResolverImpl;
+import java.sql.SQLException;
+import javax.sql.rowset.spi.SyncProviderException;
+import static org.testng.Assert.*;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubSyncResolver;
+
+public class SyncProviderExceptionTests extends BaseTest {
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ System.out.println(System.getProperty("java.naming.factory.initial"));
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception {
+ }
+ /*
+ * Create SyncProviderException with no-arg constructor
+ */
+ @Test
+ public void test() {
+ SyncProviderException ex = new SyncProviderException();
+ assertTrue(ex.getMessage() == null
+ && ex.getSQLState() == null
+ && ex.getCause() == null
+ && ex.getErrorCode() == 0
+ && ex.getSyncResolver() instanceof SyncResolverImpl);
+ }
+
+ /*
+ * Create SyncProviderException with no-arg constructor and
+ * call setSyncResolver to indicate the SyncResolver to use
+ */
+ @Test
+ public void test01() {
+ SyncProviderException ex = new SyncProviderException();
+ ex.setSyncResolver(new StubSyncResolver());
+ assertTrue(ex.getMessage() == null
+ && ex.getSQLState() == null
+ && ex.getCause() == null
+ && ex.getErrorCode() == 0
+ && ex.getSyncResolver() instanceof StubSyncResolver);
+ }
+
+ /*
+ * Create SyncProviderException with message
+ */
+ @Test
+ public void test02() {
+ SyncProviderException ex = new SyncProviderException(reason);
+ assertTrue(ex.getMessage().equals(reason)
+ && ex.getSQLState() == null
+ && ex.getCause() == null
+ && ex.getErrorCode() == 0
+ && ex.getSyncResolver() instanceof SyncResolverImpl);
+ }
+
+ /*
+ * Create SyncProviderException with message and
+ * call setSyncResolver to indicate the SyncResolver to use
+ */
+ @Test
+ public void test03() {
+ SyncProviderException ex = new SyncProviderException(reason);
+ ex.setSyncResolver(new StubSyncResolver());
+
+ assertTrue(ex.getMessage().equals(reason)
+ && ex.getSQLState() == null
+ && ex.getCause() == null
+ && ex.getErrorCode() == 0
+ && ex.getSyncResolver() instanceof StubSyncResolver);
+ }
+
+ /*
+ * Create SyncProviderException with and specify the SyncResolver to use
+ */
+ @Test
+ public void test04() {
+ SyncProviderException ex = new SyncProviderException(new StubSyncResolver());
+ assertTrue(ex.getMessage() == null
+ && ex.getSQLState() == null
+ && ex.getCause() == null
+ && ex.getErrorCode() == 0
+ && ex.getSyncResolver() instanceof StubSyncResolver);
+ }
+
+ /*
+ * Validate that the ordering of the returned Exceptions is correct using
+ * for-each loop
+ */
+ @Test
+ public void test05() {
+ SyncProviderException ex = new SyncProviderException("Exception 1");
+ ex.initCause(t1);
+ SyncProviderException ex1 = new SyncProviderException("Exception 2");
+ SyncProviderException ex2 = new SyncProviderException("Exception 3");
+ ex2.initCause(t2);
+ ex.setNextException(ex1);
+ ex.setNextException(ex2);
+ int num = 0;
+ for (Throwable e : ex) {
+ assertTrue(msgs[num++].equals(e.getMessage()));
+ }
+ }
+
+ /*
+ * Validate that the ordering of the returned Exceptions is correct using
+ * traditional while loop
+ */
+ @Test
+ public void test06() {
+ SQLException ex = new SyncProviderException("Exception 1");
+ ex.initCause(t1);
+ SyncProviderException ex1 = new SyncProviderException("Exception 2");
+ SyncProviderException ex2 = new SyncProviderException("Exception 3");
+ ex2.initCause(t2);
+ ex.setNextException(ex1);
+ ex.setNextException(ex2);
+ int num = 0;
+ while (ex != null) {
+ assertTrue(msgs[num++].equals(ex.getMessage()));
+ Throwable c = ex.getCause();
+ while (c != null) {
+ assertTrue(msgs[num++].equals(c.getMessage()));
+ c = c.getCause();
+ }
+ ex = ex.getNextException();
+ }
+ }
+
+ /*
+ * Serialize a SyncProviderException and make sure you can read it back properly
+ */
+ @Test
+ public void test07() throws Exception {
+ SyncProviderException e = new SyncProviderException(reason);
+ SyncProviderException ex1 = createSerializedException(e);
+ assertTrue(ex1.getMessage().equals(reason)
+ && ex1.getSQLState() == null
+ && ex1.getCause() == null
+ && ex1.getErrorCode() == 0
+ && ex1.getSyncResolver() instanceof SyncResolverImpl, ex1.getSyncResolver().getClass().getName());
+ }
+
+ /*
+ * Serialize a SyncProviderException and make sure you can read it back properly
+ */
+ @Test
+ public void test08() throws Exception {
+ SyncProviderException e = new SyncProviderException(reason);
+ e.setSyncResolver(new StubSyncResolver());
+
+ SyncProviderException ex1 = createSerializedException(e);
+ assertTrue(ex1.getMessage().equals(reason)
+ && ex1.getSQLState() == null
+ && ex1.getCause() == null
+ && ex1.getErrorCode() == 0
+ && ex1.getSyncResolver() instanceof StubSyncResolver);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/PropertyStubProvider.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,27 @@
+/*
+ * 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 util;
+
+public class PropertyStubProvider extends StubSyncProvider {
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/StubContext.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,220 @@
+/*
+ * 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 util;
+
+import java.util.Hashtable;
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameClassPair;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+@SuppressWarnings("unchecked")
+public class StubContext implements Context {
+
+ @Override
+ public Object lookup(Name name) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public Object lookup(String name) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public void bind(Name name, Object obj) throws NamingException {
+
+ }
+
+ @Override
+ public void bind(String name, Object obj) throws NamingException {
+
+ }
+
+ @Override
+ public void rebind(Name name, Object obj) throws NamingException {
+
+ }
+
+ @Override
+ public void rebind(String name, Object obj) throws NamingException {
+
+ }
+
+ @Override
+ public void unbind(Name name) throws NamingException {
+
+ }
+
+ @Override
+ public void unbind(String name) throws NamingException {
+
+ }
+
+ @Override
+ public void rename(Name oldName, Name newName) throws NamingException {
+
+ }
+
+ @Override
+ public void rename(String oldName, String newName) throws NamingException {
+
+ }
+
+ @Override
+ public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
+ return new NamingEnumerationStub();
+ }
+
+ @Override
+ public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
+ return new NamingEnumerationStub();
+ }
+
+ @Override
+ public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
+ return new NamingEnumerationStub();
+ }
+
+ @Override
+ public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
+ return new NamingEnumerationStub();
+ }
+
+ @Override
+ public void destroySubcontext(Name name) throws NamingException {
+
+ }
+
+ @Override
+ public void destroySubcontext(String name) throws NamingException {
+
+ }
+
+ @Override
+ public Context createSubcontext(Name name) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public Context createSubcontext(String name) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public Object lookupLink(Name name) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public Object lookupLink(String name) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public NameParser getNameParser(Name name) throws NamingException {
+ return new NameParserStub();
+ }
+
+ @Override
+ public NameParser getNameParser(String name) throws NamingException {
+ return new NameParserStub();
+ }
+
+ @Override
+ public Name composeName(Name name, Name prefix) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public String composeName(String name, String prefix) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public Object addToEnvironment(String propName, Object propVal) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public Object removeFromEnvironment(String propName) throws NamingException {
+ return null;
+ }
+
+ @Override
+ public Hashtable<?, ?> getEnvironment() throws NamingException {
+ return new Hashtable();
+ }
+
+ @Override
+ public void close() throws NamingException {
+
+ }
+
+ @Override
+ public String getNameInNamespace() throws NamingException {
+ return null;
+ }
+
+ class NamingEnumerationStub implements NamingEnumeration {
+
+ @Override
+ public Object next() throws NamingException {
+ return null;
+ }
+
+ @Override
+ public boolean hasMore() throws NamingException {
+ return false;
+ }
+
+ @Override
+ public void close() throws NamingException {
+
+ }
+
+ @Override
+ public boolean hasMoreElements() {
+ return false;
+ }
+
+ @Override
+ public Object nextElement() {
+ return null;
+ }
+
+ }
+
+ class NameParserStub implements NameParser {
+
+ @Override
+ public Name parse(String name) throws NamingException {
+ return null;
+ }
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/StubSyncProvider.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,92 @@
+/*
+ * 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 util;
+
+import javax.sql.RowSetReader;
+import javax.sql.RowSetWriter;
+import javax.sql.rowset.spi.SyncProvider;
+import javax.sql.rowset.spi.SyncProviderException;
+
+public class StubSyncProvider extends SyncProvider {
+
+ /**
+ * The unique provider identifier.
+ */
+ private String providerID = "util.StubSyncProvider";
+
+ /**
+ * The vendor name of this SyncProvider implementation
+ */
+ private String vendorName = "Oracle Corporation";
+
+ /**
+ * The version number of this SyncProvider implementation
+ */
+ private String versionNumber = "1.0";
+
+ @Override
+ public String getProviderID() {
+ return providerID;
+ }
+
+ @Override
+ public RowSetReader getRowSetReader() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public RowSetWriter getRowSetWriter() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getProviderGrade() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setDataSourceLock(int datasource_lock) throws SyncProviderException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getDataSourceLock() throws SyncProviderException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int supportsUpdatableView() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getVersion() {
+ return versionNumber;
+ }
+
+ @Override
+ public String getVendor() {
+ return vendorName;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/util/StubSyncResolver.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,1616 @@
+/*
+ * 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 util;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.net.URL;
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.Date;
+import java.sql.NClob;
+import java.sql.Ref;
+import java.sql.ResultSetMetaData;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.SQLXML;
+import java.sql.Statement;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Map;
+import javax.sql.RowSetListener;
+import javax.sql.rowset.spi.SyncResolver;
+
+public class StubSyncResolver implements SyncResolver, Serializable {
+
+ @Override
+ public int getStatus() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Object getConflictValue(int index) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Object getConflictValue(String columnName) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setResolvedValue(int index, Object obj) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setResolvedValue(String columnName, Object obj) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean nextConflict() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean previousConflict() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getUrl() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setUrl(String url) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getDataSourceName() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setDataSourceName(String name) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getUsername() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setUsername(String name) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getPassword() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setPassword(String password) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getTransactionIsolation() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTransactionIsolation(int level) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Map<String, Class<?>> getTypeMap() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getCommand() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setCommand(String cmd) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setReadOnly(boolean value) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getMaxFieldSize() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setMaxFieldSize(int max) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getMaxRows() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setMaxRows(int max) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean getEscapeProcessing() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setEscapeProcessing(boolean enable) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getQueryTimeout() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setQueryTimeout(int seconds) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setType(int type) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setConcurrency(int concurrency) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNull(int parameterIndex, int sqlType) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNull(String parameterName, int sqlType) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBoolean(String parameterName, boolean x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setByte(int parameterIndex, byte x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setByte(String parameterName, byte x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setShort(int parameterIndex, short x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setShort(String parameterName, short x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setInt(int parameterIndex, int x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setInt(String parameterName, int x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setLong(int parameterIndex, long x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setLong(String parameterName, long x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setFloat(int parameterIndex, float x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setFloat(String parameterName, float x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setDouble(int parameterIndex, double x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setDouble(String parameterName, double x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setString(int parameterIndex, String x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setString(String parameterName, String x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBytes(String parameterName, byte[] x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setDate(int parameterIndex, Date x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTime(int parameterIndex, Time x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setObject(String parameterName, Object x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setObject(int parameterIndex, Object x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setRef(int i, Ref x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBlob(int i, Blob x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBlob(String parameterName, Blob x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setClob(int i, Clob x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setClob(int parameterIndex, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setClob(String parameterName, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setClob(String parameterName, Clob x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setClob(String parameterName, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setArray(int i, Array x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setDate(String parameterName, Date x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTime(String parameterName, Time x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void clearParameters() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void execute() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void addRowSetListener(RowSetListener listener) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void removeRowSetListener(RowSetListener listener) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setRowId(int parameterIndex, RowId x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setRowId(String parameterName, RowId x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNString(int parameterIndex, String value) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNString(String parameterName, String value) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNCharacterStream(String parameterName, Reader value) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNClob(String parameterName, NClob value) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNClob(String parameterName, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNClob(int parameterIndex, NClob value) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setNClob(int parameterIndex, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setURL(int parameterIndex, URL x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean next() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void close() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean wasNull() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getString(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean getBoolean(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public byte getByte(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public short getShort(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getInt(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public long getLong(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public float getFloat(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public double getDouble(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public byte[] getBytes(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Date getDate(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Time getTime(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Timestamp getTimestamp(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public InputStream getAsciiStream(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public InputStream getUnicodeStream(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public InputStream getBinaryStream(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getString(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean getBoolean(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public byte getByte(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public short getShort(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getInt(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public long getLong(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public float getFloat(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public double getDouble(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public byte[] getBytes(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Date getDate(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Time getTime(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Timestamp getTimestamp(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public InputStream getAsciiStream(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public InputStream getUnicodeStream(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public InputStream getBinaryStream(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public SQLWarning getWarnings() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void clearWarnings() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getCursorName() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public ResultSetMetaData getMetaData() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Object getObject(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Object getObject(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int findColumn(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Reader getCharacterStream(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Reader getCharacterStream(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isBeforeFirst() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isAfterLast() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isFirst() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isLast() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void beforeFirst() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void afterLast() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean first() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean last() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getRow() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean absolute(int row) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean relative(int rows) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean previous() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setFetchDirection(int direction) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getFetchDirection() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setFetchSize(int rows) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getFetchSize() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getType() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getConcurrency() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean rowUpdated() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean rowInserted() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean rowDeleted() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNull(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBoolean(int columnIndex, boolean x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateByte(int columnIndex, byte x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateShort(int columnIndex, short x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateInt(int columnIndex, int x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateLong(int columnIndex, long x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateFloat(int columnIndex, float x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateDouble(int columnIndex, double x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateString(int columnIndex, String x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBytes(int columnIndex, byte[] x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateDate(int columnIndex, Date x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateTime(int columnIndex, Time x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateObject(int columnIndex, Object x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNull(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBoolean(String columnLabel, boolean x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateByte(String columnLabel, byte x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateShort(String columnLabel, short x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateInt(String columnLabel, int x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateLong(String columnLabel, long x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateFloat(String columnLabel, float x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateDouble(String columnLabel, double x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateString(String columnLabel, String x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBytes(String columnLabel, byte[] x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateDate(String columnLabel, Date x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateTime(String columnLabel, Time x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateObject(String columnLabel, Object x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void insertRow() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateRow() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void deleteRow() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void refreshRow() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void cancelRowUpdates() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void moveToInsertRow() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void moveToCurrentRow() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Statement getStatement() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Ref getRef(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Blob getBlob(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Clob getClob(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Array getArray(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Ref getRef(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Blob getBlob(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Clob getClob(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Array getArray(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Date getDate(String columnLabel, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Time getTime(String columnLabel, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public URL getURL(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public URL getURL(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateRef(int columnIndex, Ref x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateRef(String columnLabel, Ref x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBlob(int columnIndex, Blob x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBlob(String columnLabel, Blob x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateClob(int columnIndex, Clob x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateClob(String columnLabel, Clob x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateArray(int columnIndex, Array x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateArray(String columnLabel, Array x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public RowId getRowId(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public RowId getRowId(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateRowId(int columnIndex, RowId x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateRowId(String columnLabel, RowId x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getHoldability() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isClosed() throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNString(int columnIndex, String nString) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNString(String columnLabel, String nString) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public NClob getNClob(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public NClob getNClob(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public SQLXML getSQLXML(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public SQLXML getSQLXML(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getNString(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getNString(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Reader getNCharacterStream(int columnIndex) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Reader getNCharacterStream(String columnLabel) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateClob(int columnIndex, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateClob(String columnLabel, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNClob(int columnIndex, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void updateNClob(String columnLabel, Reader reader) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public <T> T unwrap(Class<T> iface) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isWrapperFor(Class<?> iface) throws SQLException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/testng/parse/EntityCharacterEventOrder.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,116 @@
+package parse;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+import static org.testng.Assert.assertEquals;
+import org.testng.annotations.Test;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.DefaultHandler2;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * JDK-6770436: Entity callback order differs between Java1.5 and Java1.6
+ * https://bugs.openjdk.java.net/browse/JDK-6770436
+ *
+ */
+
+public class EntityCharacterEventOrder {
+
+ protected final static String xmlEncoding = "ISO-8859-15";
+ protected static Charset xmlEncodingCharset = null;
+
+ String _xml;
+ static {
+ xmlEncodingCharset = Charset.forName(xmlEncoding);
+ }
+ /**
+ public static void main(String[] args) {
+ TestRunner.run(JDK6770436Test.class);
+ }
+*/
+ @Test
+ public void entityCallbackOrderJava() throws SAXException, IOException {
+ final String input = "<element> & some more text</element>";
+
+ final MockContentHandler handler = new MockContentHandler();
+ final XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+
+ xmlReader.setContentHandler(handler);
+ xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
+
+ xmlReader.parse(new InputSource(new StringReader(input)));
+
+ final List<String> events = handler.getEvents();
+ printEvents(events);
+ assertCallbackOrder(events); //regression from JDK5
+ }
+
+ private void assertCallbackOrder(final List<String> events) {
+ assertEquals("startDocument", events.get(0));
+ assertEquals("startElement 'element'", events.get(1));
+ assertEquals("characters ' '", events.get(2));
+ assertEquals("startEntity 'amp'", events.get(3));
+ assertEquals("characters '&'", events.get(4));
+ assertEquals("endEntity 'amp'", events.get(5));
+ assertEquals("characters ' some more text'", events.get(6));
+ assertEquals("endElement 'element'", events.get(7));
+ assertEquals("endDocument", events.get(8));
+ }
+
+ private void printEvents(final List<String> events) {
+ events.stream().forEach((e) -> {
+ System.out.println(e);
+ });
+ }
+
+ private class MockContentHandler extends DefaultHandler2 {
+
+ private List<String> events;
+
+ public List<String> getEvents() {
+ return events;
+ }
+
+ @Override
+ public void startDocument() throws SAXException {
+ events = new ArrayList<String>();
+ events.add("startDocument");
+ }
+
+ @Override
+ public void characters(char[] ch, int start, int length) throws SAXException {
+ events.add("characters '" + new String(ch, start, length) + "'");
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException {
+ events.add("startElement '" + name + "'");
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String name) throws SAXException {
+ events.add("endElement '" + name + "'");
+ }
+
+ @Override
+ public void endDocument() throws SAXException {
+ events.add("endDocument");
+ }
+
+ @Override
+ public void startEntity(String name) throws SAXException {
+ events.add("startEntity '" + name + "'");
+ }
+
+ @Override
+ public void endEntity(String name) throws SAXException {
+ events.add("endEntity '" + name + "'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/jdk/net/Sockets/SupportedOptions.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,48 @@
+/*
+ * 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 8062744
+ * @run main SupportedOptions
+ */
+
+import java.net.*;
+import java.io.IOException;
+import jdk.net.*;
+
+public class SupportedOptions {
+
+ public static void main(String[] args) throws Exception {
+ if (!Sockets.supportedOptions(ServerSocket.class)
+ .contains(StandardSocketOptions.IP_TOS)) {
+ throw new RuntimeException("Test failed");
+ }
+ // Now set the option
+ ServerSocket ss = new ServerSocket();
+ if (!ss.supportedOptions().contains(StandardSocketOptions.IP_TOS)) {
+ throw new RuntimeException("Test failed");
+ }
+ Sockets.setOption(ss, java.net.StandardSocketOptions.IP_TOS, 128);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/LockFreeLogManager.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.testlibrary;
+
+import java.util.Collection;
+import java.util.Formatter;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+/**
+ * A log manager designed specifically to allow collecting ordered log messages
+ * in a multi-threaded environment without involving any kind of locking.
+ * <p>
+ * It is particularly useful in situations when one needs to assert various
+ * details about the tested thread state or the locks it hold while also wanting
+ * to produce diagnostic log messages.
+ * <p>
+ * The log manager does not provide any guarantees about the completness of the
+ * logs written from different threads - it is up to the caller to make sure
+ * {@code toString()} method is called only when all the activity has ceased
+ * and the per-thread logs contain all the necessary data.
+ *
+ * @author Jaroslav Bachorik
+ **/
+public class LockFreeLogManager {
+ private final AtomicInteger logCntr = new AtomicInteger(0);
+ private final Collection<Map<Integer, String>> allRecords = new ConcurrentLinkedQueue<>();
+ private final ThreadLocal<Map<Integer, String>> records = new ThreadLocal<Map<Integer, String>>() {
+ @Override
+ protected Map<Integer, String> initialValue() {
+ Map<Integer, String> m = new ConcurrentHashMap<>();
+ allRecords.add(m);
+ return m;
+ }
+
+ };
+
+ /**
+ * Log a message
+ * @param format Message format
+ * @param params Message parameters
+ */
+ public void log(String format, Object ... params) {
+ int id = logCntr.getAndIncrement();
+ try (Formatter formatter = new Formatter()) {
+ records.get().put(id, formatter.format(format, params).toString());
+ }
+ }
+
+ /**
+ * Will generate an aggregated log of chronologically ordered messages.
+ * <p>
+ * Make sure that you call this method only when all the related threads
+ * have finished; otherwise you might get incomplete data.
+ *
+ * @return An aggregated log of chronologically ordered messages
+ */
+ @Override
+ public String toString() {
+ return allRecords.stream()
+ .flatMap(m->m.entrySet().stream())
+ .sorted((l, r)->l.getKey().compareTo(r.getKey()))
+ .map(e->e.getValue())
+ .collect(Collectors.joining());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/tools/jarsigner/DefaultSigalg.java Thu Nov 06 15:12:17 2014 -0800
@@ -0,0 +1,106 @@
+/*
+ * 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 8057810
+ * @summary New defaults for DSA keys in jarsigner and keytool
+ */
+
+import sun.security.pkcs.PKCS7;
+import sun.security.util.KeyUtil;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+import java.util.jar.JarFile;
+
+public class DefaultSigalg {
+
+ public static void main(String[] args) throws Exception {
+
+ // Three test cases
+ String[] keyalgs = {"DSA", "RSA", "EC"};
+ // Expected default keytool sigalg
+ String[] sigalgs = {"SHA256withDSA", "SHA256withRSA", "SHA256withECDSA"};
+ // Expected keysizes
+ int[] keysizes = {2048, 2048, 256};
+ // Expected jarsigner digest alg used in signature
+ String[] digestalgs = {"SHA-256", "SHA-256", "SHA-256"};
+
+ // Create a jar file
+ sun.tools.jar.Main m =
+ new sun.tools.jar.Main(System.out, System.err, "jar");
+ Files.write(Paths.get("x"), new byte[10]);
+ if (!m.run("cvf a.jar x".split(" "))) {
+ throw new Exception("jar creation failed");
+ }
+
+ // Generate keypairs and sign the jar
+ Files.deleteIfExists(Paths.get("jks"));
+ for (String keyalg: keyalgs) {
+ sun.security.tools.keytool.Main.main(
+ ("-keystore jks -storepass changeit -keypass changeit " +
+ "-dname CN=A -alias " + keyalg + " -genkeypair " +
+ "-keyalg " + keyalg).split(" "));
+ sun.security.tools.jarsigner.Main.main(
+ ("-keystore jks -storepass changeit a.jar " + keyalg).split(" "));
+ }
+
+ // Check result
+ KeyStore ks = KeyStore.getInstance("JKS");
+ try (FileInputStream jks = new FileInputStream("jks");
+ JarFile jf = new JarFile("a.jar")) {
+ ks.load(jks, null);
+ for (int i = 0; i<keyalgs.length; i++) {
+ String keyalg = keyalgs[i];
+ // keytool
+ X509Certificate c = (X509Certificate) ks.getCertificate(keyalg);
+ String sigalg = c.getSigAlgName();
+ if (!sigalg.equals(sigalgs[i])) {
+ throw new Exception(
+ "keytool sigalg for " + keyalg + " is " + sigalg);
+ }
+ int keysize = KeyUtil.getKeySize(c.getPublicKey());
+ if (keysize != keysizes[i]) {
+ throw new Exception(
+ "keytool keysize for " + keyalg + " is " + keysize);
+ }
+ // jarsigner
+ String bk = "META-INF/" + keyalg + "." + keyalg;
+ try (InputStream is = jf.getInputStream(jf.getEntry(bk))) {
+ String digestalg = new PKCS7(is).getSignerInfos()[0]
+ .getDigestAlgorithmId().toString();
+ if (!digestalg.equals(digestalgs[i])) {
+ throw new Exception(
+ "jarsigner digest of sig for " + keyalg
+ + " is " + digestalg);
+ }
+ }
+ }
+ }
+ }
+}
--- a/jdk/test/sun/security/tools/keytool/KeyToolTest.java Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/sun/security/tools/keytool/KeyToolTest.java Thu Nov 06 15:12:17 2014 -0800
@@ -170,6 +170,13 @@
*/
void testOK(String input, String cmd) throws Exception {
try {
+ // Workaround for "8057810: Make SHA256withDSA the default
+ // jarsigner and keytool algorithm for DSA keys". Unfortunately
+ // SunPKCS11-NSS does not support SHA256withDSA yet.
+ if (cmd.contains("p11-nss.txt") && cmd.contains("-genkey")
+ && !cmd.contains("-keyalg")) {
+ cmd += " -sigalg SHA1withDSA -keysize 1024";
+ }
test(input, cmd);
} catch(Exception e) {
afterFail(input, cmd, "OK");
@@ -245,6 +252,9 @@
* Helper method, print some output after a test does not do as expected
*/
void afterFail(String input, String cmd, String should) {
+ if (cmd.contains("p11-nss.txt")) {
+ cmd = "-J-Dnss.lib=" + System.getProperty("nss.lib") + " " + cmd;
+ }
System.err.println("\nTest fails for the command ---\n" +
"keytool " + cmd + "\nOr its debug version ---\n" +
"keytool -debug " + cmd);
@@ -799,7 +809,7 @@
remove("x.jks.p1.cert");
remove("csr1");
// PrivateKeyEntry can do certreq
- testOK("", "-keystore x.jks -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
+ testOK("", "-keystore x.jks -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keysize 1024");
testOK("", "-keystore x.jks -storepass changeit -certreq -file csr1 -alias mykey");
testOK("", "-keystore x.jks -storepass changeit -certreq -file csr1");
testOK("", "-keystore x.jks -storepass changeit -certreq -file csr1 -sigalg SHA1withDSA");
--- a/jdk/test/sun/security/tools/keytool/autotest.sh Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/sun/security/tools/keytool/autotest.sh Thu Nov 06 15:12:17 2014 -0800
@@ -118,13 +118,4 @@
KeyToolTest
status=$?
-rm -f p11-nss.txt
-rm -f cert8.db
-rm -f key3.db
-rm -f secmod.db
-
-rm HumanInputStream*.class
-rm KeyToolTest*.class
-rm TestException.class
-
exit $status
--- a/jdk/test/sun/security/tools/keytool/standard.sh Thu Nov 06 10:11:37 2014 -0800
+++ b/jdk/test/sun/security/tools/keytool/standard.sh Thu Nov 06 15:12:17 2014 -0800
@@ -62,9 +62,5 @@
echo | ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dfile KeyToolTest
status=$?
-rm HumanInputStream*.class
-rm KeyToolTest*.class
-rm TestException.class
-
exit $status