avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1049732 - /avro/trunk/lang/java/src/java/org/apache/avro/ipc/Requestor.java
Date Wed, 15 Dec 2010 22:31:29 GMT
Author: cutting
Date: Wed Dec 15 22:31:29 2010
New Revision: 1049732

URL: http://svn.apache.org/viewvc?rev=1049732&view=rev
Log:
AVRO-687.  Fix a NullPointerException.

Modified:
    avro/trunk/lang/java/src/java/org/apache/avro/ipc/Requestor.java

Modified: avro/trunk/lang/java/src/java/org/apache/avro/ipc/Requestor.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/ipc/Requestor.java?rev=1049732&r1=1049731&r2=1049732&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/ipc/Requestor.java (original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/ipc/Requestor.java Wed Dec 15 22:31:29 2010
@@ -237,10 +237,10 @@ public abstract class Requestor {
 
   /** Return the remote protocol.  Force a handshake if required. */
   public synchronized Protocol getRemote() throws IOException {
+    if (remote != null) return remote;            // already have it
     MD5 remoteHash = REMOTE_HASHES.get(transceiver.getRemoteName());
     remote = REMOTE_PROTOCOLS.get(remoteHash);
-    if (remote != null)
-      return remote;
+    if (remote != null) return remote;            // already cached
     // force handshake
     ByteBufferOutputStream bbo = new ByteBufferOutputStream();
     Encoder out = new BinaryEncoder(bbo);



Mime
View raw message