mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8238175: CTW: Class.getDeclaredMethods fails with assert(k->is_subclass_of(SystemDictionary::Throwable_klass())) failed: invalid exception class
Replace the assert with a logging message saying that the class is not a subclass of java.lang.Throwable Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
2ac2d590c2
commit
d298a05d02
3 changed files with 243 additions and 1 deletions
|
@ -811,7 +811,13 @@ objArrayHandle Method::resolved_checked_exceptions_impl(Method* method, TRAPS) {
|
|||
for (int i = 0; i < length; i++) {
|
||||
CheckedExceptionElement* table = h_this->checked_exceptions_start(); // recompute on each iteration, not gc safe
|
||||
Klass* k = h_this->constants()->klass_at(table[i].class_cp_index, CHECK_(objArrayHandle()));
|
||||
assert(k->is_subclass_of(SystemDictionary::Throwable_klass()), "invalid exception class");
|
||||
if (log_is_enabled(Warning, exceptions) &&
|
||||
!k->is_subclass_of(SystemDictionary::Throwable_klass())) {
|
||||
ResourceMark rm(THREAD);
|
||||
log_warning(exceptions)(
|
||||
"Class %s in throws clause of method %s is not a subtype of class java.lang.Throwable",
|
||||
k->external_name(), method->external_name());
|
||||
}
|
||||
mirrors->obj_at_put(i, k->java_mirror());
|
||||
}
|
||||
return mirrors;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue