Browse Source

changed to generate more javap-friendly code


git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@228 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
tags/rel_3_17_1_ga
chiba 18 years ago
parent
commit
23e4e9827e
3 changed files with 29 additions and 3 deletions
  1. 3
    3
      .classpath
  2. 10
    0
      .project
  3. 16
    0
      src/main/javassist/bytecode/ConstPool.java

+ 3
- 3
.classpath View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="sample/hotswap/logging/|src/main/|sample/evolve/|sample/hotswap/|sample/|tutorial/" kind="src" path=""/>
<classpathentry excluding="javassist/tool/HotSwapper.java" kind="src" path="src/main"/>
<classpathentry kind="src" path="src/main"/>
<classpathentry kind="src" path="local/src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>

+ 10
- 0
.project View File

@@ -10,6 +10,16 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/Ant.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>

+ 16
- 0
src/main/javassist/bytecode/ConstPool.java View File

@@ -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 {

Loading…
Cancel
Save