commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] Commented: (DBCP-280) SequencedHashMap constructor calls overridable method; throws Error
Date Mon, 16 Feb 2009 16:15:00 GMT


Sebb commented on DBCP-280:

I've had a look at Collections (trunk), and the class SequencedHashMap is deprecated - it
recommends using LinkedMap or ListOrderedMap instead  - so the Collections code is unlikely
to be fixed.

Unfortunately, LinkedMap is a sub-class of AbstractHashedMap which has the same problem (I'll
raise a separate Jira for this).

Perhaps a minimally invasive solution would be to make the SequencedHashMap - or putall()
method - final in DBCP?

The former would probably be better, given that the original class is now deprecated.

> SequencedHashMap constructor calls overridable method; throws Error
> -------------------------------------------------------------------
>                 Key: DBCP-280
>                 URL:
>             Project: Commons Dbcp
>          Issue Type: Bug
>            Reporter: Sebb
> The constructor SequencedHashMap(Map) calls the public non-final method putAll().
> This is likely to cause problems if the class is ever extended. Possible solution: extract
the code into a common private method.
> The next() method also throws an Error if the return type is unexpected.
> It should probably return IllegalStateException or similar.

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

View raw message