提交 027bd433 编写于 作者: P poonam

7145358: SA throws ClassCastException for partially loaded ConstantPool

Summary: In printValueOn() in ConstantPool.java check if the poolHolder is a valid Klass and only then print it.
Reviewed-by: sla, sspitsyn
Contributed-by: NKrystal Mok <sajia@taobao.com>
上级 e21db581
...@@ -648,7 +648,12 @@ public class ConstantPool extends Oop implements ClassConstants { ...@@ -648,7 +648,12 @@ public class ConstantPool extends Oop implements ClassConstants {
} }
public void printValueOn(PrintStream tty) { public void printValueOn(PrintStream tty) {
tty.print("ConstantPool for " + getPoolHolder().getName().asString()); Oop holder = poolHolder.getValue(this);
if (holder instanceof Klass) {
tty.print("ConstantPool for " + ((Klass)holder).getName().asString());
} else {
tty.print("ConstantPool for partially loaded class");
}
} }
public long getObjectSize() { public long getObjectSize() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册