TeslaCN commented on code in PR #21170:
URL: https://github.com/apache/shardingsphere/pull/21170#discussion_r979514993
##########
shardingsphere-agent/shardingsphere-agent-core/src/test/java/org/apache/shardingsphere/agent/core/util/ReflectiveUtil.java:
##########
@@ -43,8 +44,31 @@ public static void setStaticField(final Class<?> target,
final String fieldName,
for (Field each : fields) {
if (Modifier.isStatic(each.getModifiers()) &&
each.getName().equalsIgnoreCase(fieldName)) {
each.setAccessible(true);
+ Field modifiersField = getModifiersField();
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(each, each.getModifiers() &
~Modifier.FINAL);
Review Comment:
This stop working since Java 18
https://stackoverflow.com/a/69418150/7913731
--
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]