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

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new e9be1a3  Use StringManager. Align with 9.0.x/10.0.x
e9be1a3 is described below

commit e9be1a3a74a1a9080e4a2449f3af8f67f2e8d4e9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri May 21 16:12:31 2021 +0100

    Use StringManager. Align with 9.0.x/10.0.x
---
 java/org/apache/catalina/core/JniLifecycleListener.java     | 12 +++++++-----
 java/org/apache/catalina/core/LocalStrings.properties       |  5 +++++
 java/org/apache/catalina/core/LocalStrings_fr.properties    |  5 +++++
 java/org/apache/catalina/core/LocalStrings_ja.properties    |  5 +++++
 java/org/apache/catalina/core/LocalStrings_ko.properties    |  5 +++++
 java/org/apache/catalina/core/LocalStrings_zh_CN.properties |  5 +++++
 6 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/core/JniLifecycleListener.java 
b/java/org/apache/catalina/core/JniLifecycleListener.java
index fcc2967..0804d61 100644
--- a/java/org/apache/catalina/core/JniLifecycleListener.java
+++ b/java/org/apache/catalina/core/JniLifecycleListener.java
@@ -22,6 +22,7 @@ import org.apache.catalina.LifecycleEvent;
 import org.apache.catalina.LifecycleListener;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
 
 /**
  * An implementation of LifeCycleListener that loads a native library into the 
JVM.
@@ -38,6 +39,7 @@ import org.apache.juli.logging.LogFactory;
 public class JniLifecycleListener implements LifecycleListener {
 
     private static final Log log = 
LogFactory.getLog(JniLifecycleListener.class);
+    protected static final StringManager sm = 
StringManager.getManager(Constants.Package);
 
     private String libraryName = "";
     private String libraryPath = "";
@@ -49,12 +51,12 @@ public class JniLifecycleListener implements 
LifecycleListener {
 
             if (!libraryName.isEmpty()) {
                 System.loadLibrary(libraryName);
-                log.info("Loaded native library " + libraryName);
+                log.info(sm.getString("jniLifecycleListener.load.name", 
libraryName));
             } else if (!libraryPath.isEmpty()) {
                 System.load(libraryPath);
-                log.info("Loaded native library from " + libraryPath);
+                log.info(sm.getString("jniLifecycleListener.load.path", 
libraryPath));
             } else {
-                throw new IllegalArgumentException("Either libraryName or 
libraryPath must be set");
+                throw new 
IllegalArgumentException(sm.getString("jniLifecycleListener.missingPathOrName"));
             }
         }
     }
@@ -62,7 +64,7 @@ public class JniLifecycleListener implements 
LifecycleListener {
     public void setLibraryName(String libraryName) {
 
         if (!this.libraryPath.isEmpty()) {
-            throw new IllegalArgumentException("Either libraryName or 
libraryPath may be set, not both.");
+            throw new 
IllegalArgumentException(sm.getString("jniLifecycleListener.bothPathAndName"));
         }
 
         this.libraryName = libraryName;
@@ -75,7 +77,7 @@ public class JniLifecycleListener implements 
LifecycleListener {
     public void setLibraryPath(String libraryPath) {
 
         if (!this.libraryName.isEmpty()) {
-            throw new IllegalArgumentException("Either libraryName or 
libraryPath may be set, not both.");
+            throw new 
IllegalArgumentException(sm.getString("jniLifecycleListener.bothPathAndName"));
         }
 
         this.libraryPath = libraryPath;
diff --git a/java/org/apache/catalina/core/LocalStrings.properties 
b/java/org/apache/catalina/core/LocalStrings.properties
index 14fe743..d5c32cc 100644
--- a/java/org/apache/catalina/core/LocalStrings.properties
+++ b/java/org/apache/catalina/core/LocalStrings.properties
@@ -138,6 +138,11 @@ defaultInstanceManager.restrictedWrongValue=Wrong value in 
restricted classes pr
 filterChain.filter=Filter execution threw an exception
 filterChain.servlet=Servlet execution threw an exception
 
+jniLifecycleListener.bothPathAndName=Either libraryName or libraryPath may be 
set, not both
+jniLifecycleListener.load.name=Loaded native library [{0}]
+jniLifecycleListener.load.path=Loaded native library from [{0}]
+jniLifecycleListener.missingPathOrName=One of libraryName or libraryPath must 
be set
+
 jreLeakListener.authPolicyFail=Error whilst attempting to prevent memory leak 
in javax.security.auth.Policy class
 jreLeakListener.classToInitializeFail=Failed to load class [{0}] during Tomcat 
start to prevent possible memory leaks.
 jreLeakListener.gcDaemonFail=Failed to trigger creation of the GC Daemon 
thread during Tomcat start to prevent possible memory leaks. This is expected 
on non-Sun JVMs.
diff --git a/java/org/apache/catalina/core/LocalStrings_fr.properties 
b/java/org/apache/catalina/core/LocalStrings_fr.properties
index 56ba3f0..bf17b10 100644
--- a/java/org/apache/catalina/core/LocalStrings_fr.properties
+++ b/java/org/apache/catalina/core/LocalStrings_fr.properties
@@ -137,6 +137,11 @@ defaultInstanceManager.restrictedWrongValue=Mauvaise 
valeur dans le fichier de p
 filterChain.filter=L'exécution du filtre (Filter) a lancé une exception
 filterChain.servlet=L'exécution de la servlet a lancé une exception
 
+jniLifecycleListener.bothPathAndName=Soit libraryName ou libraryPath peuvent 
être définis, pas les deux
+jniLifecycleListener.load.name=La librairie native [{0}] a été chargée
+jniLifecycleListener.load.path=La librairie native a été chargée à partir de 
[{0}]
+jniLifecycleListener.missingPathOrName=Soit libraryName soit libraryPath 
doivent être définis
+
 jreLeakListener.authPolicyFail=Erreur en essayant de prévenir une fuite de 
mémoire dans la classe javax.security.auth.Policy
 jreLeakListener.classToInitializeFail=Echec du chargement de la classe [{0}] 
pendant le démarrage de Tomcat, effectué pour empêcher de possibles fuites de 
mémoire
 jreLeakListener.gcDaemonFail=Echec de la création du thread GC Daemon durant 
le démarrage de Tomcat pour éviter une fuite de mémoire, cela est normal sur 
toutes les JVMs non Oracle
diff --git a/java/org/apache/catalina/core/LocalStrings_ja.properties 
b/java/org/apache/catalina/core/LocalStrings_ja.properties
index a48bc8c..d1fa939 100644
--- a/java/org/apache/catalina/core/LocalStrings_ja.properties
+++ b/java/org/apache/catalina/core/LocalStrings_ja.properties
@@ -137,6 +137,11 @@ defaultInstanceManager.restrictedWrongValue=クラス名[{1}]の制限付きク
 filterChain.filter=フィルタの実行により例外を投げました
 filterChain.servlet=サーブレットの実行により例外を投げました
 
+jniLifecycleListener.bothPathAndName=libraryName あるいは libraryPath 
のどちらか一方を設定するはずです。
+jniLifecycleListener.load.name=ネイティブライブラリ [{0}] を読み込みました。
+jniLifecycleListener.load.path=[{0}] からネイティブライブラリを読み込みました。
+jniLifecycleListener.missingPathOrName=libraryName あるいは libraryPath 
を設定しなければなりません。
+
 
jreLeakListener.authPolicyFail=javax.security.auth.Policyクラスのメモリリークの防止を試みる際にエラーが発生しました。
 
jreLeakListener.classToInitializeFail=Tomcat起動中に可能なメモリーリークを防止するためのクラス[{0}]をロードすることに失敗しました。
 jreLeakListener.gcDaemonFail=Tomcat の開始時に潜在的なメモリーリークを防ぐ GC 
デーモンスレッドの作成を開始できませんでした。Sun の JVM ではない可能性があります。
diff --git a/java/org/apache/catalina/core/LocalStrings_ko.properties 
b/java/org/apache/catalina/core/LocalStrings_ko.properties
index bc2961a..ecb2e7c 100644
--- a/java/org/apache/catalina/core/LocalStrings_ko.properties
+++ b/java/org/apache/catalina/core/LocalStrings_ko.properties
@@ -137,6 +137,11 @@ defaultInstanceManager.restrictedWrongValue=제한 클래스들 프로퍼티 파
 filterChain.filter=필터 실행에서 예외가 발생했습니다.
 filterChain.servlet=서블릿 실행이 예외를 발생시켰습니다.
 
+jniLifecycleListener.bothPathAndName=libraryName 또는 libraryPath, 둘 중 하나만 설정될 수 
있습니다 (둘 다 설정하면 안됨).
+jniLifecycleListener.load.name=Native 라이브러리 [{0}]을(를) 로드했습니다.
+jniLifecycleListener.load.path=[{0}](으)로부터 native 라이브러리를 로드했습니다.
+jniLifecycleListener.missingPathOrName=libraryName 또는 libraryPath, 둘 중 하나는 반드시 
설정되어야 합니다.
+
 jreLeakListener.authPolicyFail=javax.security.auth.Policy 클래스에서 메모리 누수를 방지하려 
시도하는 중 오류 발생
 jreLeakListener.classToInitializeFail=Tomcat을 시작하던 중, 발생 가능성 있는 메모리 누수를 방지하기 
위한 클래스 [{0}]을(를) 로드하지 못했습니다.
 jreLeakListener.gcDaemonFail=Tomcat이 시작하는 동안, 가능성 있는 메모리 누수들을 방지하기 위한 GC 
Daemon 쓰레드 생성을 개시하지 못했습니다. 이는 Sun JVM들이 아닌 환경에서 발생할 수 있습니다.
diff --git a/java/org/apache/catalina/core/LocalStrings_zh_CN.properties 
b/java/org/apache/catalina/core/LocalStrings_zh_CN.properties
index 4f487ae..1ef99e0 100644
--- a/java/org/apache/catalina/core/LocalStrings_zh_CN.properties
+++ b/java/org/apache/catalina/core/LocalStrings_zh_CN.properties
@@ -138,6 +138,11 @@ defaultInstanceManager.restrictedWrongValue=类名为{1}的受限类属性文件
 filterChain.filter=Filter 执行抛出一个异常
 filterChain.servlet=Servlet执行抛出一个异常
 
+jniLifecycleListener.bothPathAndName=可以设置libraryName或libraryPath,但不能同时设置两者
+jniLifecycleListener.load.name=已加载本机库[{0}]
+jniLifecycleListener.load.path=已从[{0}]加载本机库
+jniLifecycleListener.missingPathOrName=必须设置libraryName或libraryPath之一
+
 jreLeakListener.classToInitializeFail=在tomcat启动期间未能加载类[{0}],以防止可能的内存泄漏。
 jreLeakListener.gcDaemonFail=Tomcat开始预防潜在的内存溢出期间,触发GC守护线程失败,在非Sun JVMs上这是正常的。
 jreLeakListener.jarUrlConnCacheFail=默认情况下无法禁用Jar URL连接缓存。

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

Reply via email to