mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8033735: make Throwable.backtrace visible to Class.getDeclaredField again
Removed old hack to workaround an old crash. Reviewed-by: hseigel, twisti, mchung
This commit is contained in:
parent
25f35cda7d
commit
e9a1251fb3
2 changed files with 80 additions and 14 deletions
|
@ -1818,9 +1818,6 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass,
|
|||
// Ensure class is linked
|
||||
k->link_class(CHECK_NULL);
|
||||
|
||||
// 4496456 We need to filter out java.lang.Throwable.backtrace
|
||||
bool skip_backtrace = false;
|
||||
|
||||
// Allocate result
|
||||
int num_fields;
|
||||
|
||||
|
@ -1831,11 +1828,6 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass,
|
|||
}
|
||||
} else {
|
||||
num_fields = k->java_fields_count();
|
||||
|
||||
if (k() == SystemDictionary::Throwable_klass()) {
|
||||
num_fields--;
|
||||
skip_backtrace = true;
|
||||
}
|
||||
}
|
||||
|
||||
objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_Field_klass(), num_fields, CHECK_NULL);
|
||||
|
@ -1844,12 +1836,6 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass,
|
|||
int out_idx = 0;
|
||||
fieldDescriptor fd;
|
||||
for (JavaFieldStream fs(k); !fs.done(); fs.next()) {
|
||||
if (skip_backtrace) {
|
||||
// 4496456 skip java.lang.Throwable.backtrace
|
||||
int offset = fs.offset();
|
||||
if (offset == java_lang_Throwable::get_backtrace_offset()) continue;
|
||||
}
|
||||
|
||||
if (!publicOnly || fs.access_flags().is_public()) {
|
||||
fd.reinitialize(k(), fs.index());
|
||||
oop field = Reflection::new_field(&fd, CHECK_NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue