jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Bocanegra <tri...@day.com>
Subject Re: Generics generator class
Date Tue, 05 May 2009 15:50:26 GMT
On Tue, May 5, 2009 at 1:56 PM, Thomas Müller <thomas.mueller@day.com> wrote:
> Hi,
>
> I'm not proposing to use Google Collections, but it does have the
> 'missing' methods:
>
> import com.google.common.collect.Maps;
> import com.google.common.collect.Arrays;
> HashMap<String, WorkspaceInfo> wspInfos = Maps.newHashMap();
> ArrayList<DataIdentifier> list = Arrays.newArrayList();
>
>> since when is less verbose automatically easier to read?
>
> Probably your are right, reading things twice is better. Probably your
> are right, reading things twice is better. :-)

i think that it's important to differentiate between the declared type
and the created object.
for example, i would never write:

HashMap<String, WorkspaceInfo> wspInfos = Maps.newHashMap();

but

Map<String, WorkspaceInfo> wspInfos = Maps.newHashMap();

sure, if this would be in the jdk, i would use it (because everyone
else would use it too).
i think we should first focus of cleaning up the code by replacing
untyped collections and integer enums.

regards, toby

Mime
View raw message