felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1782832 - in /felix/trunk/webconsole-plugins/subsystems: pom.xml src/main/java/org/apache/felix/webconsole/plugins/subsystem/internal/WebConsolePlugin.java
Date Mon, 13 Feb 2017 18:26:43 GMT
Author: cziegeler
Date: Mon Feb 13 18:26:43 2017
New Revision: 1782832

URL: http://svn.apache.org/viewvc?rev=1782832&view=rev
Log:
FELIX-5510 : Remove usage of org.json form web console plugins

Modified:
    felix/trunk/webconsole-plugins/subsystems/pom.xml
    felix/trunk/webconsole-plugins/subsystems/src/main/java/org/apache/felix/webconsole/plugins/subsystem/internal/WebConsolePlugin.java

Modified: felix/trunk/webconsole-plugins/subsystems/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/subsystems/pom.xml?rev=1782832&r1=1782831&r2=1782832&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/subsystems/pom.xml (original)
+++ felix/trunk/webconsole-plugins/subsystems/pom.xml Mon Feb 13 18:26:43 2017
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.felix</groupId>
         <artifactId>felix-parent</artifactId>
-        <version>2.1</version>
+        <version>4</version>
         <relativePath>../../../pom/pom.xml</relativePath>
     </parent>
 
@@ -41,12 +41,15 @@
         <url>http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/subsystems</url>
     </scm>
 
+    <properties>
+        <felix.java.version>6</felix.java.version>
+    </properties>
     <build>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.3.4</version>
+                <version>3.2.0</version>
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
@@ -59,17 +62,12 @@
                         <Private-Package>
                             org.apache.felix.webconsole.plugins.subsystem.*
                         </Private-Package>
+                        <Embed-Dependency>
+                             org.apache.felix.utils;inline=org/apache/felix/utils/json/JSONWriter**
+                        </Embed-Dependency>
                     </instructions>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                        <source>1.6</source>
-                        <target>1.6</target>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
 
@@ -83,13 +81,13 @@
         <dependency>
             <groupId>commons-fileupload</groupId>
             <artifactId>commons-fileupload</artifactId>
-            <version>1.2.1</version>
+            <version>1.3.2</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.json</groupId>
-            <artifactId>json</artifactId>
-            <version>20070829</version>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.utils</artifactId>
+            <version>1.9.0</version>
             <scope>provided</scope>
         </dependency>
 

Modified: felix/trunk/webconsole-plugins/subsystems/src/main/java/org/apache/felix/webconsole/plugins/subsystem/internal/WebConsolePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/subsystems/src/main/java/org/apache/felix/webconsole/plugins/subsystem/internal/WebConsolePlugin.java?rev=1782832&r1=1782831&r2=1782832&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/subsystems/src/main/java/org/apache/felix/webconsole/plugins/subsystem/internal/WebConsolePlugin.java
(original)
+++ felix/trunk/webconsole-plugins/subsystems/src/main/java/org/apache/felix/webconsole/plugins/subsystem/internal/WebConsolePlugin.java
Mon Feb 13 18:26:43 2017
@@ -32,12 +32,11 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.fileupload.FileItem;
+import org.apache.felix.utils.json.JSONWriter;
 import org.apache.felix.webconsole.AbstractWebConsolePlugin;
 import org.apache.felix.webconsole.DefaultVariableResolver;
 import org.apache.felix.webconsole.SimpleWebConsolePlugin;
 import org.apache.felix.webconsole.WebConsoleUtil;
-import org.json.JSONException;
-import org.json.JSONWriter;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
@@ -344,32 +343,25 @@ public class WebConsolePlugin extends Si
     private void renderResult(PrintWriter pw, RequestInfo reqInfo) throws IOException
     {
         JSONWriter jw = new JSONWriter(pw);
-        try
-        {
-            jw.object();
-
-            List<Subsystem> subsystems = getSubsystems();
+        jw.object();
 
-            jw.key("status");
-            jw.value(subsystems.size());
+        List<Subsystem> subsystems = getSubsystems();
 
-            jw.key("data");
-            jw.array();
-            for (Subsystem ss : subsystems)
-            {
-                subsystem(jw, ss);
-            }
-            jw.endArray();
+        jw.key("status");
+        jw.value(subsystems.size());
 
-            jw.endObject();
-        }
-        catch (JSONException je)
+        jw.key("data");
+        jw.array();
+        for (Subsystem ss : subsystems)
         {
-            throw new IOException(je);
+            subsystem(jw, ss);
         }
+        jw.endArray();
+
+        jw.endObject();
     }
 
-    private void subsystem(JSONWriter jw, Subsystem ss) throws JSONException
+    private void subsystem(JSONWriter jw, Subsystem ss) throws IOException
     {
         jw.object();
 



Mime
View raw message