Fixed remaining generics warnings in o.a.h.impl.conn
git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@603874 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
08bf8e8e50
commit
b62ae8fc19
|
@ -185,7 +185,7 @@ public abstract class AbstractConnPool implements RefQueueHandler {
|
||||||
|
|
||||||
|
|
||||||
// non-javadoc, see interface RefQueueHandler
|
// non-javadoc, see interface RefQueueHandler
|
||||||
public synchronized void handleReference(Reference ref) {
|
public synchronized void handleReference(Reference<?> ref) {
|
||||||
|
|
||||||
if (ref instanceof BasicPoolEntryRef) {
|
if (ref instanceof BasicPoolEntryRef) {
|
||||||
// check if the GCed pool entry was still in use
|
// check if the GCed pool entry was still in use
|
||||||
|
|
|
@ -32,7 +32,6 @@ package org.apache.http.impl.conn.tsccm;
|
||||||
|
|
||||||
|
|
||||||
import java.lang.ref.ReferenceQueue;
|
import java.lang.ref.ReferenceQueue;
|
||||||
import java.lang.ref.WeakReference;
|
|
||||||
|
|
||||||
import org.apache.http.conn.HttpRoute;
|
import org.apache.http.conn.HttpRoute;
|
||||||
import org.apache.http.conn.OperatedClientConnection;
|
import org.apache.http.conn.OperatedClientConnection;
|
||||||
|
|
|
@ -484,7 +484,7 @@ public class ConnPoolByRoute extends AbstractConnPool {
|
||||||
// non-javadoc, see base class AbstractConnPool
|
// non-javadoc, see base class AbstractConnPool
|
||||||
public synchronized void deleteClosedConnections() {
|
public synchronized void deleteClosedConnections() {
|
||||||
|
|
||||||
Iterator iter = freeConnections.iterator();
|
Iterator<BasicPoolEntry> iter = freeConnections.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
BasicPoolEntry entry = (BasicPoolEntry) iter.next();
|
BasicPoolEntry entry = (BasicPoolEntry) iter.next();
|
||||||
if (!entry.getConnection().isOpen()) {
|
if (!entry.getConnection().isOpen()) {
|
||||||
|
|
|
@ -43,6 +43,6 @@ public interface RefQueueHandler {
|
||||||
*
|
*
|
||||||
* @param ref the reference to handle
|
* @param ref the reference to handle
|
||||||
*/
|
*/
|
||||||
public void handleReference(Reference ref)
|
public void handleReference(Reference<?> ref)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class RefQueueWorker implements Runnable {
|
||||||
|
|
||||||
|
|
||||||
/** The reference queue to monitor. */
|
/** The reference queue to monitor. */
|
||||||
protected final ReferenceQueue refQueue;
|
protected final ReferenceQueue<?> refQueue;
|
||||||
|
|
||||||
/** The handler for the references found. */
|
/** The handler for the references found. */
|
||||||
protected final RefQueueHandler refHandler;
|
protected final RefQueueHandler refHandler;
|
||||||
|
@ -72,7 +72,7 @@ public class RefQueueWorker implements Runnable {
|
||||||
* @param queue the queue on which to wait for references
|
* @param queue the queue on which to wait for references
|
||||||
* @param handler the handler to pass the references to
|
* @param handler the handler to pass the references to
|
||||||
*/
|
*/
|
||||||
public RefQueueWorker(ReferenceQueue queue, RefQueueHandler handler) {
|
public RefQueueWorker(ReferenceQueue<?> queue, RefQueueHandler handler) {
|
||||||
if (queue == null) {
|
if (queue == null) {
|
||||||
throw new IllegalArgumentException("Queue must not be null.");
|
throw new IllegalArgumentException("Queue must not be null.");
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ public class RefQueueWorker implements Runnable {
|
||||||
while (this.workerThread == Thread.currentThread()) {
|
while (this.workerThread == Thread.currentThread()) {
|
||||||
try {
|
try {
|
||||||
// remove the next reference and process it
|
// remove the next reference and process it
|
||||||
Reference ref = refQueue.remove();
|
Reference<?> ref = refQueue.remove();
|
||||||
refHandler.handleReference(ref);
|
refHandler.handleReference(ref);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
//@@@ is logging really necessary? this here is the
|
//@@@ is logging really necessary? this here is the
|
||||||
|
|
|
@ -302,7 +302,8 @@ public class TestTSCCMWithServer extends ServerTestBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
// We now drop the hard references to the connection and trigger GC.
|
// We now drop the hard references to the connection and trigger GC.
|
||||||
WeakReference wref = new WeakReference(conn);
|
WeakReference<ManagedClientConnection> wref =
|
||||||
|
new WeakReference<ManagedClientConnection>(conn);
|
||||||
conn = null;
|
conn = null;
|
||||||
httpContext = null; // holds a reference to the connection
|
httpContext = null; // holds a reference to the connection
|
||||||
|
|
||||||
|
@ -356,7 +357,8 @@ public class TestTSCCMWithServer extends ServerTestBase {
|
||||||
// we got from the manager, directly as well as in the request
|
// we got from the manager, directly as well as in the request
|
||||||
// and in the context. The manager will be GCed only if the
|
// and in the context. The manager will be GCed only if the
|
||||||
// connection wrapper is truly detached.
|
// connection wrapper is truly detached.
|
||||||
WeakReference wref = new WeakReference(mgr);
|
WeakReference<ThreadSafeClientConnManager> wref =
|
||||||
|
new WeakReference<ThreadSafeClientConnManager>(mgr);
|
||||||
mgr = null;
|
mgr = null;
|
||||||
|
|
||||||
// Java does not guarantee that this will trigger the GC, but
|
// Java does not guarantee that this will trigger the GC, but
|
||||||
|
|
Loading…
Reference in New Issue