You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by nu...@apache.org on 2006/09/08 00:05:05 UTC
svn commit: r441253 -
/jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/listener/ObjectProcessedEventCounter.java
Author: nuttycom
Date: Thu Sep 7 15:05:04 2006
New Revision: 441253
URL: http://svn.apache.org/viewvc?view=rev&rev=441253
Log:
Fixed ClassCastException when processing unrecognized events
Modified:
jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/listener/ObjectProcessedEventCounter.java
Modified: jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/listener/ObjectProcessedEventCounter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/listener/ObjectProcessedEventCounter.java?view=diff&rev=441253&r1=441252&r2=441253
==============================================================================
--- jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/listener/ObjectProcessedEventCounter.java (original)
+++ jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/listener/ObjectProcessedEventCounter.java Thu Sep 7 15:05:04 2006
@@ -38,8 +38,10 @@
private Map<Stage,Integer> counts = Collections.synchronizedMap(new HashMap<Stage, Integer>());
public synchronized void notify(EventObject evo) {
+ if (evo instanceof ObjectProcessedEvent) {
ObjectProcessedEvent ev = (ObjectProcessedEvent) evo;
if (!counts.containsKey(ev.getSource())) counts.put(ev.getSource(), 1);
+ }
}
public Map<Stage, Integer> getCounts() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org