Make some inner classes static (#9624)

Motivation:
Classes `AbstractHttp2StreamChannel.Http2StreamChannelConfig`
and `DnsNameResolver.AddressedEnvelopeAdapter` may be static:
it doesn't reference its enclosing instance.

Modification:
Add `static` modifier.

Result:
Prevents a possible memory leak and uses less memory per class instance.
This commit is contained in:
Nikolay Fedorovskikh 2019-10-07 11:13:48 +05:00 committed by Norman Maurer
parent 3f7a7949db
commit 47040bd791
2 changed files with 2 additions and 2 deletions

View File

@ -1013,7 +1013,7 @@ abstract class AbstractHttp2StreamChannel extends DefaultAttributeMap implements
* window, without having to create a new {@link WriteBufferWaterMark} object whenever the flow control window
* changes.
*/
private final class Http2StreamChannelConfig extends DefaultChannelConfig {
private static final class Http2StreamChannelConfig extends DefaultChannelConfig {
Http2StreamChannelConfig(Channel channel) {
super(channel);
}

View File

@ -1327,7 +1327,7 @@ public class DnsNameResolver extends InetNameResolver {
}
}
private final class AddressedEnvelopeAdapter implements AddressedEnvelope<DnsResponse, InetSocketAddress> {
private static final class AddressedEnvelopeAdapter implements AddressedEnvelope<DnsResponse, InetSocketAddress> {
private final InetSocketAddress sender;
private final InetSocketAddress recipient;
private final DnsResponse response;