Remove unnecessary null check before equals()
This commit is contained in:
parent
58ba0de659
commit
b8f5ef0423
@ -214,13 +214,13 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
|
||||
}
|
||||
|
||||
String upgrade = response.getHeader(Names.UPGRADE);
|
||||
if (upgrade == null || !upgrade.equalsIgnoreCase(Values.WEBSOCKET)) {
|
||||
if (Values.WEBSOCKET.equalsIgnoreCase(upgrade)) {
|
||||
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
||||
+ response.getHeader(Names.UPGRADE));
|
||||
}
|
||||
|
||||
String connection = response.getHeader(Names.CONNECTION);
|
||||
if (connection == null || !connection.equalsIgnoreCase(Values.UPGRADE)) {
|
||||
if (Values.UPGRADE.equalsIgnoreCase(connection)) {
|
||||
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
||||
+ response.getHeader(Names.CONNECTION));
|
||||
}
|
||||
|
@ -190,13 +190,13 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
|
||||
}
|
||||
|
||||
String upgrade = response.getHeader(Names.UPGRADE);
|
||||
if (upgrade == null || !upgrade.equalsIgnoreCase(Values.WEBSOCKET)) {
|
||||
if (Values.WEBSOCKET.equalsIgnoreCase(upgrade)) {
|
||||
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
||||
+ response.getHeader(Names.UPGRADE));
|
||||
}
|
||||
|
||||
String connection = response.getHeader(Names.CONNECTION);
|
||||
if (connection == null || !connection.equalsIgnoreCase(Values.UPGRADE)) {
|
||||
if (Values.UPGRADE.equalsIgnoreCase(connection)) {
|
||||
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
||||
+ response.getHeader(Names.CONNECTION));
|
||||
}
|
||||
|
@ -190,13 +190,13 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
|
||||
}
|
||||
|
||||
String upgrade = response.getHeader(Names.UPGRADE);
|
||||
if (upgrade == null || !upgrade.equalsIgnoreCase(Values.WEBSOCKET)) {
|
||||
if (Values.WEBSOCKET.equalsIgnoreCase(upgrade)) {
|
||||
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
||||
+ response.getHeader(Names.UPGRADE));
|
||||
}
|
||||
|
||||
String connection = response.getHeader(Names.CONNECTION);
|
||||
if (connection == null || !connection.equalsIgnoreCase(Values.UPGRADE)) {
|
||||
if (Values.UPGRADE.equalsIgnoreCase(connection)) {
|
||||
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
||||
+ response.getHeader(Names.CONNECTION));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user