putClassName/Type

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@573 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 05fbbd1b57
commit 5f78283313
  1. 11
      jode/jode/bytecode/GrowableConstantPool.java

@ -106,18 +106,25 @@ public class GrowableConstantPool extends ConstantPool {
return putConstant(UTF8, utf);
}
public int putClassRef(String name) {
public int putClassName(String name) {
name = name.replace('.','/');
return putIndexed(""+(char) CLASS + name,
CLASS, putUTF(name), 0);
}
public int putClassType(String name) {
if (name.charAt(0) == 'L')
name = name.substring(1, name.length()-1);
return putIndexed(""+(char) CLASS + name,
CLASS, putUTF(name), 0);
}
public int putRef(int tag, Reference ref) {
String className = ref.getClazz();
String typeSig = ref.getType();
String nameAndType = ref.getName() + "/" + typeSig;
int classIndex = putClassRef(className);
int classIndex = putClassType(className);
int nameIndex = putUTF(ref.getName());
int typeIndex = putUTF(typeSig);
int nameTypeIndex = putIndexed("" + (char) NAMEANDTYPE + nameAndType,

Loading…
Cancel
Save