Fix failed java build (#3019)
Fix Java compilation issues introduced by THRIFT-4847 in d4503a1f0e62d38f7a12ba9748744c5490c915c4
Also fix the failing spotlessCheck
---------
Co-authored-by: Mario Emmenlauer <mario@emmenlauer.de>
Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
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 a573f0c..0388c11 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
@@ -304,6 +304,7 @@
/**
* Sets the selection key (this is not thread safe).
+ *
* @param selectionKey the new key to set.
*/
public void setSelectionKey(SelectionKey selectionKey) {
diff --git a/lib/java/src/main/java/org/apache/thrift/server/TThreadedSelectorServer.java b/lib/java/src/main/java/org/apache/thrift/server/TThreadedSelectorServer.java
index 2a95fe1..33b4686 100644
--- a/lib/java/src/main/java/org/apache/thrift/server/TThreadedSelectorServer.java
+++ b/lib/java/src/main/java/org/apache/thrift/server/TThreadedSelectorServer.java
@@ -637,11 +637,11 @@
SelectionKey newKey;
try {
if (attachment == null) {
- newKey = channel.register(newSelector, interestOpts);
+ newKey = channel.register(newSelector, interestOps);
} else {
- newKey = channel.register(newSelector, interestOpts, attachment);
+ newKey = channel.register(newSelector, interestOps, attachment);
if (attachment instanceof FrameBuffer) {
- ((FrameBuffer) attachment.setSelectionKey(newKey);
+ ((FrameBuffer) attachment).setSelectionKey(newKey);
}
}
} catch (ClosedChannelException e) {