felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvalc...@apache.org
Subject svn commit: r1454445 - /felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
Date Fri, 08 Mar 2013 16:13:51 GMT
Author: vvalchev
Date: Fri Mar  8 16:13:50 2013
New Revision: 1454445

URL: http://svn.apache.org/r1454445
Log:
Fixed FELIX-3960 exception in the event plugin
https://issues.apache.org/jira/browse/FELIX-3960

Modified:
    felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java

Modified: felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java?rev=1454445&r1=1454444&r2=1454445&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
(original)
+++ felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
Fri Mar  8 16:13:50 2013
@@ -21,6 +21,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintWriter;
+import java.lang.reflect.Array;
 import java.net.URL;
 import java.util.*;
 import java.util.Map.Entry;
@@ -358,14 +359,14 @@ public class PluginServlet extends HttpS
                 if ( value.getClass().isArray() )
                 {
                     // as we can't use 1.5 functionality we have to print the array ourselves
-                    Object[] arr = (Object[])value;
                     final StringBuffer b = new StringBuffer("[");
-                    for(int m=0; m<arr.length; m++) {
+                    final int arrayLength = Array.getLength(value);
+                    for(int m=0; m<arrayLength; m++) {
                         if ( m > 0 )
                         {
                             b.append(", ");
                         }
-                        b.append(arr[m].toString());
+                        b.append( Array.get(value, m).toString() );
                     }
                     b.append(']');
                     jsonValue(jw, b.toString());



Mime
View raw message