jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Müller <thomas.muel...@day.com>
Subject Re: Generics generator class
Date Mon, 04 May 2009 15:13:58 GMT

> In fact, while the "new HashMap<String, WorkspaceInfo>()"

It looks like there was a misunderstanding. You only need one method
hashMap(). This method will generate any kind of HashMap instance,
that means the exact same method is used to create:

HashMap<String, String> a = New.hashMap();
HashMap<NodeId, Node> b = New.hashMap();
HashMap<String, Value> c = New.hashMap();

I have counted the number of times this could be useful in Jackrabbit.
For the 2218 java files I counted (using grep -c -R --include=*.java
'new ArrayList' . | wc -l ):

new ArrayList: 586
new Hash: 477
new Linked: 65
new Weak: 24
new Tree: 21
new Stack: 19

By the way, I didn't invent using a generator function:



View raw message