classpath
[Top][All Lists]
Advanced

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

Japi vs JEditorPaneAccessibleHypertextSupport


From: Stuart Ballard
Subject: Japi vs JEditorPaneAccessibleHypertextSupport
Date: Tue, 8 Nov 2005 20:20:27 -0500

The current japi results show that the only non-minor error in the
top-level javax.swing package against 1.2 is that the constructor of
JEditorPaneAccessibleHypertextSupport (which I'm going to call JEPAHS
from now on because I can't be bothered to type all that) is protected
in classpath but public in the JDK. I thought that would be a nice
easy bit of green to add, but when I went to create a patch I realized
the problem: there *is* no constructor of JEPAHS.

Basically, JEPAHS is a protected non-static inner class of JEditorPane
so the compiler translates the usual default no-argument constructor
into a constructor that takes a JEditorPane argument[1]. However, it
looks like javac makes that constructor public where gcj(?) is making
it protected.

What I'm wondering is whether this is a compiler bug or whether it's
simply undefined behavior that japi should account for and ignore.

My guess is that the compiler is wrong. It seems to me that a subclass
of JEditorPane (that's not in the same package) wouldn't be able to
access the constructor if it were protected, because protected would
mean accessible to subclasses of JEPAHS, not of JEditorPane.

Anyone have any ideas whether I'm right or wrong about this?

If I'm right, I suspect we could work around the compiler bug by
explicitly declaring a no-argument public constructor in the class,
but it would probably be better to fix the compiler. On the other
hand, that would mean a japi error we can't eliminate until the next
gcc release...

Thoughts?
Stuart.

[1] Which raises another japi question: Should Japi automatically
remove these implicit arguments from nonstatic inner class
constructors so that its output matches what you'd actually put in
Java source? My gut feeling is yes, but I'm not sure exactly how to
detect them...
--
http://sab39.dev.netreach.com/




reply via email to

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