Here is the code for setRelatedListener and clearRelatedListener:
public void setRelatedListener(Object subject, Object relatedListener)
// force the dependency by adding a listener that just doesn't
// do anything. This will make sure that subject is always after
// related listener in the dependencies graph
addListener(relatedListener, subject, NoOpEventFormat.INSTANCE);
public void clearRelatedListener(Object subject, Object relatedListener)
So the code looks correct to me, as the addListener and removeListener methods
are called consistently with the same parameter ordering.
It's important that you call setRelatedListener and clearRelatedListener with
the same consistent parameter ordering from your code.
If you still think there is an error, please provide a test case to demonstrate