Author: sergeyb Date: Fri Jan 18 16:40:38 2013 New Revision: 1435238 URL: http://svn.apache.org/viewvc?rev=1435238&view=rev Log: Merged revisions 1435231 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
................ r1435231 | sergeyb | 2013-01-18 16:26:12 +0000 (Fri, 18 Jan 2013) | 16 lines Merged revisions 1435227 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes ................ r1435227 | sergeyb | 2013-01-18 16:21:21 +0000 (Fri, 18 Jan 2013) | 9 lines Merged revisions 1435223 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1435223 | sergeyb | 2013-01-18 16:15:19 +0000 (Fri, 18 Jan 2013) | 1 line [CXF-4766] Stripping custom regular expressions from method names ........ ................ ................ Modified: cxf/branches/2.5.x-fixes/ (props changed) cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java cxf/branches/2.5.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml Propchange: cxf/branches/2.5.x-fixes/ ------------------------------------------------------------------------------ Merged /cxf/branches/2.7.x-fixes:r1435227 Merged /cxf/trunk:r1435223 Merged /cxf/branches/2.6.x-fixes:r1435231 Propchange: cxf/branches/2.5.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java?rev=1435238&r1=1435237&r2=1435238&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java (original) +++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java Fri Jan 18 16:40:38 2013 @@ -58,6 +58,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.PathSegment; import javax.ws.rs.core.Response; import javax.xml.namespace.QName; import javax.xml.transform.Source; @@ -689,8 +690,17 @@ public class SourceGenerator { responseTypeAvailable = writeResponseType(responseEls, sbCode, imports, info); String genMethodName = id + suffixName; if (methodNameLowerCase.equals(genMethodName)) { - genMethodName += firstCharToUpperCase( - currentPath.replaceAll("/", "").replaceAll("\\{", "").replaceAll("\\}", "")); + List<PathSegment> segments = JAXRSUtils.getPathSegments(currentPath, true, true); + StringBuilder sb = new StringBuilder(); + for (PathSegment ps : segments) { + String pathSeg = ps.getPath().replaceAll("\\{", "").replaceAll("\\}", ""); + int index = pathSeg.indexOf(":"); + if (index > 0) { + pathSeg = pathSeg.substring(0, index); + } + sb.append(pathSeg); + } + genMethodName += firstCharToUpperCase(sb.toString()); } sbCode.append(genMethodName); } else { Modified: cxf/branches/2.5.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml?rev=1435238&r1=1435237&r2=1435238&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml (original) +++ cxf/branches/2.5.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml Fri Jan 18 16:40:38 2013 @@ -95,13 +95,18 @@ required="true"> <response status="204"></response> </method> - <resource path="/book2"> + <resource path="/book2/{bookid:.*}"> <method name="GET" id="getBook2"> <response> <representation mediaType="application/xml" element="prefix1:theBook2"/> <representation mediaType="application/json"/> </response> </method> + <method name="GET"> + <response> + <representation mediaType="application/pdf"/> + </response> + </method> </resource> <resource path="/books/{bookid}">
