You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/06/10 15:44:02 UTC
[2/2] commons-dbcp git commit: Use a line length max of 120 and add
missing Javadoc tags.
Use a line length max of 120 and add missing Javadoc tags.
Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/845fca72
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/845fca72
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/845fca72
Branch: refs/heads/master
Commit: 845fca72fb3736ba07f9f35b138295d77530e500
Parents: 43b203c
Author: Gary Gregory <ga...@gmail.com>
Authored: Sun Jun 10 09:43:58 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sun Jun 10 09:43:58 2018 -0600
----------------------------------------------------------------------
.../apache/commons/dbcp2/AbandonedTrace.java | 43 +-
.../apache/commons/dbcp2/BasicDataSource.java | 1290 +++++++++---------
2 files changed, 678 insertions(+), 655 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/845fca72/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java b/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java
index 983d40a..3b8752b 100644
--- a/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java
+++ b/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java
@@ -25,11 +25,10 @@ import java.util.List;
import org.apache.commons.pool2.TrackedUse;
/**
- * Tracks db connection usage for recovering and reporting
- * abandoned db connections.
- *
- * The JDBC Connection, Statement, and ResultSet classes
- * extend this class.
+ * Tracks db connection usage for recovering and reporting abandoned db connections.
+ * <p>
+ * The JDBC Connection, Statement, and ResultSet classes extend this class.
+ * </p>
*
* @author Glenn L. Nielsen
* @since 2.0
@@ -38,19 +37,19 @@ public class AbandonedTrace implements TrackedUse {
/** A list of objects created by children of this object */
private final List<WeakReference<AbandonedTrace>> traceList = new ArrayList<>();
+
/** Last time this connection was used */
private volatile long lastUsed = 0;
/**
- * Create a new AbandonedTrace without config and
- * without doing abandoned tracing.
+ * Create a new AbandonedTrace without config and without doing abandoned tracing.
*/
public AbandonedTrace() {
init(null);
}
/**
- * Construct a new AbandonedTrace with a parent object.
+ * Constructs a new AbandonedTrace with a parent object.
*
* @param parent AbandonedTrace parent object
*/
@@ -59,7 +58,7 @@ public class AbandonedTrace implements TrackedUse {
}
/**
- * Initialize abandoned tracing for this object.
+ * Initializes abandoned tracing for this object.
*
* @param parent AbandonedTrace parent object
*/
@@ -70,7 +69,7 @@ public class AbandonedTrace implements TrackedUse {
}
/**
- * Get the last time this object was used in ms.
+ * Gets the last time this object was used in ms.
*
* @return long time in ms
*/
@@ -80,27 +79,27 @@ public class AbandonedTrace implements TrackedUse {
}
/**
- * Set the time this object was last used to the
- * current time in ms.
+ * Sets the time this object was last used to the current time in ms.
*/
protected void setLastUsed() {
lastUsed = System.currentTimeMillis();
}
/**
- * Set the time in ms this object was last used.
+ * Sets the time in ms this object was last used.
*
- * @param time time in ms
+ * @param time
+ * time in ms
*/
protected void setLastUsed(final long time) {
lastUsed = time;
}
/**
- * Add an object to the list of objects being
- * traced.
+ * Adds an object to the list of objects being traced.
*
- * @param trace AbandonedTrace object to add
+ * @param trace
+ * AbandonedTrace object to add
*/
protected void addTrace(final AbandonedTrace trace) {
synchronized (this.traceList) {
@@ -110,8 +109,7 @@ public class AbandonedTrace implements TrackedUse {
}
/**
- * Clear the list of objects being traced by this
- * object.
+ * Clears the list of objects being traced by this object.
*/
protected void clearTrace() {
synchronized(this.traceList) {
@@ -120,7 +118,7 @@ public class AbandonedTrace implements TrackedUse {
}
/**
- * Get a list of objects being traced by this object.
+ * Gets a list of objects being traced by this object.
*
* @return List of objects
*/
@@ -146,9 +144,10 @@ public class AbandonedTrace implements TrackedUse {
}
/**
- * Remove a child object this object is tracing.
+ * Removes a child object this object is tracing.
*
- * @param trace AbandonedTrace object to remove
+ * @param trace
+ * AbandonedTrace object to remove
*/
protected void removeTrace(final AbandonedTrace trace) {
synchronized(this.traceList) {