deniskuzZ commented on code in PR #5404: URL: https://github.com/apache/hive/pull/5404#discussion_r1881992046
########## common/src/java/org/apache/hive/common/util/ReflectionUtil.java: ########## @@ -129,13 +127,25 @@ private static void setJobConf(Object theObject, Configuration conf) { * @param value new value * @throws RuntimeException in case the field is not found or cannot be set. */ + @SuppressFBWarnings(value = "REFLF_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_FIELD", justification = "HIVE-23613: intended_TO_DO") public static void setField(Object object, String field, Object value) { try { Field fieldToChange = object.getClass().getDeclaredField(field); fieldToChange.setAccessible(true); fieldToChange.set(object, value); } catch (NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException(format("Cannot set field %s in object %s", field, object.getClass())); + throw new RuntimeException("Cannot set field %s in object %s".formatted(field, object.getClass())); + } + } + + @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE", justification = "HIVE-23613: intended_TO_DO") + public static void setField(Object object, Field fld, Object value) { Review Comment: typo: `field` why not reuse this method above to avoid code duplication? -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org