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-6375] Checking null Type in ProvidersImpl
Date Mon, 27 Apr 2015 14:23:34 GMT
Repository: cxf
Updated Branches:
  refs/heads/master cc10f1b7d -> c4aac43ff


[CXF-6375] Checking null Type in ProvidersImpl


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

Branch: refs/heads/master
Commit: c4aac43ffcca1d0877dc42107953d1b02a113877
Parents: cc10f1b
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Mon Apr 27 15:23:15 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Mon Apr 27 15:23:15 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c4aac43f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java
index d756637..feba99e 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java
@@ -43,13 +43,13 @@ public class ProvidersImpl implements Providers {
     public <T> MessageBodyReader<T> getMessageBodyReader(
          Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType)
{
         return ProviderFactory.getInstance(m).createMessageBodyReader(
-            type, genericType, annotations, mediaType, m);
+            type, getGenericType(type, genericType), annotations, mediaType, m);
     }
 
     public <T> MessageBodyWriter<T> getMessageBodyWriter(
         Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType)
{
         return ProviderFactory.getInstance(m).createMessageBodyWriter(
-                   type, genericType, annotations, mediaType, m);
+                   type, getGenericType(type, genericType), annotations, mediaType, m);
     }
 
     public <T> ContextResolver<T> getContextResolver(Class<T> contextType,
MediaType mediaType) {
@@ -59,5 +59,7 @@ public class ProvidersImpl implements Providers {
     public <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T>
type) {
         return ServerProviderFactory.getInstance(m).createExceptionMapper(type, m);
     }
-
+    private Type getGenericType(Class<?> type, Type genericType) {
+        return genericType == null ? type : genericType;
+    }
 }


Mime
View raw message