Here it is:

--- StringArrayConverter.java.orig      2003-03-21 04:43:17.000000000 -0500
+++ StringArrayConverter.java   2003-03-21 04:43:20.000000000 -0500
@@ -113,6 +113,10 @@
 
     // ------------------------------------------------------- Static Variables
 
+       /**
+        * <p> Model object for int arrays.</p>
+        */
+       private static int ints[] = new int[0];
 
     /**
      * <p>Model object for type comparisons.</p>
@@ -149,6 +153,19 @@
             return (value);
         }
 
+               // Deal with the input value as an int array
+               if (ints.getClass() == value.getClass())
+               {
+                       int[] values = (int[]) value;
+                       String[] results = new String[values.length];
+                       for (int i = 0; i < values.length; i++)
+                       {
+                               results[i] = new 
StringBuffer().append(values[i]).toString();
+                       }
+                       
+                       return (results);
+               }
+
         // Parse the input value as a String into elements
         // and convert to the appropriate type
         try {


As you can see, it was just necessary to check to see if an int[]
was passed to the converter.  Now this class mirrors its inverse,
IntegerArrayConvertor.java which first checks for a String[] to be
passed in, and then works with a String (in the format {2,3,4}).
Obviously if you pass in an int[] you want to get out the exact same
values converted to a String[] and as you can see, it is failproof
since StringBuffer can deal with any type.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"Personally, I'm not finding Windows 
to be less expensive to administer, 
but those security holes--that'll kill 'em," 
-- Al Gillen, IDC
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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

Reply via email to