You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Stefano Mazzocchi <st...@apache.org> on 2006/11/07 23:01:01 UTC

[general] interesting discoveries with japitools - part 2

Stuart told me that using the released version of japitools was not
ideal, so I've re-run the tests with the latest version of japitools
from CVS.

I did find a few bugs in japitools when dealing with JRockit and J9
(submitted to the japitools mail list) but there are still interesting
results.

======== sun 1.5 vs bea 1.5 ============

Total: 99.99% good, 0% missing, 0% abs.add

Error Summary:
Methods: 1 missing, 1 abs.add.

Errors:

java.awt.peer:
Missing
method java.awt.peer.WindowPeer.updateFocusableWindowState(): missing in
bea1.5

java.util.concurrent:
Abs.add
method java.util.concurrent.Delayed.compareTo(java.lang.Object): new
interface method in bea1.5


So, it appears that that Sun added a method that is not available in the
javadocs (bad Sun, no donut for you!) and that BEA did not (correctly)
implement.

Also, BEA added the method "compareTo" to the
java.util.concurrent.Delayed interface. This is not really a problem
because Delayed extends Comparable, therefore all classes implementing
Delayed will have to have the compareTo method anyway.

Stuart, do you think this is something that japitools should check?

I would call this a false positive.



======== sun 1.5 vs ibm 1.5 ===================

Total: 99.93% good, 0% bad, 0.06% missing, 0% abs.add

Error Summary:
Classes: 2 missing.
Fields: 1 bad.
Methods: 5 missing, 6 abs.add.

Errors:

java.awt.peer:
Missing
method java.awt.peer.WindowPeer.updateFocusableWindowState(): missing in
ibm1.5

java.util.concurrent:
Abs.add
method java.util.concurrent.Delayed.compareTo(java.lang.Object): new
interface method in ibm1.5

javax.xml.datatype:
Bad
field
javax.xml.datatype.DatatypeFactory.DATATYPEFACTORY_IMPLEMENTATION_CLASS:
constant
[com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl]
in sun1.5, but constant
[org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl] in ibm1.5

org.omg.stub.javax.management.remote.rmi:
Missing
class org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie:
missing in ibm1.5
class org.omg.stub.javax.management.remote.rmi._RMIServerImpl_Tie:
missing in ibm1.5

org.w3c.dom.html:
Missing
method org.w3c.dom.html.HTMLFrameElement.getContentDocument(): missing
in ibm1.5
method org.w3c.dom.html.HTMLIFrameElement.getContentDocument(): missing
in ibm1.5
method org.w3c.dom.html.HTMLObjectElement.getContentDocument(): missing
in ibm1.5
method org.w3c.dom.html.HTMLOptionElement.setSelected(boolean): missing
in ibm1.5
Abs.add
method org.w3c.dom.html.HTMLOptionElement.setIndex(int): new interface
method in ibm1.5
method org.w3c.dom.html.HTMLTableCellElement.setCellIndex(int): new
interface method in ibm1.5
method
org.w3c.dom.html.HTMLTableRowElement.setCells(org.w3c.dom.html.HTMLCollection):
new interface method in ibm1.5
method org.w3c.dom.html.HTMLTableRowElement.setRowIndex(int): new
interface method in ibm1.5
method org.w3c.dom.html.HTMLTableRowElement.setSectionRowIndex(int): new
interface method in ibm1.5

So, it seems that the new japitools does fix some problems. The first
two are the same as with BEA. The datatype factory is not problematic.
The RMI over IIOP stubs should probably be ignored.

The only substantial difference is the HTML DOM (which nobody uses anyway).

Now the reverse checks

====== bea 1.5 vs sun 1.5 ======================

Total: 100% good, 0% abs.add

Error Summary:
Methods: 2 abs.add.

Errors:

java.awt.peer:
Abs.add
method java.awt.peer.WindowPeer.updateFocusableWindowState(): new
interface method in sun1.5

java.util.concurrent:
Abs.add
method java.util.concurrent.Delayed.compareTo(java.lang.Object): new
interface method in sun1.5
Done.

Hmmm, the compareTo is in both the direct and the reverse? smells like a
japitool bug to me.


======= IBM 1.5 vs. Sun 1.5 ========================

Total: 99.78% good, 0% bad, 0.21% missing, 0% abs.add

Error Summary:
Packages: 4 missing.
Classes: 2 missing.
Fields: 1 bad.
Methods: 6 missing, 6 abs.add.

Errors:

java.lang:
Missing
method java.lang.StringBuilder.append(java.lang.StringBuilder): missing
in sun1.5

java.awt.peer:
Abs.add
method java.awt.peer.WindowPeer.updateFocusableWindowState(): new
interface method in sun1.5

java.util.concurrent:
Abs.add
method java.util.concurrent.Delayed.compareTo(java.lang.Object): new
interface method in sun1.5

javax.management.remote.rmi:
Missing
class javax.management.remote.rmi._RMIConnectionImpl_Tie: missing in sun1.5
class javax.management.remote.rmi._RMIServerImpl_Tie: missing in sun1.5

javax.xml.datatype:
Bad
field
javax.xml.datatype.DatatypeFactory.DATATYPEFACTORY_IMPLEMENTATION_CLASS:
constant [org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl] in
ibm1.5, but constant
[com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl]
in sun1.5

org.omg.stub.java.lang:
Missing
package org.omg.stub.java.lang: missing in sun1.5

org.omg.stub.java.security:
Missing
package org.omg.stub.java.security: missing in sun1.5

org.omg.stub.java.util:
Missing
package org.omg.stub.java.util: missing in sun1.5

