Hi Wolfgang, can you check whether this fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26837 ?
cya Robert Wolfgang Baer wrote: > Hi, > > reverse japi points out that some methods must be overriden and > made final in Window. A mauve test for this is committed > (gnu/testlet/java/awt/Window/focusCycleRootTest.java). > > The API docs describe that these methods always return the same or > do nothing at all for Window. I needed to adjust one method > in Container to prevent a NPE. You can observe this NPE in the Swing > Demo if you use the ThemeEditor (try with and without the Container > NPE fixlet). > > Playing around with the Swing/Awt demos showed no further problems. > > 2006-03-23 Wolfgang Baer <[EMAIL PROTECTED]> > > * java/awt/Window.java: > (setFocusCycleRoot): New overriden method. > (isFocusCycleRoot): Likewise. > (getFocusCycleRootAncestor): Likewise. > * java/awt/Container.java: > (getFocusTraversalPolicy): Check also for anchestor == null. > > OK to commit, comments ? > > Wolfgang > > > > > ------------------------------------------------------------------------ > > Index: java/awt/Window.java > =================================================================== > RCS file: /cvsroot/classpath/classpath/java/awt/Window.java,v > retrieving revision 1.66 > diff -u -r1.66 Window.java > --- java/awt/Window.java 22 Mar 2006 19:15:21 -0000 1.66 > +++ java/awt/Window.java 23 Mar 2006 21:44:41 -0000 > @@ -1146,6 +1146,47 @@ > { > this.focusableWindowState = focusableWindowState; > } > + > + /** > + * Check whether this Container is a focus cycle root. > + * Returns always <code>true</code> as Windows are the > + * root of the focus cycle. > + * > + * @return Always <code>true</code>. > + * > + * @since 1.4 > + */ > + public final boolean isFocusCycleRoot() > + { > + return true; > + } > + > + /** > + * Set whether or not this Container is the root of a focus > + * traversal cycle. Windows are the root of the focus cycle > + * and therefore this method does nothing. > + * > + * @param focusCycleRoot ignored. > + * > + * @since 1.4 > + */ > + public final void setFocusCycleRoot(boolean focusCycleRoot) > + { > + // calls to the method are ignored > + } > + > + /** > + * Returns the root container that owns the focus cycle where this > + * component resides. Windows have no ancestors and this method > + * returns always <code>null</code>. > + * > + * @return Always <code>null</code>. > + * @since 1.4 > + */ > + public final Container getFocusCycleRootAncestor() > + { > + return null; > + } > > /** > * Generate a unique name for this window. > Index: java/awt/Container.java > =================================================================== > RCS file: /cvsroot/classpath/classpath/java/awt/Container.java,v > retrieving revision 1.89 > diff -u -r1.89 Container.java > --- java/awt/Container.java 15 Mar 2006 19:34:29 -0000 1.89 > +++ java/awt/Container.java 23 Mar 2006 21:44:42 -0000 > @@ -1465,7 +1465,7 @@ > { > Container ancestor = getFocusCycleRootAncestor (); > > - if (ancestor != this) > + if (ancestor != this && ancestor != null) > return ancestor.getFocusTraversalPolicy (); > else > {
signature.asc
Description: OpenPGP digital signature