commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] Commented: (IO-159) FileCleaningTracker: ReferenceQueue uses raw type
Date Sat, 06 Mar 2010 00:09:27 GMT


Sebb commented on IO-159:

The code was changed a while ago to use ReferenceQueue<Object>, so the raw type has

Using ReferenceQueue<Tracker> does not work, because the marker items are just Objects.

q.remove() returns a Reference to the Object.

Adding debug shows the returned item is in fact a Tracker (which is an instance of a Reference).

Debug also shows that using get() on the reference actually returns null.

So I think the code is now OK, though it perhaps should not swallow all Exceptions - remove()
is only documented to throw InterruptedException.
Also, there's no point checking the returned object for null, because remove() does not return

Fixed accordingly:

See IO-159: remove() never returns null


> FileCleaningTracker: ReferenceQueue uses raw type
> -------------------------------------------------
>                 Key: IO-159
>                 URL:
>             Project: Commons IO
>          Issue Type: Improvement
>    Affects Versions: 2.0
>            Reporter: Paul Benedict
>            Priority: Minor
>             Fix For: 2.0
> The field is:
> ReferenceQueue /* Tracker */ q = new ReferenceQueue();
> But that inline comment needs to become the parameterized type. Is it of type <?>

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message