# HG changeset patch # User ysuenaga # Date 1573608426 -32400 # Node ID 846fee5ea75e10cb6a3a056b0a46e8f23bd93ff1 # Parent 8c9d0451433b068648b61bf141af318aa2aea60f 8233785: Incorrect JDK version is reported in hs_err log Reviewed-by: dholmes, stuefe diff -r 8c9d0451433b -r 846fee5ea75e src/hotspot/share/runtime/java.cpp --- a/src/hotspot/share/runtime/java.cpp Wed Nov 13 09:09:04 2019 +0800 +++ b/src/hotspot/share/runtime/java.cpp Wed Nov 13 10:27:06 2019 +0900 @@ -733,6 +733,7 @@ return (e > o) ? 1 : ((e == o) ? 0 : -1); } +/* See JEP 223 */ void JDK_Version::to_string(char* buffer, size_t buflen) const { assert(buffer && buflen > 0, "call with useful buffer"); size_t index = 0; @@ -744,13 +745,12 @@ &buffer[index], buflen - index, "%d.%d", _major, _minor); if (rc == -1) return; index += rc; - if (_security > 0) { - rc = jio_snprintf(&buffer[index], buflen - index, ".%d", _security); + if (_patch > 0) { + rc = jio_snprintf(&buffer[index], buflen - index, ".%d.%d", _security, _patch); if (rc == -1) return; index += rc; - } - if (_patch > 0) { - rc = jio_snprintf(&buffer[index], buflen - index, ".%d", _patch); + } else if (_security > 0) { + rc = jio_snprintf(&buffer[index], buflen - index, ".%d", _security); if (rc == -1) return; index += rc; }