Fix JNI native symbol names after refactor.
This commit is contained in:
@@ -227,7 +227,8 @@ public interface MPAlgorithm {
|
||||
private static final int AES_BLOCKSIZE = 128 /* bit */;
|
||||
|
||||
static {
|
||||
Native.load( MPAlgorithm.class, "mpw" );
|
||||
if (!Native.load( MPAlgorithm.class, "mpw" ))
|
||||
Logger.get( MPAlgorithm.class ).err( "Native mpw library unavailable." );
|
||||
}
|
||||
|
||||
protected final Logger logger = Logger.get( getClass() );
|
||||
|
@@ -74,9 +74,9 @@ public final class Native {
|
||||
|
||||
// Write the library resource to a temporary file.
|
||||
libraryFile = File.createTempFile( libraryName, libraryExtension );
|
||||
libraryFile.deleteOnExit();
|
||||
FileOutputStream libraryFileStream = new FileOutputStream( libraryFile );
|
||||
try {
|
||||
libraryFile.deleteOnExit();
|
||||
ByteStreams.copy( libraryStream, libraryFileStream );
|
||||
}
|
||||
finally {
|
||||
@@ -91,9 +91,8 @@ public final class Native {
|
||||
catch (@SuppressWarnings("ErrorNotRethrown") final IOException | UnsatisfiedLinkError e) {
|
||||
logger.wrn( e, "Couldn't load library: %s", libraryResource );
|
||||
|
||||
if (libraryFile != null)
|
||||
if (libraryFile.exists() && !libraryFile.delete())
|
||||
logger.wrn( "Couldn't clean up library file: %s", libraryFile );
|
||||
if (libraryFile != null && libraryFile.exists() && !libraryFile.delete())
|
||||
logger.wrn( "Couldn't clean up library file: %s", libraryFile );
|
||||
libraryFile = null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user