Kalpak Gadre wrote:
> Hi all,
> 
> I am trying to implement the extcheck JDK tool.

Cool, thanks.

> As i read in the specification
> http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/extcheck.html,
> extcheck tool
> compares versions as in java.lang.Package.isCompatibleWith()
> 
> isCompatibleWith assumes that the version is '.' separated numeric
> values. But many of
> the jar files have alpha-numeric Specification-version attribute. How do
> you compare
> alpa-numeric versions? Do I assume versions to be numeric only?

The j.l.Package spec has a requirement that the specification version
contains only dot-separated numbers [1], and the method
#isCompatibleWith() will throw a NumberFormatException if that is not
the case.

If you get such an exception I think the only safe option is for the
tool to print a warning and assume the packages are incompatible.

[1] http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Package.html

Regards,
Tim

> As I can see, Sun's implementation of extcheck is very rough. Try
> extcheck -verbose
> It throws ArrayIndexOutOfBounds :)
> 
> Thanks,
> 
> Kalpak
> 

Reply via email to