src/java.base/share/classes/java/lang/ClassNotFoundException.java

Print this page

        

@@ -95,10 +95,25 @@
         super(s, null);  //  Disallow initCause
         this.ex = ex;
     }
 
     /**
+     * Constructs a <code>ClassNotFoundException</code> with the
+     * specified detail message, optional exception that was
+     * raised while loading the class and a writableStackTrace flag.
+     *
+     * @param s the detail message
+     * @param ex the exception that was raised while loading the class
+     * @param writableStackTrace whether or not the stack trace should
+     *                           be writable and filled-in
+     */
+    ClassNotFoundException(String s, Throwable ex, boolean writableStackTrace) {
+        super(s, null, true, writableStackTrace);
+        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