Polishing Javadoc suggested by IDEA

pull/2241/head
Yanming Zhou 4 months ago
parent 80d30d34c9
commit fc4f9a99cc

@ -145,9 +145,9 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Construct a HikariConfig from the specified property file name. <code>propertyFileName</code>
* Construct a HikariConfig from the specified property file name. <code>propertyFileName</code>
* will first be treated as a path in the file-system, and if that fails the
* Class.getResourceAsStream(propertyFileName) will be tried.
* <code>Class.getResourceAsStream(propertyFileName)</code> will be tried.
*
* @param propertyFileName the name of the property file
*/
@ -397,7 +397,7 @@ public class HikariConfig implements HikariConfigMXBean
/**
* Set the SQL string that will be executed on all new connections when they are
* created, before they are added to the pool. If this query fails, it will be
* created, before they are added to the pool. If this query fails, it will be
* treated as a failed connection attempt.
*
* @param connectionInitSql the SQL to execute on new connections
@ -420,7 +420,7 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Set a {@link DataSource} for the pool to explicitly wrap. This setter is not
* Set a {@link DataSource} for the pool to explicitly wrap. This setter is not
* available through property file based initialization.
*
* @param dataSource a specific {@link DataSource} to be wrapped by the pool
@ -456,7 +456,7 @@ public class HikariConfig implements HikariConfigMXBean
* Add a property (name/value pair) that will be used to configure the {@link DataSource}/{@link java.sql.Driver}.
* <p>
* In the case of a {@link DataSource}, the property names will be translated to Java setters following the Java Bean
* naming convention. For example, the property {@code cachePrepStmts} will translate into {@code setCachePrepStmts()}
* naming convention. For example, the property {@code cachePrepStmts} will translate into {@code setCachePrepStmts()}
* with the {@code value} passed as a parameter.
* <p>
* In the case of a {@link java.sql.Driver}, the property will be added to a {@link Properties} instance that will
@ -568,8 +568,8 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Set whether or not pool suspension is allowed. There is a performance
* impact when pool suspension is enabled. Unless you need it (for a
* Set whether pool suspension is allowed. There is a performance
* impact when pool suspension is enabled. Unless you need it (for a
* redundancy system for example) do not enable it.
*
* @param isAllowPoolSuspension the desired pool suspension allowance
@ -581,7 +581,7 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Get the pool initialization failure timeout. See {@code #setInitializationFailTimeout(long)}
* Get the pool initialization failure timeout. See {@code #setInitializationFailTimeout(long)}
* for details.
*
* @return the number of milliseconds before the pool initialization fails
@ -593,32 +593,32 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Set the pool initialization failure timeout. This setting applies to pool
* Set the pool initialization failure timeout. This setting applies to pool
* initialization when {@link HikariDataSource} is constructed with a {@link HikariConfig},
* or when {@link HikariDataSource} is constructed using the no-arg constructor
* and {@link HikariDataSource#getConnection()} is called.
* <ul>
* <li>Any value greater than zero will be treated as a timeout for pool initialization.
* The calling thread will be blocked from continuing until a successful connection
* to the database, or until the timeout is reached. If the timeout is reached, then
* to the database, or until the timeout is reached. If the timeout is reached, then
* a {@code PoolInitializationException} will be thrown. </li>
* <li>A value of zero will <i>not</i> prevent the pool from starting in the
* <li>A value of zero will <i>not</i> prevent the pool from starting in the
* case that a connection cannot be obtained. However, upon start the pool will
* attempt to obtain a connection and validate that the {@code connectionTestQuery}
* and {@code connectionInitSql} are valid. If those validations fail, an exception
* will be thrown. If a connection cannot be obtained, the validation is skipped
* and {@code connectionInitSql} are valid. If those validations fail, an exception
* will be thrown. If a connection cannot be obtained, the validation is skipped
* and the the pool will start and continue to try to obtain connections in the
* background. This can mean that callers to {@code DataSource#getConnection()} may
* background. This can mean that callers to {@code DataSource#getConnection()} may
* encounter exceptions. </li>
* <li>A value less than zero will bypass any connection attempt and validation during
* startup, and therefore the pool will start immediately. The pool will continue to
* startup, and therefore the pool will start immediately. The pool will continue to
* try to obtain connections in the background. This can mean that callers to
* {@code DataSource#getConnection()} may encounter exceptions. </li>
* </ul>
* Note that if this timeout value is greater than or equal to zero (0), and therefore an
* initial connection validation is performed, this timeout does not override the
* {@code connectionTimeout} or {@code validationTimeout}; they will be honored before this
* timeout is applied. The default value is one millisecond.
* timeout is applied. The default value is one millisecond.
*
* @param initializationFailTimeout the number of milliseconds before the
* pool initialization fails, or 0 to validate connection setup but continue with
@ -633,7 +633,7 @@ public class HikariConfig implements HikariConfigMXBean
/**
* Determine whether internal pool queries, principally aliveness checks, will be isolated in their own transaction
* via {@link Connection#rollback()}. Defaults to {@code false}.
* via {@link Connection#rollback()}. Defaults to {@code false}.
*
* @return {@code true} if internal pool queries are isolated, {@code false} if not
*/
@ -644,7 +644,7 @@ public class HikariConfig implements HikariConfigMXBean
/**
* Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction
* via {@link Connection#rollback()}. Defaults to {@code false}.
* via {@link Connection#rollback()}. Defaults to {@code false}.
*
* @param isolate {@code true} if internal pool queries should be isolated, {@code false} if not
*/
@ -669,7 +669,7 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Get the MetricRegistry instance to use for registration of metrics used by HikariCP. Default is {@code null}.
* Get the MetricRegistry instance to use for registration of metrics used by HikariCP. Default is {@code null}.
*
* @return the MetricRegistry instance that will be used
*/
@ -702,7 +702,7 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Get the HealthCheckRegistry that will be used for registration of health checks by HikariCP. Currently only
* Get the HealthCheckRegistry that will be used for registration of health checks by HikariCP. Currently only
* Codahale/DropWizard is supported for health checks.
*
* @return the HealthCheckRegistry instance that will be used
@ -713,8 +713,8 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Set the HealthCheckRegistry that will be used for registration of health checks by HikariCP. Currently only
* Codahale/DropWizard is supported for health checks. Default is {@code null}.
* Set the HealthCheckRegistry that will be used for registration of health checks by HikariCP. Currently only
* Codahale/DropWizard is supported for health checks. Default is {@code null}.
*
* @param healthCheckRegistry the HealthCheckRegistry to be used
*/
@ -821,7 +821,7 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Set the name of the connection pool. This is primarily used in logging and JMX management consoles
* Set the name of the connection pool. This is primarily used in logging and JMX management consoles
* to identify pools and pool configurations
*
* @param poolName the name of the connection pool to use
@ -951,8 +951,8 @@ public class HikariConfig implements HikariConfigMXBean
}
/**
* Set the default transaction isolation level. The specified value is the
* constant name from the <code>Connection</code> class, eg.
* Set the default transaction isolation level. The specified value is the
* constant name from the <code>Connection</code> class, for example:
* <code>TRANSACTION_REPEATABLE_READ</code>.
*
* @param isolationLevel the name of the isolation level
@ -1143,7 +1143,7 @@ public class HikariConfig implements HikariConfigMXBean
LOGGER.warn("{} - idleTimeout is less than 10000ms, setting to default {}ms.", poolName, IDLE_TIMEOUT);
idleTimeout = IDLE_TIMEOUT;
}
else if (idleTimeout != IDLE_TIMEOUT && idleTimeout != 0 && minIdle == maxPoolSize) {
else if (idleTimeout != IDLE_TIMEOUT && idleTimeout != 0 && minIdle == maxPoolSize) {
LOGGER.warn("{} - idleTimeout has been set but has no effect because the pool is operating as a fixed size pool.", poolName);
}
}

@ -19,7 +19,7 @@ package com.zaxxer.hikari;
import com.zaxxer.hikari.util.Credentials;
/**
* The javax.management MBean for a Hikari pool configuration.
* The {@code javax.management} MBean for a Hikari pool configuration.
*
* @author Brett Wooldridge
*/
@ -116,7 +116,7 @@ public interface HikariConfigMXBean
/**
* The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool,
* including both idle and in-use connections. If the idle connections dip below this value, HikariCP will
* make a best effort to restore them quickly and efficiently.
* make the best effort to restore them quickly and efficiently.
*
* @return the minimum number of connections in the pool
*/
@ -125,7 +125,7 @@ public interface HikariConfigMXBean
/**
* The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool,
* including both idle and in-use connections. If the idle connections dip below this value, HikariCP will
* make a best effort to restore them quickly and efficiently.
* make the best effort to restore them quickly and efficiently.
*
* @param minIdle the minimum number of idle connections in the pool to maintain
*/

