cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1375672 - in /cxf/trunk/tools/wadlto/jaxrs/src: main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java test/resources/wadl/resourcesNoId.xml
Date Tue, 21 Aug 2012 17:23:44 GMT
Author: sergeyb
Date: Tue Aug 21 17:23:43 2012
New Revision: 1375672

URL: http://svn.apache.org/viewvc?rev=1375672&view=rev
Log:
[CXF-4477] One more update

Modified:
    cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
    cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/resourcesNoId.xml

Modified: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java?rev=1375672&r1=1375671&r2=1375672&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
(original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Tue Aug 21 17:23:43 2012
@@ -631,6 +631,7 @@ public class SourceGenerator {
             if (id.length() == 0) {
                 id = methodNameLowerCase;
             }
+            
             String suffixName = "";
             if (!jaxpSourceRequired && inXmlRep != null && xmlRequestReps.size()
> 1) {
                 String value = inXmlRep.getAttribute("element");
@@ -666,7 +667,8 @@ public class SourceGenerator {
                 responseTypeAvailable = writeResponseType(responseEls, sbCode, imports, info);
                 String genMethodName = id + suffixName;
                 if (methodNameLowerCase.equals(genMethodName)) {
-                    genMethodName += firstCharToUpperCase(currentPath.replaceAll("/", ""));
+                    genMethodName += firstCharToUpperCase(
+                        currentPath.replaceAll("/", "").replaceAll("\\{", "").replaceAll("\\}",
""));
                 }
                 sbCode.append(genMethodName);
             } else {

Modified: cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/resourcesNoId.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/resourcesNoId.xml?rev=1375672&r1=1375671&r2=1375672&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/resourcesNoId.xml (original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/resourcesNoId.xml Tue Aug 21 17:23:43
2012
@@ -3,7 +3,8 @@
  
   <resources base="http://localhost:8080/baz">
        <resource path="/TestRs">
-          <resource path="/helloWorld">
+          <param name="id" style="template" type="xs:int"/>
+          <resource path="/helloWorld/{id}">
            <method name="GET">
            <response>
              <representation mediaType="application/octet-stream">
@@ -20,6 +21,15 @@
             </response>
            </method>
           </resource>
+          <resource path="/helloWorld3">
+           <method name="GET" id="get">
+            <response>
+              <representation mediaType="application/octet-stream">
+                <param name="result" style="plain" type="xs:string"/>
+              </representation>
+            </response>
+           </method>
+          </resource>
         </resource>
   </resources>
 </application>
\ No newline at end of file



Mime
View raw message