Commit 2a08a454 authored by Carlos Galindo's avatar Carlos Galindo
Browse files

Work#isSuffix: fix ignored previousEdgeType on NodeWork.

parent 3aad6343
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -61,4 +61,11 @@ public class NodeWork extends Work
				&& currentNode == ((NodeWork) object).currentNode
				&& previousEdgeType == ((NodeWork) object).previousEdgeType;
	}

	@Override
	public boolean isSuffix(Work w) {
		return w instanceof NodeWork
				&& previousEdgeType == ((NodeWork) w).previousEdgeType
				&& super.isSuffix(w);
	}
}
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -79,6 +79,11 @@ public abstract class Work
		return this.id.hashCode() + this.constraints.hashCode();
	}

	/**
	 * <b>Prerequisite</b>: id.equals(w.id)
	 * <br>
	 * Subclasses must override this method if equality isn't based only on id.
	 */
	public boolean isSuffix(Work w) {
		return constraints.isSuffix(w.constraints);
	}