danmuzi commented on code in PR #15864:
URL: https://github.com/apache/lucene/pull/15864#discussion_r2976260776
##########
lucene/core/src/java/org/apache/lucene/internal/tests/TestSecrets.java:
##########
@@ -136,7 +150,21 @@ private static void ensureNull(Object ob) {
}
}
- private static void ensureCaller() {
+ private static void ensureCallerForSetter(Class<?> allowedCaller) {
+ final boolean validCaller =
+ StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE)
Review Comment:
I also tried to avoid using RETAIN_CLASS_REFERENCE, but if we only check the
class name, couldn't someone just create a fake IndexWriter in a different
package (or classloader) to bypass the check?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]