> 122 private native void setDefaultMessage(String extendedMessage); > Here, I agree with David, that you should do it in Java. Just use a shared > secret, then you don't even need reflection...
Addition: you should not even need to use a shared secret as Throwable and NPE are in the same package. Just add some package private setter to Throwable's detailMessage.