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

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 15ae6ca309 Add missing strings
15ae6ca309 is described below

commit 15ae6ca309f875239db50b44858f220b0ee93e5b
Author: remm <r...@apache.org>
AuthorDate: Tue Feb 6 16:01:43 2024 +0100

    Add missing strings
---
 .../apache/catalina/core/LocalStrings.properties   |  1 +
 java/org/apache/catalina/core/StandardContext.java |  2 +-
 .../catalina/session/LocalStrings.properties       |  9 +++++++-
 .../catalina/session/PersistentManagerBase.java    |  2 +-
 java/org/apache/catalina/session/StoreBase.java    |  6 +++---
 .../apache/catalina/valves/LocalStrings.properties |  1 +
 .../apache/catalina/valves/PersistentValve.java    |  2 +-
 java/org/apache/tomcat/util/Diagnostics.java       | 24 +++++++++++-----------
 .../org/apache/tomcat/util/IntrospectionUtils.java |  2 +-
 .../org/apache/tomcat/util/LocalStrings.properties |  3 +++
 10 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/java/org/apache/catalina/core/LocalStrings.properties 
b/java/org/apache/catalina/core/LocalStrings.properties
index 3a8ecc8c37..17892d6c61 100644
--- a/java/org/apache/catalina/core/LocalStrings.properties
+++ b/java/org/apache/catalina/core/LocalStrings.properties
@@ -222,6 +222,7 @@ standardContext.reloadingCompleted=Reloading Context with 
name [{0}] is complete
 standardContext.reloadingStarted=Reloading Context with name [{0}] has started
 standardContext.requestListener.requestDestroyed=Exception sending request 
destroyed lifecycle event to listener instance of class [{0}]
 standardContext.requestListener.requestInit=Exception sending request 
initialized lifecycle event to listener instance of class [{0}]
+standardContext.resetContextFail=Error resetting Context with name [{0}]
 standardContext.resourcesInit=Error initializing static Resources
 standardContext.resourcesStart=Error starting static Resources
 standardContext.resourcesStop=Error stopping static Resources
diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index 11417130b2..1e74c6aa51 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -5141,7 +5141,7 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
         try {
             resetContext();
         } catch (Exception ex) {
-            log.error("Error resetting context " + this + " " + ex, ex);
+            log.error(sm.getString("standardContext.resetContextFail", 
getName()), ex);
         }
 
         // reset the instance manager
