Skip to content

Commit 6ac5cb2

Browse files
committed
remove unused @internal methods
1 parent 84062a1 commit 6ac5cb2

File tree

2 files changed

+7
-31
lines changed

2 files changed

+7
-31
lines changed

hibernate-c3p0/src/main/java/org/hibernate/c3p0/internal/C3P0ConnectionProvider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ public class C3P0ConnectionProvider
7474
private static final String C3P0_STYLE_MAX_STATEMENTS = "c3p0.maxStatements";
7575
private static final String C3P0_STYLE_ACQUIRE_INCREMENT = "c3p0.acquireIncrement";
7676
private static final String C3P0_STYLE_IDLE_CONNECTION_TEST_PERIOD = "c3p0.idleConnectionTestPeriod";
77-
78-
//swaldman 2006-08-28: define c3p0-style configuration parameters for initialPoolSize, which
79-
// hibernate sensibly lets default to minPoolSize, but we'll let users
80-
// override it with the c3p0-style property if they want.
77+
//swaldman 2006-08-28: define c3p0-style configuration parameters for initialPoolSize,
78+
// which hibernate sensibly lets default to minPoolSize, but we'll
79+
// let users override it with the c3p0-style property if they want.
8180
private static final String C3P0_STYLE_INITIAL_POOL_SIZE = "c3p0.initialPoolSize";
81+
8282
private DataSource dataSource;
8383
private Integer isolation;
8484
private boolean autocommit;
@@ -161,7 +161,7 @@ public void configure(Map<String, Object> properties) {
161161
jdbcDriverClass,
162162
dialect.getVersion(),
163163
Boolean.toString( autocommit ),
164-
isolation != null ? ConnectionProviderInitiator.toIsolationNiceName( isolation ) : null,
164+
isolation == null ? null : ConnectionProviderInitiator.toIsolationNiceName( isolation ),
165165
requireNonNullElse( getInteger( C3P0_STYLE_MIN_POOL_SIZE.substring( 5 ), poolSettings ),
166166
DEFAULT_MIN_POOL_SIZE ),
167167
requireNonNullElse( getInteger( C3P0_STYLE_MAX_POOL_SIZE.substring( 5 ), poolSettings ),

hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.concurrent.locks.ReentrantReadWriteLock;
2222

2323
import org.hibernate.HibernateException;
24-
import org.hibernate.Internal;
2524
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
2625
import org.hibernate.cfg.AvailableSettings;
2726
import org.hibernate.dialect.Database;
@@ -338,34 +337,19 @@ public void stop() {
338337
}
339338
}
340339

341-
//CHECKSTYLE:START_ALLOW_FINALIZER
342340
@Override
343341
protected void finalize() throws Throwable {
344342
if ( state != null ) {
345343
state.stop();
346344
}
347345
super.finalize();
348346
}
349-
//CHECKSTYLE:END_ALLOW_FINALIZER
350-
351-
/**
352-
* Exposed to facilitate testing only.
353-
*/
354-
public Properties getConnectionProperties() {
355-
BasicConnectionCreator connectionCreator = (BasicConnectionCreator) this.state.pool.connectionCreator;
356-
return connectionCreator.getConnectionProperties();
357-
}
358347

359348
@Override
360349
public boolean isValid(Connection connection) throws SQLException {
361350
return true;
362351
}
363352

364-
@Internal
365-
public void releasePooledConnections() {
366-
state.pool.releasePooledConnections();
367-
}
368-
369353
public static class PooledConnections {
370354

371355
private final ConcurrentLinkedQueue<Connection> allConnections = new ConcurrentLinkedQueue<>();
@@ -438,7 +422,7 @@ protected Connection releaseConnection(Connection conn) {
438422
return null;
439423
}
440424

441-
public Connection poll() throws SQLException {
425+
public Connection poll() {
442426
Connection conn;
443427
do {
444428
conn = availableConnections.poll();
@@ -526,13 +510,6 @@ public String getUrl() {
526510
return connectionCreator.getUrl();
527511
}
528512

529-
@Internal
530-
public void releasePooledConnections() {
531-
for ( Connection connection : allConnections ) {
532-
closeConnection( connection, null );
533-
}
534-
}
535-
536513
public static class Builder {
537514
private final ConnectionCreator connectionCreator;
538515
private ConnectionValidator connectionValidator;
@@ -641,7 +618,7 @@ public void stop() {
641618
}
642619
}
643620

644-
public Connection getConnection() throws SQLException {
621+
public Connection getConnection() {
645622
startIfNeeded();
646623
statelock.readLock().lock();
647624
try {
@@ -704,7 +681,6 @@ else if ( e != null ) {
704681
}
705682

706683
private static class ValidationThreadFactory implements ThreadFactory {
707-
708684
@Override
709685
public Thread newThread(Runnable runnable) {
710686
Thread thread = new Thread( runnable );

0 commit comments

Comments
 (0)