Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cleanup] erefactor/EclipseJdt - Remove trailing whitespace - All lines #1752

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/com/zaxxer/hikari/pool/ProxyLeakTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void run()

final var stackTrace = exception.getStackTrace();
final var trace = new StackTraceElement[stackTrace.length - 5];

System.arraycopy(stackTrace, 5, trace, 0, trace.length);

exception.setStackTrace(trace);
Expand Down
22 changes: 11 additions & 11 deletions src/test/java/com/zaxxer/hikari/pool/TestConcurrentBag.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,36 +71,36 @@ public void testConcurrentBag() throws Exception
{
try (ConcurrentBag<PoolEntry> bag = new ConcurrentBag<>(x -> CompletableFuture.completedFuture(Boolean.TRUE))) {
assertEquals(0, bag.values(8).size());

PoolEntry reserved = pool.newPoolEntry();
bag.add(reserved);
bag.reserve(reserved); // reserved

PoolEntry inuse = pool.newPoolEntry();
bag.add(inuse);
bag.borrow(2, MILLISECONDS); // in use

PoolEntry notinuse = pool.newPoolEntry();
bag.add(notinuse); // not in use

bag.dumpState();

ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos, true);
setSlf4jTargetStream(ConcurrentBag.class, ps);

bag.requite(reserved);

bag.remove(notinuse);
assertTrue(new String(baos.toByteArray()).contains("not borrowed or reserved"));

bag.unreserve(notinuse);
assertTrue(new String(baos.toByteArray()).contains("was not reserved"));

bag.remove(inuse);
bag.remove(inuse);
assertTrue(new String(baos.toByteArray()).contains("not borrowed or reserved"));

bag.close();
try {
PoolEntry bagEntry = pool.newPoolEntry();
Expand All @@ -110,7 +110,7 @@ public void testConcurrentBag() throws Exception
catch (IllegalStateException e) {
assertTrue(new String(baos.toByteArray()).contains("ignoring add()"));
}

assertNotNull(notinuse.toString());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ public void testConnectionCloseBlocking() throws SQLException {
long start = currentTime();
try (HikariDataSource ds = new HikariDataSource(config);
Connection connection = ds.getConnection()) {

connection.close();

// Hikari only checks for validity for connections with lastAccess > 1000 ms so we sleep for 1001 ms to force
// Hikari to do a connection validation which will fail and will trigger the connection to be closed
quietlySleep(1100L);

shouldFail = true;

// on physical connection close we sleep 2 seconds
try (Connection connection2 = ds.getConnection()) {
try (Connection connection2 = ds.getConnection()) {
assertTrue("Waited longer than timeout", (elapsedMillis(start) < config.getConnectionTimeout()));
}
} catch (SQLException e) {
Expand Down
22 changes: 11 additions & 11 deletions src/test/java/com/zaxxer/hikari/pool/TestProxies.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,87 +231,87 @@ public void testOtherExceptions() throws SQLException
try (Connection conn = ds.getConnection()) {
StubConnection stubConnection = conn.unwrap(StubConnection.class);
stubConnection.throwException = true;

try {
conn.setTransactionIsolation(Connection.TRANSACTION_NONE);
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.isReadOnly();
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.setReadOnly(false);
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.setCatalog("");
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.setAutoCommit(false);
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.clearWarnings();
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.isValid(0);
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.isWrapperFor(getClass());
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.unwrap(getClass());
fail();
}
catch (SQLException e) {
// pass
}

try {
conn.close();
fail();
}
catch (SQLException e) {
// pass
}

try {
assertFalse(conn.isValid(0));
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/zaxxer/hikari/util/ClockSourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void testClockSourceDisplay()
String ds2 = msSource.elapsedDisplayString0(sTime, eTime2);
Assert.assertEquals("-59m54s795ms", ds2);


ClockSource nsSource = new ClockSource.NanosecondClockSource();

final long sTime2 = DAYS.toNanos(3) + HOURS.toNanos(9) + MINUTES.toNanos(24) + SECONDS.toNanos(18) + MILLISECONDS.toNanos(572) + MICROSECONDS.toNanos(324) + NANOSECONDS.toNanos(823);
Expand Down