diff --git a/java/org/apache/catalina/session/LocalStrings.properties 
b/java/org/apache/catalina/session/LocalStrings.properties
index 6e8344ad02..f2844effd1 100644
--- a/java/org/apache/catalina/session/LocalStrings.properties
+++ b/java/org/apache/catalina/session/LocalStrings.properties
@@ -47,6 +47,7 @@ persistentManager.backupMaxIdle=Backing up session [{0}] to 
Store, idle for [{1}
 persistentManager.deserializeError=Error deserializing Session [{0}]
 persistentManager.isLoadedError=Error checking if session [{0}] is loaded in 
memory
 persistentManager.loading=Loading [{0}] persisted sessions
+persistentManager.noStore=No Store configured, persistence disabled
 persistentManager.removeError=Error removing session [{0}] from the store
 persistentManager.serializeError=Error serializing Session [{0}]: [{1}]
 persistentManager.storeClearError=Error clearning all sessions from the store
@@ -98,4 +99,10 @@ standardSessionAccessor.access.end=Unexpected error during 
the call to Session.e
 standardSessionAccessor.access.invalid=Unable to access the session [{0}] as 
the session has already been invalidated
 standardSessionAccessor.access.ioe=Unable to access the session [{0}] as an 
IOException occurred retrieving the session from the session manager
 standardSessionAccessor.nullId=Unable to create Accessor instance as session 
ID is null
-standardSessionAccessor.nullManager=Unable to create Accessor instance as 
session manager is null
\ No newline at end of file
+standardSessionAccessor.nullManager=Unable to create Accessor instance as 
session manager is null
+
+store.expireFail=Error processing session expiration for key [{0}]
+store.keysFail=Error getting keys
+store.removeFail=Error removing key [{0}]
+
+
diff --git a/java/org/apache/catalina/session/PersistentManagerBase.java 
b/java/org/apache/catalina/session/PersistentManagerBase.java
index 345c83ced4..4b495550f6 100644
--- a/java/org/apache/catalina/session/PersistentManagerBase.java
+++ b/java/org/apache/catalina/session/PersistentManagerBase.java
@@ -695,7 +695,7 @@ public abstract class PersistentManagerBase extends 
ManagerBase implements Store
         super.startInternal();
 
         if (store == null) {
-            log.error("No Store configured, persistence disabled");
+            log.error(sm.getString("persistentManager.noStore"));
         } else if (store instanceof Lifecycle) {
             ((Lifecycle) store).start();
         }
diff --git a/java/org/apache/catalina/session/StoreBase.java 
b/java/org/apache/catalina/session/StoreBase.java
index 4c0bc1422d..31ddfe9b70 100644
--- a/java/org/apache/catalina/session/StoreBase.java
+++ b/java/org/apache/catalina/session/StoreBase.java
@@ -141,7 +141,7 @@ public abstract class StoreBase extends LifecycleBase 
implements Store {
         try {
             keys = expiredKeys();
         } catch (IOException e) {
-            manager.getContext().getLogger().error("Error getting keys", e);
+            
manager.getContext().getLogger().error(sm.getString("store.keysFail"), e);
             return;
         }
         if (manager.getContext().getLogger().isTraceEnabled()) {
@@ -186,11 +186,11 @@ public abstract class StoreBase extends LifecycleBase 
implements Store {
                 }
                 remove(key);
             } catch (Exception e) {
-                manager.getContext().getLogger().error("Session: " + key + "; 
", e);
+                
manager.getContext().getLogger().error(sm.getString("store.expireFail", key), 
e);
                 try {
                     remove(key);
                 } catch (IOException e2) {
-                    manager.getContext().getLogger().error("Error removing 
key", e2);
+                    
manager.getContext().getLogger().error(sm.getString("store.removeFail", key), 
e2);
                 }
             }
         }
diff --git a/java/org/apache/catalina/valves/LocalStrings.properties 
b/java/org/apache/catalina/valves/LocalStrings.properties
index 7c03cbe25d..b58f4d3221 100644
--- a/java/org/apache/catalina/valves/LocalStrings.properties
+++ b/java/org/apache/catalina/valves/LocalStrings.properties
@@ -137,6 +137,7 @@ persistentValve.acquireInterrupted=The request for [{0}] 
did not obtain the per
 persistentValve.filter.failure=Unable to compile filter=[{0}]
 persistentValve.requestIgnore=The request for [{0}] was ignored by this Valve 
as it matches the configured filter
 persistentValve.requestProcess=The request for [{0}] will be processed by this 
Valve as it does not match the configured filter
+persistentValve.sessionLoadFail=Loading session [{0}] from the store failed
 
 remoteCidrValve.invalid=Invalid configuration provided for [{0}]. See previous 
messages for details.
 remoteCidrValve.noPort=Request does not contain a valid server port. Request 
denied.
diff --git a/java/org/apache/catalina/valves/PersistentValve.java 
b/java/org/apache/catalina/valves/PersistentValve.java
index b794f5911e..1212221aa2 100644
--- a/java/org/apache/catalina/valves/PersistentValve.java
+++ b/java/org/apache/catalina/valves/PersistentValve.java
@@ -176,7 +176,7 @@ public class PersistentValve extends ValveBase {
                     try {
                         session = store.load(sessionId);
                     } catch (Exception e) {
-                        containerLog.error("deserializeError");
+                        
containerLog.error(sm.getString("persistentValve.sessionLoadFail", sessionId));
                     }
                     if (session != null) {
                         if (!session.isValid() || isSessionStale(session, 
System.currentTimeMillis())) {
diff --git a/java/org/apache/tomcat/util/Diagnostics.java 
b/java/org/apache/tomcat/util/Diagnostics.java
index f9ae90b7e0..e4fb8631be 100644
--- a/java/org/apache/tomcat/util/Diagnostics.java
+++ b/java/org/apache/tomcat/util/Diagnostics.java
@@ -123,8 +123,8 @@ public class Diagnostics {
         threadMXBean.setThreadContentionMonitoringEnabled(enable);
         boolean checkValue = 
threadMXBean.isThreadContentionMonitoringEnabled();
         if (enable != checkValue) {
-            log.error("Could not set threadContentionMonitoringEnabled to " +
-                      enable + ", got " + checkValue + " instead");
+            log.error(sm.getString("diagnostics.setPropertyFail", 
"threadContentionMonitoringEnabled",
+                    Boolean.valueOf(enable), Boolean.valueOf(checkValue)));
         }
     }
 
@@ -146,8 +146,8 @@ public class Diagnostics {
         threadMXBean.setThreadCpuTimeEnabled(enable);
         boolean checkValue = threadMXBean.isThreadCpuTimeEnabled();
         if (enable != checkValue) {
-            log.error("Could not set threadCpuTimeEnabled to " + enable +
-                      ", got " + checkValue + " instead");
+            log.error(sm.getString("diagnostics.setPropertyFail", 
"threadCpuTimeEnabled",
+                    Boolean.valueOf(enable), Boolean.valueOf(checkValue)));
         }
     }
 
@@ -167,8 +167,8 @@ public class Diagnostics {
         classLoadingMXBean.setVerbose(verbose);
         boolean checkValue = classLoadingMXBean.isVerbose();
         if (verbose != checkValue) {
-            log.error("Could not set verbose class loading to " + verbose +
-                      ", got " + checkValue + " instead");
+            log.error(sm.getString("diagnostics.setPropertyFail", 
"verboseClassLoading",
+                    Boolean.valueOf(verbose), Boolean.valueOf(checkValue)));
         }
     }
 
@@ -182,9 +182,9 @@ public class Diagnostics {
         loggingMXBean.setLoggerLevel(loggerName, levelName);
         String checkValue = loggingMXBean.getLoggerLevel(loggerName);
         if (!checkValue.equals(levelName)) {
-            log.error("Could not set logger level for logger '" +
-                      loggerName + "' to '" + levelName +
-                      "', got '" + checkValue + "' instead");
+            String propertyName = "loggerLevel[" + loggerName + "]";
+            log.error(sm.getString("diagnostics.setPropertyFail", propertyName,
+                    levelName, checkValue));
         }
     }
 
@@ -197,8 +197,8 @@ public class Diagnostics {
         memoryMXBean.setVerbose(verbose);
         boolean checkValue = memoryMXBean.isVerbose();
         if (verbose != checkValue) {
-            log.error("Could not set verbose garbage collection logging to " + 
verbose +
-                      ", got " + checkValue + " instead");
+            log.error(sm.getString("diagnostics.setPropertyFail", 
"verboseGarbageCollection",
+                    Boolean.valueOf(verbose), Boolean.valueOf(checkValue)));
         }
     }
 
@@ -374,7 +374,7 @@ public class Diagnostics {
                                                 true, true);
             if (tinfos != null) {
                 StringBuilder sb =
-                    new StringBuilder("Deadlock found between the following 
threads:");
+                    new 
StringBuilder(sm.getString("diagnostics.deadlockFound"));
                 sb.append(CRLF);
                 sb.append(getThreadDump(tinfos));
                 return sb.toString();
diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index af2df111ec..b34bf6e6fc 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -308,7 +308,7 @@ public final class IntrospectionUtils {
             return value;
         }
         if (iterationCount >=20) {
-            log.warn("System property failed to update and remains [" + value 
+ "]");
+            log.warn(sm.getString("introspectionUtils.tooManyIterations", 
value));
             return value;
         }
         StringBuilder sb = new StringBuilder();
diff --git a/java/org/apache/tomcat/util/LocalStrings.properties 
b/java/org/apache/tomcat/util/LocalStrings.properties
index 3daefd93b0..abaa92b0c7 100644
--- a/java/org/apache/tomcat/util/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/LocalStrings.properties
@@ -13,6 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+diagnostics.deadlockFound=Deadlock found between the following threads:
+diagnostics.setPropertyFail=Could not set [{0}] to [{1}], got [{2}] instead
 diagnostics.threadDumpTitle=Full thread dump
 diagnostics.vmInfoClassCompilation=Class compilation
 diagnostics.vmInfoClassLoading=Class loading
@@ -35,3 +37,4 @@ introspectionUtils.hostResolutionFail=Cannot resolve host 
name [{0}]
 introspectionUtils.noMethod=Cannot find method [{0}] in object [{1}] of class 
[{2}]
 introspectionUtils.nullParameter=Method name, parameter and object target 
arguments must not be null
 introspectionUtils.setPropertyError=Error setting property [{0}] to [{1}] on 
class [{2}]
+introspectionUtils.tooManyIterations=Property failed to be resolved and 
remains [{0}]


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

Reply via email to