Commits

Anonymous committed 9b45437

Committing original 2.6.9 CVS checkout.

  • Participants
  • Parent commits 1a04913
  • Branches ognl_2-6-9

Comments (0)

Files changed (164)

File src/java/ognl/ASTAdd.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTAdd extends ExpressionNode
+{
+    public ASTAdd(int id) {
+        super(id);
+    }
+
+    public ASTAdd(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    public void jjtClose() {
+        flattenTree();
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object result = children[0].getValue( context, source );
+        for ( int i=1; i < children.length; ++i )
+            result = OgnlOps.add( result, children[i].getValue(context, source) );
+        return result;
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return "+";
+    }
+}

File src/java/ognl/ASTAnd.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTAnd extends ExpressionNode
+{
+    public ASTAnd(int id) {
+        super(id);
+    }
+
+    public ASTAnd(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    public void jjtClose() {
+        flattenTree();
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object result = null;
+        int last = children.length - 1;
+        for ( int i=0; i <= last; ++i ) {
+            result = children[i].getValue( context, source );
+            if ( i != last && ! OgnlOps.booleanValue(result) )
+                break;
+        }
+        return result;
+    }
+
+    protected void setValueBody( OgnlContext context, Object target, Object value ) throws OgnlException
+    {
+        int last = children.length - 1;
+        for ( int i=0; i < last; ++i ) {
+            Object v = children[i].getValue( context, target );
+            if ( ! OgnlOps.booleanValue(v) )
+                return;
+        }
+        children[last].setValue( context, target, value );
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return "&&";
+    }
+}

File src/java/ognl/ASTAssign.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTAssign extends SimpleNode
+{
+    public ASTAssign(int id) {
+        super(id);
+    }
+
+    public ASTAssign(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object result = children[1].getValue( context, source );
+        children[0].setValue( context, source, result );
+        return result;
+    }
+
+    public String toString()
+    {
+        return children[0] + " = " + children[1];
+    }
+}

File src/java/ognl/ASTBitAnd.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTBitAnd extends ExpressionNode
+{
+    public ASTBitAnd(int id) {
+        super(id);
+    }
+
+    public ASTBitAnd(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    public void jjtClose() {
+        flattenTree();
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object result = children[0].getValue( context, source );
+        for ( int i=1; i < children.length; ++i )
+            result = OgnlOps.binaryAnd( result, children[i].getValue(context, source) );
+        return result;
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return "&";
+    }
+}

File src/java/ognl/ASTBitNegate.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTBitNegate extends ExpressionNode
+{
+    public ASTBitNegate(int id) {
+        super(id);
+    }
+
+    public ASTBitNegate(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        return OgnlOps.bitNegate( children[0].getValue(context, source) );
+    }
+
+    public String toString()
+    {
+        return "~" + children[0];
+    }
+}

File src/java/ognl/ASTBitOr.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTBitOr extends ExpressionNode
+{
+    public ASTBitOr(int id) {
+        super(id);
+    }
+
+    public ASTBitOr(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    public void jjtClose() {
+        flattenTree();
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object result = children[0].getValue( context, source );
+        for ( int i=1; i < children.length; ++i )
+            result = OgnlOps.binaryOr( result, children[i].getValue(context, source) );
+        return result;
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return "|";
+    }
+}

File src/java/ognl/ASTChain.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+import java.lang.reflect.Array;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTChain extends SimpleNode
+{
+    public ASTChain(int id) {
+        super(id);
+    }
+
+    public ASTChain(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    public void jjtClose() {
+        flattenTree();
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object      result = source;
+
+        for ( int i = 0, ilast = children.length - 1; i <= ilast; ++i ) {
+            boolean         handled = false;
+
+            if (i < ilast) {
+                if (children[i] instanceof ASTProperty) {
+                    ASTProperty     propertyNode = (ASTProperty)children[i];
+                    int             indexType = propertyNode.getIndexedPropertyType(context, result);
+
+                    if ((indexType != OgnlRuntime.INDEXED_PROPERTY_NONE) && (children[i + 1] instanceof ASTProperty)) {
+                        ASTProperty     indexNode = (ASTProperty)children[i + 1];
+
+                        if (indexNode.isIndexedAccess()) {
+                            Object      index = indexNode.getProperty(context, result);
+
+                            if (index instanceof DynamicSubscript) {
+                                if (indexType == OgnlRuntime.INDEXED_PROPERTY_INT) {
+                                    Object      array = propertyNode.getValue(context, result);
+                                    int         len = Array.getLength(array);
+
+                                    switch (((DynamicSubscript)index).getFlag()) {
+                                        case DynamicSubscript.ALL:
+                                            result = Array.newInstance( array.getClass().getComponentType(), len );
+                                            System.arraycopy( array, 0, result, 0, len );
+                                            handled = true;
+                                            i++;
+                                            break;
+                                        case DynamicSubscript.FIRST:
+                                            index = new Integer((len > 0) ? 0 : -1);
+                                            break;
+                                        case DynamicSubscript.MID:
+                                            index = new Integer((len > 0) ? (len / 2) : -1);
+                                            break;
+                                        case DynamicSubscript.LAST:
+                                            index = new Integer((len > 0) ? (len - 1) : -1);
+                                            break;
+                                    }
+                                } else {
+                                    if (indexType == OgnlRuntime.INDEXED_PROPERTY_OBJECT) {
+                                        throw new OgnlException("DynamicSubscript '" + indexNode + "' not allowed for object indexed property '" + propertyNode + "'");
+                                    }
+                                }
+                            }
+                            if (!handled) {
+                                result = OgnlRuntime.getIndexedProperty(context, result, propertyNode.getProperty(context, result).toString(), index);
+                                handled = true;
+                                i++;
+                            }
+                        }
+                    }
+                }
+            }
+            if (!handled) {
+                result = children[i].getValue( context, result );
+            }
+        }
+        return result;
+    }
+
+    protected void setValueBody( OgnlContext context, Object target, Object value ) throws OgnlException
+    {
+        boolean         handled = false;
+
+        for ( int i = 0, ilast = children.length - 2; i <= ilast; ++i ) {
+            if (i == ilast) {
+                if (children[i] instanceof ASTProperty) {
+                    ASTProperty     propertyNode = (ASTProperty)children[i];
+                    int             indexType = propertyNode.getIndexedPropertyType(context, target);
+
+                    if ((indexType != OgnlRuntime.INDEXED_PROPERTY_NONE) && (children[i + 1] instanceof ASTProperty)) {
+                        ASTProperty     indexNode = (ASTProperty)children[i + 1];
+
+                        if (indexNode.isIndexedAccess()) {
+                            Object      index = indexNode.getProperty(context, target);
+
+                            if (index instanceof DynamicSubscript) {
+                                if (indexType == OgnlRuntime.INDEXED_PROPERTY_INT) {
+                                    Object      array = propertyNode.getValue(context, target);
+                                    int         len = Array.getLength(array);
+
+                                    switch (((DynamicSubscript)index).getFlag()) {
+                                        case DynamicSubscript.ALL:
+                                            System.arraycopy(target, 0, value, 0, len);
+                                            handled = true;
+                                            i++;
+                                            break;
+                                        case DynamicSubscript.FIRST:
+                                            index = new Integer((len > 0) ? 0 : -1);
+                                            break;
+                                        case DynamicSubscript.MID:
+                                            index = new Integer((len > 0) ? (len / 2) : -1);
+                                            break;
+                                        case DynamicSubscript.LAST:
+                                            index = new Integer((len > 0) ? (len - 1) : -1);
+                                            break;
+                                    }
+                                } else {
+                                    if (indexType == OgnlRuntime.INDEXED_PROPERTY_OBJECT) {
+                                        throw new OgnlException("DynamicSubscript '" + indexNode + "' not allowed for object indexed property '" + propertyNode + "'");
+                                    }
+                                }
+                            }
+                            if (!handled) {
+                                OgnlRuntime.setIndexedProperty(context, target, propertyNode.getProperty(context, target).toString(), index, value);
+                                handled = true;
+                                i++;
+                            }
+                        }
+                    }
+                }
+            }
+            if (!handled) {
+                target = children[i].getValue( context, target );
+            }
+        }
+        if (!handled) {
+            children[children.length - 1].setValue( context, target, value );
+        }
+    }
+
+    public boolean isSimpleNavigationChain( OgnlContext context ) throws OgnlException
+    {
+        boolean     result = false;
+
+        if ((children != null) && (children.length > 0)) {
+            result = true;
+            for (int i = 0; result && (i < children.length); i++) {
+                if (children[i] instanceof SimpleNode) {
+                    result = ((SimpleNode)children[i]).isSimpleProperty(context);
+                } else {
+                    result = false;
+                }
+            }
+        }
+        return result;
+    }
+
+    public String toString()
+    {
+        String      result = "";
+
+        if ((children != null) && (children.length > 0)) {
+            for (int i = 0; i < children.length; i++) {
+                if (i > 0) {
+                    if (!(children[i] instanceof ASTProperty) || !((ASTProperty)children[i]).isIndexedAccess()) {
+                        result = result + ".";
+                    }
+                }
+                result += children[i].toString();
+            }
+        }
+        return result;
+    }
+}

File src/java/ognl/ASTConst.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+import java.math.*;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTConst extends SimpleNode
+{
+    private Object value;
+
+    public ASTConst(int id) {
+        super(id);
+    }
+
+    public ASTConst(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+      /** Called from parser actions. */
+    void setValue( Object value ) {
+        this.value = value;
+    }
+
+    public Object getValue() {
+        return value;
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException {
+        return this.value;
+    }
+
+    public boolean isNodeConstant( OgnlContext context ) throws OgnlException
+    {
+        return true;
+    }
+
+    public String getEscapedChar(char ch)
+    {
+        String          result;
+
+        switch(ch) {
+            case '\b':
+                result = "\b";
+                break;
+            case '\t':
+                result = "\\t";
+                break;
+            case '\n':
+                result = "\\n";
+                break;
+            case '\f':
+                result = "\\f";
+                break;
+            case '\r':
+                result = "\\r";
+                break;
+            case '\"':
+                result = "\\\"";
+                break;
+            case '\'':
+                result = "\\\'";
+                break;
+            case '\\':
+                result = "\\\\";
+                break;
+            default:
+                if (Character.isISOControl(ch) || (ch > 255)) {
+                    String      hc = Integer.toString((int)ch, 16);
+                    int         hcl = hc.length();
+
+                    result = "\\u";
+                    if (hcl < 4) {
+                        if (hcl == 3) {
+                            result = result + "0";
+                        } else {
+                            if (hcl == 2) {
+                                result = result + "00";
+                            } else {
+                                result = result + "000";
+                            }
+                        }
+                    }
+
+                    result = result + hc;
+                } else {
+                    result = new String(ch + "");
+                }
+                break;
+        }
+        return result;
+    }
+
+    public String getEscapedString(String value)
+    {
+        StringBuffer        result = new StringBuffer();
+
+        for (int i = 0, icount = value.length(); i < icount; i++) {
+            result.append(getEscapedChar(value.charAt(i)));
+        }
+        return new String(result);
+    }
+
+    public String toString()
+    {
+        String      result;
+
+        if (value == null) {
+            result = "null";
+        } else {
+            if (value instanceof String) {
+                result = '\"' + getEscapedString(value.toString()) + '\"';
+            } else {
+                if (value instanceof Character) {
+                    result = '\'' + getEscapedChar(((Character)value).charValue()) + '\'';
+                } else {
+                    result = value.toString();
+                    if (value instanceof Long) {
+                        result = result + "L";
+                    } else {
+                        if (value instanceof BigDecimal) {
+                            result = result + "B";
+                        } else {
+                            if (value instanceof BigInteger) {
+                                result = result + "H";
+                            } else {
+                                if (value instanceof Node) {
+                                    result = ":[ " + result + " ]";
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return result;
+    }
+}

File src/java/ognl/ASTCtor.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTCtor extends SimpleNode
+{
+    private String      className;
+    private boolean     isArray;
+
+    public ASTCtor(int id) {
+        super(id);
+    }
+
+    public ASTCtor(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+      /** Called from parser action. */
+    void setClassName( String className ) {
+        this.className = className;
+    }
+
+    void setArray(boolean value) {
+        isArray = value;
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object      result,
+                    root = context.getRoot();
+        int         count = jjtGetNumChildren();
+        Object[]    args = OgnlRuntime.getObjectArrayPool().create(count);
+
+        try {
+            for ( int i=0; i < count; ++i ) {
+                args[i] = children[i].getValue(context, root);
+            }
+            if (isArray) {
+                if (args.length == 1) {
+                    try {
+                        Class       componentClass = OgnlRuntime.classForName(context, className);
+                        List        sourceList = null;
+                        int         size;
+
+                        if (args[0] instanceof List) {
+                            sourceList = (List)args[0];
+                            size = sourceList.size();
+                        } else {
+                            size = (int)OgnlOps.longValue(args[0]);
+                        }
+                        result = Array.newInstance(componentClass, size);
+                        if (sourceList != null) {
+                            TypeConverter   converter = context.getTypeConverter();
+
+                            for (int i = 0, icount = sourceList.size(); i < icount; i++) {
+                                Object      o = sourceList.get(i);
+
+                                if ((o == null) || componentClass.isInstance(o)) {
+                                    Array.set(result, i, o);
+                                } else {
+                                    Array.set(result, i, converter.convertValue(context, null, null, null, o, componentClass));
+                                }
+                            }
+                        }
+                    } catch (ClassNotFoundException ex) {
+                        throw new OgnlException("array component class '" + className + "' not found", ex);
+                    }
+                } else {
+                    throw new OgnlException("only expect array size or fixed initializer list");
+                }
+            } else {
+                result = OgnlRuntime.callConstructor( context, className, args );
+            }
+
+            return result;
+        } finally {
+            OgnlRuntime.getObjectArrayPool().recycle(args);
+        }
+    }
+
+    public String toString()
+    {
+        String      result = "new " + className;
+
+        if (isArray) {
+            if (children[0] instanceof ASTConst) {
+                result = result + "[" + children[0] + "]";
+            } else {
+                result = result + "[] " + children[0];
+            }
+        } else {
+            result = result + "(";
+            if ((children != null) && (children.length > 0)) {
+                for (int i = 0; i < children.length; i++) {
+                    if (i > 0) {
+                        result = result + ", ";
+                    }
+                    result = result + children[i];
+                }
+            }
+            result = result + ")";
+        }
+        return result;
+    }
+}

File src/java/ognl/ASTDivide.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTDivide extends ExpressionNode
+{
+    public ASTDivide(int id) {
+        super(id);
+    }
+
+    public ASTDivide(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object v1 = children[0].getValue( context, source );
+        Object v2 = children[1].getValue( context, source );
+        return OgnlOps.divide( v1, v2 );
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return "/";
+    }
+}

File src/java/ognl/ASTEq.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTEq extends ExpressionNode
+{
+    public ASTEq(int id) {
+        super(id);
+    }
+
+    public ASTEq(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object v1 = children[0].getValue( context, source );
+        Object v2 = children[1].getValue( context, source );
+        return OgnlOps.equal( v1, v2 )? Boolean.TRUE : Boolean.FALSE;
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return "==";
+    }
+}

File src/java/ognl/ASTEval.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTEval extends SimpleNode
+{
+    public ASTEval(int id) {
+        super(id);
+    }
+
+    public ASTEval(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object  result,
+                expr = children[0].getValue( context, source ),
+                previousRoot = context.getRoot();
+        Node    node;
+
+        source = children[1].getValue( context, source );
+        node = (expr instanceof Node) ? (Node) expr : (Node) Ognl.parseExpression( expr.toString() );
+        try {
+            context.setRoot( source );
+            result = node.getValue( context, source );
+        } finally {
+            context.setRoot( previousRoot );
+        }
+        return result;
+    }
+
+    protected void setValueBody( OgnlContext context, Object target, Object value ) throws OgnlException
+    {
+        Object  expr = children[0].getValue(context, target),
+                previousRoot = context.getRoot();
+        Node    node;
+
+        target = children[1].getValue( context, target );
+        node = (expr instanceof Node) ? (Node) expr : (Node) Ognl.parseExpression( expr.toString() );
+        try {
+            context.setRoot( target );
+            node.setValue( context, target, value );
+        } finally {
+            context.setRoot( previousRoot );
+        }
+    }
+
+    public String toString()
+    {
+        return "(" + children[0] + ")(" + children[1] + ")";
+    }
+}

File src/java/ognl/ASTGreater.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTGreater extends ExpressionNode
+{
+    public ASTGreater(int id) {
+        super(id);
+    }
+
+    public ASTGreater(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object v1 = children[0].getValue( context, source );
+        Object v2 = children[1].getValue( context, source );
+        return OgnlOps.greater( v1, v2 )? Boolean.TRUE : Boolean.FALSE;
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return ">";
+    }
+}

File src/java/ognl/ASTGreaterEq.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTGreaterEq extends ExpressionNode
+{
+    public ASTGreaterEq(int id) {
+        super(id);
+    }
+
+    public ASTGreaterEq(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object v1 = children[0].getValue( context, source );
+        Object v2 = children[1].getValue( context, source );
+        return OgnlOps.less( v1, v2 )? Boolean.FALSE : Boolean.TRUE;
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return ">=";
+    }
+}

File src/java/ognl/ASTIn.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTIn extends SimpleNode
+{
+    public ASTIn(int id) {
+        super(id);
+    }
+
+    public ASTIn(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object v1 = children[0].getValue( context, source );
+        Object v2 = children[1].getValue( context, source );
+        return OgnlOps.in( v1, v2 )? Boolean.TRUE : Boolean.FALSE;
+    }
+
+    public String toString()
+    {
+        return children[0] + " in " + children[1];
+    }
+}

File src/java/ognl/ASTInstanceof.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 2002, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTInstanceof extends SimpleNode
+{
+    private String targetType;
+
+    public ASTInstanceof(int id) {
+        super(id);
+    }
+
+    public ASTInstanceof(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    void setTargetType( String targetType ) {
+        this.targetType = targetType;
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object value = children[0].getValue( context, source );
+        return OgnlRuntime.isInstance(context, value, targetType)? Boolean.TRUE : Boolean.FALSE;
+    }
+
+    public String toString()
+    {
+        return children[0] + " instanceof " + targetType;
+    }
+}

File src/java/ognl/ASTKeyValue.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTKeyValue extends SimpleNode
+{
+    public ASTKeyValue(int id) {
+        super(id);
+    }
+
+    public ASTKeyValue(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Node getKey()
+    {
+        return children[0];
+    }
+
+    protected Node getValue()
+    {
+        return (jjtGetNumChildren() > 1) ? children[1] : null;
+    }
+
+    /**
+        Returns null because this is a parser construct and does not evaluate
+     */
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        return null;
+    }
+
+    public String toString()
+    {
+        return getKey() + " -> " + getValue();
+    }
+}

File src/java/ognl/ASTLess.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTLess extends ExpressionNode
+{
+    public ASTLess(int id) {
+        super(id);
+    }
+
+    public ASTLess(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object v1 = children[0].getValue( context, source );
+        Object v2 = children[1].getValue( context, source );
+        return OgnlOps.less( v1, v2 )? Boolean.TRUE : Boolean.FALSE;
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return "<";
+    }
+}

File src/java/ognl/ASTLessEq.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTLessEq extends ExpressionNode
+{
+    public ASTLessEq(int id) {
+        super(id);
+    }
+
+    public ASTLessEq(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object v1 = children[0].getValue( context, source );
+        Object v2 = children[1].getValue( context, source );
+        return OgnlOps.greater( v1, v2 )? Boolean.FALSE : Boolean.TRUE;
+    }
+
+    public String getExpressionOperator(int index)
+    {
+        return "<=";
+    }
+}

File src/java/ognl/ASTList.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+import java.util.*;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTList extends SimpleNode
+{
+    public ASTList(int id) {
+        super(id);
+    }
+
+    public ASTList(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        List answer = new ArrayList( jjtGetNumChildren() );
+        for ( int i=0; i < jjtGetNumChildren(); ++i )
+            answer.add( children[i].getValue(context, source) );
+        return answer;
+    }
+
+    public String toString()
+    {
+        String      result = "{ ";
+
+
+        for ( int i=0; i < jjtGetNumChildren(); ++i ) {
+            if (i > 0) {
+                result = result + ", ";
+            }
+            result = result + children[i].toString();
+        }
+        return result + " }";
+    }
+}

File src/java/ognl/ASTMap.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+import java.util.*;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTMap extends SimpleNode
+{
+    private static Class    DEFAULT_MAP_CLASS;
+    private String          className;
+
+    static {
+        /* Try to get LinkedHashMap; if older JDK than 1.4 use HashMap */
+        try {
+            DEFAULT_MAP_CLASS = Class.forName("java.util.LinkedHashMap");
+        } catch (ClassNotFoundException ex) {
+            DEFAULT_MAP_CLASS = HashMap.class;
+        }
+    }
+
+    public ASTMap(int id) {
+        super(id);
+    }
+
+    public ASTMap(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+    protected void setClassName(String value)
+    {
+        className = value;
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Map answer;
+
+        if (className == null) {
+            try {
+                answer = (Map)DEFAULT_MAP_CLASS.newInstance();
+            } catch (Exception ex) {
+                /* This should never happen */
+                throw new OgnlException("Default Map class '" + DEFAULT_MAP_CLASS.getName() + "' instantiation error", ex);
+            }
+        } else {
+            try {
+                answer = (Map)OgnlRuntime.classForName(context, className).newInstance();
+            } catch (Exception ex) {
+                throw new OgnlException("Map implementor '" + className + "' not found", ex);
+            }
+        }
+
+        for ( int i=0; i < jjtGetNumChildren(); ++i ) {
+            ASTKeyValue     kv = (ASTKeyValue)children[i];
+            Node            k = kv.getKey(),
+                            v = kv.getValue();
+
+            answer.put( k.getValue(context, source), (v == null) ? null : v.getValue(context, source) );
+        }
+        return answer;
+    }
+
+    public String toString()
+    {
+        String      result = "#";
+
+        if (className != null) {
+            result = result + "@" + className + "@";
+        }
+        result = result + "{ ";
+        for ( int i = 0; i < jjtGetNumChildren(); ++i ) {
+            ASTKeyValue     kv = (ASTKeyValue)children[i];
+
+            if (i > 0) {
+                result = result + ", ";
+            }
+            result = result + kv.getKey() + " : " + kv.getValue();
+        }
+        return result + " }";
+    }
+}

File src/java/ognl/ASTMethod.java

+//--------------------------------------------------------------------------
+//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
+//  All rights reserved.
+//
+//	Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+//
+//	Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+//	Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//	Neither the name of the Drew Davidson nor the names of its contributors
+//  may be used to endorse or promote products derived from this software
+//  without specific prior written permission.
+//
+//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+//  DAMAGE.
+//--------------------------------------------------------------------------
+package ognl;
+
+/**
+ * @author Luke Blanshard (blanshlu@netscape.net)
+ * @author Drew Davidson (drew@ognl.org)
+ */
+class ASTMethod extends SimpleNode
+{
+    private String methodName;
+
+    public ASTMethod(int id) {
+        super(id);
+    }
+
+    public ASTMethod(OgnlParser p, int id) {
+        super(p, id);
+    }
+
+      /** Called from parser action. */
+    void setMethodName( String methodName ) {
+        this.methodName = methodName;
+    }
+
+    /**
+        Returns the method name that this node will call.
+     */
+    public String getMethodName()
+    {
+        return methodName;
+    }
+
+    protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException
+    {
+        Object[]    args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren());
+
+        try {
+            Object      result,
+                        root = context.getRoot();
+
+            for ( int i = 0, icount = args.length; i < icount; ++i ) {
+                args[i] = children[i].getValue(context, root);
+            }
+            result = OgnlRuntime.callMethod( context, source, methodName, null, args);
+            if (result == null) {
+                NullHandler     nh = OgnlRuntime.getNullHandler(OgnlRuntime.getTargetClass(source));
+
+                result = nh.nullMethodResult(context, source, methodName, args);