30.

What We've Learned

In this chapter on bugs that spring from platform dependencies, probably the most important thing we've learned is that the cost of cross-platform capabilities is never zero.

We've also learned the following:

  • There are many compatibility snags across different JVM versions, such as incorrect platform-specific separator characters in path names.

  • There are three patterns of platform-dependent bugs—those tied to the vendor, those tied to the version, and those tied to the operating system.

  • Vendor-dependent bugs, in which errors occur on only some JVMs, are caused by unspecified areas in the JVM's specification. This is a fairly uncommon problem.

  • Version-dependent bugs, in which errors occur on only some versions of a JVM, are caused by bugs in certain JVM implementations. This is seen more commonly.

  • OS-dependent bugs, in which errors occur only on some operating systems, are caused by the rules of system behavior being different for different OSes.

  • For implementation bugs, there is a great tool: Sun's Java Bug Parade, a list of JVM-specific implementation bugs.

  • An example: Tail calls allow us to replace the stack frame built for the calling method with that for the called method, which can decrease the depth of the stack at runtime, preventing stack overflows. However, only some JVMs implement this optimization; others don't.

  • Platform dependence is not just about OS dependence and vendor dependence—it's about JVM version dependence, both backward and forward. Teams are usually concerned about providing backward compatibility, and they often expect their code to maintain its behavior under later versions of Java. But in real life, this expectation doesn't always hold true.

This is the last chapter on specific bug patterns. Chapter 21 offers a diagnostic checklist to help you quickly find the chapter in this book that is most relevant to your particular needs.



Bug Patterns in Java
Bug Patterns In Java
ISBN: 1590590619
EAN: 2147483647
Year: N/A
Pages: 95
Authors: Eric Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net