Skip to content

Commit 7a9c5a1

Browse files
committed
Checkstyle violations corrected.
1 parent a1ce15f commit 7a9c5a1

11 files changed

+97
-58
lines changed

src/main/java/zmq/SocketBase.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ else if (options.recvHwm != 0 && peer.options.sendHwm != 0) {
539539
ZObject[] parents = {this, peer.socket == null ? this : peer.socket};
540540

541541
boolean conflate = options.conflate && (options.type == ZMQ.ZMQ_DEALER || options.type == ZMQ.ZMQ_PULL
542-
|| options.type == ZMQ.ZMQ_PUSH || options.type == ZMQ.ZMQ_PUB || options.type == ZMQ.ZMQ_SUB);
542+
|| options.type == ZMQ.ZMQ_PUSH || options.type == ZMQ.ZMQ_PUB
543+
|| options.type == ZMQ.ZMQ_SUB);
543544

544545
int[] hwms = {conflate ? -1 : sndhwm, conflate ? -1 : rcvhwm};
545546
boolean[] conflates = {conflate, conflate};
@@ -624,7 +625,7 @@ else if (options.recvHwm != 0 && peer.options.sendHwm != 0) {
624625
}
625626

626627
boolean isSingleConnect = options.type == ZMQ.ZMQ_DEALER || options.type == ZMQ.ZMQ_SUB
627-
|| options.type == ZMQ.ZMQ_REQ;
628+
|| options.type == ZMQ.ZMQ_REQ;
628629

629630
if (isSingleConnect) {
630631
if (endpoints.hasValues(addr)) {
@@ -660,7 +661,8 @@ else if (options.recvHwm != 0 && peer.options.sendHwm != 0) {
660661
// Create a bi-directional pipe.
661662
ZObject[] parents = {this, session};
662663
boolean conflate = options.conflate && (options.type == ZMQ.ZMQ_DEALER || options.type == ZMQ.ZMQ_PULL
663-
|| options.type == ZMQ.ZMQ_PUSH || options.type == ZMQ.ZMQ_PUB || options.type == ZMQ.ZMQ_SUB);
664+
|| options.type == ZMQ.ZMQ_PUSH || options.type == ZMQ.ZMQ_PUB
665+
|| options.type == ZMQ.ZMQ_SUB);
664666

665667
int[] hwms = {conflate ? -1 : options.sendHwm, conflate ? -1 : options.recvHwm};
666668
boolean[] conflates = {conflate, conflate};

src/main/java/zmq/io/net/NetProtocol.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ public void resolve(Address paddr, boolean ipv6)
6767
paddr.resolve(ipv6);
6868
}
6969
},
70-
vmci(true, true),
71-
;
70+
vmci(true, true);
7271

73-
private static final Map<NetProtocol,NetworkProtocolProvider > providers;
72+
private static final Map<NetProtocol, NetworkProtocolProvider> providers;
7473
static {
7574
providers = new HashMap<>(NetProtocol.values().length);
7675
providers.put(NetProtocol.tcp, new TcpNetworkProtocolProvider());
@@ -93,7 +92,8 @@ public void resolve(Address paddr, boolean ipv6)
9392
this.isMulticast = isMulticast;
9493
}
9594

96-
public boolean isValid() {
95+
public boolean isValid()
96+
{
9797
return providers.containsKey(this) && providers.get(this).isValid();
9898
}
9999

@@ -133,7 +133,8 @@ public IZAddress zresolve(String addr, boolean ipv6)
133133
}
134134

135135
public void startConnecting(Options options, IOThread ioThread, SessionBase session, Address addr,
136-
boolean delayedStart, Consumer<Own> launchChild, BiConsumer<SessionBase, IEngine> sendAttach) {
136+
boolean delayedStart, Consumer<Own> launchChild, BiConsumer<SessionBase, IEngine> sendAttach)
137+
{
137138
providers.get(this).startConnecting(options, ioThread, session, addr, delayedStart, launchChild, sendAttach);
138139
}
139140
}

src/main/java/zmq/io/net/NetworkProtocolProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
import zmq.io.SessionBase;
1212
import zmq.io.net.Address.IZAddress;
1313

