This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: fixes for enum keyword


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I just commited the attached patch to merge some fixes from classpath 
for the enum keywork of Java 1.5.


Michael


2004-05-30  Michael Koch  <konqueror@gmx.de>

	* gnu/java/beans/BeanInfoEmbryo.java,
	java/awt/im/InputContext.java,
	javax/swing/tree/DefaultMutableTreeNode.java:
	Rename enum to e because enum is a keyword in Java 1.5.


- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAueNtWSOgCCdjSDsRAl9HAKCK86zSHOQdZOD4BqWSy+m0oWzqgQCcDPvB
c8tUZlGbGi3GOPf86CUkNy0=
=wPWS
-----END PGP SIGNATURE-----
Index: gnu/java/beans/BeanInfoEmbryo.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/beans/BeanInfoEmbryo.java,v
retrieving revision 1.4
diff -u -b -B -r1.4 BeanInfoEmbryo.java
--- gnu/java/beans/BeanInfoEmbryo.java	3 May 2004 19:52:26 -0000	1.4
+++ gnu/java/beans/BeanInfoEmbryo.java	30 May 2004 13:34:50 -0000
@@ -85,9 +85,9 @@
 
 		PropertyDescriptor[] Aproperties = new PropertyDescriptor[properties.size()];
 		int i = 0;
-		Enumeration enum = properties.elements();
-		while(enum.hasMoreElements()) {
-			Aproperties[i] = (PropertyDescriptor)enum.nextElement();
+		Enumeration e = properties.elements();
+		while (e.hasMoreElements()) {
+			Aproperties[i] = (PropertyDescriptor) e.nextElement();
 			if(defaultPropertyName != null && Aproperties[i].getName().equals(defaultPropertyName)) {
 				defaultProperty = i;
 			}
@@ -96,9 +96,9 @@
 
 		EventSetDescriptor[] Aevents = new EventSetDescriptor[events.size()];
 		i = 0;
-		enum = events.elements();
-		while(enum.hasMoreElements()) {
-			Aevents[i] = (EventSetDescriptor)enum.nextElement();
+		e = events.elements();
+		while (e.hasMoreElements()) {
+			Aevents[i] = (EventSetDescriptor) e.nextElement();
 			if(defaultEventName != null && Aevents[i].getName().equals(defaultEventName)) {
 				defaultEvent = i;
 			}
Index: java/awt/im/InputContext.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/im/InputContext.java,v
retrieving revision 1.3
diff -u -b -B -r1.3 InputContext.java
--- java/awt/im/InputContext.java	11 Jul 2003 18:27:54 -0000	1.3
+++ java/awt/im/InputContext.java	30 May 2004 13:34:50 -0000
@@ -86,20 +86,20 @@
   private static final ArrayList descriptors = new ArrayList();
   static
   {
-    Enumeration enum;
+    Enumeration e;
     try
       {
-        enum = ClassLoader.getSystemResources
+        e = ClassLoader.getSystemResources
           ("META_INF/services/java.awt.im.spi.InputMethodDescriptor");
       }
     catch (IOException ex)
       {
         // XXX Should we do something else?
-        enum = EmptyEnumeration.getInstance();
+        e = EmptyEnumeration.getInstance();
       }
-    while (enum.hasMoreElements())
+    while (e.hasMoreElements())
       {
-        URL url = (URL) enum.nextElement();
+        URL url = (URL) e.nextElement();
         BufferedReader in;
         String line;
         try
@@ -125,7 +125,7 @@
                   }
                 line = in.readLine().trim();
               }
-            catch (IOException e)
+            catch (IOException ex)
               {
                 continue outer;
               }
Index: javax/swing/tree/DefaultMutableTreeNode.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/tree/DefaultMutableTreeNode.java,v
retrieving revision 1.4
diff -u -b -B -r1.4 DefaultMutableTreeNode.java
--- javax/swing/tree/DefaultMutableTreeNode.java	12 Oct 2003 13:33:32 -0000	1.4
+++ javax/swing/tree/DefaultMutableTreeNode.java	30 May 2004 13:34:50 -0000
@@ -997,17 +997,17 @@
 	public int getLeafCount() {
 
 		// Variables
-		Enumeration	enum;
+		Enumeration	e;
 		int			count;
 		TreeNode	current;
 
 		// Get Enumeration of all descendants
-		enum = depthFirstEnumeration();
+		e = depthFirstEnumeration();
 
 		// Process Nodes
 		count = 0;
-		while (enum.hasMoreElements() == true) {
-			current = (TreeNode) enum.nextElement();
+		while (e.hasMoreElements() == true) {
+			current = (TreeNode) e.nextElement();
 			if (current.isLeaf() == true) {
 				count++;
 			} // if

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]