[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"enum" variables (patch)
From: |
Matthias Pfisterer |
Subject: |
"enum" variables (patch) |
Date: |
Wed, 21 Jan 2004 18:31:18 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 |
Hi,
in Java 1.5, "enum" is a keyword. Therefore it can no longer be used for
variable names. I've made a patch that changes all variables "enum".
Matthias
--
Matthias Pfisterer <mailto:address@hidden>
Reuchlinstrasse 28 phone ++49-711-62 87 12
D-70176 Stuttgart (in Deutschland 0711-62 87 12)
GERMANY
Work like you don't need the money.
Love like you've never been hurt.
Dance like nobody is watching.
Java Sound Resources (examples, FAQ, applications):
http://www.jsresources.org/
Tritonus, the open source implementation of the Java Sound API:
http://www.tritonus.org/
--------------------------------------------------------------
Index: external/jaxp/source/gnu/xml/aelfred2/XmlParser.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/external/jaxp/source/gnu/xml/aelfred2/XmlParser.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 XmlParser.java
--- external/jaxp/source/gnu/xml/aelfred2/XmlParser.java 1 Feb 2003
02:10:12 -0000 1.1.1.1
+++ external/jaxp/source/gnu/xml/aelfred2/XmlParser.java 21 Jan 2004
17:29:53 -0000
@@ -1504,7 +1504,7 @@
{
String name;
String type;
- String enum = null;
+ String enumStr= null;
// Read the attribute name.
name = readNmtoken (true);
@@ -1515,11 +1515,11 @@
// Get the string of enumerated values if necessary.
if ("ENUMERATION" == type || "NOTATION" == type)
- enum = dataBufferToString ();
+ enumStr = dataBufferToString ();
// Read the default value.
requireWhitespace ();
- parseDefault (elementName, name, type, enum);
+ parseDefault (elementName, name, type, enumStr);
}
@@ -1616,7 +1616,7 @@
String elementName,
String name,
String type,
- String enum
+ String enumStr
) throws Exception
{
int valueType = ATTRIBUTE_DEFAULT_SPECIFIED;
@@ -1654,11 +1654,11 @@
} else
value = readLiteral (flags);
expandPE = saved;
- setAttribute (elementName, name, type, enum, value, valueType);
+ setAttribute (elementName, name, type, enumStr, value, valueType);
if ("ENUMERATION" == type)
- type = enum;
+ type = enumStr;
else if ("NOTATION" == type)
- type = "NOTATION " + enum;
+ type = "NOTATION " + enumStr;
if (!skippedPE) handler.getDeclHandler ()
.attributeDecl (elementName, name, type, defaultType, value);
}
Index: gnu/java/beans/BeanInfoEmbryo.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/beans/BeanInfoEmbryo.java,v
retrieving revision 1.7
diff -u -r1.7 BeanInfoEmbryo.java
--- gnu/java/beans/BeanInfoEmbryo.java 23 Feb 2002 09:19:52 -0000 1.7
+++ gnu/java/beans/BeanInfoEmbryo.java 21 Jan 2004 17:29:55 -0000
@@ -78,9 +78,9 @@
PropertyDescriptor[] Aproperties = new
PropertyDescriptor[properties.size()];
int i = 0;
- Enumeration enum = properties.elements();
- while(enum.hasMoreElements()) {
- Aproperties[i] = (PropertyDescriptor)enum.nextElement();
+ Enumeration descriptors = properties.elements();
+ while(descriptors.hasMoreElements()) {
+ Aproperties[i] =
(PropertyDescriptor)descriptors.nextElement();
if(defaultPropertyName != null &&
Aproperties[i].getName().equals(defaultPropertyName)) {
defaultProperty = i;
}
@@ -89,9 +89,9 @@
EventSetDescriptor[] Aevents = new
EventSetDescriptor[events.size()];
i = 0;
- enum = events.elements();
- while(enum.hasMoreElements()) {
- Aevents[i] = (EventSetDescriptor)enum.nextElement();
+ descriptors = events.elements();
+ while(descriptors.hasMoreElements()) {
+ Aevents[i] =
(EventSetDescriptor)descriptors.nextElement();
if(defaultEventName != null &&
Aevents[i].getName().equals(defaultEventName)) {
defaultEvent = i;
}
Index: java/awt/im/InputContext.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/im/InputContext.java,v
retrieving revision 1.3
diff -u -r1.3 InputContext.java
--- java/awt/im/InputContext.java 11 Jul 2003 17:50:02 -0000 1.3
+++ java/awt/im/InputContext.java 21 Jan 2004 17:30:13 -0000
@@ -86,20 +86,20 @@
private static final ArrayList descriptors = new ArrayList();
static
{
- Enumeration enum;
+ Enumeration resources;
try
{
- enum = ClassLoader.getSystemResources
+ resources = ClassLoader.getSystemResources
("META_INF/services/java.awt.im.spi.InputMethodDescriptor");
}
catch (IOException ex)
{
// XXX Should we do something else?
- enum = EmptyEnumeration.getInstance();
+ resources = EmptyEnumeration.getInstance();
}
- while (enum.hasMoreElements())
+ while (resources.hasMoreElements())
{
- URL url = (URL) enum.nextElement();
+ URL url = (URL) resources.nextElement();
BufferedReader in;
String line;
try
Index: java/io/SequenceInputStream.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/io/SequenceInputStream.java,v
retrieving revision 1.6
diff -u -r1.6 SequenceInputStream.java
--- java/io/SequenceInputStream.java 22 Jan 2002 22:26:59 -0000 1.6
+++ java/io/SequenceInputStream.java 21 Jan 2004 17:30:14 -0000
@@ -72,7 +72,7 @@
private InputStream in2;
/** The enum handle; not used if constructed w/ 2 explicit input streams. */
- private Enumeration enum;
+ private Enumeration inStreams;
/**
* This method creates a new <code>SequenceInputStream</code> that obtains
@@ -84,8 +84,8 @@
*/
public SequenceInputStream(Enumeration e)
{
- enum = e;
- in = (InputStream) enum.nextElement();
+ inStreams = e;
+ in = (InputStream) inStreams.nextElement();
in2 = null;
}
@@ -204,10 +204,10 @@
{
InputStream nextIn = null;
- if (enum != null)
+ if (inStreams != null)
{
- if (enum.hasMoreElements())
- nextIn = (InputStream) enum.nextElement();
+ if (inStreams.hasMoreElements())
+ nextIn = (InputStream) inStreams.nextElement();
}
else
if (in2 != null)
Index: java/util/zip/ZipOutputStream.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/zip/ZipOutputStream.java,v
retrieving revision 1.7
diff -u -r1.7 ZipOutputStream.java
--- java/util/zip/ZipOutputStream.java 18 Jun 2003 09:42:57 -0000 1.7
+++ java/util/zip/ZipOutputStream.java 21 Jan 2004 17:30:16 -0000
@@ -338,10 +338,10 @@
int numEntries = 0;
int sizeEntries = 0;
- Enumeration enum = entries.elements();
- while (enum.hasMoreElements())
+ Enumeration elements = entries.elements();
+ while (elements.hasMoreElements())
{
- ZipEntry entry = (ZipEntry) enum.nextElement();
+ ZipEntry entry = (ZipEntry) elements.nextElement();
int method = entry.getMethod();
writeLeInt(CENSIG);
Index: javax/swing/plaf/basic/BasicLookAndFeel.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java,v
retrieving revision 1.4
diff -u -r1.4 BasicLookAndFeel.java
--- javax/swing/plaf/basic/BasicLookAndFeel.java 2 Jul 2003 05:21:52
-0000 1.4
+++ javax/swing/plaf/basic/BasicLookAndFeel.java 21 Jan 2004 17:30:16
-0000
@@ -205,15 +205,15 @@
private void loadResourceBundle(UIDefaults defaults)
{
ResourceBundle bundle;
- Enumeration enum;
+ Enumeration keys;
String key;
String value;
bundle = ResourceBundle.getBundle("resources/basic");
// Process Resources
- enum = bundle.getKeys();
- while (enum.hasMoreElements())
+ keys = bundle.getKeys();
+ while (keys.hasMoreElements())
{
- key = (String) enum.nextElement();
+ key = (String) keys.nextElement();
value = bundle.getString(key);
defaults.put(key, value);
}
Index: javax/swing/tree/DefaultMutableTreeNode.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/tree/DefaultMutableTreeNode.java,v
retrieving revision 1.4
diff -u -r1.4 DefaultMutableTreeNode.java
--- javax/swing/tree/DefaultMutableTreeNode.java 12 Oct 2003 16:48:34
-0000 1.4
+++ javax/swing/tree/DefaultMutableTreeNode.java 21 Jan 2004 17:30:16
-0000
@@ -997,21 +997,21 @@
public int getLeafCount() {
// Variables
- Enumeration enum;
+ Enumeration nodes;
int count;
TreeNode current;
// Get Enumeration of all descendants
- enum = depthFirstEnumeration();
+ nodes = depthFirstEnumeration();
// Process Nodes
count = 0;
- while (enum.hasMoreElements() == true) {
- current = (TreeNode) enum.nextElement();
- if (current.isLeaf() == true) {
+ while (nodes.hasMoreElements()) {
+ current = (TreeNode) nodes.nextElement();
+ if (current.isLeaf()) {
count++;
} // if
- } // if
+ } // while
return count;
- "enum" variables (patch),
Matthias Pfisterer <=