@ -47,12 +47,12 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
private volatile HikariPool pool;
/**
* Default constructor. Setters are used to configure the pool. Using
* Default constructor. Setters are used to configure the pool. Using
* this constructor vs. {@link #HikariDataSource(HikariConfig)} will
* result in {@link #getConnection()} performance that is slightly lower
* due to lazy initialization checks.
*
* The first call to {@link #getConnection()} starts the pool. Once the pool
* <p>
* The first call to {@link #getConnection()} starts the pool. Once the pool
* is started, the configuration is "sealed" and no further configuration
* changes are possible -- except via {@link HikariConfigMXBean} methods.
*/
@ -62,10 +62,10 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
}
/**
* Construct a HikariDataSource with the specified configuration. The
* Construct a HikariDataSource with the specified configuration. The
* {@link HikariConfig} is copied and the pool is started by invoking this
* constructor.
*
* <p>
* The {@link HikariConfig} can be modified without affecting the HikariDataSource
* and used to initialize another HikariDataSource instance.
*
@ -297,7 +297,7 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
}
/**
* Get the {@code HikariPoolMXBean} for this HikariDataSource instance. If this method is called on
* Get the {@code HikariPoolMXBean} for this HikariDataSource instance. If this method is called on
* a {@code HikariDataSource} that has been constructed without a {@code HikariConfig} instance,
* and before an initial call to {@code #getConnection()}, the return value will be {@code null}.
*
@ -319,9 +319,9 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
}
/**
* Evict a connection from the pool. If the connection has already been closed (returned to the pool)
* Evict a connection from the pool. If the connection has already been closed (returned to the pool)
* this may result in a "soft" eviction; the connection will be evicted sometime in the future if it is
* currently in use. If the connection has not been closed, the eviction is immediate.
* currently in use. If the connection has not been closed, the eviction is immediate.
*
* @param connection the connection to evict from the pool
*/

