----- Original Message ---- > From: Sim IJskes - QCG <[email protected]> > To: "[email protected]" <[email protected]> > Sent: Sat, December 4, 2010 11:00:10 AM > Subject: API and VM compatibility verification > > Hello, > > Is there a tool that we can use to verify API compatibility? So we can make >sure we do not call methods that do not exist? >
I don't really know of any. One way would be to run binary tests against different JREs/JDKs. Compile with the desired JDK. Then run other things with the target. Depending on code coverage of the tests that would be very useful. There are things like BigDecimal with its constructors BigDecimal(int) and 1.4.2 not having that. When you compile source code passing an int into a BigDecimal constructor with 1.5+ it references that particular method signature. That will then not run in binary form in a 1.4.2 VM, but compiling that logic in 1.4.2 will work in 1.5 because the int winds up expanded to the BigDecimal(double) call at compile time. So, without a run through of the binary logic I don't think a tool could just scan the sources and insure compatibility unless it overlooked compile time expansion as in this case and strictly looked for method signatures. Either way, I don't know of any tooling. Wade ================== Wade Chandler Software Engineer and Developer NetBeans Dream Team Member and Contributor http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam http://www.netbeans.org
