Object object = context.objectAtIndex(index); if(checkHashCodes) { if(object != null && hashCode != 0) { int objectHashCode = hashCodeForObject(object); if(objectHashCode != hashCode) { boolean found = false; for(int i = 0; i < context.count() && !found; i++) { Object o = context.objectAtIndex(i); int otherHashCode = hashCodeForObject(o); if(otherHashCode == hashCode) { object = o; index = i; found = true; } } if(!found) { if(raiseOnUnmatchedObject(wocomponent, wocontext)) { throw new UnmatchedObjectException(); } log.warn("Wrong object: " + objectHashCode + " vs " + hashCode); } else { log.info("Ignored object: " + objectHashCode + " vs " + hashCode); return null; } } } }
Object object = null; if(checkHashCodes) { boolean found = false; int otherHashCode = 0; for(int i = 0; i < context.count() && !found; i++) { Object o = context.objectAtIndex(i); otherHashCode = hashCodeForObject(o); if(otherHashCode == hashCode) { object = o; index = i; found = true; } } if(!found) { if(raiseOnUnmatchedObject(wocomponent, wocontext)) { throw new UnmatchedObjectException(); } log.warn("Wrong object: " + otherHashCode + " vs " + hashCode); return wocontext.page(); } else { log.debug("Found object: " + otherHashCode + " vs " + hashCode); } } else { object = context.objectAtIndex(index); }
    public WOActionResults invokeAction(WORequest worequest, WOContext wocontext) {        WOComponent wocomponent = wocontext.component();        Context context = createContext(wocomponent);                int count = _count(context, wocomponent);                WOActionResults woactionresults = null;        String indexString = _indexOfChosenItem(worequest, wocontext);                int index = 0;        int hashCode = 0;        boolean checkHashCodes = checkHashCodes(wocomponent, wocontext);                if(indexString != null) {            if(checkHashCodes) {                hashCode = Integer.parseInt(indexString);            } else {                index = Integer.parseInt(indexString);            }        }        if(indexString != null) {            if (_item != null) {                Object object = context.objectAtIndex(index);                if(checkHashCodes) {                    if(object != null && hashCode != 0) {                        int objectHashCode = hashCodeForObject(object);                        if(objectHashCode != hashCode) {                            boolean found = false;                            for(int i = 0; i < context.count() && !found; i++) {                                Object o = context.objectAtIndex(i);                                int otherHashCode = hashCodeForObject(o);                                if(otherHashCode == hashCode) {                                    object = o;                                    index = i;                                    found = true;                                }                            }                            if(!found) {                                if(raiseOnUnmatchedObject(wocomponent, wocontext)) {                                    throw new UnmatchedObjectException();                                }                                log.warn("Wrong object: " + objectHashCode + " vs " + hashCode);                            } else {                                log.info("Ignored object: " + objectHashCode + " vs " + hashCode);                                return null;                            }                        }                    }                }                _item._setValueNoValidation(object, wocomponent);            }            if (_index != null) {                Integer integer = ERXConstant.integerForInt(index);                _index._setValueNoValidation(integer, wocomponent);            }            wocontext.appendElementIDComponent(indexString);            if(log.isDebugEnabled()) {                log.debug("invokeAction:" + wocontext.elementID());            }            woactionresults = super.invokeAction(worequest, wocontext);            wocontext.deleteLastElementIDComponent();        } else {            int start = indexString == null ? 0 : index;            int end   = indexString == null ? count : (index + 1);                        for (int i = start; i < end && woactionresults == null; i++) {                _prepareForIterationWithIndex(context, i, wocontext, wocomponent, checkHashCodes);                woactionresults = super.invokeAction(worequest, wocontext);            }            if (count > 0) {                _cleanupAfterIteration(count, wocontext, wocomponent);            }        }        return woactionresults;    }