8334164: The fix for JDK-8322811 should use _filename.is_set() rather than strcmp()

Reviewed-by: dholmes, cjplummer
This commit is contained in:
Sonia Zaldana Calles 2024-06-20 08:28:06 +00:00 committed by Severin Gehwolf
parent d7dad50af5
commit cabd1046d0

View File

@ -1203,11 +1203,11 @@ SystemDumpMapDCmd::SystemDumpMapDCmd(outputStream* output, bool heap) :
void SystemDumpMapDCmd::execute(DCmdSource source, TRAPS) {
stringStream defaultname;
const char* name = nullptr;
if (::strcmp(default_filename, _filename.value()) == 0) {
if (_filename.is_set()) {
name = _filename.value();
} else {
defaultname.print("vm_memory_map_%d.txt", os::current_process_id());
name = defaultname.base();
} else {
name = _filename.value();
}
fileStream fs(name);
if (fs.is_open()) {