8058322: Zero name_index item of MethodParameters attribute cause MalformedParameterException
Allow hotspot to report null for 0 parameter_name index in MethodParameters attribute Reviewed-by: coleenp, dholmes
This commit is contained in:
parent
bbd7b058d1
commit
cba5bd2638
@ -806,17 +806,16 @@ oop Reflection::new_field(fieldDescriptor* fd, TRAPS) {
|
|||||||
|
|
||||||
oop Reflection::new_parameter(Handle method, int index, Symbol* sym,
|
oop Reflection::new_parameter(Handle method, int index, Symbol* sym,
|
||||||
int flags, TRAPS) {
|
int flags, TRAPS) {
|
||||||
Handle name;
|
|
||||||
|
|
||||||
// A null symbol here translates to the empty string
|
|
||||||
if(NULL != sym) {
|
|
||||||
name = java_lang_String::create_from_symbol(sym, CHECK_NULL);
|
|
||||||
} else {
|
|
||||||
name = java_lang_String::create_from_str("", CHECK_NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
Handle rh = java_lang_reflect_Parameter::create(CHECK_NULL);
|
Handle rh = java_lang_reflect_Parameter::create(CHECK_NULL);
|
||||||
java_lang_reflect_Parameter::set_name(rh(), name());
|
|
||||||
|
if(NULL != sym) {
|
||||||
|
Handle name = java_lang_String::create_from_symbol(sym, CHECK_NULL);
|
||||||
|
java_lang_reflect_Parameter::set_name(rh(), name());
|
||||||
|
} else {
|
||||||
|
java_lang_reflect_Parameter::set_name(rh(), NULL);
|
||||||
|
}
|
||||||
|
|
||||||
java_lang_reflect_Parameter::set_modifiers(rh(), flags);
|
java_lang_reflect_Parameter::set_modifiers(rh(), flags);
|
||||||
java_lang_reflect_Parameter::set_executable(rh(), method());
|
java_lang_reflect_Parameter::set_executable(rh(), method());
|
||||||
java_lang_reflect_Parameter::set_index(rh(), index);
|
java_lang_reflect_Parameter::set_index(rh(), index);
|
||||||
|
Loading…
Reference in New Issue
Block a user