src/java.base/share/classes/java/lang/ClassNotFoundException.java
Print this page
*** 95,104 ****
--- 95,121 ----
super(s, null); // Disallow initCause
this.ex = ex;
}
/**
+ * Constructs a stack-less <code>ClassNotFoundException</code>
+ * with the specified detail message, optional exception that was
+ * raised while loading the class and the name of the throwing
+ * entity (usually a runtime class name of the instance throwing
+ * this exception).
+ *
+ * @param s the detail message
+ * @param ex the exception that was raised while loading the class
+ * @param wst whether or not the stack trace should be writable
+ * and filled-in
+ */
+ ClassNotFoundException(String s, Throwable ex, boolean wst) {
+ super(s, null, true, wst);
+ this.ex = ex;
+ }
+
+ /**
* Returns the exception that was raised if an error occurred while
* attempting to load the class. Otherwise, returns <tt>null</tt>.
*
* <p>This method predates the general-purpose exception chaining facility.
* The {@link Throwable#getCause()} method is now the preferred means of