diff --git a/src/helma/framework/core/RequestPath.java b/src/helma/framework/core/RequestPath.java index 7ff56fd5..aaf52120 100644 --- a/src/helma/framework/core/RequestPath.java +++ b/src/helma/framework/core/RequestPath.java @@ -135,12 +135,25 @@ public class RequestPath { } /** - * Checks if the given object is contained in the request path + * Checks if the given object is contained in the request path. + * Itreturns the zero-based index position, or -1 if it isn't contained. + * + * @param obj the element to check + * @return the index of the element, or -1 if it isn't contained + * @deprecated use {@link #indexOf(Object)} instead. + */ + public int contains(Object obj) { + return objects.indexOf(obj); + } + + /** + * Checks if the given object is contained in the request path. + * Itreturns the zero-based index position, or -1 if it isn't contained. * * @param obj the element to check * @return the index of the element, or -1 if it isn't contained */ - public int contains(Object obj) { + public int indexOf(Object obj) { return objects.indexOf(obj); } diff --git a/src/helma/scripting/rhino/HopObject.java b/src/helma/scripting/rhino/HopObject.java index 0b98c1c5..c30f0a6f 100644 --- a/src/helma/scripting/rhino/HopObject.java +++ b/src/helma/scripting/rhino/HopObject.java @@ -651,9 +651,10 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco } /** - * Check if node is contained in subnodes + * Check if node is contained in the subnode collection. + * Return its index position if it is, and -1 otherwise. */ - public int jsFunction_contains(Object obj) { + public int jsFunction_indexOf(Object obj) { checkNode(); @@ -666,6 +667,15 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco return -1; } + /** + * Check if node is contained in the subnode collection. + * Return its index position if it is, and -1 otherwise. + * @deprecated use indexOf(Object) instead. + */ + public int jsFunction_contains(Object obj) { + return jsFunction_indexOf(obj); + } + /** * Set a property in this HopObject *