Hi everyone,
Well the title almost says it all: I'm looking for a list of the API
addition in Java 1.5 (new classes, methods, etc...). The official
reference seems to be Java release notes but the web page in not easily
parseable:
http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html
I need a parseable list to build a tool that monitors my company's
source code repository and detects when someone uses API elements from
1.5 that may not available to our clients using 1.4. I tried for
example to compile with the -target 1.4 or -source 1.4 options and
these do not check for API differences. I know I could simply use the
actual JDK 1.4 and see if compilation errors occur but they may be
caused by other problems and it's not a very elegant solution anyway.
Cheers,
LP
Chris Uppal - 05 Jul 2006 10:12 GMT
> I need a parseable list to build a tool that monitors my company's
> source code repository and detects when someone uses API elements from
> 1.5 that may not available to our clients using 1.4.
One approach would be to scan the 1.4 and 1.5 versons of rt.jar using something
like ASM or BCEL to build lists of the published members of the published
classes. Then diff 'em.
-- chris
Lethal Possum - 05 Jul 2006 13:30 GMT
If I have to make the list myself, I'll look at the tools you
suggested. Thanks.
> > I need a parseable list to build a tool that monitors my company's
> > source code repository and detects when someone uses API elements from
[quoted text clipped - 5 lines]
>
> -- chris
Thomas Hawtin - 05 Jul 2006 12:34 GMT
> I need a parseable list to build a tool that monitors my company's
> source code repository and detects when someone uses API elements from
[quoted text clipped - 3 lines]
> actual JDK 1.4 and see if compilation errors occur but they may be
> caused by other problems and it's not a very elegant solution anyway.
You need to use -Xbootclasspath in addition to -source and -target.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Lethal Possum - 05 Jul 2006 14:08 GMT
I didn't know the bootclasspath option. Using it to compile the
application with Java 1.4 rt.jar is certainly the easiest solution to
my problem. But the reason I was thinking of creating my own tool is
that compiling the application takes quite some time and I would like
to find a faster solution.
Thanks.
Thomas Hawtin a écrit :
> > I need a parseable list to build a tool that monitors my company's
> > source code repository and detects when someone uses API elements from
[quoted text clipped - 10 lines]
> Unemployed English Java programmer
> http://jroller.com/page/tackline/
EJP - 06 Jul 2006 01:55 GMT
> I didn't know the bootclasspath option. Using it to compile the
> application with Java 1.4 rt.jar is certainly the easiest solution to
> my problem. But the reason I was thinking of creating my own tool is
> that compiling the application takes quite some time and I would like
> to find a faster solution.
It may be a faster solution but compiling with 1.4 is a *correct*
solution which cannot give false positives or negatives. No tool you
build yourself can be as reliable.
Lethal Possum - 06 Jul 2006 11:03 GMT
I agree with you that it is more reliable. I think I'll compile first
with 1.5 to find syntax errors and others. If none, then I'll compile
with 1.4 to check for 1.5 dependencies.
Thank you all for your help.
Cheers,
LP
EJP a écrit :
> > I didn't know the bootclasspath option. Using it to compile the
> > application with Java 1.4 rt.jar is certainly the easiest solution to
[quoted text clipped - 5 lines]
> solution which cannot give false positives or negatives. No tool you
> build yourself can be as reliable.