Skip to content

Commit 2871f21

Browse files
author
Stephane Landelle
committed
Don't use format where a simple concat is enough
1 parent 1a9f167 commit 2871f21

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

providers/netty/src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ else if (uri.getRawQuery() != null)
700700
case NONE:
701701
break;
702702
default:
703-
throw new IllegalStateException(String.format("Invalid Authentication %s", realm.toString()));
703+
throw new IllegalStateException("Invalid Authentication " + realm);
704704
}
705705
}
706706

@@ -973,7 +973,7 @@ private <T> ListenableFuture<T> doConnect(final Request request, final AsyncHand
973973

974974
// Do not throw an exception when we need an extra connection for a redirect.
975975
if (!reclaimCache && !connectionsPool.canCacheConnection()) {
976-
IOException ex = new IOException(String.format("Too many connections %s", config.getMaxTotalConnections()));
976+
IOException ex = new IOException("Too many connections " + config.getMaxTotalConnections());
977977
try {
978978
asyncHandler.onThrowable(ex);
979979
} catch (Throwable t) {
@@ -987,7 +987,7 @@ private <T> ListenableFuture<T> doConnect(final Request request, final AsyncHand
987987
if (trackConnections) {
988988
if (!reclaimCache) {
989989
if (!freeConnections.tryAcquire()) {
990-
IOException ex = new IOException(String.format("Too many connections %s", config.getMaxTotalConnections()));
990+
IOException ex = new IOException("Too many connections " + config.getMaxTotalConnections());
991991
try {
992992
asyncHandler.onThrowable(ex);
993993
} catch (Throwable t) {
@@ -1296,7 +1296,7 @@ public Object call() throws Exception {
12961296

12971297
@Override
12981298
public String toString() {
1299-
return String.format("Draining task for channel %s", ctx.getChannel());
1299+
return "Draining task for channel " + ctx.getChannel();
13001300
}
13011301
});
13021302
}
@@ -1838,7 +1838,7 @@ public synchronized void run() {
18381838
requestTimeout = p.getRequestTimeoutInMs();
18391839
}
18401840

1841-
abort(nettyResponseFuture, new TimeoutException(String.format("No response received after %s", requestTimeout)));
1841+
abort(nettyResponseFuture, new TimeoutException("No response received after " + requestTimeout));
18421842

18431843
nettyResponseFuture = null;
18441844
}

0 commit comments

Comments
 (0)