You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by GitBox <gi...@apache.org> on 2022/10/13 21:33:50 UTC

[GitHub] [thrift] ctubbsii commented on a diff in pull request #2710: fix various java codestyle issues

ctubbsii commented on code in PR #2710:
URL: https://github.com/apache/thrift/pull/2710#discussion_r995139220


##########
lib/java/src/main/java/org/apache/thrift/TEnumHelper.java:
##########
@@ -38,11 +41,7 @@ public static TEnum getByValue(Class<? extends TEnum> enumClass, int value) {
     try {
       Method method = enumClass.getMethod("findByValue", int.class);
       return (TEnum) method.invoke(null, value);
-    } catch (NoSuchMethodException nsme) {
-      return null;
-    } catch (IllegalAccessException iae) {
-      return null;
-    } catch (InvocationTargetException ite) {
+    } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException nsme) {

Review Comment:
   I think these can be replaced with:
   
   ```suggestion
       } catch (ReflectiveOperationException nsme) {
   ```



##########
lib/java/src/main/java/org/apache/thrift/server/TSaslNonblockingServer.java:
##########
@@ -171,6 +171,7 @@ private void acceptNewConnection() {
             LOGGER.warn("Failed to accept incoming connection.", e);
           }
         } else {
+          // TODO fix with try-with-resource for the return value of .channel

Review Comment:
   TODOs in code are easily forgotten. Better to create an issue in the issue tracker for the project than to embed a TODO.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org