@ -19,7 +19,7 @@ package com.zaxxer.hikari;
import javax.sql.DataSource;
/**
* The javax.management MBean for a Hikari pool instance.
* The {@code javax.management} MBean for a Hikari pool instance.
*
* @author Brett Wooldridge
*/
@ -28,7 +28,7 @@ public interface HikariPoolMXBean
/**
* Get the number of currently idle connections in the pool.
* <p>
* The return value is extremely transient and is a point-in-time measurement. Therefore, due to a time
* The return value is extremely transient and is a point-in-time measurement. Therefore, due to a time
* difference between invoking this method and {@link #getActiveConnections()}, it is possible for the sum
* of idle plus active connections to be either less than or greater than the value returned by
* {@link #getTotalConnections()}.
@ -40,7 +40,7 @@ public interface HikariPoolMXBean
/**
* Get the number of currently active connections in the pool.
* <p>
* The return value is extremely transient and is a point-in-time measurement. Therefore, due to a time
* The return value is extremely transient and is a point-in-time measurement. Therefore, due to a time
* difference between invoking this method and {@link #getIdleConnections()}, it is possible for the sum
* of idle plus active connections to be either less than or greater than the value returned by
* {@link #getTotalConnections()}.
@ -50,7 +50,7 @@ public interface HikariPoolMXBean
int getActiveConnections();
/**
* Get the total number of connections currently in the pool. The return value is transient and is a
* Get the total number of connections currently in the pool. The return value is transient and is a
* point-in-time measurement.
*
* @return the total number of connections in the pool
@ -58,7 +58,7 @@ public interface HikariPoolMXBean
int getTotalConnections();
/**
* Get the number of threads awaiting connections from the pool. The return value is extremely transient and is
* Get the number of threads awaiting connections from the pool. The return value is extremely transient and is
* a point-in-time measurement.
*
* @return the number of threads awaiting a connection from the pool
@ -72,7 +72,7 @@ public interface HikariPoolMXBean
void softEvictConnections();
/**
* Suspend the pool. When the pool is suspended, threads calling {@link DataSource#getConnection()} will be
* Suspend the pool. When the pool is suspended, threads calling {@link DataSource#getConnection()} will be
* blocked <i>with no timeout</i> until the pool is resumed via the {@link #resumePool()} method.
* <br>
* This method has no effect unless the {@link HikariConfig#setAllowPoolSuspension(boolean)} method or equivalent
@ -81,7 +81,7 @@ public interface HikariPoolMXBean
void suspendPool();
/**
* Resume the pool. Enables connection borrowing to resume on a pool that has been suspended via the
* Resume the pool. Enables connection borrowing to resume on a pool that has been suspended via the
* {@link #suspendPool()} method.
* <br>
* This method has no effect unless the {@link HikariConfig#setAllowPoolSuspension(boolean)} method or equivalent

@ -4,9 +4,9 @@ import java.sql.SQLException;
/**
* Users can implement this interface to override the default SQLException handling
* of HikariCP. By the time an instance of this interface is invoked HikariCP has
* of HikariCP. By the time an instance of this interface is invoked HikariCP has
* already made a determination to evict the Connection from the pool.
*
* <p>
* If the {@link #adjudicate(SQLException)} method returns {@link Override#CONTINUE_EVICT} the eviction will occur, but if the
* method returns {@link Override#DO_NOT_EVICT} the eviction will be elided.
*/

