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:
Coleen Phillimore 2015-10-26 13:11:36 -04:00
parent 25cc742a8f
commit 5179fc3488
43 changed files with 215 additions and 252 deletions

View file

@ -862,7 +862,7 @@ public:
#ifdef ASSERT
// check whether this class or one of its superclasses was redefined
bool has_redefined_this_or_super() const;
bool has_redefined_this_or_super();
#endif
// Access to the implementor of an interface.
@ -922,7 +922,8 @@ public:
// Casting from Klass*
static InstanceKlass* cast(Klass* k) {
assert(k == NULL || k->oop_is_instance(), "cast to InstanceKlass");
assert(k != NULL, "k should not be null");
assert(k->oop_is_instance(), "cast to InstanceKlass");
return static_cast<InstanceKlass*>(k);
}