Patch: FYI: AWT fixlet

Tom Tromey tromey@redhat.com
Tue Apr 26 00:22:00 GMT 2005


I'm checking this in to libgcj and Classpath.

This avoids an accessor method in AWTKeyStroke.
IMO we should always avoid these, as they are simply bloat.
Eclipse and gcjx can both warn when one is created.

This particular one is helpful since it lets us BC-compile AWT.
I.e., it works around a gcj bug.  FWIW there are bunch more in Swing
which I imagine will be removed in the not-too-distant future.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* java/awt/AWTKeyStroke.java (vktable): Now package-private.

Index: java/awt/AWTKeyStroke.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/AWTKeyStroke.java,v
retrieving revision 1.5
diff -u -r1.5 AWTKeyStroke.java
--- java/awt/AWTKeyStroke.java 17 Feb 2005 07:48:23 -0000 1.5
+++ java/awt/AWTKeyStroke.java 26 Apr 2005 00:15:01 -0000
@@ -108,11 +108,12 @@
   private static Constructor ctor;
 
   /**
-   * A table of keyCode names to values.
+   * A table of keyCode names to values.  This is package-private to
+   * avoid an accessor method.
    *
    * @see #getAWTKeyStroke(String)
    */
-  private static final HashMap vktable = new HashMap();
+  static final HashMap vktable = new HashMap();
   static
   {
     // Using reflection saves the hassle of keeping this in sync with KeyEvent,



More information about the Java-patches mailing list