Make inner classes static when feasible
A static nested class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class. Closes gh-28433
This commit is contained in:
parent
e26d8839b3
commit
941b92cbed
|
@ -88,7 +88,7 @@ public class UndertowHttpHandlerAdapter implements io.undertow.server.HttpHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class HandlerResultSubscriber implements Subscriber<Void> {
|
private static class HandlerResultSubscriber implements Subscriber<Void> {
|
||||||
|
|
||||||
private final HttpServerExchange exchange;
|
private final HttpServerExchange exchange;
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class FileNameVersionedResource extends AbstractResource implements HttpResource {
|
private static class FileNameVersionedResource extends AbstractResource implements HttpResource {
|
||||||
|
|
||||||
private final Resource original;
|
private final Resource original;
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class UndertowRequestUpgradeStrategy implements RequestUpgradeStrategy {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class DefaultCallback implements WebSocketConnectionCallback {
|
private static class DefaultCallback implements WebSocketConnectionCallback {
|
||||||
|
|
||||||
private final HandshakeInfo handshakeInfo;
|
private final HandshakeInfo handshakeInfo;
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class FileNameVersionedResource extends AbstractResource implements HttpResource {
|
private static class FileNameVersionedResource extends AbstractResource implements HttpResource {
|
||||||
|
|
||||||
private final Resource original;
|
private final Resource original;
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class XhrStreamingTransportHandler extends AbstractHttpSendingTransportHa
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class XhrStreamingSockJsSession extends StreamingSockJsSession {
|
private static class XhrStreamingSockJsSession extends StreamingSockJsSession {
|
||||||
|
|
||||||
public XhrStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
|
public XhrStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
|
||||||
WebSocketHandler wsHandler, Map<String, Object> attributes) {
|
WebSocketHandler wsHandler, Map<String, Object> attributes) {
|
||||||
|
|
Loading…
Reference in New Issue