Inline declaration of default value

This commit is contained in:
Florian Reimair 2019-02-26 16:37:46 +01:00
parent 22b4ef921b
commit 4bafea83ee
No known key found for this signature in database
GPG Key ID: 7EA8CA324B6E5633

View File

@ -151,8 +151,10 @@ public class Connection extends Capabilities implements Runnable, MessageListene
private Optional<NodeAddress> peersNodeAddressOptional = Optional.<NodeAddress>empty();
@Getter
private volatile boolean stopped;
// Use Peer as default, in case of other types they will set it as soon as possible.
@Getter
private PeerType peerType;
private PeerType peerType = PeerType.PEER;
@Getter
private final ObjectProperty<NodeAddress> peersNodeAddressProperty = new SimpleObjectProperty<>();
private final List<Tuple2<Long, String>> messageTimeStamps = new ArrayList<>();
@ -203,9 +205,6 @@ public class Connection extends Capabilities implements Runnable, MessageListene
// We create a thread for handling inputStream data
singleThreadExecutor.submit(this);
// Use Peer as default, in case of other types they will set it as soon as possible.
peerType = PeerType.PEER;
if (peersNodeAddress != null)
setPeersNodeAddress(peersNodeAddress);