提交 c7a86067 编写于 作者: J jjg

6841420: classfile: add new methods to ConstantClassInfo

Reviewed-by: mcimadamore
Contributed-by: kevin.t.looney@sun.com
上级 2b1c09c8
......@@ -310,6 +310,20 @@ public class ConstantPool {
return cp.getUTF8Value(name_index);
}
public String getBaseName() throws ConstantPoolException {
String name = getName();
int index = name.indexOf("[L") + 1;
return name.substring(index);
}
public int getDimensionCount() throws ConstantPoolException {
String name = getName();
int count = 0;
while (name.charAt(count) == '[')
count++;
return count;
}
@Override
public String toString() {
return "CONSTANT_Class_info[name_index: " + name_index + "]";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册