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
branch_1_1
hoenicke 19 years ago
parent 26933573bb
commit fca129b90a
  1. 6
      jode/jode/bytecode/ClassInfo.java.in
  2. 30
      jode/jode/decompiler/LocalInfo.java
  3. 12
      jode/jode/decompiler/Main.java
  4. 36
      jode/jode/decompiler/MethodAnalyzer.java.in
  5. 6
      jode/jode/decompiler/OuterValues.java
  6. 32
      jode/jode/decompiler/TabbedPrintWriter.java
  7. 12
      jode/jode/obfuscator/PackageIdentifier.java.in
  8. 12
      jode/jode/swingui/HierarchyTreeModel.java.in
  9. 6
      jode/jode/swingui/PackagesTreeModel.java.in

@ -124,14 +124,14 @@ public class ClassInfo extends BinaryInfo {
} }
public static Enumeration getClassesAndPackages(final String packageName) { public static Enumeration getClassesAndPackages(final String packageName) {
final Enumeration enum = final Enumeration enumeration =
classpath.listFiles(packageName.replace('.','/')); classpath.listFiles(packageName.replace('.','/'));
return new Enumeration() { return new Enumeration() {
public boolean hasMoreElements() { public boolean hasMoreElements() {
return enum.hasMoreElements(); return enumeration.hasMoreElements();
} }
public Object nextElement() { public Object nextElement() {
String name = (String) enum.nextElement(); String name = (String) enumeration.nextElement();
if (!name.endsWith(".class")) if (!name.endsWith(".class"))
// This is a package // This is a package
return name; return name;

@ -153,10 +153,10 @@ public class LocalInfo implements Declarable {
boolean needTypeUpdate = !shadow.type.equals(type); boolean needTypeUpdate = !shadow.type.equals(type);
java.util.Enumeration enum = operators.elements(); java.util.Enumeration enumeration = operators.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
LocalVarOperator lvo = LocalVarOperator lvo =
(LocalVarOperator) enum.nextElement(); (LocalVarOperator) enumeration.nextElement();
if (needTypeUpdate) { if (needTypeUpdate) {
if ((GlobalOptions.debuggingFlags if ((GlobalOptions.debuggingFlags
& GlobalOptions.DEBUG_TYPES) != 0) & GlobalOptions.DEBUG_TYPES) != 0)
@ -166,9 +166,9 @@ public class LocalInfo implements Declarable {
shadow.operators.addElement(lvo); shadow.operators.addElement(lvo);
} }
enum = hints.elements(); enumeration = hints.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
Object hint = enum.nextElement(); Object hint = enumeration.nextElement();
if (!shadow.hints.contains(hint)) if (!shadow.hints.contains(hint))
shadow.hints.addElement(hint); shadow.hints.addElement(hint);
} }
@ -209,9 +209,9 @@ public class LocalInfo implements Declarable {
return shadow.guessName(); return shadow.guessName();
} }
if (name == null) { if (name == null) {
Enumeration enum = hints.elements(); Enumeration enumeration = hints.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
Hint hint = (Hint) enum.nextElement(); Hint hint = (Hint) enumeration.nextElement();
if (type.isOfType(hint.getType())) { if (type.isOfType(hint.getType())) {
name = hint.getName(); name = hint.getName();
setType(hint.getType()); setType(hint.getType());
@ -322,9 +322,9 @@ public class LocalInfo implements Declarable {
if (!li.type.equals(newType)) { if (!li.type.equals(newType)) {
li.type = newType; li.type = newType;
java.util.Enumeration enum = li.operators.elements(); java.util.Enumeration enumeration = li.operators.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
LocalVarOperator lvo = (LocalVarOperator) enum.nextElement(); LocalVarOperator lvo = (LocalVarOperator) enumeration.nextElement();
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0) if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0)
GlobalOptions.err.println("updating "+lvo); GlobalOptions.err.println("updating "+lvo);
lvo.updateType(); lvo.updateType();
@ -377,10 +377,10 @@ public class LocalInfo implements Declarable {
public boolean markFinal() { public boolean markFinal() {
LocalInfo li = getLocalInfo(); LocalInfo li = getLocalInfo();
Enumeration enum = li.operators.elements(); Enumeration enumeration = li.operators.elements();
int writes = 0; int writes = 0;
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
if (((LocalVarOperator) enum.nextElement()).isWrite()) if (((LocalVarOperator) enumeration.nextElement()).isWrite())
writes++; writes++;
} }
/* FIXME: Check if declaring final is okay */ /* FIXME: Check if declaring final is okay */

@ -230,9 +230,9 @@ public class Main extends Options {
GlobalOptions.err.println(); GlobalOptions.err.println();
if (failedClasses.size() > 0) { if (failedClasses.size() > 0) {
GlobalOptions.err.println("Failed to decompile these classes:"); GlobalOptions.err.println("Failed to decompile these classes:");
Enumeration enum = failedClasses.elements(); Enumeration enumeration = failedClasses.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
GlobalOptions.err.println("\t" + enum.nextElement()); GlobalOptions.err.println("\t" + enumeration.nextElement());
} }
GlobalOptions.err.println("Failed to decompile " + failedClasses.size() + " classes."); GlobalOptions.err.println("Failed to decompile " + failedClasses.size() + " classes.");
} }
@ -387,10 +387,10 @@ public class Main extends Options {
ClassInfo.setClassPath(params[i] ClassInfo.setClassPath(params[i]
+ Decompiler.altPathSeparatorChar + Decompiler.altPathSeparatorChar
+ classPath); + classPath);
Enumeration enum = new ZipFile(params[i]).entries(); Enumeration enumeration = new ZipFile(params[i]).entries();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
String entry String entry
= ((ZipEntry) enum.nextElement()).getName(); = ((ZipEntry) enumeration.nextElement()).getName();
if (entry.endsWith(".class")) { if (entry.endsWith(".class")) {
entry = entry.substring(0, entry.length() - 6) entry = entry.substring(0, entry.length() - 6)
.replace('/', '.'); .replace('/', '.');

@ -674,9 +674,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
*/ */
public void makeDeclaration(Set done) { public void makeDeclaration(Set done) {
if (innerAnalyzers != null) { if (innerAnalyzers != null) {
for (Enumeration enum = innerAnalyzers.elements(); for (Enumeration enumeration = innerAnalyzers.elements();
enum.hasMoreElements(); ) { enumeration.hasMoreElements(); ) {
ClassAnalyzer classAna = (ClassAnalyzer) enum.nextElement(); ClassAnalyzer classAna = (ClassAnalyzer) enumeration.nextElement();
if (classAna.getParent() == this) { if (classAna.getParent() == this) {
OuterValues innerOV = classAna.getOuterValues(); OuterValues innerOV = classAna.getOuterValues();
for (int i=0; i < innerOV.getCount(); i++) { for (int i=0; i < innerOV.getCount(); i++) {
@ -692,9 +692,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
} }
} }
for (Enumeration enum = allLocals.elements(); for (Enumeration enumeration = allLocals.elements();
enum.hasMoreElements(); ) { enumeration.hasMoreElements(); ) {
LocalInfo li = (LocalInfo)enum.nextElement(); LocalInfo li = (LocalInfo)enumeration.nextElement();
if (!li.isShadow()) if (!li.isShadow())
imports.useType(li.getType()); imports.useType(li.getType());
} }
@ -947,9 +947,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
* exists. * exists.
*/ */
public LocalInfo findLocal(String name) { public LocalInfo findLocal(String name) {
Enumeration enum = allLocals.elements(); Enumeration enumeration = allLocals.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
LocalInfo li = (LocalInfo) enum.nextElement(); LocalInfo li = (LocalInfo) enumeration.nextElement();
if (li.getName().equals(name)) if (li.getName().equals(name))
return li; return li;
} }
@ -964,9 +964,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
*/ */
public ClassAnalyzer findAnonClass(String name) { public ClassAnalyzer findAnonClass(String name) {
if (innerAnalyzers != null) { if (innerAnalyzers != null) {
Enumeration enum = innerAnalyzers.elements(); Enumeration enumeration = innerAnalyzers.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
ClassAnalyzer classAna = (ClassAnalyzer) enum.nextElement(); ClassAnalyzer classAna = (ClassAnalyzer) enumeration.nextElement();
if (classAna.getParent() == this if (classAna.getParent() == this
&& classAna.getName() != null && classAna.getName() != null
&& classAna.getName().equals(name)) { && classAna.getName().equals(name)) {
@ -1115,9 +1115,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
*/ */
public ClassAnalyzer getClassAnalyzer(ClassInfo cinfo) { public ClassAnalyzer getClassAnalyzer(ClassInfo cinfo) {
if (innerAnalyzers != null) { if (innerAnalyzers != null) {
Enumeration enum = innerAnalyzers.elements(); Enumeration enumeration = innerAnalyzers.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
ClassAnalyzer classAna = (ClassAnalyzer) enum.nextElement(); ClassAnalyzer classAna = (ClassAnalyzer) enumeration.nextElement();
if (classAna.getClazz().equals(cinfo)) { if (classAna.getClazz().equals(cinfo)) {
if (classAna.getParent() != this) { if (classAna.getParent() != this) {
ClassDeclarer declarer = classAna.getParent(); ClassDeclarer declarer = classAna.getParent();
@ -1150,9 +1150,9 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
if (usedAnalyzers != null) if (usedAnalyzers != null)
used.addAll(usedAnalyzers); used.addAll(usedAnalyzers);
if (innerAnalyzers != null) { if (innerAnalyzers != null) {
Enumeration enum = innerAnalyzers.elements(); Enumeration enumeration = innerAnalyzers.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
ClassAnalyzer classAna = (ClassAnalyzer) enum.nextElement(); ClassAnalyzer classAna = (ClassAnalyzer) enumeration.nextElement();
if (classAna.getParent() == this) if (classAna.getParent() == this)
classAna.fillDeclarables(used); classAna.fillDeclarables(used);
} }

@ -340,9 +340,9 @@ public class OuterValues
} }
if (ovListeners != null) { if (ovListeners != null) {
for (Enumeration enum = ovListeners.elements(); for (Enumeration enumeration = ovListeners.elements();
enum.hasMoreElements();) enumeration.hasMoreElements();)
((OuterValueListener) enum.nextElement() ((OuterValueListener) enumeration.nextElement()
).shrinkingOuterValues(this, newHeadCount); ).shrinkingOuterValues(this, newHeadCount);
} }
} }

@ -143,16 +143,16 @@ public class TabbedPrintWriter {
String parens = "{\010{}\010}<\010<>\010>[\010[]\010]`\010`'\010'" String parens = "{\010{}\010}<\010<>\010>[\010[]\010]`\010`'\010'"
.substring(options*6, options*6+6); .substring(options*6, options*6+6);
pw.print(parens.substring(0,3)); pw.print(parens.substring(0,3));
Enumeration enum = childBPs.elements(); Enumeration enumeration = childBPs.elements();
int cur = startPos; int cur = startPos;
BreakPoint child = (BreakPoint) enum.nextElement(); BreakPoint child = (BreakPoint) enumeration.nextElement();
if (child.startPos >= 0) { if (child.startPos >= 0) {
pw.print(line.substring(cur, child.startPos)); pw.print(line.substring(cur, child.startPos));
child.dumpRegion(line); child.dumpRegion(line);
cur = child.endPos; cur = child.endPos;
} }
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
child = (BreakPoint) enum.nextElement(); child = (BreakPoint) enumeration.nextElement();
pw.print(line.substring(cur, child.breakPos)); pw.print(line.substring(cur, child.breakPos));
pw.print("!\010!"+breakPenalty); pw.print("!\010!"+breakPenalty);
cur = child.breakPos; cur = child.breakPos;
@ -182,9 +182,9 @@ public class TabbedPrintWriter {
indent++; indent++;
} }
Enumeration enum = childBPs.elements(); Enumeration enumeration = childBPs.elements();
int cur = startPos; int cur = startPos;
BreakPoint child = (BreakPoint) enum.nextElement(); BreakPoint child = (BreakPoint) enumeration.nextElement();
if (child.startPos >= 0) { if (child.startPos >= 0) {
pw.print(line.substring(cur, child.startPos)); pw.print(line.substring(cur, child.startPos));
child.printRegion(indent + child.startPos - cur, line); child.printRegion(indent + child.startPos - cur, line);
@ -193,8 +193,8 @@ public class TabbedPrintWriter {
if (options == NO_PAREN) if (options == NO_PAREN)
indent += indentsize; indent += indentsize;
String indentStr = makeIndentStr(indent); String indentStr = makeIndentStr(indent);
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
child = (BreakPoint) enum.nextElement(); child = (BreakPoint) enumeration.nextElement();
pw.print(line.substring(cur, child.breakPos)); pw.print(line.substring(cur, child.breakPos));
pw.println(); pw.println();
pw.print(indentStr); pw.print(indentStr);
@ -318,14 +318,14 @@ public class TabbedPrintWriter {
lastSpace -= 2; lastSpace -= 2;
} }
Enumeration enum = childBPs.elements(); Enumeration enumeration = childBPs.elements();
childBPs = new Vector(); childBPs = new Vector();
int currInd = 0; int currInd = 0;
BreakPoint lastChild, nextChild; BreakPoint lastChild, nextChild;
boolean indentNext = options == NO_PAREN; boolean indentNext = options == NO_PAREN;
for (lastChild = (BreakPoint) enum.nextElement(); for (lastChild = (BreakPoint) enumeration.nextElement();
enum.hasMoreElements(); lastChild = nextChild) { enumeration.hasMoreElements(); lastChild = nextChild) {
nextChild = (BreakPoint) enum.nextElement(); nextChild = (BreakPoint) enumeration.nextElement();
int childStart = lastChild.breakPos; int childStart = lastChild.breakPos;
int childEnd = nextChild.breakPos; int childEnd = nextChild.breakPos;
@ -391,12 +391,12 @@ public class TabbedPrintWriter {
} }
if (space < 0) if (space < 0)
return minPenalty; return minPenalty;
Enumeration enum = childBPs.elements(); Enumeration enumeration = childBPs.elements();
BreakPoint lastChild, nextChild; BreakPoint lastChild, nextChild;
boolean indentNext = options == NO_PAREN; boolean indentNext = options == NO_PAREN;
for (lastChild = (BreakPoint) enum.nextElement(); for (lastChild = (BreakPoint) enumeration.nextElement();
enum.hasMoreElements(); lastChild = nextChild) { enumeration.hasMoreElements(); lastChild = nextChild) {
nextChild = (BreakPoint) enum.nextElement(); nextChild = (BreakPoint) enumeration.nextElement();
int childStart = lastChild.breakPos; int childStart = lastChild.breakPos;
int childEnd = nextChild.breakPos; int childEnd = nextChild.breakPos;

@ -77,10 +77,10 @@ public class PackageIdentifier extends Identifier {
(fullName.length() > 0) ? fullName + "." : ""; (fullName.length() > 0) ? fullName + "." : "";
// Load all classes and packages now, so they don't get stripped // Load all classes and packages now, so they don't get stripped
Enumeration enum = Enumeration enumeration =
ClassInfo.getClassesAndPackages(getFullName()); ClassInfo.getClassesAndPackages(getFullName());
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
String subclazz = ((String)enum.nextElement()).intern(); String subclazz = ((String)enumeration.nextElement()).intern();
String subFull = (fullNamePrefix + subclazz).intern(); String subFull = (fullNamePrefix + subclazz).intern();
if (ClassInfo.isPackage(subFull) if (ClassInfo.isPackage(subFull)
@ -232,10 +232,10 @@ public class PackageIdentifier extends Identifier {
String fullNamePrefix = String fullNamePrefix =
(fullName.length() > 0) ? fullName + "." : ""; (fullName.length() > 0) ? fullName + "." : "";
/* Load all matching classes and packages */ /* Load all matching classes and packages */
Enumeration enum = Enumeration enumeration =
ClassInfo.getClassesAndPackages(getFullName()); ClassInfo.getClassesAndPackages(getFullName());
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
String subclazz = ((String)enum.nextElement()).intern(); String subclazz = ((String)enumeration.nextElement()).intern();
String subFull = (fullNamePrefix + subclazz).intern(); String subFull = (fullNamePrefix + subclazz).intern();
if (matcher.matchesSub(this, subclazz)) { if (matcher.matchesSub(this, subclazz)) {

@ -113,11 +113,11 @@ public class HierarchyTreeModel implements TreeModel, Runnable {
if (depth++ >= MAX_PACKAGE_LEVEL) if (depth++ >= MAX_PACKAGE_LEVEL)
return count; return count;
String prefix = packageName.length() == 0 ? "" : packageName + "."; String prefix = packageName.length() == 0 ? "" : packageName + ".";
Enumeration enum = Enumeration enumeration =
ClassInfo.getClassesAndPackages(packageName); ClassInfo.getClassesAndPackages(packageName);
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
//insert sorted and remove double elements; //insert sorted and remove double elements;
String name = (String)enum.nextElement(); String name = (String)enumeration.nextElement();
String fqn = prefix + name; String fqn = prefix + name;
if (ClassInfo.isPackage(fqn)) { if (ClassInfo.isPackage(fqn)) {
count = readPackage(depth, classes, fqn, count); count = readPackage(depth, classes, fqn, count);
@ -138,11 +138,11 @@ public class HierarchyTreeModel implements TreeModel, Runnable {
return 0; return 0;
int number = 0; int number = 0;
String prefix = packageName.length() == 0 ? "" : packageName + "."; String prefix = packageName.length() == 0 ? "" : packageName + ".";
Enumeration enum = Enumeration enumeration =
ClassInfo.getClassesAndPackages(packageName); ClassInfo.getClassesAndPackages(packageName);
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
//insert sorted and remove double elements; //insert sorted and remove double elements;
String name = (String)enum.nextElement(); String name = (String)enumeration.nextElement();
String fqn = prefix + name; String fqn = prefix + name;
if (ClassInfo.isPackage(fqn)) { if (ClassInfo.isPackage(fqn)) {
number += countClasses(depth, fqn); number += countClasses(depth, fqn);

@ -114,11 +114,11 @@ public class PackagesTreeModel implements TreeModel {
if (result == null) { if (result == null) {
TreeSet v = new TreeSet(); TreeSet v = new TreeSet();
String prefix = parent == root ? "" : parent.getFullName() + "."; String prefix = parent == root ? "" : parent.getFullName() + ".";
Enumeration enum = Enumeration enumeration =
ClassInfo.getClassesAndPackages(parent.getFullName()); ClassInfo.getClassesAndPackages(parent.getFullName());
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
//insert sorted and remove double elements; //insert sorted and remove double elements;
String name = (String)enum.nextElement(); String name = (String)enumeration.nextElement();
String fqn = prefix + name; String fqn = prefix + name;
boolean isClass = !ClassInfo.isPackage(fqn); boolean isClass = !ClassInfo.isPackage(fqn);

Loading…
Cancel
Save