Hi Remy,

I saw you taking over classes from commons modeler into tc 6. Just yesterday William Barker commited a very small and non-risky patch I submitted two years ago to bugzilla against Registry.convertValue():

http://issues.apache.org/bugzilla/show_bug.cgi?id=31608

The method has conversions for Integer and Boolean, but not for Long. It is used in Tomcats manager webapp (manager/jmxproxy) and many of tomcat's internal JMX parameters are longs and can therefore not yet been set via the manager webapp.

It would be very nice, if you could apply the patch to tc 6 copy of Regitry.java. Four your convenience I include it here:

Index: Registry.java
===================================================================
--- Registry.java       (revision 390034)
+++ Registry.java       (working copy)
@@ -713,6 +713,9 @@
         } else if( "java.lang.Integer".equals( type ) ||
                 "int".equals( type )) {
             objValue=new Integer( value );
+        } else if( "java.lang.Long".equals( type ) ||
+                "long".equals( type )) {
+            objValue=new Long( value );
         } else if( "java.lang.Boolean".equals( type ) ||
                 "boolean".equals( type )) {
             objValue=new Boolean( value );

Thank you!

[EMAIL PROTECTED] wrote:
Added: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/modeler/Registry.java
URL: 
http://svn.apache.org/viewcvs/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/modeler/Registry.java?rev=389946&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/modeler/Registry.java 
(added)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/modeler/Registry.java Wed 
Mar 29 16:55:22 2006
...
+    public Object convertValue(String type, String value)
+    {
+        Object objValue=value;
+ + if( type==null || "java.lang.String".equals( type )) {
+            // string is default
+            objValue=value;
+        } else if( "javax.management.ObjectName".equals( type ) ||
+                "ObjectName".equals( type )) {
+            try {
+                objValue=new ObjectName( value );
+            } catch (MalformedObjectNameException e) {
+                return null;
+            }
+        } else if( "java.lang.Integer".equals( type ) ||
+                "int".equals( type )) {
+            objValue=new Integer( value );
+        } else if( "java.lang.Boolean".equals( type ) ||
+                "boolean".equals( type )) {
+            objValue=new Boolean( value );
+        }
+        return objValue;


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to