Skip to content

Commit

Permalink
Remove redudant cast
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Mar 1, 2018
1 parent 49d1609 commit 26ab444
Showing 1 changed file with 3 additions and 7 deletions.
Expand Up @@ -49,15 +49,13 @@
import io.undertow.util.HttpString; import io.undertow.util.HttpString;
import io.undertow.util.LocaleUtils; import io.undertow.util.LocaleUtils;
import io.undertow.util.Methods; import io.undertow.util.Methods;
import org.xnio.LocalSocketAddress;


import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException; import java.nio.charset.UnsupportedCharsetException;
import java.security.AccessController; import java.security.AccessController;
Expand Down Expand Up @@ -994,11 +992,9 @@ public String getLocalName() {


@Override @Override
public String getLocalAddr() { public String getLocalAddr() {
SocketAddress address = exchange.getDestinationAddress(); InetSocketAddress address = exchange.getDestinationAddress();
if (address instanceof InetSocketAddress) { if (address != null) {
return ((InetSocketAddress) address).getAddress().getHostAddress(); return address.getAddress().getHostAddress();
} else if (address instanceof LocalSocketAddress) {
return ((LocalSocketAddress) address).getName();
} }
return null; return null;
} }
Expand Down

0 comments on commit 26ab444

Please sign in to comment.