cleanups in Jetty WS API

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-09-04 17:08:44 +10:00
parent 8bbea55ed9
commit 7082e2086a
6 changed files with 7 additions and 10 deletions

View File

@ -23,7 +23,6 @@ module org.eclipse.jetty.websocket.jetty.api
exports org.eclipse.jetty.websocket.api;
exports org.eclipse.jetty.websocket.api.annotations;
exports org.eclipse.jetty.websocket.api.exceptions;
exports org.eclipse.jetty.websocket.api.extensions;
exports org.eclipse.jetty.websocket.api.util;
uses ExtensionConfig.Parser;

View File

@ -23,8 +23,8 @@ public class CloseStatus
private static final int MAX_CONTROL_PAYLOAD = 125;
public static final int MAX_REASON_PHRASE = MAX_CONTROL_PAYLOAD - 2;
private int code;
private String phrase;
private final int code;
private final String phrase;
/**
* Creates a reason for closing a web socket connection with the given code and reason phrase.

View File

@ -46,7 +46,7 @@ public interface Frame
throw new IllegalArgumentException("OpCode " + op + " is not a valid Frame.Type");
}
private byte opcode;
private final byte opcode;
Type(byte code)
{

View File

@ -39,14 +39,12 @@ public class WebSocketAdapter implements WebSocketListener
public boolean isConnected()
{
Session sess = this.session;
return (sess != null) && (sess.isOpen());
return session.isOpen();
}
public boolean isNotConnected()
{
Session sess = this.session;
return (sess == null) || (!sess.isOpen());
return !isConnected();
}
@Override

View File

@ -21,7 +21,7 @@ package org.eclipse.jetty.websocket.api.exceptions;
@SuppressWarnings("serial")
public class CloseException extends WebSocketException
{
private int statusCode;
private final int statusCode;
public CloseException(int closeCode, String message)
{

View File

@ -16,7 +16,7 @@
// ========================================================================
//
package org.eclipse.jetty.websocket.api;
package org.eclipse.jetty.websocket.api.util;
public final class WebSocketConstants
{