tanishq-chugh commented on code in PR #5404: URL: https://github.com/apache/hive/pull/5404#discussion_r2048779869
########## 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: Made the change in to use the added method in above method to remove code duplication in [3c521be](https://github.com/apache/hive/pull/5404/commits/3c521be48ade04f17ce3ee69bf588aff0ec8e34a) @deniskuzZ `field` is not a typo instead we are actually referring to field java class. -- 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