felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1775126 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
Date Mon, 19 Dec 2016 15:41:40 GMT
Author: cziegeler
Date: Mon Dec 19 15:41:40 2016
New Revision: 1775126

URL: http://svn.apache.org/viewvc?rev=1775126&view=rev
Log:
FELIX-5445 : Web Console: Properly display non-string property arrays in name hint. Apply
patch from Stefan Seifert

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java?rev=1775126&r1=1775125&r2=1775126&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
Mon Dec 19 15:41:40 2016
@@ -21,6 +21,7 @@ package org.apache.felix.webconsole.inte
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.lang.reflect.Array;
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.Enumeration;
@@ -688,19 +689,22 @@ class ConfigAdminSupport
 
         if (value != null)
         {
-            // if set convert to string
-            if (value instanceof String[]) {
-                String[] valueArray = (String[])value;
+            // convert array to string
+            if (value.getClass().isArray())
+            {
                 StringBuffer valueString = new StringBuffer();
-                for (int i = 0; i < valueArray.length; i++) {
-                    if (i > 0) {
+                for (int i = 0; i < Array.getLength(value); i++)
+                {
+                    if (i > 0)
+                    {
                         valueString.append(",");
                     }
-                    valueString.append(valueArray[i]);
+                    valueString.append(Array.get(value, i));
                 }
                 return valueString.toString();
             }
-            else {
+            else
+            {
                 return value.toString();
             }
         }



Mime
View raw message