6841420: classfile: add new methods to ConstantClassInfo
Reviewed-by: mcimadamore
This commit is contained in:
parent
c1b42c6d84
commit
58eddef3f4
@ -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 + "]";
|
||||
|
Loading…
Reference in New Issue
Block a user