incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r764775 - /incubator/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
Date Tue, 14 Apr 2009 13:38:13 GMT
Author: fmeschbe
Date: Tue Apr 14 13:38:12 2009
New Revision: 764775

URL: http://svn.apache.org/viewvc?rev=764775&view=rev
Log:
SLING-921 Explicitly guard cast to SlingHttpServletRequest|Response instead
of remapping all ClassCastExceptions (which may be cause by other problems)

Modified:
    incubator/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java

Modified: incubator/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java?rev=764775&r1=764774&r2=764775&view=diff
==============================================================================
--- incubator/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
(original)
+++ incubator/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
Tue Apr 14 13:38:12 2009
@@ -363,16 +363,17 @@
     public void service(ServletRequest req, ServletResponse res)
             throws ServletException, IOException {
 
-        try {
-            SlingHttpServletRequest request = (SlingHttpServletRequest) req;
-            SlingHttpServletResponse response = (SlingHttpServletResponse) res;
+        if ((req instanceof SlingHttpServletRequest)
+            && (res instanceof SlingHttpServletResponse)) {
 
-            service(request, response);
+            service((SlingHttpServletRequest) req,
+                (SlingHttpServletResponse) res);
+
+        } else {
 
-        } catch (ClassCastException cce) {
             throw new ServletException("Not a Sling HTTP request/response");
-        }
 
+        }
     }
 
     /**



Mime
View raw message