classpath
[Top][All Lists]
Advanced

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

Re: Japi vs JEditorPaneAccessibleHypertextSupport


From: Tom Tromey
Subject: Re: Japi vs JEditorPaneAccessibleHypertextSupport
Date: 08 Nov 2005 19:23:14 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Stuart> The current japi results show that the only non-minor error in the
Stuart> top-level javax.swing package against 1.2 is that the constructor of
Stuart> JEditorPaneAccessibleHypertextSupport

I love the description of this constructor in the online javadoc.

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

The rule is, a default constructor inherits the access of its class.
I.E., 'protected' is correct here.

So, we should just define our own public no-argument constructor here.

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

Perhaps you can do it by noticing if the class has a synthetic
'this$0' field.  This is the usual name for an 'outer this'
reference, meaning that the class is not static.

Tom




reply via email to

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