You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/12/18 13:25:23 UTC

[commons-crypto] branch master updated: Refactor magic string

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
     new 3630226  Refactor magic string
3630226 is described below

commit 3630226c0dd60dc143b741d41c0b93e856b96ca5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Dec 18 08:25:20 2022 -0500

    Refactor magic string
---
 src/main/java/org/apache/commons/crypto/NativeCodeLoader.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/crypto/NativeCodeLoader.java b/src/main/java/org/apache/commons/crypto/NativeCodeLoader.java
index 83da968..a69c243 100644
--- a/src/main/java/org/apache/commons/crypto/NativeCodeLoader.java
+++ b/src/main/java/org/apache/commons/crypto/NativeCodeLoader.java
@@ -40,6 +40,8 @@ final class NativeCodeLoader {
 
     private static final String NATIVE_LIBNAME = "commons-crypto";
 
+    private static final String NATIVE_LIBNAME_ALT = "lib" + NATIVE_LIBNAME + ".jnilib";
+
     /**
      * End of file pseudo-character.
      */
@@ -216,7 +218,7 @@ final class NativeCodeLoader {
         nativeLibraryPath = "/org/apache/commons/crypto/native/" + OsInfo.getNativeLibFolderPathForCurrentOS();
         boolean hasNativeLib = hasResource(nativeLibraryPath + File.separator + nativeLibraryName);
         if (!hasNativeLib) {
-            final String altName = "libcommons-crypto.jnilib";
+            final String altName = NATIVE_LIBNAME_ALT;
             if (OsInfo.getOSName().equals("Mac") && hasResource(nativeLibraryPath + File.separator + altName)) {
                 // Fix for openjdk7 for Mac
                 nativeLibraryName = altName;