Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > main-updates-src > by-pkgid > 58d8b71011ae4b697ea1192ba69e1c47 > files > 29

tomcat5-5.5.28-0.5.0.4mdv2010.2.src.rpm


http://svn.apache.org/viewvc?view=revision&revision=1140072

diff -Naurp tomcat5-5.5.28/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java tomcat5-5.5.28.oden/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java
--- tomcat5-5.5.28/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java	2009-07-24 21:36:47.000000000 +0200
+++ tomcat5-5.5.28.oden/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java	2011-10-18 12:35:42.508723505 +0200
@@ -188,7 +188,7 @@ public class MemoryUserDatabaseMBean ext
             MBeanUtils.createMBean(group);
         } catch (Exception e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Exception creating group " + group + " MBean");
+                ("Exception creating group [" + groupname + "] MBean");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
@@ -211,7 +211,7 @@ public class MemoryUserDatabaseMBean ext
             MBeanUtils.createMBean(role);
         } catch (Exception e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Exception creating role " + role + " MBean");
+                ("Exception creating role [" + rolename + "] MBean");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
@@ -236,7 +236,7 @@ public class MemoryUserDatabaseMBean ext
             MBeanUtils.createMBean(user);
         } catch (Exception e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Exception creating user " + user + " MBean");
+                ("Exception creating user [" + username + "] MBean");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
@@ -264,7 +264,7 @@ public class MemoryUserDatabaseMBean ext
             return (oname.toString());
         } catch (MalformedObjectNameException e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Cannot create object name for group " + group);
+                ("Cannot create object name for group [" + groupname + "]");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
@@ -291,7 +291,7 @@ public class MemoryUserDatabaseMBean ext
             return (oname.toString());
         } catch (MalformedObjectNameException e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Cannot create object name for role " + role);
+                ("Cannot create object name for role [" + rolename + "]");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
@@ -318,7 +318,7 @@ public class MemoryUserDatabaseMBean ext
             return (oname.toString());
         } catch (MalformedObjectNameException e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Cannot create object name for user " + user);
+                ("Cannot create object name for user [" + username + "]");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
@@ -343,7 +343,7 @@ public class MemoryUserDatabaseMBean ext
             database.removeGroup(group);
         } catch (Exception e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Exception destroying group " + group + " MBean");
+                ("Exception destroying group [" + groupname + "] MBean");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
@@ -368,7 +368,7 @@ public class MemoryUserDatabaseMBean ext
             database.removeRole(role);
         } catch (Exception e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Exception destroying role " + role + " MBean");
+                ("Exception destroying role [" + rolename + "] MBean");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
@@ -393,7 +393,7 @@ public class MemoryUserDatabaseMBean ext
             database.removeUser(user);
         } catch (Exception e) {
             IllegalArgumentException iae = new IllegalArgumentException
-                ("Exception destroying user " + user + " MBean");
+                ("Exception destroying user [" + username + "] MBean");
             jdkCompat.chainException(iae, e);
             throw iae;
         }
diff -Naurp tomcat5-5.5.28/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/users/MemoryUserDatabase.java tomcat5-5.5.28.oden/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/users/MemoryUserDatabase.java
--- tomcat5-5.5.28/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/users/MemoryUserDatabase.java	2009-07-24 21:36:50.000000000 +0200
+++ tomcat5-5.5.28.oden/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/users/MemoryUserDatabase.java	2011-10-18 12:36:13.555723503 +0200
@@ -541,7 +541,7 @@ public class MemoryUserDatabase implemen
             values = getUsers();
             while (values.hasNext()) {
                 writer.print("  ");
-                writer.println(values.next());
+                writer.println(((MemoryUser) values.next()).toXml());
             }
 
             // Print the file epilog
diff -Naurp tomcat5-5.5.28/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/users/MemoryUser.java tomcat5-5.5.28.oden/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/users/MemoryUser.java
--- tomcat5-5.5.28/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/users/MemoryUser.java	2009-07-24 21:36:50.000000000 +0200
+++ tomcat5-5.5.28.oden/apache-tomcat-5.5.28-src/container/catalina/src/share/org/apache/catalina/users/MemoryUser.java	2011-10-18 12:36:49.021723512 +0200
@@ -246,7 +246,7 @@ public class MemoryUser extends Abstract
      * <code>username</code> or </code>name</code> for the username
      * property.</p>
      */
-    public String toString() {
+    public String toXml() {
 
         StringBuffer sb = new StringBuffer("<user username=\"");
         sb.append(RequestUtil.filter(username));
@@ -293,5 +293,53 @@ public class MemoryUser extends Abstract
 
     }
 
+    /**
+     * <p>Return a String representation of this user.</p>
+     */
+    public String toString() {
+
+        StringBuffer sb = new StringBuffer("User username=\"");
+        sb.append(RequestUtil.filter(username));
+        sb.append("\"");
+        if (fullName != null) {
+            sb.append(", fullName=\"");
+            sb.append(RequestUtil.filter(fullName));
+            sb.append("\"");
+        }
+        synchronized (groups) {
+            if (groups.size() > 0) {
+                sb.append(", groups=\"");
+                int n = 0;
+                Iterator values = groups.iterator();
+                while (values.hasNext()) {
+                    if (n > 0) {
+                        sb.append(',');
+                    }
+                    n++;
+                    sb.append(RequestUtil.filter(
+                            ((Group)values.next()).getGroupname()));
+                }
+                sb.append("\"");
+            }
+        }
+        synchronized (roles) {
+            if (roles.size() > 0) {
+                sb.append(", roles=\"");
+                int n = 0;
+                Iterator values = roles.iterator();
+                while (values.hasNext()) {
+                    if (n > 0) {
+                        sb.append(',');
+                    }
+                    n++;
+                    sb.append(RequestUtil.filter(
+                            ((Role)values.next()).getRolename()));
+                }
+                sb.append("\"");
+            }
+        }
+        return (sb.toString());
+    }
+
 
 }