This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: AWT fixlet
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: classpath-patches at gnu dot org
- Date: 25 Apr 2005 18:18:33 -0600
- Subject: Patch: FYI: AWT fixlet
- Reply-to: tromey at redhat dot com
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,