January 18, 2004

API Compatibility Tool problems

I said in an earlier entry that I'd post my API compatibility checker program here, and I never posted it. I didn't because there's a bug that I don't think I can fix without changing a lot of the code I've already written.

Right now, API Compatibility Tool takes a JAR file and generates a single Java source file that uses every public and protected method, field, and inner class of every public class, in every way possible (except one, keep reading).

It's not meant to be run, it's only meant to be compiled. What you do is you generate it based on YourLibrary v1.0, and then you try to compile it against YourLibrary v1.1 before you release 1.1. If it compiles, then version 1.1 is binary (and source) compatible with version 1.0.

The problem I'm having is that it doesn't extend every abstract class and interface with a non-abstract subclass, with dummy methods for all non-final public and protected methods. This would show you compatibility errors where an implementation of SomeInterface works in 1.0, but is missing a new (abstract) method that was added in 1.1, and so will break at runtime or compile time.

I don't know how to do this well, because as it is right now, each class's representation doesn't know anything except its methods and what its superclass's name is, and what its inner classes are called. To implement the feature I described above, a class would need to know what abstract methods in every supertype need to be implemented. For this, I would probably have to either parse the JDK runtime jar myself, which is code I don't want to write, or inspect the classes loaded at the runtime of the API Compatibility Tool via the reflection API, which would be annoying for the user. The latter method would require the API Compatibility Tool user to specify the classpath that will be used to run YourLibrary, and use the same JRE that it will be running on, and things like that.

So I've kind of given up on that project for now, after about a day of work. I found joscar's main compatibility problems from 0.9.3 to the current CVS, and there aren't many, so API Compatibility Tool is not very useful to me anymore.

Posted by keith at January 18, 2004 08:54 PM | TrackBack
Comments

Very nice site. Keep up the good work.

grants

Posted by: grants at June 19, 2004 11:05 AM

Now there is the internet. And I really appreciate people like you who take their chance in such an excellent way to give an impression on certain topics. Thanks for having me here.

best online casinos

Posted by: best online casinos at July 30, 2004 12:35 PM

Hello. I just wanted to give a quick greeting and tell you I enjoyed reading your material.

online casinos

Posted by: online casinos at July 30, 2004 12:35 PM

Thank you, I just wanted to give a greeting and tell you I like your blog very much.

online casinos

Posted by: online casinos at August 1, 2004 03:51 PM

Hi, just popped in here through a random link. Cool site, keep this good work up :-)

online casinos

Posted by: online casinos at August 1, 2004 03:51 PM

Your site is very good.

best online casinos

Posted by: best online casinos at August 4, 2004 06:30 AM

Very useful comments - good to read

online casinos

Posted by: online casinos at August 4, 2004 06:30 AM

Hello! Super work performed. Top PAGE, further so!

online casino

Posted by: online casino at August 13, 2004 10:24 PM

Hello, I just wanted to say you have a very informative site which really made me think, thanks very much! Have a nice Day!!

internet casino

Posted by: internet casino at August 13, 2004 10:24 PM

I have always looked for a possibility to find information as quick as I can. Now there is the internet. And I really appreciate people like you who take their chance in such an excellent way to give an impression on certain topics. Thanks for having me here.

internet casino

Posted by: internet casino at August 13, 2004 10:24 PM

Now there is the internet. And I really appreciate people like you who take their chance in such an excellent way to give an impression on certain topics. Thanks for having me here.

casino games

Posted by: casino games at August 13, 2004 10:24 PM

Very useful comments - good to read

online casino

Posted by: online casino at August 13, 2004 10:24 PM
Post a comment