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/07/28 18:21:04 UTC

svn commit: r798596 - /incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java

Author: cwiklik
Date: Tue Jul 28 16:21:04 2009
New Revision: 798596

URL: http://svn.apache.org/viewvc?rev=798596&view=rev
Log:
UIMA-1459 Check for null before dereferencing vars

Modified:
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java?rev=798596&r1=798595&r2=798596&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java Tue Jul 28 16:21:04 2009
@@ -754,7 +754,7 @@
 	      }
         // Incremented number of outstanding CASes sent to a service. When a reply comes
         // this counter is decremented
-        long outstandingCasCount = outstandingCasRequests.incrementAndGet();
+        outstandingCasRequests.incrementAndGet();
 	      //  Add message to the pending queue
 	      addMessage(msg);
 	    }
@@ -1630,10 +1630,12 @@
     //  Once the semaphore is acquired and the CAS is dispatched
     //  the thread will block in trying to acquire the semaphore again
     //  below.
-    try {
-      threadMonitor.getMonitor().acquire();
-    } catch( InterruptedException e) {
-      System.out.println("UIMA AS Client Received Interrrupt While Acquiring Monitor Semaphore in sendAndReceive()");
+    if (threadMonitor != null && threadMonitor.getMonitor() != null) {
+      try {
+        threadMonitor.getMonitor().acquire();
+      } catch( InterruptedException e) {
+        System.out.println("UIMA AS Client Received Interrrupt While Acquiring Monitor Semaphore in sendAndReceive()");
+      }
     }
     // send CAS. This call does not block. Instead we will block the sending thread below.
     casReferenceId = sendCAS(aCAS, cachedRequest);
@@ -1873,7 +1875,6 @@
 
 		private String endpoint;
 
-		private volatile boolean receivedProcessCasReply = false;
 		private long threadId=-1;
 		
 		private Message message;
@@ -2009,7 +2010,6 @@
 		}
 		public void setReceivedProcessCasReply()
 		{
-			receivedProcessCasReply = true;
 		}
 		public void setMetadataTimeout( int aTimeout )
 		{