mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8202171: Some oopDesc functions compare this with NULL
Add Method* parameter and made verify* methods static to avoid 'this' comparison with NULL, Added NULL checks before calling print_on() methods. Reviewed-by: kbarrett, coleenp
This commit is contained in:
parent
b71f3e7104
commit
38db1d1620
15 changed files with 73 additions and 39 deletions
|
@ -477,8 +477,12 @@ void ObjArrayKlass::oop_print_on(oop obj, outputStream* st) {
|
|||
int print_len = MIN2((intx) oa->length(), MaxElementPrintSize);
|
||||
for(int index = 0; index < print_len; index++) {
|
||||
st->print(" - %3d : ", index);
|
||||
oa->obj_at(index)->print_value_on(st);
|
||||
st->cr();
|
||||
if (oa->obj_at(index) != NULL) {
|
||||
oa->obj_at(index)->print_value_on(st);
|
||||
st->cr();
|
||||
} else {
|
||||
st->print_cr("NULL");
|
||||
}
|
||||
}
|
||||
int remaining = oa->length() - print_len;
|
||||
if (remaining > 0) {
|
||||
|
@ -494,7 +498,11 @@ void ObjArrayKlass::oop_print_value_on(oop obj, outputStream* st) {
|
|||
element_klass()->print_value_on(st);
|
||||
int len = objArrayOop(obj)->length();
|
||||
st->print("[%d] ", len);
|
||||
obj->print_address_on(st);
|
||||
if (obj != NULL) {
|
||||
obj->print_address_on(st);
|
||||
} else {
|
||||
st->print_cr("NULL");
|
||||
}
|
||||
}
|
||||
|
||||
const char* ObjArrayKlass::internal_name() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue