Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/com/mchange/v2/resourcepool/BasicResourcePool.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ void cscSignalAll()

int target_pool_size;

/* keys are all valid, managed resources, value is a PunchCard */
HashMap managed = new HashMap();
/* keys are all valid, managed resources */
HashMap<Object, PunchCard> managed = new HashMap<>();

/* all valid, managed resources currently available for checkout */
LinkedList unused = new LinkedList();
Expand Down Expand Up @@ -636,7 +636,7 @@ public Object checkoutResource( long timeout )
asyncFireResourceCheckedOut( resc, managed.size(), unused.size(), excluded.size() );
if (Debug.DEBUG && Debug.TRACE == Debug.TRACE_MAX) trace();

PunchCard card = (PunchCard) managed.get( resc );
PunchCard card = managed.get( resc );
if (card == null) //the resource has been removed!
{
if (Debug.DEBUG && logger.isLoggable( MLevel.FINER ))
Expand Down Expand Up @@ -1565,7 +1565,7 @@ public void run()
lockMain.lock();
try
{
PunchCard card = (PunchCard) managed.get( resc );
PunchCard card = managed.get( resc );

if ( resc_okay && card != null) //we have to check that the resource is still in the pool
{
Expand Down Expand Up @@ -1725,7 +1725,7 @@ private void removeResource(Object resc, boolean synchronous)
{
assert lockMain.isHeldByCurrentThread();

PunchCard pc = (PunchCard) managed.remove(resc);
PunchCard pc = managed.remove(resc);

boolean checked_out = false;
if (pc != null)
Expand Down Expand Up @@ -1838,7 +1838,7 @@ private boolean shouldExpire( Object resc )

boolean expired = false;

PunchCard pc = (PunchCard) managed.get( resc );
PunchCard pc = managed.get( resc );

// the resource has already been removed
// we return true, because removing twice does no harm
Expand Down