Skip to content

Commit

Permalink
SpotBugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Dec 11, 2019
1 parent aefc7b4 commit 4c701f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/hudson/remoting/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ public void afterResponse(HandshakeResponse hr) {
}
}
HeaderHandler headerHandler = new HeaderHandler();
ContainerProvider.getWebSocketContainer().connectToServer(new Endpoint() {
@SuppressFBWarnings(value = "UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR", justification = "just trust me here")
class AgentEndpoint extends Endpoint {
AbstractByteArrayCommandTransport.ByteArrayReceiver receiver;
@Override
public void onOpen(Session session, EndpointConfig config) {
Expand All @@ -565,7 +566,6 @@ public void onOpen(Session session, EndpointConfig config) {
events.error(x);
}
}
@SuppressFBWarnings(value = "UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR", justification = "just trust me here")
private void onMessage(byte[] message) {
LOGGER.finest(() -> "received message of length " + message.length);
receiver.handle(message);
Expand Down Expand Up @@ -610,7 +610,9 @@ public void closeRead() throws IOException {
session.close();
}
}
}, ClientEndpointConfig.Builder.create().configurator(headerHandler).build(), URI.create(candidateUrls.get(0).toString().replaceFirst("^http", "ws") + "wsagents/"));
}
ContainerProvider.getWebSocketContainer().connectToServer(new AgentEndpoint(),
ClientEndpointConfig.Builder.create().configurator(headerHandler).build(), URI.create(candidateUrls.get(0).toString().replaceFirst("^http", "ws") + "wsagents/"));
while (ch.get() == null) {
Thread.sleep(100);
}
Expand Down

0 comments on commit 4c701f3

Please sign in to comment.