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:05:16 GMT
Repository: cxf
Updated Branches:
  refs/heads/master c1387810b -> d97610790


[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/d9761079
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d9761079
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d9761079

Branch: refs/heads/master
Commit: d97610790549e687e8af2b81019d87feca80698f
Parents: c138781
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:05:01 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/d9761079/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 e42c232..af9fc58 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
@@ -1147,17 +1147,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