Skip to content

Commit b073780

Browse files
committed
add comment about class init
1 parent 8ef7447 commit b073780

File tree

1 file changed

+4
-0
lines changed
  • modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4

1 file changed

+4
-0
lines changed

modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Utils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public InternalLogger newInstance(final String name) {
6666
public static void setup() {
6767
// TODO remove this once we get a fix into Netty so we don't have to do this
6868
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
69+
// this is triggering class initialization which triggers the reflective retrieval of
70+
// the Throwable#addSuppressed method. We need to do this to avoid
71+
// AccessControlExceptions that this code would otherwise trigger without us wrapping
72+
// it in a doPrivileged block
6973
ThrowableUtil.haveSuppressed();
7074
return null;
7175
});

0 commit comments

Comments
 (0)