cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/3] 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:54:17 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 8bfc34f12 -> 4ccaa6d5e


[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/4ea7db88
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4ea7db88
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4ea7db88

Branch: refs/heads/3.0.x-fixes
Commit: 4ea7db88c0894904f8b904d4049753be4ebec068
Parents: 8bfc34f
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:54:02 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/4ea7db88/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/4ea7db88/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