Hi,
I would like to use Java 1.5 features now in Jackrabbit. I hope this
will improve reliability, simplify maintenance, and reduce source code
size. Unfortunately using generics is sometimes quite verbose.
Example:
HashMap wspInfos = new HashMap();
becomes
HashMap wspInfos = new HashMap();
Part of that could be avoided using a helper class:
HashMap wspInfos = New.hashMap();
I propose to add a new 'generics generator class' called 'New' to
jackrabbit-jcr-commons. It would contain constructor methods for the
most commonly used collection objects.
public class New {
public static HashMap hashMap() {
return new HashMap();
}
public static ArrayList arrayList() {
return new ArrayList();
}
public static WeakReference weakReference(T t) {
return new WeakReference(t);
}
...
}
What do you think? Are there better solutions?
Regards,
Thomas