aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/javassist/bytecode/ConstPool.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/ConstPool.java b/src/main/javassist/bytecode/ConstPool.java
index 3a3443d1..83159d21 100644
--- a/src/main/javassist/bytecode/ConstPool.java
+++ b/src/main/javassist/bytecode/ConstPool.java
@@ -905,6 +905,15 @@ public final class ConstPool {
--n;
}
}
+
+ int i = 1;
+ while (true) {
+ ConstInfo info = (ConstInfo)items.elementAt(i++);
+ if (info == null)
+ break;
+ else
+ info.makeHashtable(this);
+ }
}
private int readOne(DataInputStream in) throws IOException {
@@ -997,6 +1006,8 @@ abstract class ConstInfo {
public abstract void write(DataOutputStream out) throws IOException;
public abstract void print(PrintWriter out);
+ void makeHashtable(ConstPool cp) {} // called after read() finishes in ConstPool.
+
public String toString() {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
PrintWriter out = new PrintWriter(bout);
@@ -1087,6 +1098,11 @@ class ClassInfo extends ConstInfo {
out.print("Class #");
out.println(name);
}
+
+ void makeHashtable(ConstPool cp) {
+ String name = Descriptor.toJavaName(getClassName(cp));
+ cp.classes.put(name, this);
+ }
}
class NameAndTypeInfo extends ConstInfo {