diff --git a/examples/src/main/java/org/bitcoinj/examples/PeerMonitor.java b/examples/src/main/java/org/bitcoinj/examples/PeerMonitor.java index e5bf14152..49b120ab9 100644 --- a/examples/src/main/java/org/bitcoinj/examples/PeerMonitor.java +++ b/examples/src/main/java/org/bitcoinj/examples/PeerMonitor.java @@ -252,13 +252,11 @@ public class PeerMonitor { } } - private Object getAddressForPeer(Peer peer) { - String s; - s = reverseDnsLookups.get(peer); - if (s != null) - return s; - else - return peer.getAddress().getAddr().getHostAddress(); + private String getAddressForPeer(Peer peer) { + String s = reverseDnsLookups.get(peer); + return (s != null) + ? s + : peer.getAddress().getAddr().getHostAddress(); } private String getAddressesForPeer(Peer peer) {