From fca129b90afe8350ecca2e908916afa6386d548a Mon Sep 17 00:00:00 2001 From: hoenicke Date: Thu, 13 Oct 2005 10:34:54 +0000 Subject: [PATCH] enum -> enumeration (jdk1.5) git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1396 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/bytecode/ClassInfo.java.in | 6 ++-- jode/jode/decompiler/LocalInfo.java | 30 ++++++++-------- jode/jode/decompiler/Main.java | 12 +++---- jode/jode/decompiler/MethodAnalyzer.java.in | 36 +++++++++---------- jode/jode/decompiler/OuterValues.java | 6 ++-- jode/jode/decompiler/TabbedPrintWriter.java | 32 ++++++++--------- .../jode/obfuscator/PackageIdentifier.java.in | 12 +++---- jode/jode/swingui/HierarchyTreeModel.java.in | 12 +++---- jode/jode/swingui/PackagesTreeModel.java.in | 6 ++-- 9 files changed, 76 insertions(+), 76 deletions(-) diff --git a/jode/jode/bytecode/ClassInfo.java.in b/jode/jode/bytecode/ClassInfo.java.in index 09ec98d..7db468f 100644 --- a/jode/jode/bytecode/ClassInfo.java.in +++ b/jode/jode/bytecode/ClassInfo.java.in @@ -124,14 +124,14 @@ public class ClassInfo extends BinaryInfo { } public static Enumeration getClassesAndPackages(final String packageName) { - final Enumeration enum = + final Enumeration enumeration = classpath.listFiles(packageName.replace('.','/')); return new Enumeration() { public boolean hasMoreElements() { - return enum.hasMoreElements(); + return enumeration.hasMoreElements(); } public Object nextElement() { - String name = (String) enum.nextElement(); + String name = (String) enumeration.nextElement(); if (!name.endsWith(".class")) // This is a package return name; diff --git a/jode/jode/decompiler/LocalInfo.java b/jode/jode/decompiler/LocalInfo.java index cd50a88..afa74dc 100644 --- a/jode/jode/decompiler/LocalInfo.java +++ b/jode/jode/decompiler/LocalInfo.java @@ -153,10 +153,10 @@ public class LocalInfo implements Declarable { boolean needTypeUpdate = !shadow.type.equals(type); - java.util.Enumeration enum = operators.elements(); - while (enum.hasMoreElements()) { + java.util.Enumeration enumeration = operators.elements(); + while (enumeration.hasMoreElements()) { LocalVarOperator lvo = - (LocalVarOperator) enum.nextElement(); + (LocalVarOperator) enumeration.nextElement(); if (needTypeUpdate) { if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0) @@ -166,9 +166,9 @@ public class LocalInfo implements Declarable { shadow.operators.addElement(lvo); } - enum = hints.elements(); - while (enum.hasMoreElements()) { - Object hint = enum.nextElement(); + enumeration = hints.elements(); + while (enumeration.hasMoreElements()) { + Object hint = enumeration.nextElement(); if (!shadow.hints.contains(hint)) shadow.hints.addElement(hint); } @@ -209,9 +209,9 @@ public class LocalInfo implements Declarable { return shadow.guessName(); } if (name == null) { - Enumeration enum = hints.elements(); - while (enum.hasMoreElements()) { - Hint hint = (Hint) enum.nextElement(); + Enumeration enumeration = hints.elements(); + while (enumeration.hasMoreElements()) { + Hint hint = (Hint) enumeration.nextElement(); if (type.isOfType(hint.getType())) { name = hint.getName(); setType(hint.getType()); @@ -322,9 +322,9 @@ public class LocalInfo implements Declarable { if (!li.type.equals(newType)) { li.type = newType; - java.util.Enumeration enum = li.operators.elements(); - while (enum.hasMoreElements()) { - LocalVarOperator lvo = (LocalVarOperator) enum.nextElement(); + java.util.Enumeration enumeration = li.operators.elements(); + while (enumeration.hasMoreElements()) { + LocalVarOperator lvo = (LocalVarOperator) enumeration.nextElement(); if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0) GlobalOptions.err.println("updating "+lvo); lvo.updateType(); @@ -377,10 +377,10 @@ public class LocalInfo implements Declarable { public boolean markFinal() { LocalInfo li = getLocalInfo(); - Enumeration enum = li.operators.elements(); + Enumeration enumeration = li.operators.elements(); int writes = 0; - while (enum.hasMoreElements()) { - if (((LocalVarOperator) enum.nextElement()).isWrite()) + while (enumeration.hasMoreElements()) { + if (((LocalVarOperator) enumeration.nextElement()).isWrite()) writes++; } /* FIXME: Check if declaring final is okay */ diff --git a/jode/jode/decompiler/Main.java b/jode/jode/decompiler/Main.java index 26493b4..b3c3d6e 100644 --- a/jode/jode/decompiler/Main.java +++ b/jode/jode/decompiler/Main.java @@ -230,9 +230,9 @@ public class Main extends Options { GlobalOptions.err.println(); if (failedClasses.size() > 0) { GlobalOptions.err.println("Failed to decompile these classes:"); - Enumeration enum = failedClasses.elements(); - while (enum.hasMoreElements()) { - GlobalOptions.err.println("\t" + enum.nextElement()); + Enumeration enumeration = failedClasses.elements(); + while (enumeration.hasMoreElements()) { + GlobalOptions.err.println("\t" + enumeration.nextElement()); } GlobalOptions.err.println("Failed to decompile " + failedClasses.size() + " classes."); } @@ -387,10 +387,10 @@ public class Main extends Options { ClassInfo.setClassPath(params[i] + Decompiler.altPathSeparatorChar + classPath); - Enumeration enum = new ZipFile(params[i]).entries(); - while (enum.hasMoreElements()) { + Enumeration enumeration = new ZipFile(params[i]).entries(); + while (enumeration.hasMoreElements()) { String entry - = ((ZipEntry) enum.nextElement()).getName(); + = ((ZipEntry) enumeration.nextElement()).getName(); if (entry.endsWith(".class")) { entry = entry.substring(0, entry.length() - 6) .replace('/', '.'); diff --git a/jode/jode/decompiler/MethodAnalyzer.java.in b/jode/jode/decompiler/MethodAnalyzer.java.in index 0585b5c..7ac6f35 100644 --- a/jode/jode/decompiler/MethodAnalyzer.java.in +++ b/jode/jode/decompiler/MethodAnalyzer.java.in @@ -674,9 +674,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { */ public void makeDeclaration(Set done) { if (innerAnalyzers != null) { - for (Enumeration enum = innerAnalyzers.elements(); - enum.hasMoreElements(); ) { - ClassAnalyzer classAna = (ClassAnalyzer) enum.nextElement(); + for (Enumeration enumeration = innerAnalyzers.elements(); + enumeration.hasMoreElements(); ) { + ClassAnalyzer classAna = (ClassAnalyzer) enumeration.nextElement(); if (classAna.getParent() == this) { OuterValues innerOV = classAna.getOuterValues(); for (int i=0; i < innerOV.getCount(); i++) { @@ -692,9 +692,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { } } - for (Enumeration enum = allLocals.elements(); - enum.hasMoreElements(); ) { - LocalInfo li = (LocalInfo)enum.nextElement(); + for (Enumeration enumeration = allLocals.elements(); + enumeration.hasMoreElements(); ) { + LocalInfo li = (LocalInfo)enumeration.nextElement(); if (!li.isShadow()) imports.useType(li.getType()); } @@ -947,9 +947,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { * exists. */ public LocalInfo findLocal(String name) { - Enumeration enum = allLocals.elements(); - while (enum.hasMoreElements()) { - LocalInfo li = (LocalInfo) enum.nextElement(); + Enumeration enumeration = allLocals.elements(); + while (enumeration.hasMoreElements()) { + LocalInfo li = (LocalInfo) enumeration.nextElement(); if (li.getName().equals(name)) return li; } @@ -964,9 +964,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { */ public ClassAnalyzer findAnonClass(String name) { if (innerAnalyzers != null) { - Enumeration enum = innerAnalyzers.elements(); - while (enum.hasMoreElements()) { - ClassAnalyzer classAna = (ClassAnalyzer) enum.nextElement(); + Enumeration enumeration = innerAnalyzers.elements(); + while (enumeration.hasMoreElements()) { + ClassAnalyzer classAna = (ClassAnalyzer) enumeration.nextElement(); if (classAna.getParent() == this && classAna.getName() != null && classAna.getName().equals(name)) { @@ -1115,9 +1115,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { */ public ClassAnalyzer getClassAnalyzer(ClassInfo cinfo) { if (innerAnalyzers != null) { - Enumeration enum = innerAnalyzers.elements(); - while (enum.hasMoreElements()) { - ClassAnalyzer classAna = (ClassAnalyzer) enum.nextElement(); + Enumeration enumeration = innerAnalyzers.elements(); + while (enumeration.hasMoreElements()) { + ClassAnalyzer classAna = (ClassAnalyzer) enumeration.nextElement(); if (classAna.getClazz().equals(cinfo)) { if (classAna.getParent() != this) { ClassDeclarer declarer = classAna.getParent(); @@ -1150,9 +1150,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { if (usedAnalyzers != null) used.addAll(usedAnalyzers); if (innerAnalyzers != null) { - Enumeration enum = innerAnalyzers.elements(); - while (enum.hasMoreElements()) { - ClassAnalyzer classAna = (ClassAnalyzer) enum.nextElement(); + Enumeration enumeration = innerAnalyzers.elements(); + while (enumeration.hasMoreElements()) { + ClassAnalyzer classAna = (ClassAnalyzer) enumeration.nextElement(); if (classAna.getParent() == this) classAna.fillDeclarables(used); } diff --git a/jode/jode/decompiler/OuterValues.java b/jode/jode/decompiler/OuterValues.java index 5a663b2..55f499e 100644 --- a/jode/jode/decompiler/OuterValues.java +++ b/jode/jode/decompiler/OuterValues.java @@ -340,9 +340,9 @@ public class OuterValues } if (ovListeners != null) { - for (Enumeration enum = ovListeners.elements(); - enum.hasMoreElements();) - ((OuterValueListener) enum.nextElement() + for (Enumeration enumeration = ovListeners.elements(); + enumeration.hasMoreElements();) + ((OuterValueListener) enumeration.nextElement() ).shrinkingOuterValues(this, newHeadCount); } } diff --git a/jode/jode/decompiler/TabbedPrintWriter.java b/jode/jode/decompiler/TabbedPrintWriter.java index e9db787..842363f 100644 --- a/jode/jode/decompiler/TabbedPrintWriter.java +++ b/jode/jode/decompiler/TabbedPrintWriter.java @@ -143,16 +143,16 @@ public class TabbedPrintWriter { String parens = "{\010{}\010}<\010<>\010>[\010[]\010]`\010`'\010'" .substring(options*6, options*6+6); pw.print(parens.substring(0,3)); - Enumeration enum = childBPs.elements(); + Enumeration enumeration = childBPs.elements(); int cur = startPos; - BreakPoint child = (BreakPoint) enum.nextElement(); + BreakPoint child = (BreakPoint) enumeration.nextElement(); if (child.startPos >= 0) { pw.print(line.substring(cur, child.startPos)); child.dumpRegion(line); cur = child.endPos; } - while (enum.hasMoreElements()) { - child = (BreakPoint) enum.nextElement(); + while (enumeration.hasMoreElements()) { + child = (BreakPoint) enumeration.nextElement(); pw.print(line.substring(cur, child.breakPos)); pw.print("!\010!"+breakPenalty); cur = child.breakPos; @@ -182,9 +182,9 @@ public class TabbedPrintWriter { indent++; } - Enumeration enum = childBPs.elements(); + Enumeration enumeration = childBPs.elements(); int cur = startPos; - BreakPoint child = (BreakPoint) enum.nextElement(); + BreakPoint child = (BreakPoint) enumeration.nextElement(); if (child.startPos >= 0) { pw.print(line.substring(cur, child.startPos)); child.printRegion(indent + child.startPos - cur, line); @@ -193,8 +193,8 @@ public class TabbedPrintWriter { if (options == NO_PAREN) indent += indentsize; String indentStr = makeIndentStr(indent); - while (enum.hasMoreElements()) { - child = (BreakPoint) enum.nextElement(); + while (enumeration.hasMoreElements()) { + child = (BreakPoint) enumeration.nextElement(); pw.print(line.substring(cur, child.breakPos)); pw.println(); pw.print(indentStr); @@ -318,14 +318,14 @@ public class TabbedPrintWriter { lastSpace -= 2; } - Enumeration enum = childBPs.elements(); + Enumeration enumeration = childBPs.elements(); childBPs = new Vector(); int currInd = 0; BreakPoint lastChild, nextChild; boolean indentNext = options == NO_PAREN; - for (lastChild = (BreakPoint) enum.nextElement(); - enum.hasMoreElements(); lastChild = nextChild) { - nextChild = (BreakPoint) enum.nextElement(); + for (lastChild = (BreakPoint) enumeration.nextElement(); + enumeration.hasMoreElements(); lastChild = nextChild) { + nextChild = (BreakPoint) enumeration.nextElement(); int childStart = lastChild.breakPos; int childEnd = nextChild.breakPos; @@ -391,12 +391,12 @@ public class TabbedPrintWriter { } if (space < 0) return minPenalty; - Enumeration enum = childBPs.elements(); + Enumeration enumeration = childBPs.elements(); BreakPoint lastChild, nextChild; boolean indentNext = options == NO_PAREN; - for (lastChild = (BreakPoint) enum.nextElement(); - enum.hasMoreElements(); lastChild = nextChild) { - nextChild = (BreakPoint) enum.nextElement(); + for (lastChild = (BreakPoint) enumeration.nextElement(); + enumeration.hasMoreElements(); lastChild = nextChild) { + nextChild = (BreakPoint) enumeration.nextElement(); int childStart = lastChild.breakPos; int childEnd = nextChild.breakPos; diff --git a/jode/jode/obfuscator/PackageIdentifier.java.in b/jode/jode/obfuscator/PackageIdentifier.java.in index b6bd8a3..4dac970 100644 --- a/jode/jode/obfuscator/PackageIdentifier.java.in +++ b/jode/jode/obfuscator/PackageIdentifier.java.in @@ -77,10 +77,10 @@ public class PackageIdentifier extends Identifier { (fullName.length() > 0) ? fullName + "." : ""; // Load all classes and packages now, so they don't get stripped - Enumeration enum = + Enumeration enumeration = ClassInfo.getClassesAndPackages(getFullName()); - while (enum.hasMoreElements()) { - String subclazz = ((String)enum.nextElement()).intern(); + while (enumeration.hasMoreElements()) { + String subclazz = ((String)enumeration.nextElement()).intern(); String subFull = (fullNamePrefix + subclazz).intern(); if (ClassInfo.isPackage(subFull) @@ -232,10 +232,10 @@ public class PackageIdentifier extends Identifier { String fullNamePrefix = (fullName.length() > 0) ? fullName + "." : ""; /* Load all matching classes and packages */ - Enumeration enum = + Enumeration enumeration = ClassInfo.getClassesAndPackages(getFullName()); - while (enum.hasMoreElements()) { - String subclazz = ((String)enum.nextElement()).intern(); + while (enumeration.hasMoreElements()) { + String subclazz = ((String)enumeration.nextElement()).intern(); String subFull = (fullNamePrefix + subclazz).intern(); if (matcher.matchesSub(this, subclazz)) { diff --git a/jode/jode/swingui/HierarchyTreeModel.java.in b/jode/jode/swingui/HierarchyTreeModel.java.in index cc7e048..50f1da8 100644 --- a/jode/jode/swingui/HierarchyTreeModel.java.in +++ b/jode/jode/swingui/HierarchyTreeModel.java.in @@ -113,11 +113,11 @@ public class HierarchyTreeModel implements TreeModel, Runnable { if (depth++ >= MAX_PACKAGE_LEVEL) return count; String prefix = packageName.length() == 0 ? "" : packageName + "."; - Enumeration enum = + Enumeration enumeration = ClassInfo.getClassesAndPackages(packageName); - while (enum.hasMoreElements()) { + while (enumeration.hasMoreElements()) { //insert sorted and remove double elements; - String name = (String)enum.nextElement(); + String name = (String)enumeration.nextElement(); String fqn = prefix + name; if (ClassInfo.isPackage(fqn)) { count = readPackage(depth, classes, fqn, count); @@ -138,11 +138,11 @@ public class HierarchyTreeModel implements TreeModel, Runnable { return 0; int number = 0; String prefix = packageName.length() == 0 ? "" : packageName + "."; - Enumeration enum = + Enumeration enumeration = ClassInfo.getClassesAndPackages(packageName); - while (enum.hasMoreElements()) { + while (enumeration.hasMoreElements()) { //insert sorted and remove double elements; - String name = (String)enum.nextElement(); + String name = (String)enumeration.nextElement(); String fqn = prefix + name; if (ClassInfo.isPackage(fqn)) { number += countClasses(depth, fqn); diff --git a/jode/jode/swingui/PackagesTreeModel.java.in b/jode/jode/swingui/PackagesTreeModel.java.in index 87e6380..1dde773 100644 --- a/jode/jode/swingui/PackagesTreeModel.java.in +++ b/jode/jode/swingui/PackagesTreeModel.java.in @@ -114,11 +114,11 @@ public class PackagesTreeModel implements TreeModel { if (result == null) { TreeSet v = new TreeSet(); String prefix = parent == root ? "" : parent.getFullName() + "."; - Enumeration enum = + Enumeration enumeration = ClassInfo.getClassesAndPackages(parent.getFullName()); - while (enum.hasMoreElements()) { + while (enumeration.hasMoreElements()) { //insert sorted and remove double elements; - String name = (String)enum.nextElement(); + String name = (String)enumeration.nextElement(); String fqn = prefix + name; boolean isClass = !ClassInfo.isPackage(fqn);