Menu

#85 Use Java Generics

open
nobody
5
2008-10-06
2008-10-06
No

As of Java 1.5, it is possible to specify the type of the elements of Lists etc. by means of "Java Generics". NXT uses quite a lot of lists, e.g., as return values of API methods. It would be nice if these lists would be defined with their generic type, for instance instead of

public List getElementsByName(String name) { ... }

we would get

public List<NOMElement> getElementsByName(String name) { ... }

This way users can benefit from Java 1.5 features: more type safety at compile time and less type casting.

Discussion

MongoDB Logo MongoDB