Remove double and triple blank lines

This commit is contained in:
Peter Lawrey
2014-11-30 22:43:32 +02:00
parent 6dc1792f19
commit 6d4b143903
83 changed files with 9 additions and 621 deletions
@@ -75,12 +75,10 @@ public class NodeDiscovery {
}
private final DiscoveryNodeBytesMarshallable discoveryNodeBytesMarshallable;
private final AtomicReference<NodeDiscoveryEventListener> nodeDiscoveryEventListenerAtomicReference =
new AtomicReference<NodeDiscoveryEventListener>();
private KnownNodes knownNodes;
public NodeDiscovery() throws IOException {
@@ -105,7 +103,6 @@ public class NodeDiscovery {
discoveryNodeBytesMarshallable.setModificationNotifier(nodeDiscoveryBroadcaster);
}
public synchronized ReplicationHubFindByName mapByName() throws
IOException, InterruptedException {
@@ -150,7 +147,6 @@ public class NodeDiscovery {
countDownLatch.get().countDown();
}
};
nodeDiscoveryEventListenerAtomicReference.set(nodeDiscoveryEventListener);
@@ -220,7 +216,6 @@ public class NodeDiscovery {
break;
}
// we should make a local copy as this may change
final RemoteNodeValidator remoteNodeValidator = new RemoteNodeValidator() {
@@ -253,7 +248,6 @@ public class NodeDiscovery {
LOG.info("Using Remote identifier=" + identifier);
nodeDiscoveryEventListenerAtomicReference.set(null);
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig.of(8123, new
InetSocketAddress("192.168.1.253", 8123));
@@ -286,7 +280,6 @@ public class NodeDiscovery {
return addresses;
}
/**
* bitwise OR's the two bit sets or put another way, merges the source bitset into the destination bitset
* and returns the destination
@@ -311,12 +304,10 @@ public class NodeDiscovery {
return destination;
}
static byte proposeRandomUnusedIdentifier(final DirectBitSet knownIdentifiers,
boolean isFirstTime) throws UnknownHostException {
byte possible;
// the first time, rather than choosing a random number, we will choose the last value of the IP
// address as our random number, ( or at least something that is based upon it)
if (isFirstTime) {
@@ -463,7 +454,6 @@ class NodeDiscoveryBroadcaster extends UdpChannelReplicator {
externalizable.readMarshallable(out);
}
}
static class UdpSocketChannelEntryWriter implements EntryWriter {
@@ -487,7 +477,6 @@ class NodeDiscoveryBroadcaster extends UdpChannelReplicator {
in = new ByteBufferBytes(out);
}
/**
* @param socketChannel the socketChannel that we will write to
* @throws InterruptedException
@@ -526,7 +515,6 @@ class NodeDiscoveryBroadcaster extends UdpChannelReplicator {
}
class KnownNodes implements BytesMarshallable {
private Bytes activeIdentifiersBitSetBytes;
@@ -540,7 +528,6 @@ class KnownNodes implements BytesMarshallable {
this.atsDirectBitSet = new ATSDirectBitSet(this.activeIdentifiersBitSetBytes);
}
public Set<AddressAndPort> addressAndPorts() {
return addressAndPorts;
}
@@ -559,7 +546,6 @@ class KnownNodes implements BytesMarshallable {
return atsDirectBitSet;
}
@Override
public void readMarshallable(@net.openhft.lang.model.constraints.NotNull Bytes in) throws IllegalStateException {
short size = in.readShort();
@@ -606,7 +592,6 @@ class KnownNodes implements BytesMarshallable {
}
}
class AddressAndPort implements Comparable<AddressAndPort>, BytesMarshallable {
private byte[] address;
private short port;
@@ -656,7 +641,6 @@ class AddressAndPort implements Comparable<AddressAndPort>, BytesMarshallable {
return result;
}
@Override
public int compareTo(AddressAndPort o) {
int i = 0;
@@ -668,7 +652,6 @@ class AddressAndPort implements Comparable<AddressAndPort>, BytesMarshallable {
return Short.compare(port, o.port);
}
@Override
public String toString() {
return "{" +
@@ -696,10 +679,8 @@ class AddressAndPort implements Comparable<AddressAndPort>, BytesMarshallable {
return sb.toString();
}
@Override
public void readMarshallable(@net.openhft.lang.model.constraints.NotNull Bytes in) throws IllegalStateException {
short len = in.readShort();
@@ -722,7 +703,6 @@ class AddressAndPort implements Comparable<AddressAndPort>, BytesMarshallable {
}
}
class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
private AddressAndPort sourceAddressAndPort = new AddressAndPort();
@@ -788,7 +768,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
proposedIdentifiersWithHost.writeMarshallable(out);
}
private boolean writeBootstrap(Bytes out) {
@@ -838,7 +817,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
}
}
@Override
public void readMarshallable(@net.openhft.lang.model.constraints.NotNull Bytes in) throws IllegalStateException {
@@ -863,7 +841,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
return;
}
// the host and port the message came from
this.sourceAddressAndPort.readMarshallable(in);
if (sourceAddressAndPort.equals(ourAddressAndPort))
@@ -879,7 +856,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
listener.onRemoteNodeEvent(remoteNode, proposedIdentifiersWithHost);
}
public void onChange() {
if (modificationNotifier != null)
modificationNotifier.onChange();
@@ -906,7 +882,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
this.timestamp = System.currentTimeMillis();
}
AddressAndPort addressAndPort() {
return addressAndPort;
}
@@ -957,7 +932,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
}
}
/**
* sends a bootstrap message to the other nodes in the grid, the bootstrap message contains the host:port
* and perhaps even proposed identifier of the node that sent it.
@@ -970,7 +944,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
onChange();
}
}
interface NodeDiscoveryEventListener {
@@ -1061,7 +1034,6 @@ class ConcurrentExpiryMap<K extends BytesMarshallable, V extends BytesMarshallab
});
}
// this is used for expiry
private final Queue<Map.Entry<K, W<V>>> queue = new ConcurrentLinkedQueue<Map.Entry<K, W<V>>>();
@@ -1069,7 +1041,6 @@ class ConcurrentExpiryMap<K extends BytesMarshallable, V extends BytesMarshallab
return map.values();
}
void expireEntries(long timeOlderThan) {
for (; ; ) {
@@ -1087,7 +1058,6 @@ class ConcurrentExpiryMap<K extends BytesMarshallable, V extends BytesMarshallab
}
}
public static void main(String... args) {
String ip;
try {
@@ -1110,7 +1080,6 @@ class ConcurrentExpiryMap<K extends BytesMarshallable, V extends BytesMarshallab
}
}
/**
* private NetworkInterface defaultNetworkInterface() throws SocketException { NetworkInterface
* networkInterface = null
@@ -1154,7 +1123,6 @@ class ConcurrentExpiryMap<K extends BytesMarshallable, V extends BytesMarshallab
inetAddress = inetAddresses.nextElement();
}
if (inetAddress == null)
throw new IllegalStateException();