Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java @ 4962:38fd165da001
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: Krystal Mok <sajia@taobao.com>
author | poonam |
---|---|
date | Mon, 20 Feb 2012 21:27:56 -0800 |
parents | 6a991dcb52bb |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
4961:0368109684cb | 4962:38fd165da001 |
---|---|
646 dos.flush(); | 646 dos.flush(); |
647 return; | 647 return; |
648 } | 648 } |
649 | 649 |
650 public void printValueOn(PrintStream tty) { | 650 public void printValueOn(PrintStream tty) { |
651 tty.print("ConstantPool for " + getPoolHolder().getName().asString()); | 651 Oop holder = poolHolder.getValue(this); |
652 if (holder instanceof Klass) { | |
653 tty.print("ConstantPool for " + ((Klass)holder).getName().asString()); | |
654 } else { | |
655 tty.print("ConstantPool for partially loaded class"); | |
656 } | |
652 } | 657 } |
653 | 658 |
654 public long getObjectSize() { | 659 public long getObjectSize() { |
655 return alignObjectSize(headerSize + (getLength() * getElementSize())); | 660 return alignObjectSize(headerSize + (getLength() * getElementSize())); |
656 } | 661 } |