@ -68,7 +68,7 @@ public class HikariConnectionProvider implements ConnectionProvider, Configurabl
this.hds = null;
if (Version.getVersionString().substring(0, 5).compareTo("4.3.6") >= 1) {
LOGGER.warn("com.zaxxer.hikari.hibernate.HikariConnectionProvider has been deprecated for versions of "
+ "Hibernate 4.3.6 and newer. Please switch to org.hibernate.hikaricp.internal.HikariCPConnectionProvider.");
+ "Hibernate 4.3.6 and newer. Please switch to org.hibernate.hikaricp.internal.HikariCPConnectionProvider.");
}
}

@ -109,5 +109,5 @@ public abstract class PoolStats
return true;
}
}
}
}
}

@ -28,13 +28,13 @@ import java.sql.SQLException;
import java.util.concurrent.TimeUnit;
/**
* Provides Dropwizard HealthChecks. Two health checks are provided:
* Provides Dropwizard HealthChecks. Two health checks are provided:
* <ul>
* <li>ConnectivityCheck</li>
* <li>Connection99Percent</li>
* </ul>
* The ConnectivityCheck will use the <code>connectionTimeout</code>, unless the health check property
* <code>connectivityCheckTimeoutMs</code> is defined. However, if either the <code>connectionTimeout</code>
* <code>connectivityCheckTimeoutMs</code> is defined. However, if either the <code>connectionTimeout</code>
* or the <code>connectivityCheckTimeoutMs</code> is 0 (infinite), a timeout of 10 seconds will be used.
* <p>
* The Connection99Percent health check will only be registered if the health check property

@ -276,7 +276,7 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag
}
/**
* Set a metrics registry to be used when registering metrics collectors. The HikariDataSource prevents this
* Set a metrics registry to be used when registering metrics collectors. The HikariDataSource prevents this
* method from being called more than once.
*
* @param metricRegistry the metrics registry instance to use
@ -311,7 +311,7 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag
}
/**
* Set the health check registry to be used when registering health checks. Currently only Codahale health
* Set the health check registry to be used when registering health checks. Currently only Codahale health
* checks are supported.
*
* @param healthCheckRegistry the health check registry instance to use
@ -470,7 +470,7 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag
// ***********************************************************************
/**
* Creating new poolEntry. If maxLifetime is configured, create a future End-of-life task with 2.5% variance from
* Creating new poolEntry. If maxLifetime is configured, create a future End-of-life task with 2.5% variance from
* the maxLifetime time to ensure there is no massive die-off of Connections in the pool.
*/
private PoolEntry createPoolEntry()
@ -603,11 +603,11 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag
}
/**
* "Soft" evict a Connection (/PoolEntry) from the pool. If this method is being called by the user directly
* "Soft" evict a Connection (/PoolEntry) from the pool. If this method is being called by the user directly
* through {@link com.zaxxer.hikari.HikariDataSource#evictConnection(Connection)} then {@code owner} is {@code true}.
*
* <p>
* If the caller is the owner, or if the Connection is idle (i.e. can be "reserved" in the {@link ConcurrentBag}),
* then we can close the connection immediately. Otherwise, we leave it "marked" for eviction so that it is evicted
* then we can close the connection immediately. Otherwise, we leave it "marked" for eviction so that it is evicted
* the next time someone tries to acquire it from the pool.
*
* @param poolEntry the PoolEntry (/Connection) to "soft" evict from the pool
@ -627,8 +627,8 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag
}
/**
* Create/initialize the Housekeeping service {@link ScheduledExecutorService}. If the user specified an Executor
* to be used in the {@link HikariConfig}, then we use that. If no Executor was specified (typical), then create
* Create/initialize the Housekeeping service {@link ScheduledExecutorService}. If the user specified an Executor
* to be used in the {@link HikariConfig}, then we use that. If no Executor was specified (typical), then create
* an Executor and configure it.
*
* @return either the user specified {@link ScheduledExecutorService}, or the one we created
@ -679,11 +679,11 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag
/**
* Create a timeout exception (specifically, {@link SQLTransientConnectionException}) to be thrown, because a
* timeout occurred when trying to acquire a Connection from the pool. If there was an underlying cause for the
* timeout occurred when trying to acquire a Connection from the pool. If there was an underlying cause for the
* timeout, e.g. a SQLException thrown by the driver while trying to create a new Connection, then use the
* SQL State from that exception as our own and additionally set that exception as the "next" SQLException inside
* our exception.
*
* <p>
* As a side effect, log the timeout failure at DEBUG, and record the timeout failure in the metrics tracker.
*
* @param startTime the start time (timestamp) of the acquisition attempt
@ -769,7 +769,7 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag
/**
* We only create connections if we need another idle connection or have threads still waiting
* for a new connection. Otherwise we bail out of the request to create.
* for a new connection. Otherwise, we bail out of the request to create.
*
* @return true if we should create a connection, false if the need has disappeared
*/

