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:
parent
3f7a7949db
commit
47040bd791
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user