incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1054951 - /sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/GetConfigServlet.java
Date Tue, 04 Jan 2011 10:07:29 GMT
Author: cziegeler
Date: Tue Jan  4 10:07:28 2011
New Revision: 1054951

URL: http://svn.apache.org/viewvc?rev=1054951&view=rev
Log:
Avoid Java 6 constructor

Modified:
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/GetConfigServlet.java

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/GetConfigServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/GetConfigServlet.java?rev=1054951&r1=1054950&r2=1054951&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/GetConfigServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/GetConfigServlet.java
Tue Jan  4 10:07:28 2011
@@ -24,8 +24,6 @@ import java.util.Enumeration;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.sling.commons.json.JSONException;
-import org.apache.sling.commons.json.io.JSONWriter;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Properties;
 import org.apache.felix.scr.annotations.Property;
@@ -34,6 +32,8 @@ import org.apache.felix.scr.annotations.
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
+import org.apache.sling.commons.json.JSONException;
+import org.apache.sling.commons.json.io.JSONWriter;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
 
@@ -45,12 +45,12 @@ import org.osgi.service.cm.Configuration
     @Property(name="sling.servlet.extensions",value="json")
 })
 public class GetConfigServlet extends SlingSafeMethodsServlet {
-    
+
     @Reference
     private ConfigurationAdmin configAdmin;
-    
+
     @Override
-    protected void doGet(SlingHttpServletRequest request,SlingHttpServletResponse response)

+    protected void doGet(SlingHttpServletRequest request,SlingHttpServletResponse response)
     throws ServletException,IOException {
 
         // PID comes from request suffix, like /testing/GetConfigServlet.tidy.json/integrationTestsConfig
@@ -61,7 +61,7 @@ public class GetConfigServlet extends Sl
         if(pid.startsWith("/")) {
             pid = pid.substring(1);
         }
-        
+
         // Get config and properties
         final Configuration cfg = configAdmin.getConfiguration(pid);
         if(cfg == null) {
@@ -94,7 +94,7 @@ public class GetConfigServlet extends Sl
             w.endObject();
             w.endObject();
         } catch(JSONException je) {
-            throw new IOException("JSONException in doGet", je);
+            throw (IOException)new IOException("JSONException in doGet").initCause(je);
         }
     }
 }



Mime
View raw message