Changed enum to enumeration to make it compile with Java 5

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1390 379699f6-c40d-0410-875b-85095c16579e
master
hoenicke 20 years ago
parent 183db2f66c
commit 4ff081adef
  1. 12
      jode/src/net/sf/jode/bytecode/BasicBlockReader.java
  2. 2
      jode/src/net/sf/jode/bytecode/BinaryInfo.java
  3. 20
      jode/src/net/sf/jode/bytecode/ClassPath.java
  4. 36
      jode/src/net/sf/jode/decompiler/LocalInfo.java
  5. 6
      jode/src/net/sf/jode/decompiler/Main.java
  6. 36
      jode/src/net/sf/jode/decompiler/MethodAnalyzer.java
  7. 6
      jode/src/net/sf/jode/decompiler/OuterValues.java
  8. 32
      jode/src/net/sf/jode/decompiler/TabbedPrintWriter.java
  9. 12
      jode/src/net/sf/jode/obfuscator/PackageIdentifier.java
  10. 18
      jode/src/net/sf/jode/obfuscator/modules/LocalOptimizer.java
  11. 12
      jode/src/net/sf/jode/swingui/HierarchyTreeModel.java
  12. 6
      jode/src/net/sf/jode/swingui/PackagesTreeModel.java
  13. 6
      jode/src/net/sf/jode/type/ReferenceType.java

