Skip to content

Commit 554f85d

Browse files
committed
minor fix.
Remove unnecessary var
1 parent fcf6a24 commit 554f85d

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

httpcore5/src/test/java/org/apache/hc/core5/pool/ConnPoolContractFuzzer.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,12 @@ private ConnPoolContractFuzzer() {
5656
}
5757

5858
private static final class PendingLease {
59-
private final String route;
6059
private final Object state;
6160
private final Future<PoolEntry<String, PoolTestSupport.DummyConn>> future;
6261

6362
private PendingLease(
64-
final String route,
6563
final Object state,
6664
final Future<PoolEntry<String, PoolTestSupport.DummyConn>> future) {
67-
this.route = route;
6865
this.state = state;
6966
this.future = future;
7067
}
@@ -116,11 +113,10 @@ static void run(
116113
case 1:
117114
case 2: {
118115
final String route = routes.get(rnd.nextInt(routes.size()));
119-
final Object state = (rnd.nextInt(4) == 0) ? null : Integer.valueOf(rnd.nextInt(3));
116+
final Object state = (rnd.nextInt(4) == 0) ? null : rnd.nextInt(3);
120117
trace.add(step + ": lease(" + route + ", state=" + state + ")");
121-
final Future<PoolEntry<String, PoolTestSupport.DummyConn>> f =
122-
pool.lease(route, state, REQUEST_TIMEOUT, null);
123-
pending.add(new PendingLease(route, state, f));
118+
final Future<PoolEntry<String, PoolTestSupport.DummyConn>> f = pool.lease(route, state, REQUEST_TIMEOUT, null);
119+
pending.add(new PendingLease(state, f));
124120
break;
125121
}
126122
case 3: {

httpcore5/src/test/java/org/apache/hc/core5/pool/PoolTestSupport.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ boolean isClosed() {
5757

5858
}
5959

60-
static final DisposalCallback<DummyConn> DISPOSAL =
61-
(final DummyConn closeable, final CloseMode closeMode) -> closeable.close(closeMode);
60+
static final DisposalCallback<DummyConn> DISPOSAL = DummyConn::close;
6261

6362
enum PoolType {
6463
STRICT,

httpcore5/src/test/java/org/apache/hc/core5/pool/TestConnPoolConcurrencyStress.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void stress(final PoolTestSupport.PoolType poolType) throws Exception {
119119
case 1:
120120
case 2: {
121121
final String route = routes.get(rnd.nextInt(routes.size()));
122-
final Object state = (rnd.nextInt(5) == 0) ? null : Integer.valueOf(rnd.nextInt(3));
122+
final Object state = (rnd.nextInt(5) == 0) ? null : rnd.nextInt(3);
123123
pending.add(pool.lease(route, state, Timeout.ofMilliseconds(200), null));
124124
break;
125125
}

0 commit comments

Comments
 (0)