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:24:26 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes b7636a85d -> f26cbcc51


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

Branch: refs/heads/3.0.x-fixes
Commit: f26cbcc515d90be5bb690aaefc84c4a6a5e108cd
Parents: b7636a8
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:24:06 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/f26cbcc5/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