diff --git a/src/share/vm/jfr/dcmd/jfrDcmds.cpp b/src/share/vm/jfr/dcmd/jfrDcmds.cpp index c7964ccd3e8f2b4869550397c3af57f47b9278b8..dcb9e98d1883c14ed6fcc95e1a28c7f99dc903cf 100644 --- a/src/share/vm/jfr/dcmd/jfrDcmds.cpp +++ b/src/share/vm/jfr/dcmd/jfrDcmds.cpp @@ -434,7 +434,13 @@ void JfrStartFlightRecordingDCmd::execute(DCmdSource source, TRAPS) { jobjectArray settings = NULL; if (_settings.is_set()) { - const int length = _settings.value()->array()->length(); + int length = _settings.value()->array()->length(); + if (length == 1) { + const char* c_str = _settings.value()->array()->at(0); + if (strcmp(c_str, "none") == 0) { + length = 0; + } + } settings = JfrJavaSupport::new_string_array(length, CHECK); assert(settings != NULL, "invariant"); for (int i = 0; i < length; ++i) { diff --git a/src/share/vm/jfr/jni/jfrJavaCall.cpp b/src/share/vm/jfr/jni/jfrJavaCall.cpp index 37f3e01343a7b76aceac91268db89910b995d14c..ec6f2c1a20f5a01975a3021d815769978702830d 100644 --- a/src/share/vm/jfr/jni/jfrJavaCall.cpp +++ b/src/share/vm/jfr/jni/jfrJavaCall.cpp @@ -184,7 +184,7 @@ void JfrJavaArguments::Parameters::copy(JavaCallArguments& args, TRAPS) const { } } -JfrJavaArguments::JfrJavaArguments(JavaValue* result) : _result(result), _klass(NULL), _name(NULL), _signature(NULL), _array_length(0) { +JfrJavaArguments::JfrJavaArguments(JavaValue* result) : _result(result), _klass(NULL), _name(NULL), _signature(NULL), _array_length(-1) { assert(result != NULL, "invariant"); } @@ -193,7 +193,7 @@ JfrJavaArguments::JfrJavaArguments(JavaValue* result, const char* klass_name, co _klass(NULL), _name(NULL), _signature(NULL), - _array_length(0) { + _array_length(-1) { assert(result != NULL, "invariant"); if (klass_name != NULL) { set_klass(klass_name, CHECK); @@ -210,7 +210,7 @@ JfrJavaArguments::JfrJavaArguments(JavaValue* result, const Klass* klass, const _klass(NULL), _name(NULL), _signature(NULL), - _array_length(0) { + _array_length(-1) { assert(result != NULL, "invariant"); if (klass != NULL) { set_klass(klass); diff --git a/src/share/vm/jfr/jni/jfrJavaSupport.cpp b/src/share/vm/jfr/jni/jfrJavaSupport.cpp index 38f8386bb36fc1e4d6eb61b10cfc9936cf52f4bc..9c227a1a54cea6c570a0f14ec9fd34f4daca79a0 100644 --- a/src/share/vm/jfr/jni/jfrJavaSupport.cpp +++ b/src/share/vm/jfr/jni/jfrJavaSupport.cpp @@ -166,7 +166,7 @@ static void create_object(JfrJavaArguments* args, JavaValue* result, TRAPS) { const int array_length = args->array_length(); - if (array_length > 0) { + if (array_length >= 0) { array_construction(args, result, klass, array_length, CHECK); } else { object_construction(args, result, klass, THREAD);