|
|
|
|
|
by bsou
3476 days ago
|
|
My main gripe with Java is its lack of type inference and the resulting redundancy that pops up. Things like the following got tiresome quickly (I might be a newb missing out on a better way to do things like this) private final TreeMap<String, TreeMap<String, Record>> searchTree = new TreeMap<String, TreeMap<String, Record>>();
|
|
Also I'd consider it better style to only specify the interface on the left hand side, something like this should work:
private final Map<String, Map<String, Record>> searchTree = new TreeMap<>();
Edit: if you use Netbeans with maven it will automatically pick up correct settings from the pom and autocomplete with a shorter version like the one I suggested.