Author: sergeyb Date: Wed Nov 17 22:58:45 2010 New Revision: 1036270 URL: http://svn.apache.org/viewvc?rev=1036270&view=rev Log: Merged revisions 1036260 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.3.x-fixes
................ r1036260 | sergeyb | 2010-11-17 22:34:29 +0000 (Wed, 17 Nov 2010) | 9 lines Merged revisions 1036258 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1036258 | sergeyb | 2010-11-17 22:25:44 +0000 (Wed, 17 Nov 2010) | 1 line [CXF-3022] Fixing more generics-related issues ........ ................ Added: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/GenericRestServiceImpl.java - copied unchanged from r1036260, cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/GenericRestServiceImpl.java cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/IRestService.java - copied unchanged from r1036260, cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/IRestService.java Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Nov 17 22:58:45 2010 @@ -1,2 +1,2 @@ -/cxf/branches/2.3.x-fixes:1036007 -/cxf/trunk:1036004 +/cxf/branches/2.3.x-fixes:1036007,1036260 +/cxf/trunk:1036004,1036258 Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=1036270&r1=1036269&r2=1036270&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java Wed Nov 17 22:58:45 2010 @@ -334,10 +334,7 @@ public abstract class AbstractJAXBProvid } JAXBContext context = getPackageContext(type); - if (context == null && type != genericType) { - context = getPackageContext(InjectionUtils.getActualType(genericType)); - } - + return context != null ? context : getClassContext(type); } Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=1036270&r1=1036269&r2=1036270&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java Wed Nov 17 22:58:45 2010 @@ -113,8 +113,9 @@ public final class InjectionUtils { } Type[] bounds = var.getBounds(); - if (bounds.length > pos && bounds[pos] != Object.class) { - return bounds[pos]; + int boundPos = bounds.length > pos ? pos : 0; + if (bounds.length > boundPos && bounds[boundPos] != Object.class) { + return bounds[boundPos]; } Type genericSubtype = serviceClass.getGenericSuperclass(); Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=1036270&r1=1036269&r2=1036270&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java (original) +++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java Wed Nov 17 22:58:45 2010 @@ -55,7 +55,17 @@ public class JAXRSClientServerSpringBook @BeforeClass public static void startServers() throws Exception { assertTrue("server did not launch correctly", - launchServer(BookServerSpring.class)); + launchServer(BookServerSpring.class, true)); + } + + @Test + public void testGetGenericBook() throws Exception { + String baseAddress = "http://localhost:" + PORT + "/the/thebooks8/books"; + WebClient wc = WebClient.create(baseAddress); + Long id = wc.type("application/xml").accept("text/plain").post(new Book("CXF", 1L), Long.class); + assertEquals(new Long(1), id); + Book book = wc.accept("application/xml").query("id", 1L).get(Book.class); + assertEquals("CXF", book.getName()); } @Test Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml?rev=1036270&r1=1036269&r2=1036270&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml (original) +++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml Wed Nov 17 22:58:45 2010 @@ -152,6 +152,12 @@ http://cxf.apache.org/schemas/core.xsd"> </jaxrs:model> </jaxrs:server> + <jaxrs:server id="bookservice8" address="/thebooks8"> + <jaxrs:serviceBeans> + <bean class="org.apache.cxf.systest.jaxrs.GenericRestServiceImpl"/> + </jaxrs:serviceBeans> + </jaxrs:server> + <bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"> <property name="schemaHandler" ref="schemaHolder"/> </bean>
