if ((id + " ").equals(value.substring(0, idLen + 1))) {
if (valLen < idLen) { return false; } else if (id.equals(value.substring(0, idLen)) && (valLen == idLen || Character.isWhitespace(value.charAt(idLen)))) {
    public boolean matches(Item item) {        if (reference) {            if (fieldName == ObjectStoreItemPathFollowingImpl.IDENTIFIER) {                String id = item.getIdentifier();                int idLen = id.length();                if (value == null) {                    return false;                }                int valLen = value.length();                if ((id + " ").equals(value.substring(0, idLen + 1))) {                    return true;                } else if (value.indexOf(" " + id + " ") != -1) {                    return true;                } else if ((" " + id).equals(value.substring(valLen - idLen - 1))) {                    return true;                }                return false;            } else {                Iterator refIter = item.getReferences().iterator();                while (refIter.hasNext()) {                    Reference ref = (Reference) refIter.next();                    if (ref.getName().equals(fieldName)) {                        return ref.getRefId().equals(value);                    }                }                return false;            }        } else {            if (fieldName == ObjectStoreItemPathFollowingImpl.IDENTIFIER) {                return value.equals(item.getIdentifier());            } else if (fieldName == ObjectStoreItemPathFollowingImpl.CLASSNAME) {                return value.equals(item.getClassName());            } else {                Iterator attIter = item.getAttributes().iterator();                while (attIter.hasNext()) {                    Attribute att = (Attribute) attIter.next();                    if (att.getName().equals(fieldName)) {                        return att.getValue().equals(value);                    }                }                return false;            }        }    }