--- old/src/java.base/share/classes/java/lang/System.java Tue Mar 8 21:59:04 2016 +++ new/src/java.base/share/classes/java/lang/System.java Tue Mar 8 21:59:04 2016 @@ -1919,7 +1919,7 @@ // base module needs to be loose Module base = Object.class.getModule(); if (base == null) - throw new InternalError(); + throw new InternalError("base module is null"); Modules.addReads(base, null); // module system initialized --- old/src/java.base/share/classes/java/lang/module/InstalledModuleFinder.java Tue Mar 8 21:59:06 2016 +++ new/src/java.base/share/classes/java/lang/module/InstalledModuleFinder.java Tue Mar 8 21:59:06 2016 @@ -110,7 +110,7 @@ md = ModuleDescriptor.read(imageReader.getResourceBuffer(location)); } if (!md.name().equals(mn)) - throw new InternalError(); + throw new InternalError(md.name() + " is not equal to " + mn); // create the ModuleReference --- old/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java Tue Mar 8 21:59:08 2016 +++ new/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java Tue Mar 8 21:59:07 2016 @@ -953,7 +953,7 @@ */ public Builder requires(Set mods, String mn) { if (name.equals(mn)) - throw new IllegalArgumentException("Dependence on self"); + throw new IllegalArgumentException("Dependence on self: " + mn); if (requires.containsKey(mn)) throw new IllegalStateException("Dependence upon " + mn + " already declared"); @@ -1273,7 +1273,8 @@ */ public Builder version(String v) { if (version != null) - throw new IllegalStateException("module version already set"); + throw new IllegalStateException( + "module version already set: " + version); version = Version.parse(v); return this; } @@ -1293,7 +1294,8 @@ */ public Builder mainClass(String mc) { if (mainClass != null) - throw new IllegalStateException("main class already set"); + throw new IllegalStateException( + "main class already set: " + mainClass); mainClass = requireJavaIdentifier("main class name", mc); return this; } @@ -1313,7 +1315,8 @@ */ public Builder osName(String name) { if (osName != null) - throw new IllegalStateException("OS name already set"); + throw new IllegalStateException( + "OS name already set: " + osName); if (name == null || name.isEmpty()) throw new IllegalArgumentException("OS name is null or empty"); osName = name; @@ -1335,7 +1338,8 @@ */ public Builder osArch(String arch) { if (osArch != null) - throw new IllegalStateException("OS arch already set"); + throw new IllegalStateException( + "OS arch already set: " + osArch); if (arch == null || arch.isEmpty()) throw new IllegalArgumentException("OS arch is null or empty"); osArch = arch; @@ -1357,7 +1361,8 @@ */ public Builder osVersion(String version) { if (osVersion != null) - throw new IllegalStateException("OS version already set"); + throw new IllegalStateException( + "OS version already set: " + osVersion); if (version == null || version.isEmpty()) throw new IllegalArgumentException("OS version is null or empty"); osVersion = version; --- old/src/java.base/share/classes/java/lang/module/ModuleInfo.java Tue Mar 8 21:59:09 2016 +++ new/src/java.base/share/classes/java/lang/module/ModuleInfo.java Tue Mar 8 21:59:09 2016 @@ -663,7 +663,7 @@ try { bb.get(b, off, len); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -680,7 +680,7 @@ int ch = bb.get(); return (ch != 0); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -689,7 +689,7 @@ try { return bb.get(); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -698,7 +698,7 @@ try { return ((int) bb.get()) & 0xff; } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -707,7 +707,7 @@ try { return bb.getShort(); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -716,7 +716,7 @@ try { return ((int) bb.getShort()) & 0xffff; } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -725,7 +725,7 @@ try { return bb.getChar(); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -734,7 +734,7 @@ try { return bb.getInt(); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -743,7 +743,7 @@ try { return bb.getLong(); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -752,7 +752,7 @@ try { return bb.getFloat(); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @@ -761,13 +761,13 @@ try { return bb.getDouble(); } catch (BufferUnderflowException e) { - throw new EOFException(); + throw new EOFException(e.getMessage()); } } @Override public String readLine() { - throw new RuntimeException("not implemented"); + throw new RuntimeException("readLine() not implemented"); } @Override --- old/src/java.base/share/classes/java/lang/reflect/Proxy.java Tue Mar 8 21:59:11 2016 +++ new/src/java.base/share/classes/java/lang/reflect/Proxy.java Tue Mar 8 21:59:10 2016 @@ -708,7 +708,7 @@ throw new InternalError("Proxy is not supported until module system is fully initialzed"); } if (interfaces.size() > 65535) { - throw new IllegalArgumentException("interface limit exceeded"); + throw new IllegalArgumentException("interface limit exceeded: " + interfaces.size()); } Set> refTypes = referencedTypes(loader, interfaces); --- old/src/java.base/share/classes/jdk/internal/jrtfs/AbstractJrtFileSystem.java Tue Mar 8 21:59:12 2016 +++ new/src/java.base/share/classes/jdk/internal/jrtfs/AbstractJrtFileSystem.java Tue Mar 8 21:59:12 2016 @@ -102,7 +102,7 @@ if (lo == LinkOption.NOFOLLOW_LINKS) { return false; } else if (lo == null) { - throw new NullPointerException(); + throw new NullPointerException("LinkOption"); } else { throw new AssertionError("should not reach here"); } @@ -116,10 +116,11 @@ // check for options of null type and option is an intance of StandardOpenOption for (OpenOption option : options) { if (option == null) { - throw new NullPointerException(); + throw new NullPointerException("OpenOption"); } if (!(option instanceof StandardOpenOption)) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException( + "option class : " + option.getClass().getName()); } } @@ -211,7 +212,7 @@ public PathMatcher getPathMatcher(String syntaxAndInput) { int pos = syntaxAndInput.indexOf(':'); if (pos <= 0 || pos == syntaxAndInput.length()) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("pos is " + pos); } String syntax = syntaxAndInput.substring(0, pos); String input = syntaxAndInput.substring(pos + 1); --- old/src/java.base/share/classes/jdk/internal/jrtfs/AbstractJrtPath.java Tue Mar 8 21:59:14 2016 +++ new/src/java.base/share/classes/jdk/internal/jrtfs/AbstractJrtPath.java Tue Mar 8 21:59:13 2016 @@ -123,7 +123,8 @@ public final AbstractJrtPath getName(int index) { initOffsets(); if (index < 0 || index >= offsets.length) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("index: " + + index + ", offsets length: " + offsets.length); } int begin = offsets[index]; int len; @@ -145,7 +146,8 @@ || beginIndex >= offsets.length || endIndex > offsets.length || beginIndex >= endIndex) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("beginIndex: " + beginIndex + + ", endIndex: " + endIndex + ", offsets length: " + offsets.length); } // starting offset and length @@ -241,7 +243,7 @@ return newJrtPath(new byte[0], true); } if (/* this.getFileSystem() != o.getFileSystem() || */this.isAbsolute() != o.isAbsolute()) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("this.isAbsolute(): " + this.isAbsolute()); } int mc = this.getNameCount(); int oc = o.getNameCount(); @@ -311,7 +313,7 @@ @Override public final Path resolveSibling(Path other) { if (other == null) { - throw new NullPointerException(); + throw new NullPointerException("other"); } Path parent = getParent(); return (parent == null) ? other : parent.resolve(other); @@ -396,10 +398,11 @@ private AbstractJrtPath checkPath(Path path) { if (path == null) { - throw new NullPointerException(); + throw new NullPointerException("path"); } if (!(path instanceof AbstractJrtPath)) { - throw new ProviderMismatchException(); + throw new ProviderMismatchException("path class:" + + path.getClass().getName()); } return (AbstractJrtPath) path; } @@ -475,7 +478,7 @@ } if (c == '\u0000') { throw new InvalidPathException(JrtFileSystem.getString(path), - "Path: nul character not allowed"); + "Path: null character not allowed"); } prevC = c; } --- old/src/java.base/share/classes/jdk/internal/loader/BootLoader.java Tue Mar 8 21:59:15 2016 +++ new/src/java.base/share/classes/jdk/internal/loader/BootLoader.java Tue Mar 8 21:59:15 2016 @@ -224,7 +224,7 @@ // named module from runtime image or exploded module Optional om = BOOT_LAYER.findModule(moduleName); if (!om.isPresent()) - throw new InternalError(); + throw new InternalError("Module not present:" + moduleName); return om.get(); } --- old/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java Tue Mar 8 21:59:16 2016 +++ new/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java Tue Mar 8 21:59:16 2016 @@ -92,7 +92,8 @@ { static { if (!ClassLoader.registerAsParallelCapable()) - throw new InternalError(); + throw new InternalError("Classloader is not registered" + + " as parallel capable."); } // parent ClassLoader --- old/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java Tue Mar 8 21:59:18 2016 +++ new/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java Tue Mar 8 21:59:17 2016 @@ -133,7 +133,8 @@ private static class ExtClassLoader extends BuiltinClassLoader { static { if (!ClassLoader.registerAsParallelCapable()) - throw new InternalError(); + throw new InternalError("Classloader is not registered" + + " as parallel capable."); } ExtClassLoader(BootClassLoader parent) { @@ -158,7 +159,8 @@ private static class AppClassLoader extends BuiltinClassLoader { static { if (!ClassLoader.registerAsParallelCapable()) - throw new InternalError(); + throw new InternalError("Classloader is not registered" + + " as parallel capable."); } final URLClassPath ucp; --- old/src/java.base/share/classes/jdk/internal/misc/VM.java Tue Mar 8 21:59:19 2016 +++ new/src/java.base/share/classes/jdk/internal/misc/VM.java Tue Mar 8 21:59:19 2016 @@ -164,7 +164,7 @@ public static void initLevel(int value) { synchronized (lock) { if (value <= initLevel || value > SYSTEM_BOOTED) - throw new InternalError(); + throw new InternalError("Bad level: " + value); initLevel = value; lock.notifyAll(); } --- old/src/java.base/share/classes/jdk/internal/module/Builder.java Tue Mar 8 21:59:21 2016 +++ new/src/java.base/share/classes/jdk/internal/module/Builder.java Tue Mar 8 21:59:20 2016 @@ -193,7 +193,8 @@ */ public Builder version(String v) { if (version != null) - throw new IllegalStateException("module version already set"); + throw new IllegalStateException( + "module version already set: " + version); Version ver = cachedVersion; if (ver != null && v.equals(ver.toString())) { version = ver; @@ -210,7 +211,8 @@ */ public Builder mainClass(String mc) { if (mainClass != null) - throw new IllegalStateException("main class already set"); + throw new IllegalStateException( + "main class already set: " + mainClass); mainClass = mc; return this; } @@ -222,7 +224,8 @@ */ public Builder osName(String name) { if (osName != null) - throw new IllegalStateException("OS name already set"); + throw new IllegalStateException( + "OS name already set: " + osName); this.osName = name; return this; } @@ -234,7 +237,8 @@ */ public Builder osArch(String arch) { if (osArch != null) - throw new IllegalStateException("OS arch already set"); + throw new IllegalStateException( + "OS arch already set: " + osArch); this.osArch = arch; return this; } @@ -246,7 +250,8 @@ */ public Builder osVersion(String version) { if (osVersion != null) - throw new IllegalStateException("OS version already set"); + throw new IllegalStateException( + "OS version already set: " + osVersion); this.osVersion = version; return this; } --- old/src/java.desktop/share/classes/com/sun/beans/finder/ConstructorFinder.java Tue Mar 8 21:59:22 2016 +++ new/src/java.desktop/share/classes/com/sun/beans/finder/ConstructorFinder.java Tue Mar 8 21:59:22 2016 @@ -67,19 +67,22 @@ */ public static Constructor findConstructor(Class type, Class...args) throws NoSuchMethodException { if (type.isPrimitive()) { - throw new NoSuchMethodException("Primitive wrapper does not contain constructors"); + throw new NoSuchMethodException("Primitive wrapper does not contain constructors:" + + type.getName()); } if (type.isInterface()) { - throw new NoSuchMethodException("Interface does not contain constructors"); + throw new NoSuchMethodException("Interface does not contain constructors:" + + type.getName()); } if (!FinderUtils.isExported(type)) { - throw new NoSuchMethodException("Class is not accessible"); + throw new NoSuchMethodException("Class is not accessible:" + type.getName()); } if (Modifier.isAbstract(type.getModifiers())) { - throw new NoSuchMethodException("Abstract class cannot be instantiated"); + throw new NoSuchMethodException("Abstract class cannot be instantiated:" + + type.getName()); } if (!Modifier.isPublic(type.getModifiers()) || !isPackageAccessible(type)) { - throw new NoSuchMethodException("Class is not accessible"); + throw new NoSuchMethodException("Class is not accessible:" + type.getName()); } PrimitiveWrapperMap.replacePrimitivesWithWrappers(args); Signature signature = new Signature(type, args); --- old/src/java.desktop/share/classes/javax/imageio/ImageReader.java Tue Mar 8 21:59:23 2016 +++ new/src/java.desktop/share/classes/javax/imageio/ImageReader.java Tue Mar 8 21:59:23 2016 @@ -2461,7 +2461,7 @@ try { bundle = ResourceBundle.getBundle(baseName, locale, this.getClass().getModule()); } catch (MissingResourceException mre) { - throw new IllegalArgumentException("Bundle not found!"); + throw new IllegalArgumentException("Bundle not found!", mre); } String warning = null; @@ -2468,9 +2468,9 @@ try { warning = bundle.getString(keyword); } catch (ClassCastException cce) { - throw new IllegalArgumentException("Resource is not a String!"); + throw new IllegalArgumentException("Resource is not a String!", cce); } catch (MissingResourceException mre) { - throw new IllegalArgumentException("Resource is missing!"); + throw new IllegalArgumentException("Resource is missing!", mre); } listener.warningOccurred(this, warning); --- old/src/java.desktop/share/classes/javax/imageio/ImageWriter.java Tue Mar 8 21:59:25 2016 +++ new/src/java.desktop/share/classes/javax/imageio/ImageWriter.java Tue Mar 8 21:59:25 2016 @@ -1963,7 +1963,7 @@ try { bundle = ResourceBundle.getBundle(baseName, locale, this.getClass().getModule()); } catch (MissingResourceException mre) { - throw new IllegalArgumentException("Bundle not found!"); + throw new IllegalArgumentException("Bundle not found!", mre); } String warning = null; @@ -1970,9 +1970,9 @@ try { warning = bundle.getString(keyword); } catch (ClassCastException cce) { - throw new IllegalArgumentException("Resource is not a String!"); + throw new IllegalArgumentException("Resource is not a String!", cce); } catch (MissingResourceException mre) { - throw new IllegalArgumentException("Resource is missing!"); + throw new IllegalArgumentException("Resource is missing!", mre); } listener.warningOccurred(this, imageIndex, warning); --- old/src/java.management/share/classes/sun/management/StackTraceElementCompositeData.java Tue Mar 8 21:59:26 2016 +++ new/src/java.management/share/classes/sun/management/StackTraceElementCompositeData.java Tue Mar 8 21:59:26 2016 @@ -148,7 +148,7 @@ if (!isTypeMatched(stackTraceElementCompositeType, ct)) { if (!isTypeMatched(stackTraceElementV6CompositeType, ct)) { throw new IllegalArgumentException( - "Unexpected composite type for StackTraceElement"); + "Unexpected composite type for StackTraceElement: " + ct); } } }