Author: sergeyb
Date: Fri Jan 18 16:21:21 2013
New Revision: 1435227
URL: http://svn.apache.org/viewvc?rev=1435227&view=rev
Log:
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.7.x-fixes/ (props changed)
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Merged /cxf/trunk:r1435223
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jan 18 16:21:21 2013
@@ -1 +1 @@
-/cxf/trunk:1-1430398,1430564,1430881-1430882,1430905,1430965,1430976,1431315,1431604-1431607,1432070,1432236,1432798,1433007,1433033,1433135,1433305,1433347,1433895,1434042,1434124,1434564,1435034,1435111
+/cxf/trunk:1-1430398,1430564,1430881-1430882,1430905,1430965,1430976,1431315,1431604-1431607,1432070,1432236,1432798,1433007,1433033,1433135,1433305,1433347,1433895,1434042,1434124,1434564,1435034,1435111,1435223
Modified:
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java?rev=1435227&r1=1435226&r2=1435227&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
(original)
+++
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Fri Jan 18 16:21:21 2013
@@ -60,6 +60,7 @@ import javax.ws.rs.container.AsyncRespon
import javax.ws.rs.container.Suspended;
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;
@@ -699,8 +700,17 @@ public class SourceGenerator {
responseTypeAvailable = writeResponseType(responseEls, sbCode,
imports, info, suspendedAsync);
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.7.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml?rev=1435227&r1=1435226&r2=1435227&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
(original)
+++
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
Fri Jan 18 16:21:21 2013
@@ -97,13 +97,18 @@ required="true">
<method name="DELETE"/>
- <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}">