Skip to content

Commit

Permalink
Fixed code to enable normal forward execution
Browse files Browse the repository at this point in the history
  • Loading branch information
michbarsinai committed Aug 10, 2017
1 parent be7e23d commit d32fdf4
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import il.ac.bgu.cs.bp.bpjs.bprogram.runtimeengine.jsproxy.BThreadJsProxy;
import il.ac.bgu.cs.bp.bpjs.events.BEvent;
import il.ac.bgu.cs.bp.bpjs.search.ContinuationProgramState;
import java.util.Objects;

/**
* The state of a BThread at {@code bsync}.
Expand Down Expand Up @@ -219,18 +220,21 @@ public int hashCode() {

@Override
public boolean equals(Object obj) {
if (this == obj) return true;

// Quick circuit-breakers
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;

BThreadSyncSnapshot other = (BThreadSyncSnapshot) obj;
if ( ! Objects.equals(getName(), other.getName())) return false;

if (continuation == null) {
return (other.continuation == null)
return (other.continuation == null);

} else {
NativeContinuation natCont = (NativeContinuation) continuation;
NativeContinuation natOtherCont = (NativeContinuation) other.continuation;
return new ContinuationProgramState(natCont).equals(new ContinuationProgramState(natOtherCont))
return new ContinuationProgramState(natCont).equals(new ContinuationProgramState(natOtherCont));
}
}

Expand Down

0 comments on commit d32fdf4

Please sign in to comment.