The thread.throwNewException() method is very convenient when throwing exceptions from native code. However, it uses the bootstrap class loader for loading the exception class, making it difficult to throw custom exceptions.
If it uses the loader from getLoader(), user defined exceptions can be easily thrown.
The
thread.throwNewException()
method is very convenient when throwing exceptions from native code. However, it uses the bootstrap class loader for loading the exception class, making it difficult to throw custom exceptions.If it uses the loader from
getLoader()
, user defined exceptions can be easily thrown.