twalthr commented on a change in pull request #13373: URL: https://github.com/apache/flink/pull/13373#discussion_r487029161
########## File path: flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoComparator.java ########## @@ -176,14 +181,25 @@ public void getFlatComparator(List<TypeComparator> flatComparators) { */ public final Object accessField(Field field, Object object) { try { - object = field.get(object); + if (field.isAccessible()) { Review comment: wouldn't it be easier (and also more performant) to simply make the field accessible in the constructor of the comparator? Going through all methods for every field access is not very beautiful. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org