ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1830590 - /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
Date Mon, 30 Apr 2018 13:49:59 GMT
Author: seanfinan
Date: Mon Apr 30 13:49:59 2018
New Revision: 1830590

URL: http://svn.apache.org/viewvc?rev=1830590&view=rev
Log:
Throw exception if there is an attempt to add the same engine twice.  Thanks to Tim for the
suggestion.

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java?rev=1830590&r1=1830589&r2=1830590&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
Mon Apr 30 13:49:59 2018
@@ -65,7 +65,13 @@ public enum PatientNoteStore {
     * @param engineName name of engine that consumes patients
     */
    synchronized public void registerEngine( final String engineName ) {
-      _registeredEngines.add( engineName );
+      if ( !_registeredEngines.add( engineName ) ) {
+         throw new IllegalArgumentException( engineName
+                                             + " already Registered!  To add an engine twice,
please use the parameter "
+                                             + AbstractPatientConsumer.ENGINE_NAME
+                                             + " to specify unique names" +
+                                             " OR if you are developing the engine override
getEngineName() method." );
+      }
    }
 
    /**



Mime
View raw message