@ -347,7 +347,7 @@ abstract class PoolBase
/**
* Obtain connection from data source.
*
* @return a Connection connection
* @return a connection
*/
private Connection newConnection() throws Exception
{
@ -388,7 +388,7 @@ abstract class PoolBase
}
/**
* Setup a connection initial state.
* Set up a connection initial state.
*
* @param connection a Connection
* @throws ConnectionSetupException thrown if any exception is encountered
@ -517,7 +517,7 @@ abstract class PoolBase
/**
* Set the network timeout, if <code>isUseNetworkTimeout</code> is <code>true</code> and the
* driver supports it. Return the pre-existing value of the network timeout.
* driver supports it. Return the pre-existing value of the network timeout.
*
* @param connection the connection to set the network timeout on
* @param timeoutMs the number of milliseconds before timeout
@ -630,7 +630,7 @@ abstract class PoolBase
/**
* This will create a string for debug logging. Given a set of "reset bits", this
* method will return a concatenated string, for example:
*
* <p>
* Input : 0b00110
* Output: "autoCommit, isolation"
*
@ -700,7 +700,7 @@ abstract class PoolBase
}
/**
* A class that delegates to a MetricsTracker implementation. The use of a delegate
* A class that delegates to a MetricsTracker implementation. The use of a delegate
* allows us to use the NopMetricsTrackerDelegate when metrics are disabled, which in
* turn allows the JIT to completely optimize away to callsites to record metrics.
*/

