Skip to content

Commit 03ea237

Browse files
committed
vert-x3#108: Some code formatting
Signed-off-by: Ernesto J. Perez <[email protected]>
1 parent b71503f commit 03ea237

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/main/asciidoc/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Both the PostgreSql and MySql clients take the same configuration:
220220
0 ::: No connection retries will be done
221221
`connectionRetryDelay`:: Delay in milliseconds between each retry attempt. Defaults to `5000` (= 5 seconds).
222222
`sslMode` :: If you want to enable SSL support you should enable this parameter.
223-
For example to connect Heroku you will need to useprefer*.
223+
For example to connect Heroku you will need to use *prefer*.
224224

225225
"disable" ::: only try a non-SSL connection
226226
"prefer" ::: first try an SSL connection; if that fails, try a non-SSL connection

src/main/java/io/vertx/ext/asyncsql/impl/pool/AsyncConnectionPool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ private synchronized void createConnection(Handler<AsyncResult<Connection>> hand
7373
public void handle(AsyncResult<Connection> connectionResult) {
7474
if (connectionResult.succeeded()) {
7575
handler.handle(connectionResult);
76-
} else if (maxConnectionRetries<0 || retries<maxConnectionRetries) {
76+
} else if (maxConnectionRetries < 0 || retries < maxConnectionRetries) {
7777
retries++;
78-
logger.debug("Error creating connection. Waiting " + connectionRetryDelay + " ms for the retry " +
78+
logger.debug("Error creating connection. Waiting " + connectionRetryDelay + " ms for retry " +
7979
retries + (maxConnectionRetries >= 0 ? " of " + maxConnectionRetries : ""));
8080
vertx.setTimer(connectionRetryDelay, timerId ->
8181
createAndConnect(this) // Try to connect again using this handler

src/main/java/io/vertx/ext/asyncsql/package-info.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*
1414
* You may elect to redistribute this code under either of these licenses.
1515
*/
16-
1716
@ModuleGen(name = "vertx-mysql-postgresql", groupPackage = "io.vertx") package io.vertx.ext.asyncsql;
1817

1918
import io.vertx.codegen.annotations.ModuleGen;

src/test/java/io/vertx/ext/asyncsql/impl/tool/AsyncConnectionPoolTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ public void testMaxPoolSize(TestContext context) throws InterruptedException {
7272

7373
final Queue<Connection> connectionSet = new LinkedList<>();
7474
// Ask for 50 connections
75-
for (int i=0 ; i<TEST_LENGTH ; i++) {
75+
for (int i = 0; i < TEST_LENGTH; i++) {
7676
pool.take(result -> {
77+
// We will decrease our CountDownLatch with each obtained connection
7778
countDownLatch.countDown();
7879
context.assertTrue(result.succeeded());
7980
connectionSet.add(result.result());
@@ -89,7 +90,7 @@ public void testMaxPoolSize(TestContext context) throws InterruptedException {
8990
context.assertEquals(TEST_LENGTH - MAX_POOL_SIZE, (int)countDownLatch.getCount()); // Counter should be 35
9091

9192
// We will give back the connections one by one. No new connections should be created
92-
for (int i=MAX_POOL_SIZE+1 ; i<=TEST_LENGTH ; i++) {
93+
for (int i = MAX_POOL_SIZE + 1; i <= TEST_LENGTH; i++) {
9394
pool.giveBack(connectionSet.poll());
9495
context.assertEquals(MAX_POOL_SIZE, pool.connectionAttempts);
9596
context.assertEquals(MAX_POOL_SIZE, pool.createdConnections);
@@ -136,7 +137,7 @@ public void testRetriesAndFail(TestContext context) {
136137
context.assertEquals(MAX_RETRIES + 1, pool.connectionAttempts);
137138
context.assertEquals(0, pool.createdConnections);
138139

139-
// Verify the the Vert.x timer has been used 5 times (MAX_RETRIES
140+
// Verify the the Vert.x timer has been used 5 times (MAX_RETRIES)
140141
Mockito.verify(vertx, Mockito.times(MAX_RETRIES)).setTimer(Mockito.eq(100L), Mockito.any());
141142
Mockito.verifyNoMoreInteractions(vertx);
142143

@@ -171,7 +172,7 @@ public void testRetriesAndSuccess(TestContext context) {
171172
context.assertEquals(MAX_RETRIES + 1, pool.connectionAttempts);
172173
context.assertEquals(1, pool.createdConnections);
173174

174-
// Verify the the Vert.x timer has been used 5 times (MAX_RETRIES
175+
// Verify the the Vert.x timer has been used 5 times (MAX_RETRIES)
175176
Mockito.verify(vertx, Mockito.times(MAX_RETRIES)).setTimer(Mockito.eq(100L), Mockito.any());
176177
async.complete();
177178
});

0 commit comments

Comments
 (0)