Comment Re:Epic type system fail - universal covariance (Score 1) 330
I concur exactly with your null/NPE observations. The next addition I want to the Java spec is the ability to mark a method as never returning null.
JSR 305 defines a set of annotations that allow you to do this (including '@NonNull' for method return values).
The weakness of this is that you can formally specify a method should never return 'null' with this, but the compiler does not check whether you live up to this promise. There are tools that can do some basic checks against blatant mistakes (Eclipse does this nowadays), and tools that are a bit more advanced and find even more subtle mistakes (FindBugs comes to mind).
Really proving correctness without a doubt is an unsolved problem - even when adding additional annotations it's a tough nut to crack - check out research projects like ESC/Java if you're interested in the gory details
.