@ -24,7 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A Runnable that is scheduled in the future to report leaks. The ScheduledFuture is
* A Runnable that is scheduled in the future to report leaks. The ScheduledFuture is
* cancelled if the connection is closed before the leak time expires.
*
* @author Brett Wooldridge

@ -26,7 +26,7 @@ import java.util.concurrent.ScheduledExecutorService;
*/
class ProxyLeakTaskFactory
{
private ScheduledExecutorService executorService;
private final ScheduledExecutorService executorService;
private long leakDetectionThreshold;
ProxyLeakTaskFactory(final long leakDetectionThreshold, final ScheduledExecutorService executorService)

@ -56,7 +56,7 @@ public abstract class ProxyResultSet implements ResultSet
/** {@inheritDoc} */
@Override
public final Statement getStatement() throws SQLException
public final Statement getStatement()
{
return statement;
}

@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit;
*/
public interface ClockSource
{
static ClockSource CLOCK = Factory.create();
ClockSource CLOCK = Factory.create();
/**
* Get the current time-stamp (resolution is opaque).
@ -142,7 +142,7 @@ public interface ClockSource
/**
* Get the TimeUnit the ClockSource is denominated in.
* @return
* @return the TimeUnit
*/
static TimeUnit getSourceTimeUnit() {
return CLOCK.getSourceTimeUnit0();

@ -39,17 +39,17 @@ import static java.util.concurrent.locks.LockSupport.parkNanos;
/**
* This is a specialized concurrent bag that achieves superior performance
* to LinkedBlockingQueue and LinkedTransferQueue for the purposes of a
* connection pool. It uses ThreadLocal storage when possible to avoid
* connection pool. It uses ThreadLocal storage when possible to avoid
* locks, but resorts to scanning a common collection if there are no
* available items in the ThreadLocal list. Not-in-use items in the
* available items in the ThreadLocal list. Not-in-use items in the
* ThreadLocal lists can be "stolen" when the borrowing thread has none
* of its own. It is a "lock-less" implementation using a specialized
* of its own. It is a "lock-less" implementation using a specialized
* AbstractQueuedLongSynchronizer to manage cross-thread signaling.
* <p>
* Note that items that are "borrowed" from the bag are not actually
* removed from any collection, so garbage collection will not occur
* even if the reference is abandoned. Thus care must be taken to
* "requite" borrowed objects otherwise a memory leak will result. Only
* even if the reference is abandoned. Thus care must be taken to
* "requite" borrowed objects otherwise a memory leak will result. Only
* the "remove" method can completely remove an object from the bag.
*
* @author Brett Wooldridge
@ -164,7 +164,7 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
}
/**
* This method will return a borrowed object to the bag. Objects
* This method will return a borrowed object to the bag. Objects
* that are borrowed from the bag but never "requited" will result
* in a memory leak.
*
@ -215,7 +215,7 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
}
/**
* Remove a value from the bag. This method should only be called
* Remove a value from the bag. This method should only be called
* with objects obtained by <code>borrow(long, TimeUnit)</code> or <code>reserve(T)</code>
*
* @param bagEntry the value to remove
@ -251,8 +251,8 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
/**
* This method provides a "snapshot" in time of the BagEntry
* items in the bag in the specified state. It does not "lock"
* or reserve items in any way. Call <code>reserve(T)</code>
* items in the bag in the specified state. It does not "lock"
* or reserve items in any way. Call <code>reserve(T)</code>
* on items in list before performing any action on them.
*
* @param state one of the {@link IConcurrentBagEntry} states
@ -266,8 +266,8 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
}
/**
* This method provides a "snapshot" in time of the bag items. It
* does not "lock" or reserve items in any way. Call <code>reserve(T)</code>
* This method provides a "snapshot" in time of the bag items. It
* does not "lock" or reserve items in any way. Call <code>reserve(T)</code>
* on items in the list, or understand the concurrency implications of
* modifying items, before performing any action on them.
*
@ -281,15 +281,15 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
/**
* The method is used to make an item in the bag "unavailable" for
* borrowing. It is primarily used when wanting to operate on items
* returned by the <code>values(int)</code> method. Items that are
* borrowing. It is primarily used when wanting to operate on items
* returned by the <code>values(int)</code> method. Items that are
* reserved can be removed from the bag via <code>remove(T)</code>
* without the need to unreserve them. Items that are not removed
* without the need to unreserve them. Items that are not removed
* from the bag can be make available for borrowing again by calling
* the <code>unreserve(T)</code> method.
*
* @param bagEntry the item to reserve
* @return true if the item was able to be reserved, false otherwise
* @return true if the item is able to reserve, false otherwise
*/
public boolean reserve(final T bagEntry)
{

@ -152,13 +152,13 @@ public final class DriverDataSource implements DataSource
}
@Override
public void setLoginTimeout(int seconds) throws SQLException
public void setLoginTimeout(int seconds)
{
DriverManager.setLoginTimeout(seconds);
}
@Override
public int getLoginTimeout() throws SQLException
public int getLoginTimeout()
{
return DriverManager.getLoginTimeout();
}

@ -105,7 +105,7 @@ public final class FastList<T> implements List<T>, RandomAccess, Serializable
}
/**
* Remove the last element from the list. No bound check is performed, so if this
* Remove the last element from the list. No bound check is performed, so if this
* method is called on an empty list and ArrayIndexOutOfBounds exception will be
* thrown.
*
@ -120,7 +120,7 @@ public final class FastList<T> implements List<T>, RandomAccess, Serializable
/**
* This remove method is most efficient when the element being removed
* is the last element. Equality is identity based, not equals() based.
* is the last element. Equality is identity based, not equals() based.
* Only the first matching element is removed.
*
* @param element the element to remove

@ -30,7 +30,7 @@ import java.util.Set;
/**
* This class generates the proxy objects for {@link Connection}, {@link Statement},
* {@link PreparedStatement}, and {@link CallableStatement}. Additionally it injects
* {@link PreparedStatement}, and {@link CallableStatement}. Additionally, it injects
* method bodies into the {@link ProxyFactory} class methods that can instantiate
* instances of the generated proxies.
*
@ -100,7 +100,7 @@ public final class JavassistProxyFactory
}
/**
* Generate Javassist Proxy Classes
* Generate Javassist Proxy Classes
*/
private static <T> void generateProxyClass(Class<T> primaryInterface, String superClassName, String methodBody) throws Exception
{
@ -186,7 +186,7 @@ public final class JavassistProxyFactory
}
}
catch (NotFoundException e) {
// fall thru
// fall through
}
return false;

@ -21,7 +21,7 @@ import java.sql.SQLTransientException;
import java.util.concurrent.Semaphore;
/**
* This class implements a lock that can be used to suspend and resume the pool. It
* This class implements a lock that can be used to suspend and resume the pool. It
* also provides a faux implementation that is used when the feature is disabled that
* hopefully gets fully "optimized away" by the JIT.
*

@ -43,7 +43,7 @@ public final class UtilityElf
/**
*
* @return null if string is null or empty, , trimmed string otherwise
* @return null if string is null or empty, trimmed string otherwise
*/
public static String getNullIfEmpty(final String text)
{

@ -106,7 +106,7 @@ public class TestFastList
}
Iterator<Statement> iter = list.iterator();
for (int i = 0; i < list.size(); i++) {
for (int i = 0; i < list.size(); i++) {
assertSame(list.get(i), iter.next());
}
}

Loading…
Cancel
Save