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
031c2e2e88
commit
4dc1eccf60
@ -1021,7 +1021,7 @@ abstract class AbstractHttp2StreamChannel extends DefaultAttributeMap implements
|
|||||||
* window, without having to create a new {@link WriteBufferWaterMark} object whenever the flow control window
|
* window, without having to create a new {@link WriteBufferWaterMark} object whenever the flow control window
|
||||||
* changes.
|
* changes.
|
||||||
*/
|
*/
|
||||||
private final class Http2StreamChannelConfig extends DefaultChannelConfig {
|
private static final class Http2StreamChannelConfig extends DefaultChannelConfig {
|
||||||
Http2StreamChannelConfig(Channel channel) {
|
Http2StreamChannelConfig(Channel channel) {
|
||||||
super(channel);
|
super(channel);
|
||||||
}
|
}
|
||||||
|
@ -1336,7 +1336,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 sender;
|
||||||
private final InetSocketAddress recipient;
|
private final InetSocketAddress recipient;
|
||||||
private final DnsResponse response;
|
private final DnsResponse response;
|
||||||
|
Loading…
Reference in New Issue
Block a user