spuru9 commented on code in PR #29120:
URL: https://github.com/apache/flink/pull/29120#discussion_r3948205082
##########
flink-core/src/test/java/org/apache/flink/util/MdcLogbackCompatibilityTest.java:
##########
@@ -67,13 +66,13 @@ void testContextRestorationWorksWithNullContext() {
}
private MDCAdapter getCurrentMDCAdapter() throws Exception {
- Field adapterField = MDC.class.getDeclaredField("mdcAdapter");
+ Field adapterField = MDC.class.getDeclaredField("MDC_ADAPTER");
adapterField.setAccessible(true);
return (MDCAdapter) adapterField.get(null);
}
Review Comment:
nit: since you're already touching this line for the field rename -
`MDC.getMDCAdapter()` is public on both 1.7.36 and 2.0.19 (checked via javap),
so the reflection here isn't needed for the getter, only for `setMDCAdapter`
(which stays package-private).
```suggestion
private MDCAdapter getCurrentMDCAdapter() throws Exception {
return MDC.getMDCAdapter();
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]