notes-computer-programming-programmingLanguageDesign-prosAndCons-java

" 5) Method overloading. One of the most constraining parts of the Java language specification is method resolution, where the compiler has to work out what method you intended to call. Resolution touches superclasses, interfaces, varargs, generics, boxing and primitives. It is a very complex algorithm, that is difficult to extend. Having no method overloading, except by default parameters, would be a huge win.

6) Generics. Java generics is complex, especially around the ? extends and ? super variance clauses. Its too easy to get these wrong. The lesson from Java should be that use-site variance hasn't worked out well. " -- purported mistakes in Java, from http://blog.joda.org/2010/09/next-big-jvm-language_964.html

" steve21 September 2010 14:45

Fix Java and you end up with Scala. It's as simple as that.

The thing you imagine has already been done. Go through "Java Puzzlers" one-by-one and check if these bugs/design mistakes still exist in Scala (hint: most of them are fixed, while some are maintained to be more compatible with Scala).

1) Checked exceptions. Fixed.

2) Primitives and Arrays. Fixed.

3) Everything is a monitor. Every reference type in Scala inherits from java.lang.Object for compatibility reasons. Java has to fix it.

4) Static. Fixed, but creates static forwarders for java compatibility.

5) Method overloading. The JVM has this hard-coded. InvokeDynamic?