commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Commented: (LANG-564) StrLookup API is confused
Date Sat, 16 Jan 2010 08:24:54 GMT


Henri Yandell commented on LANG-564:

The class is for providing a Str, Str view on a Str, V storage. From the tests:

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("number", new Integer(2));
        assertEquals("2", StrLookup.mapLookup(map).lookup("number"));

Based on that, the genercizing looks good to me (yeah I know I'm contradicting my previous
comment, I hadn't dug into the previous code). I think a bit more javadoc explanation is in
need but not a generics change.

> StrLookup API is confused
> -------------------------
>                 Key: LANG-564
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.text.*
>            Reporter: Sebb
>             Fix For: 3.0
> The API for StrLookup is confused. The class has been partly genericised, but why?
> The Javadoc says the class is for looking up Strings which are indexed by Strings, and
this agrees with the method lookup()
> Surely if the class is generic on <V>, the lookup() method should return V, not
> Does it make any sense for the class to return anything but a String? If not, then why
is the class generic?
> If it does make sense, then lookup() should return V.

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

View raw message