Remove unnecessary null check before equals()

This commit is contained in:
Trustin Lee 2012-11-10 01:34:39 +09:00
parent ff03df6851
commit f4585b9f53

View File

@ -228,13 +228,13 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
}
String upgrade = response.getHeader(Names.UPGRADE);
if (upgrade == null || !upgrade.equals(Values.WEBSOCKET)) {
if (Values.WEBSOCKET.equals(upgrade)) {
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
+ response.getHeader(Names.UPGRADE));
}
String connection = response.getHeader(Names.CONNECTION);
if (connection == null || !connection.equals(Values.UPGRADE)) {
if (Values.UPGRADE.equals(connection)) {
throw new WebSocketHandshakeException("Invalid handshake response connection: "
+ response.getHeader(Names.CONNECTION));
}