@ -1003,10 +1003,10 @@ class BasicBlockReader implements Opcodes {
&& instr.getOpcode() <= opc_astore) && instr.getOpcode() <= opc_astore)
addr = infos[i].nextAddr; addr = infos[i].nextAddr;
Enumeration enum = lvt[slot].elements(); Enumeration enumeration = lvt[slot].elements();
LVTEntry match = null; LVTEntry match = null;
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
LVTEntry lve = (LVTEntry) enum.nextElement(); LVTEntry lve = (LVTEntry) enumeration.nextElement();
if (lve.start <= addr && lve.end > addr) { if (lve.start <= addr && lve.end > addr) {
if (match != null if (match != null
&& (!match.name.equals(lve.name) && (!match.name.equals(lve.name)
@ -1028,10 +1028,10 @@ class BasicBlockReader implements Opcodes {
for (int slot=0; slot< paramCount; slot++) { for (int slot=0; slot< paramCount; slot++) {
if (lvt[slot] == null) if (lvt[slot] == null)
continue; continue;
Enumeration enum = lvt[slot].elements(); Enumeration enumeration = lvt[slot].elements();
LVTEntry match = null; LVTEntry match = null;
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
LVTEntry lve = (LVTEntry) enum.nextElement(); LVTEntry lve = (LVTEntry) enumeration.nextElement();
if (lve.start == 0) { if (lve.start == 0) {
if (match != null if (match != null
&& (!match.name.equals(lve.name) && (!match.name.equals(lve.name)

@ -106,7 +106,7 @@ public class BinaryInfo {
*/ */
public static int ACC_VARARGS = 0x0080; public static int ACC_VARARGS = 0x0080;
/** /**
* The bit mask representing enum fields. * The bit mask representing enumeration fields.
*/ */
public static int ACC_ENUM = 0x0100; public static int ACC_ENUM = 0x0100;
/** /**

@ -942,29 +942,29 @@ public class ClassPath {
public Enumeration listFiles(final String dirName) { public Enumeration listFiles(final String dirName) {
return new Enumeration() { return new Enumeration() {
int i = 0; int i = 0;
Enumeration enum; Enumeration enumeration;
public boolean hasMoreElements() { public boolean hasMoreElements() {
while (true) { while (true) {
while (enum == null && i < paths.length) { while (enumeration == null && i < paths.length) {
if (paths[i] != null && paths[i].exists(dirName) if (paths[i] != null && paths[i].exists(dirName)
&& paths[i].isDirectory(dirName)) && paths[i].isDirectory(dirName))
enum = paths[i].listFiles(dirName); enumeration = paths[i].listFiles(dirName);
i++; i++;
} }
if (enum == null) if (enumeration == null)
return false; return false;
if (enum.hasMoreElements()) if (enumeration.hasMoreElements())
return true; return true;
enum = null; enumeration = null;
} }
} }
public Object nextElement() { public Object nextElement() {
if (!hasMoreElements()) if (!hasMoreElements())
return new NoSuchElementException(); return new NoSuchElementException();
return enum.nextElement(); return enumeration.nextElement();
} }
}; };
} }
@ -977,14 +977,14 @@ public class ClassPath {
*/ */
public Enumeration listClassesAndPackages(String packageName) { public Enumeration listClassesAndPackages(String packageName) {
String dir = packageName.replace('.','/'); String dir = packageName.replace('.','/');
final Enumeration enum = listFiles(dir); final Enumeration enumeration = listFiles(dir);
final String prefix = dir.length() > 0 ? dir + "/" : dir; final String prefix = dir.length() > 0 ? dir + "/" : dir;
return new Enumeration() { return new Enumeration() {
String next = getNext(); String next = getNext();
private String getNext() { private String getNext() {
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
String name = (String) enum.nextElement(); String name = (String) enumeration.nextElement();
if (name.indexOf('.') == -1 if (name.indexOf('.') == -1
&& isDirectory(prefix + name)) && isDirectory(prefix + name))
// This is a package // This is a package

@ -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());
@ -325,9 +325,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();
@ -365,10 +365,10 @@ public class LocalInfo implements Declarable {
public boolean isConstant() { public boolean isConstant() {
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++;
} }
if (writes > 1) if (writes > 1)
@ -382,10 +382,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 */

@ -388,10 +388,10 @@ public class Main extends Options {
*/ */
ClassPath zipClassPath ClassPath zipClassPath
= new ClassPath(params[i], classPath); = new ClassPath(params[i], 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('/', '.');

@ -633,9 +633,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++) {
@ -651,9 +651,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());
} }
@ -915,9 +915,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;
} }
@ -932,9 +932,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)) {
@ -1089,9 +1089,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();
@ -1124,9 +1124,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);
} }

@ -363,9 +363,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);
} }
} }

@ -152,16 +152,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;
@ -191,9 +191,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);
@ -202,8 +202,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);
@ -311,14 +311,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;
@ -384,12 +384,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;

@ -80,10 +80,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 =
bundle.getClassPath().listClassesAndPackages(getFullName()); bundle.getClassPath().listClassesAndPackages(getFullName());
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
String subclazz = ((String)enum.nextElement()).intern(); String subclazz = ((String)enumeration.nextElement()).intern();
if (loadedClasses.containsKey(subclazz)) if (loadedClasses.containsKey(subclazz))
continue; continue;
String subFull = (fullNamePrefix + subclazz).intern(); String subFull = (fullNamePrefix + subclazz).intern();
@ -163,10 +163,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 =
bundle.getClassPath().listClassesAndPackages(getFullName()); bundle.getClassPath().listClassesAndPackages(getFullName());
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
String subclazz = ((String)enum.nextElement()).intern(); String subclazz = ((String)enumeration.nextElement()).intern();
if (loadedClasses.containsKey(subclazz)) if (loadedClasses.containsKey(subclazz))
continue; continue;
String subFull = (fullNamePrefix + subclazz).intern(); String subFull = (fullNamePrefix + subclazz).intern();

@ -424,9 +424,9 @@ public class LocalOptimizer implements Opcodes, CodeTransformer {
if (v2 == null || v2.isEmpty()) if (v2 == null || v2.isEmpty())
return v1; return v1;
Vector result = (Vector) v1.clone(); Vector result = (Vector) v1.clone();
Enumeration enum = v2.elements(); Enumeration enumeration = v2.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
Object elem = enum.nextElement(); Object elem = enumeration.nextElement();
if (!result.contains(elem)) if (!result.contains(elem))
result.addElement(elem); result.addElement(elem);
} }
@ -594,9 +594,9 @@ public class LocalOptimizer implements Opcodes, CodeTransformer {
/* Find the local with the least conflicts. */ /* Find the local with the least conflicts. */
int min = Integer.MAX_VALUE; int min = Integer.MAX_VALUE;
LocalInfo bestLocal = null; LocalInfo bestLocal = null;
Enumeration enum = locals.elements(); Enumeration enumeration = locals.elements();
while (enum.hasMoreElements()) { while (enumeration.hasMoreElements()) {
LocalInfo li = (LocalInfo) enum.nextElement(); LocalInfo li = (LocalInfo) enumeration.nextElement();
int conflicts = 0; int conflicts = 0;
Enumeration conflenum = li.conflictingLocals.elements(); Enumeration conflenum = li.conflictingLocals.elements();
while (conflenum.hasMoreElements()) { while (conflenum.hasMoreElements()) {
@ -741,9 +741,9 @@ public class LocalOptimizer implements Opcodes, CodeTransformer {
if (info.local != null && !locals.contains(info.local)) if (info.local != null && !locals.contains(info.local))
locals.addElement(info.local); locals.addElement(info.local);
} }
// Enumeration enum = locals.elements(); // Enumeration enumeration = locals.elements();
// while (enum.hasMoreElements()) { // while (enumeration.hasMoreElements()) {
// LocalInfo li = (LocalInfo) enum.nextElement(); // LocalInfo li = (LocalInfo) enumeration.nextElement();
// int slot = ((InstrInfo)li.usingInstrs.elementAt(0)) // int slot = ((InstrInfo)li.usingInstrs.elementAt(0))
// .instr.getLocalSlot(); // .instr.getLocalSlot();
// GlobalOptions.err.print("Slot: "+slot+" conflicts:"); // GlobalOptions.err.print("Slot: "+slot+" conflicts:");

@ -128,10 +128,10 @@ 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 = classPath.listClassesAndPackages(packageName); Enumeration enumeration = classPath.listClassesAndPackages(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 (classPath.isPackage(fqn)) { if (classPath.isPackage(fqn)) {
count = readPackage(depth, classes, fqn, count); count = readPackage(depth, classes, fqn, count);
@ -153,10 +153,10 @@ 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 = classPath.listClassesAndPackages(packageName); Enumeration enumeration = classPath.listClassesAndPackages(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 (classPath.isPackage(fqn)) { if (classPath.isPackage(fqn)) {
number += countClasses(depth, fqn); number += countClasses(depth, fqn);

@ -122,11 +122,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
= classPath.listClassesAndPackages(parent.getFullName()); = classPath.listClassesAndPackages(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 = !classPath.isPackage(fqn); boolean isClass = !classPath.isPackage(fqn);

@ -85,9 +85,9 @@ public abstract class ReferenceType extends Type {
/* tObject is always implied. */ /* tObject is always implied. */
continue type_loop; continue type_loop;
for (Enumeration enum = classes.elements(); for (Enumeration enumeration = classes.elements();
enum.hasMoreElements(); ) { enumeration.hasMoreElements(); ) {
if (type.isSubTypeOf((Type) enum.nextElement())) if (type.isSubTypeOf((Type) enumeration.nextElement()))
/* We can skip this, as another class already /* We can skip this, as another class already
* implies it. */ * implies it. */
continue type_loop; continue type_loop;

Loading…
Cancel
Save