commit | bfaaee3737d88cf5d14fb7ff53e8341e582e649a | [log] [tgz] |
---|---|---|
author | Valentin Valchev <vvalchev@apache.org> | Fri Mar 08 16:13:50 2013 +0000 |
committer | Valentin Valchev <vvalchev@apache.org> | Fri Mar 08 16:13:50 2013 +0000 |
tree | d4704107f6d5625241226cc81a82de6ee49fac2e | |
parent | 105244ef8e9764754ea9e224386a80007826505f [diff] |
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());