/** * Does nothing in the simulator. * * @param pta is always null in the simulator. * @param ptaKind loaded from XML. * @param sequence loaded from XML. * @param accepted loaded from XML. * @param newColour loaded from XML. */ @Override public synchronized void AugmentPTA( LearnerGraph pta, RestartLearningEnum ptaKind, List<Label> sequence, boolean accepted, JUConstants newColour) { AugmentPTAData data = new AugmentPTAData(ptaKind, sequence, accepted, newColour); // now call the expected method if (Thread.currentThread() == secondThread) { whatToCompareWith.AugmentPTA(pta, ptaKind, sequence, accepted, newColour); augmentData = data; } else decoratedLearner.AugmentPTA(pta, ptaKind, sequence, accepted, newColour); syncOnCallOf(KIND_OF_METHOD.M_AUGMENT); if (Thread.currentThread() != secondThread) { if (!data.equals(augmentData)) // second thread, checking. failureCode = new IllegalArgumentException("different augment PTA values"); augmentData = null; // reset stored data } syncOnCallOf(KIND_OF_METHOD.M_METHODEXIT); // aims to stop one of the threads running fast // from the first checkCall and overwriting the stored value before the other // thread had a chance to use it in a comparison. }