japitools-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Japi] java.awt.font.TextLine.TextLineMetrics in JDK1.2


From: Stuart Ballard
Subject: [Japi] java.awt.font.TextLine.TextLineMetrics in JDK1.2
Date: Wed, 29 Nov 2006 09:15:20 -0500

By sheer coincidence while trying to answer a question from Roman
about percentages not adding up to 100%, I discovered this class.
java.awt.font.TextLine is non-public, but the javadoc for 1.2 says the
TextLineMetrics inner class is static and public. However, the javadoc
is wrong: A public inner class of a nonpublic class is not actually
public for all intents and purposes.

package foo;
class Foo {
 public static class Bar {}
}
package bar;
class Test {
 foo.Foo.Bar bar;
}

bar/Test.java will not compile - foo.Foo is inaccessible.

Japize knows about this, and in fact there's code in the method called
isEntirelyVisible that will cause it to skip a class with a nonpublic
containing class.

However, for some reason jdk12.japi still ends up with
TextLine.TextLineMetrics in it. My first thought as to why this is was
that I'd forgotten to call isEntirelyVisible, but I had, just not
where I thought it was.

So now my best guess is that for some reason ClassFile isn't
recognizing TextLine as TextLineMetrics's containing class. I'm going
to write a little test program to verify this but I just thought I'd
give a heads up.

Incidentally I checked in the change to treat all enums, and all their
methods, as final and nonabstract.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]