diff --git a/src/hotspot/share/logging/logFileOutput.cpp b/src/hotspot/share/logging/logFileOutput.cpp index 39703f1c498f0..2838fb55c0805 100644 --- a/src/hotspot/share/logging/logFileOutput.cpp +++ b/src/hotspot/share/logging/logFileOutput.cpp @@ -196,12 +196,13 @@ bool LogFileOutput::parse_options(const char* options, outputStream* errstream) *equals_pos = '\0'; if (strcmp(FoldMultilinesOptionKey, key) == 0) { - // We need to pass = style option to LogFileStreamOutput::initialize(). - // Thus we restore '=' temporally. - *equals_pos = '='; - success = LogFileStreamOutput::initialize(pos, errstream); - *equals_pos = '\0'; - if (!success) { + if (strcmp(value_str, "true") == 0) { + _fold_multilines = true; + } else if (strcmp(value_str, "false") == 0) { + _fold_multilines = false; + } else { + errstream->print_cr("Invalid option '%s' for %s.", value_str, FoldMultilinesOptionKey); + success = false; break; } } else if (strcmp(FileCountOptionKey, key) == 0) { diff --git a/src/hotspot/share/logging/logFileStreamOutput.cpp b/src/hotspot/share/logging/logFileStreamOutput.cpp index e0bbe3bb04f60..60296e4f05080 100644 --- a/src/hotspot/share/logging/logFileStreamOutput.cpp +++ b/src/hotspot/share/logging/logFileStreamOutput.cpp @@ -53,40 +53,6 @@ LogFileStreamInitializer::LogFileStreamInitializer() { } } -bool LogFileStreamOutput::initialize(const char* options, outputStream* errstream) { - if (options == NULL || strlen(options) == 0) { - return true; - } - - char* opts = os::strdup_check_oom(options, mtLogging); - char* equals_pos = strchr(opts, '='); - bool success = false; - if (equals_pos == NULL) { - errstream->print_cr("Invalid option '%s' for log file stream output.", opts); - } else { - char* key = opts; - char* value_str = equals_pos + 1; - *equals_pos = '\0'; - - if (strcmp(FoldMultilinesOptionKey, key) == 0) { - if (strcmp(value_str, "true") == 0) { - _fold_multilines = true; - success = true; - } else if (strcmp(value_str, "false") == 0) { - _fold_multilines = false; - success = true; - } else { - errstream->print_cr("Invalid option '%s' for %s.", value_str, FoldMultilinesOptionKey); - } - } else { - errstream->print_cr("Invalid option '%s' for log file stream output.", options); - } - } - - os::free(opts); - return success; -} - int LogFileStreamOutput::write_decorations(const LogDecorations& decorations) { int total_written = 0; char buf[LogDecorations::max_decoration_size + 1]; diff --git a/src/hotspot/share/logging/logFileStreamOutput.hpp b/src/hotspot/share/logging/logFileStreamOutput.hpp index 52d5394d03f06..d211e8bda2a13 100644 --- a/src/hotspot/share/logging/logFileStreamOutput.hpp +++ b/src/hotspot/share/logging/logFileStreamOutput.hpp @@ -42,7 +42,6 @@ static LogFileStreamInitializer log_stream_initializer; // Base class for all FileStream-based log outputs. class LogFileStreamOutput : public LogOutput { private: - bool _fold_multilines; bool _write_error_is_shown; int write_internal(const char* msg); @@ -50,8 +49,9 @@ class LogFileStreamOutput : public LogOutput { static const char* const FoldMultilinesOptionKey; FILE* _stream; size_t _decorator_padding[LogDecorators::Count]; + bool _fold_multilines; - LogFileStreamOutput(FILE *stream) : _fold_multilines(false), _write_error_is_shown(false), _stream(stream) { + LogFileStreamOutput(FILE *stream) : _write_error_is_shown(false), _stream(stream), _fold_multilines(false) { for (size_t i = 0; i < LogDecorators::Count; i++) { _decorator_padding[i] = 0; } @@ -61,7 +61,6 @@ class LogFileStreamOutput : public LogOutput { bool flush(); public: - virtual bool initialize(const char* options, outputStream* errstream); virtual int write(const LogDecorations& decorations, const char* msg); virtual int write(LogMessageBuffer::Iterator msg_iterator); };