Fixed FELIX-3960 exception in the event plugin
https://issues.apache.org/jira/browse/FELIX-3960

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1454445 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java b/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
index 8e8579c..d7968c7 100644
--- a/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
+++ b/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
@@ -21,6 +21,7 @@
 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 @@
                 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());