From 5f782833136525a94a0d3f07dae692f3a2ff55b9 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 13 Apr 1999 10:45:22 +0000 Subject: [PATCH] putClassName/Type git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@573 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/bytecode/GrowableConstantPool.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jode/jode/bytecode/GrowableConstantPool.java b/jode/jode/bytecode/GrowableConstantPool.java index b5f594a..629d8c9 100644 --- a/jode/jode/bytecode/GrowableConstantPool.java +++ b/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,