cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1362437 - /cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
Date Tue, 17 Jul 2012 10:22:23 GMT
Author: sergeyb
Date: Tue Jul 17 10:22:23 2012
New Revision: 1362437

URL: http://svn.apache.org/viewvc?rev=1362437&view=rev
Log:
[CXF-4426] Fixing JSONProvider not to loose the actual class type after the adapter has been
used for interfaces

Modified:
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java?rev=1362437&r1=1362436&r2=1362437&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
Tue Jul 17 10:22:23 2012
@@ -349,7 +349,8 @@ public class JSONProvider<T> extends Abs
                 marshalCollection(cls, obj, genericType, enc, os, m, anns);
             } else {
                 Object actualObject = checkAdapter(obj, cls, anns, true);
-                Class<?> actualClass = obj != actualObject ? actualObject.getClass()
: cls;
+                Class<?> actualClass = obj != actualObject || cls.isInterface() 
+                    ? actualObject.getClass() : cls;
                 if (cls == genericType) {
                     genericType = actualClass;
                 }



Mime
View raw message