tillrohrmann commented on a change in pull request #11160: [FLINK-15094] Use
Unsafe to instantiate and construct DirectByteBuffer
URL: https://github.com/apache/flink/pull/11160#discussion_r383183769
##########
File path:
flink-core/src/main/java/org/apache/flink/core/memory/MemoryUtils.java
##########
@@ -60,32 +63,31 @@
}
}
- /** Should not be instantiated. */
- private MemoryUtils() {}
-
- private static Constructor<? extends ByteBuffer>
getDirectBufferPrivateConstructor() {
+ private static long
getClassFieldOffset(@SuppressWarnings("SameParameterValue") Class<?> cl, String
fieldName) {
+ final String errorMessage = "Could not get field '" + fieldName
+ "' offset in class '" + cl + "' for unsafe operations";
Review comment:
nit: We only need `errorMessage` in the error case. Hence, no need to create
it here.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services