The portability of Java applications is directly dependent on the consistency of their Java Virtual Machine (JVM) implementation. The Java language places a lot of emphasis on simplicity. The design tradeoffs in language design--to ensure a feature-packed, easy-to-use language--have resulted in ambiguities for developers. This paper provides an insightful look into the various ambiguities and irregularities in Java.
The first section of the paper discusses the default access ambiguities resulting from the mixing of inheritance and package relationship rules. The problem is described with three illustrative examples, which address, respectively, static and instance methods, member variables, and abstract classes. The next set of ambiguities deals with widening primitive and reference conversion. The primitive and reference conversions are implicitly done in Java. The example demonstrates the problem in scenarios where overloading and inheritance, being employed in the logic, conflict with the rules of widening conversions. The next section of the paper discusses irregularities in the language, which range from import declarations to access privileges. The irregularities presented in this section can be statically checked at compile time, for example, the differences in method and field overloading rules. The last section addresses the inconsistencies that arise because some parts of the Java language specification are open to interpretation by the compiler writers.
The paper provides a fairly comprehensive evaluation of the various ambiguities and irregularities of the Java language. The authors used data from Java Development Kit (JDK) 1.0.2 to 1.3.0, primarily to demonstrate the ambiguities in the Java language. It is an accepted fact that JVM implementations have become better and more consistent with each significant release. Java 2 Platform, Standard Edition (J2SE) 5.0 (the upcoming release in Fall 2004) has introduced support for generics that can address some of the widening conversion issues. The information in this paper can be extremely helpful in creating processes like coding conventions, and programming best practices that can avoid these traps. Developers and architects will find this material useful, not only in understanding the Java language better, but also in making sense of previously encountered bizarre application behavior.
The paper is well written, and backed by good and concise sample code and data. I would definitely recommend this paper to all developers using Java.