cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/2] cxf git commit: [CXF-6163] Fixed xsd:any behaviour when used with minOccurs=0, maxOccurs>1 This closes #46
Date Fri, 19 Dec 2014 18:33:32 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 0052a5527 -> 328a1a5cf


[CXF-6163] Fixed xsd:any behaviour when used with minOccurs=0, maxOccurs>1
This closes #46


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bcdc4ffc
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bcdc4ffc
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bcdc4ffc

Branch: refs/heads/master
Commit: bcdc4ffc4e615c644eb8b461f0973298ed0aaca5
Parents: 0052a55
Author: Andrii Nikitiuk <demonshi.ua@gmail.com>
Authored: Fri Dec 19 16:17:27 2014 +0200
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Dec 19 13:19:52 2014 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/javascript/JavascriptUtils.java  | 3 ++-
 .../org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java  | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/bcdc4ffc/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
----------------------------------------------------------------------
diff --git a/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
b/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
index c22cd9c..7ff0097 100755
--- a/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
+++ b/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
@@ -473,7 +473,8 @@ public class JavascriptUtils {
      */
     public void generateCodeToSerializeAny(ParticleInfo itemInfo, String prefix,
                                            SchemaCollection schemaCollection) {
-        boolean optional = XmlSchemaUtils.isParticleOptional(itemInfo.getParticle());
+        boolean optional = XmlSchemaUtils.isParticleOptional(itemInfo.getParticle())
+                || (itemInfo.isArray() && itemInfo.getMinOccurs() == 0);
         boolean array = XmlSchemaUtils.isParticleArray(itemInfo.getParticle());
 
         appendLine("var anyHolder = this._" + itemInfo.getJavascriptName() + ";");

http://git-wip-us.apache.org/repos/asf/cxf/blob/bcdc4ffc/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
----------------------------------------------------------------------
diff --git a/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
b/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
index 3292672..f13a51d 100755
--- a/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
+++ b/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
@@ -533,6 +533,8 @@ public class SchemaJavascriptBuilder {
         // non-matching case
         utils.startIf("anyNeeded > 0");
         utils.appendLine("throw 'not enough ws:any elements';");
+        utils.appendElse(); // else non-match
+        utils.appendLine("break;");
         utils.endBlock(); // non-match+required
         utils.endBlock(); // match/non-match.
         utils.endBlock(); // while


Mime
View raw message