cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6472] Avoiding the cast exception if a custom servlet context is injected
Date Wed, 24 Jun 2015 12:10:04 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 45e03d5fc -> b39688086


[CXF-6472] Avoiding the cast exception if a custom servlet context is injected


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b3968808
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b3968808
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b3968808

Branch: refs/heads/3.0.x-fixes
Commit: b396880860f2166be6e726b7b6e858615f115a7b
Parents: 45e03d5
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Jun 24 13:05:01 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Jun 24 13:09:42 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b3968808/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
index 55f6b1f..163e267 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
@@ -1150,17 +1150,14 @@ public final class JAXRSUtils {
     public static <T> T createServletResourceValue(Message m, Class<T> clazz)
{
         
         Object value = null; 
-        if (HttpServletRequest.class.isAssignableFrom(clazz)) {
+        if (clazz == HttpServletRequest.class) {
             value = m.get(AbstractHTTPDestination.HTTP_REQUEST);
-        }
-        if (HttpServletResponse.class.isAssignableFrom(clazz)) {
+        } else if (clazz == HttpServletResponse.class) {
             HttpServletResponse response = (HttpServletResponse)m.get(AbstractHTTPDestination.HTTP_RESPONSE);
             value = response != null ? new HttpServletResponseFilter(response, m) : null;
-        }
-        if (ServletContext.class.isAssignableFrom(clazz)) {
+        } else if (clazz == ServletContext.class) {
             value = m.get(AbstractHTTPDestination.HTTP_CONTEXT);
-        }
-        if (ServletConfig.class.isAssignableFrom(clazz)) {
+        } else if (clazz == ServletConfig.class) {
             value = m.get(AbstractHTTPDestination.HTTP_CONFIG);
         }
         


Mime
View raw message