org.w3c.dom.html:
Missing
method org.w3c.dom.html.HTMLOptionElement.setIndex(int): missing in sun1.5
method org.w3c.dom.html.HTMLTableCellElement.setCellIndex(int): missing
in sun1.5
method
org.w3c.dom.html.HTMLTableRowElement.setCells(org.w3c.dom.html.HTMLCollection):
missing in sun1.5
method org.w3c.dom.html.HTMLTableRowElement.setRowIndex(int): missing in
sun1.5
method org.w3c.dom.html.HTMLTableRowElement.setSectionRowIndex(int):
missing in sun1.5
Abs.add
method org.w3c.dom.html.HTMLFrameElement.getContentDocument(): new
interface method in sun1.5
method org.w3c.dom.html.HTMLIFrameElement.getContentDocument(): new
interface method in sun1.5
method org.w3c.dom.html.HTMLObjectElement.getContentDocument(): new
interface method in sun1.5
method org.w3c.dom.html.HTMLOptionElement.setSelected(boolean): new
interface method in sun1.5

org.w3c.dom.xpath:
Missing
package org.w3c.dom.xpath: missing in sun1.5


So other than the problems we identified before, there seem to be two
more issues:

 1) java.lang.StringBuilder.append(java.lang.StringBuilder) missing in
sun1.5

 2) package org.w3c.dom.xpath: missing in sun1.5


                                  - o -

The results show clearly that japitools did indeed improve a lot over
the last released version.

NOTE: the results were taken with the following package passed to the
"japize" tool:

 +java +javax +org -org.apache -org.ietf

-- 
Stefano.


Re: [Japi] [general] interesting discoveries with japitools - part 2

Posted by Stuart Ballard <st...@gmail.com>.
On 11/7/06, Stefano Mazzocchi <st...@apache.org> wrote:
> java.awt.peer:
> Missing
> method java.awt.peer.WindowPeer.updateFocusableWindowState(): missing in
> bea1.5

This one indicates that your set of packages is not correct:
java.awt.peer is not a documented package. Unfortunately getting the
right set of packages is hard on Windows - I just posted on
japitools-list about improving that situation. If you do happen to be
on a unix-like system this should work:

japiextractpkgs docs/api/overview-frame.html >jdk15.pkgs
japize as jdk15 packages jre/lib/*.jar `cat jdk15.pkgs`

where "docs/api" is a folder containing the JDK javadocs.

The trouble is that the "backquote" quoting and the cat command aren't
available on Windows and I'm not aware of an alternative. So the plan
is to get Japize to accept "@jdk15.pkgs" as an alternative syntax. Any
volunteers or anyone who knows where I could find code to do that,
dealing with quoting and the like, under a GPL-compatible license,
please speak up on japitools-list...

> java.util.concurrent:
> Abs.add
> method java.util.concurrent.Delayed.compareTo(java.lang.Object): new
> interface method in bea1.5
>
>
> So, it appears that that Sun added a method that is not available in the
> javadocs (bad Sun, no donut for you!) and that BEA did not (correctly)
> implement.
>
> Also, BEA added the method "compareTo" to the
> java.util.concurrent.Delayed interface. This is not really a problem
> because Delayed extends Comparable, therefore all classes implementing
> Delayed will have to have the compareTo method anyway.

Comparable is really fun in the presence of generics. Does Delayed
implement Comparable or Comparable<Delayed> or Comparable<? extends
Delayed> or what?

If it implements Comparable<Delayed> then it *doesn't* technically
have a compareTo(Object) method but a compareTo(Delayed) instead. If
Sun added a compareTo(Object) method as well... well that'd have some
rather weird effects. I'll need to take a while to get my head round
that. Could you produce and send me Japi files of *just* the Delayed
class in both implementations so I can look at the differences in
detail?

> Stuart, do you think this is something that japitools should check?
>
> I would call this a false positive.

I think it's an indicator of something, I'd say more investigation is
needed before determining it's a Japitools bug.

> java.awt.peer:
> Missing
> method java.awt.peer.WindowPeer.updateFocusableWindowState(): missing in
> ibm1.5

Again peer should not be included.

> java.util.concurrent:
> Abs.add
> method java.util.concurrent.Delayed.compareTo(java.lang.Object): new
> interface method in ibm1.5

Same as above.

> javax.xml.datatype:
> Bad
> field
> javax.xml.datatype.DatatypeFactory.DATATYPEFACTORY_IMPLEMENTATION_CLASS:
> constant
> [com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl]
> in sun1.5, but constant
> [org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl] in ibm1.5

This is an API bug on Sun's part; alternative implementers are screwed
here either way. Constant fields are inlined so the value will be
taken from the implementation the code was *compiled* against, not
what it's running against. Japitools is correct to report this as an
error, but the only *correct* fix is for Sun to un-constify that
field.

> java.util.concurrent:
> Abs.add
> method java.util.concurrent.Delayed.compareTo(java.lang.Object): new
> interface method in sun1.5
> Done.
>
> Hmmm, the compareTo is in both the direct and the reverse? smells like a
> japitool bug to me.

Yes that is odd. Please do send me those two Japi files.

> java.lang:
> Missing
> method java.lang.StringBuilder.append(java.lang.StringBuilder): missing
> in sun1.5

Weird.

>  2) package org.w3c.dom.xpath: missing in sun1.5

This again is a "not getting the right set of packages" issue. Adding
extra packages isn't illegal (at least not in Japitools's view of the
world); the comparisons should be done based on which packages are
*documented* as present.

> The results show clearly that japitools did indeed improve a lot over
> the last released version.

Great :)

> NOTE: the results were taken with the following package passed to the
> "japize" tool:
>
>  +java +javax +org -org.apache -org.ietf

Yup, that's your trouble ;)

Stuart.
-- 
http://sab39.dev.netreach.com/