14-
public interface NetworkProtocolProvider {
14+
public interface NetworkProtocolProvider
15+
{
1516
boolean handleProtocol(NetProtocol protocol);
1617
Listener getListener(IOThread ioThread, SocketBase socket, Options options);
1718
IZAddress zresolve(String addr, boolean ipv6);
1819
void startConnecting(Options options, IOThread ioThread, SessionBase session, Address addr, boolean delayedStart,
1920
Consumer<Own> launchChild, BiConsumer<SessionBase, IEngine> sendAttach);
2021
boolean isValid();
21-
2222
}

src/main/java/zmq/io/net/inproc/InprocNetworkProtocolProvider.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,39 @@
1515
import zmq.io.net.NetProtocol;
1616
import zmq.io.net.NetworkProtocolProvider;
1717

18-
public class InprocNetworkProtocolProvider implements NetworkProtocolProvider {
19-
18+
public class InprocNetworkProtocolProvider implements NetworkProtocolProvider
19+
{
2020
@Override
21-
public boolean handleProtocol(NetProtocol protocol) {
21+
public boolean handleProtocol(NetProtocol protocol)
22+
{
2223
return protocol == NetProtocol.inproc;
2324
}
2425

2526
@Override
2627
public Listener getListener(IOThread ioThread, SocketBase socket,
27-
Options options) {
28+
Options options)
29+
{
2830
return null;
2931
}
3032

3133
@Override
32-
public IZAddress zresolve(String addr, boolean ipv6) {
34+
public IZAddress zresolve(String addr, boolean ipv6)
35+
{
3336
return null;
3437
}
3538

3639
@Override
3740
public void startConnecting(Options options, IOThread ioThread,
3841
SessionBase session, Address addr,
3942
boolean delayedStart, Consumer<Own> launchChild,
40-
BiConsumer<SessionBase, IEngine> sendAttach) {
43+
BiConsumer<SessionBase, IEngine> sendAttach)
44+
{
4145
assert false;
4246
}
4347

4448
@Override
45-
public boolean isValid() {
49+
public boolean isValid()
50+
{
4651
return true;
4752
}
48-
4953
}

src/main/java/zmq/io/net/ipc/IpcNetworkProtocolProvider.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,40 @@
1515
import zmq.io.net.NetProtocol;
1616
import zmq.io.net.NetworkProtocolProvider;
1717

18-
public class IpcNetworkProtocolProvider implements NetworkProtocolProvider {
18+
public class IpcNetworkProtocolProvider implements NetworkProtocolProvider
19+
{
1920
@Override
20-
public boolean handleProtocol(NetProtocol protocol) {
21+
public boolean handleProtocol(NetProtocol protocol)
22+
{
2123
return protocol == NetProtocol.ipc;
2224
}
2325

2426
@Override
2527
public Listener getListener(IOThread ioThread, SocketBase socket,
26-
Options options) {
28+
Options options)
29+
{
2730
return new IpcListener(ioThread, socket, options);
2831
}
2932

3033
@Override
31-
public IZAddress zresolve(String addr, boolean ipv6) {
34+
public IZAddress zresolve(String addr, boolean ipv6)
35+
{
3236
return new IpcAddress(addr);
3337
}
3438

3539
@Override
3640
public void startConnecting(Options options, IOThread ioThread,
3741
SessionBase session, Address addr,
3842
boolean delayedStart, Consumer<Own> launchChild,
39-
BiConsumer<SessionBase, IEngine> sendAttach) {
43+
BiConsumer<SessionBase, IEngine> sendAttach)
44+
{
4045
IpcConnecter connecter = new IpcConnecter(ioThread, session, options, addr, delayedStart);
4146
launchChild.accept(connecter);
4247
}
4348

4449
@Override
45-
public boolean isValid() {
50+
public boolean isValid()
51+
{
4652
return true;
4753
}
4854
}

src/main/java/zmq/io/net/norm/NormNetworkProtocolProvider.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,26 @@
1616
import zmq.io.net.NetProtocol;
1717
import zmq.io.net.NetworkProtocolProvider;
1818

19-
public class NormNetworkProtocolProvider implements NetworkProtocolProvider {
19+
public class NormNetworkProtocolProvider implements NetworkProtocolProvider
20+
{
2021
@Override
21-
public boolean handleProtocol(NetProtocol protocol) {
22+
public boolean handleProtocol(NetProtocol protocol)
23+
{
2224
// TODO Auto-generated method stub
2325
return false;
2426
}
2527

2628
@Override
2729
public Listener getListener(IOThread ioThread, SocketBase socket,
28-
Options options) {
30+
Options options)
31+
{
2932
// TODO Auto-generated method stub
3033
return null;
3134
}
3235

3336
@Override
34-
public IZAddress zresolve(String addr, boolean ipv6) {
37+
public IZAddress zresolve(String addr, boolean ipv6)
38+
{
3539
// TODO Auto-generated method stub
3640
return null;
3741
}
@@ -41,7 +45,8 @@ public void startConnecting(Options options, IOThread ioThread,
4145
SessionBase session, Address addr,
4246
boolean delayedStart,
4347
Consumer<Own> launchChild,
44-
BiConsumer<SessionBase, IEngine> sendAttach) {
48+
BiConsumer<SessionBase, IEngine> sendAttach)
49+
{
4550
// At this point we'll create message pipes to the session straight
4651
// away. There's no point in delaying it as no concept of 'connect'
4752
// exists with NORM anyway.
@@ -62,8 +67,8 @@ public void startConnecting(Options options, IOThread ioThread,
6267
}
6368

6469
@Override
65-
public boolean isValid() {
70+
public boolean isValid()
71+
{
6672
return false;
6773
}
68-
6974
}

src/main/java/zmq/io/net/pgm/EpgmNetworkProtocolProvider.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
import zmq.io.net.NetProtocol;
44

5-
public class EpgmNetworkProtocolProvider extends PgmNetworkProtocolProvider {
5+
public class EpgmNetworkProtocolProvider extends PgmNetworkProtocolProvider
6+
{
67
@Override
7-
public boolean handleProtocol(NetProtocol protocol) {
8+
public boolean handleProtocol(NetProtocol protocol)
9+
{
810
return protocol == NetProtocol.epgm;
911
}
1012

1113
@Override
12-
protected boolean withUdpEncapsulation() {
14+
protected boolean withUdpEncapsulation()
15+
{
1316
return true;
1417
}
1518
}

src/main/java/zmq/io/net/pgm/PgmNetworkProtocolProvider.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,33 @@
1616
import zmq.io.net.NetProtocol;
1717
import zmq.io.net.NetworkProtocolProvider;
1818

19-
public class PgmNetworkProtocolProvider implements NetworkProtocolProvider {
20-
19+
public class PgmNetworkProtocolProvider implements NetworkProtocolProvider
20+
{
2121
@Override
22-
public boolean handleProtocol(NetProtocol protocol) {
22+
public boolean handleProtocol(NetProtocol protocol)
23+
{
2324
return protocol == NetProtocol.pgm;
2425
}
2526

2627
@Override
2728
public Listener getListener(IOThread ioThread, SocketBase socket,
28-
Options options) {
29+
Options options)
30+
{
2931
return null;
3032
}
3133

3234
@Override
33-
public IZAddress zresolve(String addr, boolean ipv6) {
35+
public IZAddress zresolve(String addr, boolean ipv6)
36+
{
3437
return null;
3538
}
3639

3740
@Override
3841
public void startConnecting(Options options, IOThread ioThread,
3942
SessionBase session, Address addr,
4043
boolean delayedStart, Consumer<Own> launchChild,
41-
BiConsumer<SessionBase, IEngine> sendAttach) {
44+
BiConsumer<SessionBase, IEngine> sendAttach)
45+
{
4246
assert (options.type == ZMQ.ZMQ_PUB || options.type == ZMQ.ZMQ_XPUB || options.type == ZMQ.ZMQ_SUB
4347
|| options.type == ZMQ.ZMQ_XSUB);
4448

@@ -63,14 +67,15 @@ public void startConnecting(Options options, IOThread ioThread,
6367
sendAttach.accept(session, pgmReceiver);
6468
}
6569
}
66-
67-
protected boolean withUdpEncapsulation() {
70+
71+
protected boolean withUdpEncapsulation()
72+
{
6873
return false;
6974
}
7075

7176
@Override
72-
public boolean isValid() {
77+
public boolean isValid()
78+
{
7379
return false;
7480
}
75-
7681
}

src/main/java/zmq/io/net/tcp/TcpAddress.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public ProtocolFamily family()
5757
if (address.getAddress() instanceof Inet6Address) {
5858
return StandardProtocolFamily.INET6;
5959
}
60-
return StandardProtocolFamily.INET;
60+
else {
61+
return StandardProtocolFamily.INET;
62+
}
6163
}
6264

6365
// The opposite to resolve()

src/main/java/zmq/io/net/tcp/TcpNetworkProtocolProvider.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,33 @@
1515
import zmq.io.net.NetProtocol;
1616
import zmq.io.net.NetworkProtocolProvider;
1717

18-
public class TcpNetworkProtocolProvider implements NetworkProtocolProvider {
18+
public class TcpNetworkProtocolProvider implements NetworkProtocolProvider
19+
{
1920
@Override
20-
public boolean handleProtocol(NetProtocol protocol) {
21+
public boolean handleProtocol(NetProtocol protocol)
22+
{
2123
return protocol == NetProtocol.tcp;
2224
}
2325

2426
@Override
2527
public Listener getListener(IOThread ioThread, SocketBase socket,
26-
Options options) {
28+
Options options)
29+
{
2730
return new TcpListener(ioThread, socket, options);
2831
}
2932

3033
@Override
31-
public IZAddress zresolve(String addr, boolean ipv6) {
34+
public IZAddress zresolve(String addr, boolean ipv6)
35+
{
3236
return new TcpAddress(addr, ipv6);
3337
}
3438

3539
@Override
3640
public void startConnecting(Options options, IOThread ioThread,
3741
SessionBase session, Address addr,
3842
boolean delayedStart, Consumer<Own> launchChild,
39-
BiConsumer<SessionBase, IEngine> sendAttach) {
43+
BiConsumer<SessionBase, IEngine> sendAttach)
44+
{
4045
if (options.socksProxyAddress != null) {
4146
Address proxyAddress = new Address(NetProtocol.tcp, options.socksProxyAddress);
4247
SocksConnecter connecter = new SocksConnecter(ioThread, session, options, addr, proxyAddress, delayedStart);
@@ -49,7 +54,8 @@ public void startConnecting(Options options, IOThread ioThread,
4954
}
5055

5156
@Override
52-
public boolean isValid() {
57+
public boolean isValid()
58+
{
5359
return true;
5460
}
5561
}

0 commit comments

Comments
 (0)