You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2010/01/18 22:16:19 UTC

svn commit: r900563 - /incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java

Author: cwiklik
Date: Mon Jan 18 21:16:11 2010
New Revision: 900563

URL: http://svn.apache.org/viewvc?rev=900563&view=rev
Log:
UIMA-1727 Validate callback listener reference before using it

Modified:
    incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java?rev=900563&r1=900562&r2=900563&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java Mon Jan 18 21:16:11 2010
@@ -880,12 +880,14 @@
   private void notifyListeners(CAS aCas, Exception anException) {
     for (int i = 0; callbackListeners != null && i < callbackListeners.size(); i++) {
       StatusCallbackListener statCL = (StatusCallbackListener) callbackListeners.get(i);
-      ProcessTrace prTrace = new ProcessTrace_impl(cpm.getPerformanceTuningSettings());
-      EntityProcessStatusImpl aEntityProcStatus = new EntityProcessStatusImpl(prTrace);
-      aEntityProcStatus.addEventStatus("Collection Reader Failure", "failed", anException);
-      // Notify the listener that the Cas has been processed
-      CPMEngine.callEntityProcessCompleteWithCAS(statCL, aCas, aEntityProcStatus);
-//      statCL.entityProcessComplete(aCas, aEntityProcStatus);
+      if ( statCL != null ) {
+        ProcessTrace prTrace = new ProcessTrace_impl(cpm.getPerformanceTuningSettings());
+        EntityProcessStatusImpl aEntityProcStatus = new EntityProcessStatusImpl(prTrace);
+        aEntityProcStatus.addEventStatus("Collection Reader Failure", "failed", anException);
+        // Notify the listener that the Cas has been processed
+        CPMEngine.callEntityProcessCompleteWithCAS(statCL, aCas, aEntityProcStatus);
+//        statCL.entityProcessComplete(aCas, aEntityProcStatus);
+      }
     }
   }