Project

General

Profile

« Previous | Next » 

Revision 2458

Added by Chris Jones over 19 years ago

When searching for attributes in the XPATH expression, an 'index out of bounds'
exception was thrown when only an attribute was included in the path string.

This fix changes the pathexpr.indexOf comparison to 0 rather than 1, since
the index starts at 0.

This is a partial fix to
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=2052

View differences:

src/edu/ucsb/nceas/metacat/QuerySpecification.java
1132 1132
        if (pathExpression == null) { return null; }
1133 1133
        int index = pathExpression.lastIndexOf(ATTRIBUTESYMBOL);
1134 1134
        String newExpression = null;
1135
        if (index != 1) {
1135
        if (index != 0) {
1136 1136
            newExpression = pathExpression.substring(0, index - 1);
1137 1137
        }
1138 1138
        MetaCatUtil.debugMessage("The path expression without attributes: "

Also available in: Unified diff