mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8139163: InstanceKlass::cast passes through NULL
Reduce raw (InstanceKlass*) casts and InstanceKlass::cast, which no long allows null Reviewed-by: twisti, kbarrett
This commit is contained in:
parent
25cc742a8f
commit
5179fc3488
43 changed files with 215 additions and 252 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -505,8 +505,7 @@ void StackFrameInfo::print_on(outputStream* st) const {
|
|||
int len = (_locked_monitors != NULL ? _locked_monitors->length() : 0);
|
||||
for (int i = 0; i < len; i++) {
|
||||
oop o = _locked_monitors->at(i);
|
||||
InstanceKlass* ik = InstanceKlass::cast(o->klass());
|
||||
st->print_cr("\t- locked <" INTPTR_FORMAT "> (a %s)", p2i(o), ik->external_name());
|
||||
st->print_cr("\t- locked <" INTPTR_FORMAT "> (a %s)", p2i(o), o->klass()->external_name());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -729,8 +728,7 @@ void ConcurrentLocksDump::print_locks_on(JavaThread* t, outputStream* st) {
|
|||
|
||||
for (int i = 0; i < locks->length(); i++) {
|
||||
instanceOop obj = locks->at(i);
|
||||
InstanceKlass* ik = InstanceKlass::cast(obj->klass());
|
||||
st->print_cr("\t- <" INTPTR_FORMAT "> (a %s)", p2i(obj), ik->external_name());
|
||||
st->print_cr("\t- <" INTPTR_FORMAT "> (a %s)", p2i(obj), obj->klass()->external_name());
|
||||
}
|
||||
st->cr();
|
||||
}
|
||||
|
@ -887,7 +885,7 @@ void DeadlockCycle::print_on(outputStream* st) const {
|
|||
oop obj = (oop)waitingToLockMonitor->object();
|
||||
if (obj != NULL) {
|
||||
st->print(" (object " INTPTR_FORMAT ", a %s)", p2i(obj),
|
||||
(InstanceKlass::cast(obj->klass()))->external_name());
|
||||
obj->klass()->external_name());
|
||||
|
||||
if (!currentThread->current_pending_monitor_is_from_java()) {
|
||||
owner_desc = "\n in JNI, which is held by";
|
||||
|
@ -911,7 +909,7 @@ void DeadlockCycle::print_on(outputStream* st) const {
|
|||
} else {
|
||||
st->print(" waiting for ownable synchronizer " INTPTR_FORMAT ", (a %s)",
|
||||
p2i(waitingToLockBlocker),
|
||||
(InstanceKlass::cast(waitingToLockBlocker->klass()))->external_name());
|
||||
waitingToLockBlocker->klass()->external_name());
|
||||
assert(waitingToLockBlocker->is_a(SystemDictionary::abstract_ownable_synchronizer_klass()),
|
||||
"Must be an AbstractOwnableSynchronizer");
|
||||
oop ownerObj = java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj(waitingToLockBlocker);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue