There are a few methods using Throwable.printStackTrace(...). Often System.err might not be visible or the user will not see it, so throwing an exception is more appropriate:
The printStackTrace calls in the static initializer of RuntimeUtils might make sense since you apparently don't want to throw an exception instead (though this would at least fail early; I doubt that any user is checking RuntimeUtils.loaded), but I think the static intializer should probably not call init(); if loading the native lib failed.
There are a few methods using
Throwable.printStackTrace(...)
. OftenSystem.err
might not be visible or the user will not see it, so throwing an exception is more appropriate:ex
as causeprintStackTrace
on the created exception (instead of throwing and then catching it again). However it might be saner to throw anIllegalArgumentException
here becausenull
is not a valid argument there?The
printStackTrace
calls in the static initializer ofRuntimeUtils
might make sense since you apparently don't want to throw an exception instead (though this would at least fail early; I doubt that any user is checkingRuntimeUtils.loaded
), but I think the static intializer should probably not callinit();
if loading the native lib failed.