a unit test for this would be nice actually (I know I should have written it initially, sorry about that). -Vincent On Jun 7, 2008, at 5:09 AM, sdumitriu (SVN) wrote:
Author: sdumitriu Date: 2008-06-07 05:09:36 +0200 (Sat, 07 Jun 2008) New Revision: 10143
Modified: xwiki-platform/core/trunk/xwiki-observation/src/main/java/org/ xwiki/observation/event/ActionExecutionEvent.java Log: XWIKI-2441: Comparing two ActionExecutionEvent always fails Fixed
Modified: xwiki-platform/core/trunk/xwiki-observation/src/main/java/ org/xwiki/observation/event/ActionExecutionEvent.java =================================================================== --- xwiki-platform/core/trunk/xwiki-observation/src/main/java/org/ xwiki/observation/event/ActionExecutionEvent.java 2008-06-07 03:02:21 UTC (rev 10142) +++ xwiki-platform/core/trunk/xwiki-observation/src/main/java/org/ xwiki/observation/event/ActionExecutionEvent.java 2008-06-07 03:09:36 UTC (rev 10143) @@ -71,6 +71,9 @@ @Override public boolean equals(Object object) { + if (object instanceof ActionExecutionEvent) { + return getActionName().equals(((ActionExecutionEvent) object).getActionName()); + } return getActionName().equals(object); }
@@ -82,7 +85,7 @@ public boolean matches(Object otherEvent) { boolean isMatching = false; - if (ActionExecutionEvent.class.isAssignableFrom(otherEvent.getClass())) { + if (this.getClass().isAssignableFrom(otherEvent.getClass())) { ActionExecutionEvent actionEvent = (ActionExecutionEvent) otherEvent; isMatching = getActionName().equals(actionEvent.getActionName()); }