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 2009/09/08 17:23:23 UTC

svn commit: r812549 - /incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java

Author: cwiklik
Date: Tue Sep  8 15:23:19 2009
New Revision: 812549

URL: http://svn.apache.org/viewvc?rev=812549&view=rev
Log:
UIMA-1560 Added check for null before dereferencing casProcessor 

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

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java?rev=812549&r1=812548&r2=812549&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java Tue Sep  8 15:23:19 2009
@@ -426,7 +426,7 @@
       }
       // Provide CollectionReader with the number of documents to process
       ((ConfigurableResource_ImplBase) colreader).setConfigParameterValue("processSize",
-              new Integer((int)numDocs2Process));
+              Integer.valueOf((int)numDocs2Process) );
       CpeConfiguration cpeType = getCpeDescriptor().getCpeConfiguration();
       if (cpeType != null && cpeType.getStartingEntityId() != null
               && cpeType.getStartingEntityId().trim().length() > 0) {
@@ -1108,7 +1108,9 @@
     // Override the name of the component with the name specified in the cpe descriptor
     // Uniqueness of names is enforced on names in the cpe descriptor not those defined
     // in the component descriptor
-    casProcessor.getProcessingResourceMetaData().setName(aCasProcessorType.getName());
+    if ( casProcessor != null && aCasProcessorType != null ) {
+      casProcessor.getProcessingResourceMetaData().setName(aCasProcessorType.getName());
+    }
 
     return casProcessor;