cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1179584 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
Date Thu, 06 Oct 2011 11:50:21 GMT
Author: sergeyb
Date: Thu Oct  6 11:50:21 2011
New Revision: 1179584

URL: http://svn.apache.org/viewvc?rev=1179584&view=rev
Log:
[CXF-3797] Checking for duplicate element references when looking for representations with
links

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
    cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java?rev=1179584&r1=1179583&r2=1179584&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
Thu Oct  6 11:50:21 2011
@@ -623,11 +623,13 @@ public class SourceGenerator {
     }
 
     private List<Element> getXmlReps(List<Element> repElements) {
+        Set<String> values = new HashSet<String>(repElements.size());
         List<Element> xmlReps = new ArrayList<Element>();
         for (Element el : repElements) {
             String value = el.getAttribute("element");
-            if (value.length() > 0 && value.contains(":")) {
+            if (value.length() > 0 && value.contains(":") && !values.contains(value))
{
                 xmlReps.add(el);
+                values.add(value);
             }
         }
         if (xmlReps.isEmpty()) {

Modified: cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml?rev=1179584&r1=1179583&r2=1179584&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml (original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml Thu Oct  6 11:50:21
2011
@@ -103,7 +103,7 @@
        <representation mediaType="application/xml" element="prefix1:theBook2">
         <doc>InputBook</doc>
        </representation>
-       <representation mediaType="application/json">
+       <representation mediaType="application/json" element="prefix1:theBook2">
         <doc>InputBook</doc>
        </representation>
       </request>



Mime
View raw message