activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r881274 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java
Date Tue, 17 Nov 2009 13:26:17 GMT
Author: dejanb
Date: Tue Nov 17 13:26:16 2009
New Revision: 881274

URL: http://svn.apache.org/viewvc?rev=881274&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQ-2499 - don't show passwords in log files

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java?rev=881274&r1=881273&r2=881274&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java
Tue Nov 17 13:26:16 2009
@@ -262,23 +262,28 @@
         boolean first = true;
         for (Iterator iter = entrySet.iterator(); iter.hasNext();) {
             Map.Entry entry = (Map.Entry)iter.next();
+            Object value = entry.getValue();
+            Object key = entry.getKey();
             if (first) {
                 first = false;
             } else {
                 buffer.append(", ");
             }
-            buffer.append(entry.getKey());
+            buffer.append(key);
             buffer.append(" = ");
-            appendToString(buffer, entry.getValue());
+            
+            appendToString(buffer, key, value);
         }
         buffer.append("}");
         return buffer.toString();
     }
 
-    protected static void appendToString(StringBuffer buffer, Object value) {
+    protected static void appendToString(StringBuffer buffer, Object key, Object value) {
         if (value instanceof ActiveMQDestination) {
             ActiveMQDestination destination = (ActiveMQDestination)value;
             buffer.append(destination.getQualifiedName());
+        } else if (key.toString().contains("password")){
+            buffer.append("*****");           
         } else {
             buffer.append(value);
         }



Mime
View raw message