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

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/master by this push:
     new a086e72  Update Java JNI code
a086e72 is described below

commit a086e7271fb1743de61ab3925cb25ecc6e098830
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Aug 21 18:44:47 2020 +0100

    Update Java JNI code
---
 java/org/apache/tomcat/jni/Library.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/tomcat/jni/Library.java 
b/java/org/apache/tomcat/jni/Library.java
index 9034e23..c6c1398 100644
--- a/java/org/apache/tomcat/jni/Library.java
+++ b/java/org/apache/tomcat/jni/Library.java
@@ -64,9 +64,9 @@ public final class Library {
         if (!loaded) {
             String path = System.getProperty("java.library.path");
             String [] paths = path.split(File.pathSeparator);
-            for (int i = 0; i < NAMES.length; i++) {
+            for (String value : NAMES) {
                 try {
-                    System.loadLibrary(NAMES[i]);
+                    System.loadLibrary(value);
                     loaded = true;
                 } catch (ThreadDeath t) {
                     throw t;
@@ -75,9 +75,9 @@ public final class Library {
                     // the JNI code identical between Tomcat 6/7/8/9
                     throw t;
                 } catch (Throwable t) {
-                    String name = System.mapLibraryName(NAMES[i]);
-                    for (int j = 0; j < paths.length; j++) {
-                        java.io.File fd = new java.io.File(paths[j] , name);
+                    String name = System.mapLibraryName(value);
+                    for (String s : paths) {
+                        File fd = new File(s, name);
                         if (fd.exists()) {
                             // File exists but failed to load
                             throw t;


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to