Skip to content

Commit b01891a

Browse files
author
Larry McQueary
committed
Merge pull request #55 from nats-io/long-exception-fixes-#30
Long exception fixes #30
2 parents 754ee25 + 2c0d748 commit b01891a

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/main/java/io/nats/client/ConnectionImpl.java

+12-7
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ class ConnectionImpl implements Connection {
172172
private Channel<Boolean> fch = new Channel<Boolean>(FLUSH_CHAN_SIZE);
173173
private List<Thread> threads = new ArrayList<Thread>();
174174

175-
ConnectionImpl() {
176-
}
175+
ConnectionImpl() {}
177176

178177
ConnectionImpl(Options opts) {
179178
this(opts, null);
@@ -505,6 +504,7 @@ public void run() {
505504
}
506505
if (opts.getClosedCallback() != null) {
507506
cbexec.execute(new Runnable() {
507+
508508
public void run() {
509509
opts.getClosedCallback().onClose(new ConnectionEvent(nc));
510510
logger.trace("executed ClosedCB");
@@ -525,7 +525,9 @@ public void run() {
525525
while (!cbexec.awaitTermination(5, TimeUnit.SECONDS)) {
526526
logger.debug("Awaiting completion of threads.");
527527
}
528-
} catch (InterruptedException e) {
528+
} catch (
529+
530+
InterruptedException e) {
529531
logger.debug("Interrupted waiting to shutdown cbexec", e);
530532
}
531533
}
@@ -894,6 +896,7 @@ public void run() {
894896
// TODO This mirrors go, and so does not spawn a thread/task.
895897
logger.trace("Spawning reconnectedCB from doReconnect()");
896898
cbexec.execute(new Runnable() {
899+
897900
public void run() {
898901
opts.getReconnectedCallback().onReconnect(new ConnectionEvent(nc));
899902

@@ -909,7 +912,9 @@ public void run() {
909912
// the lock seems important
910913
try {
911914
flush();
912-
} catch (Exception e) {
915+
} catch (
916+
917+
Exception e) {
913918
/* NOOP */
914919
}
915920
logger.trace("doReconnect reconnected successfully!");
@@ -1183,7 +1188,7 @@ public void run() {
11831188
}
11841189

11851190
protected Thread go(final Runnable task, final String name, final String group,
1186-
final Phaser ph) {
1191+
final Phaser ph) {
11871192
NATSThread.setDebug(true);
11881193
NATSThread t = new NATSThread(task, name) {
11891194
public void run() {
@@ -1261,7 +1266,7 @@ class ConnectInfo {
12611266
private String version = ConnectionImpl.this.version;
12621267

12631268
public ConnectInfo(boolean verbose, boolean pedantic, String username, String password,
1264-
String token, boolean secure, String connectionName) {
1269+
String token, boolean secure, String connectionName) {
12651270
this.verbose = new Boolean(verbose);
12661271
this.pedantic = new Boolean(pedantic);
12671272
this.user = username;
@@ -1965,7 +1970,7 @@ private void writePublishProto(ByteBuffer buffer, byte[] subject, byte[] reply,
19651970
}
19661971

19671972
// Used for handrolled itoa
1968-
static final byte[] digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
1973+
static final byte[] digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
19691974

19701975
void _publish(byte[] subject, byte[] reply, byte[] data) throws IOException {
19711976
int msgSize = (data != null) ? data.length : 0;

src/main/java/io/nats/client/Parser.java

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ protected void parse(byte[] buf, int len) throws ParseException {
205205
// what is left we fall out and process split
206206
// buffer.
207207
i = ps.as + ps.ma.size - 1;
208+
208209
break;
209210
default:
210211
// We have a leftover argBuf we'll continuing filling

0 commit comments

Comments
 (0)