fix pmd main for java
diff --git a/lib/java/src/main/java/org/apache/thrift/TNonblockingMultiFetchClient.java b/lib/java/src/main/java/org/apache/thrift/TNonblockingMultiFetchClient.java
index 034cc85..ffe4fa7 100644
--- a/lib/java/src/main/java/org/apache/thrift/TNonblockingMultiFetchClient.java
+++ b/lib/java/src/main/java/org/apache/thrift/TNonblockingMultiFetchClient.java
@@ -280,16 +280,14 @@
             }
           }
 
-          if (selKey.isValid() && selKey.isWritable()) {
-            if (sendBuf[index].hasRemaining()) {
-              // if this socket throws an exception, print error msg and
-              // skip it.
-              try {
-                SocketChannel sChannel = (SocketChannel) selKey.channel();
-                sChannel.write(sendBuf[index]);
-              } catch (Exception e) {
-                LOGGER.error("Socket {} writes to server {} error", index, servers.get(index), e);
-              }
+          if (selKey.isValid() && selKey.isWritable() && sendBuf[index].hasRemaining()) {
+            // if this socket throws an exception, print error msg and
+            // skip it.
+            try {
+              SocketChannel sChannel = (SocketChannel) selKey.channel();
+              sChannel.write(sendBuf[index]);
+            } catch (Exception e) {
+              LOGGER.error("Socket {} writes to server {} error", index, servers.get(index), e);
             }
           }
 
diff --git a/lib/java/src/main/java/org/apache/thrift/server/AbstractNonblockingServer.java b/lib/java/src/main/java/org/apache/thrift/server/AbstractNonblockingServer.java
index 44341d9..01b15e8 100644
--- a/lib/java/src/main/java/org/apache/thrift/server/AbstractNonblockingServer.java
+++ b/lib/java/src/main/java/org/apache/thrift/server/AbstractNonblockingServer.java
@@ -190,10 +190,8 @@
       }
 
       // if the buffer's frame read is complete, invoke the method.
-      if (buffer.isFrameFullyRead()) {
-        if (!requestInvoke(buffer)) {
-          cleanupSelectionKey(key);
-        }
+      if (buffer.isFrameFullyRead() && !requestInvoke(buffer)) {
+        cleanupSelectionKey(key);
       }
     }
 
diff --git a/lib/java/src/main/java/org/apache/thrift/transport/TFileTransport.java b/lib/java/src/main/java/org/apache/thrift/transport/TFileTransport.java
index 713d521..b067272 100644
--- a/lib/java/src/main/java/org/apache/thrift/transport/TFileTransport.java
+++ b/lib/java/src/main/java/org/apache/thrift/transport/TFileTransport.java
@@ -447,12 +447,11 @@
     if (!isOpen())
       throw new TTransportException(TTransportException.NOT_OPEN, "Must open before reading");
 
-    if (currentEvent_.getRemaining() == 0) {
-      if (!readEvent()) return (0);
+    if (currentEvent_.getRemaining() == 0 && !readEvent()) {
+      return 0;
     }
 
-    int nread = currentEvent_.emit(buf, off, len);
-    return nread;
+    return currentEvent_.emit(buf, off, len);
   }
 
   public int getNumChunks() throws TTransportException {