From d355f2a16ca083e9ab5f655c5f6807816e5c265d Mon Sep 17 00:00:00 2001 From: slaws Date: Mon, 14 Nov 2011 14:22:19 +0000 Subject: Add extra check for zero child elements when processing the OMElement wrapper. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1201718 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/databinding/axiom/OMElementWrapperHandler.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sca-java-2.x') diff --git a/sca-java-2.x/trunk/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java b/sca-java-2.x/trunk/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java index 0c657756a0..09fc0a311b 100644 --- a/sca-java-2.x/trunk/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java +++ b/sca-java-2.x/trunk/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java @@ -231,6 +231,14 @@ public class OMElementWrapperHandler implements WrapperHandler { private List getInvalidChildren(List> groupedElementList, List childElements) { List retVal = new ArrayList(); + // if this is an operation without arguments then it seems that + // the groupedElementList can have a list with an empty list in it while + // the child elements list is empty. This leads to an IndexOutOfBounds when + // trying to de-reference childElements. So check for this now + if (childElements.size() == 0){ + return retVal; + } + // Since not all the ElementInfo(s) will be represented, (if some elements don't appear as children // of the wrapper payload, we need to loop through the schema for (int index=0; index < groupedElementList.size(); index++) { -- cgit v1.2.3