# HG changeset patch # User tschatzl # Date 1472807884 -7200 # Node ID 7ca02bd6fbf64c54a3fba125769609ec5cfe566e # Parent 072bdbb90c13086c108cddffeec759470a250cab# Parent 90c87069b39c37d0bf905c9f4c9aaaf4d3cdd86a Merge diff -r 90c87069b39c -r 7ca02bd6fbf6 hotspot/src/share/vm/logging/logTagLevelExpression.cpp --- a/hotspot/src/share/vm/logging/logTagLevelExpression.cpp Fri Sep 02 09:49:10 2016 +0200 +++ b/hotspot/src/share/vm/logging/logTagLevelExpression.cpp Fri Sep 02 11:18:04 2016 +0200 @@ -164,7 +164,14 @@ success = false; break; } - add_tag(tag); + if (!add_tag(tag)) { + if (errstream != NULL) { + errstream->print_cr("Tag combination have duplicate tag '%s' in what-expression.", + cur_tag); + } + success = false; + break; + } cur_tag = plus_pos + 1; } while (plus_pos != NULL); diff -r 90c87069b39c -r 7ca02bd6fbf6 hotspot/src/share/vm/logging/logTagLevelExpression.hpp --- a/hotspot/src/share/vm/logging/logTagLevelExpression.hpp Fri Sep 02 09:49:10 2016 +0200 +++ b/hotspot/src/share/vm/logging/logTagLevelExpression.hpp Fri Sep 02 11:18:04 2016 +0200 @@ -59,9 +59,15 @@ _ntags = 0; } - void add_tag(LogTagType tag) { + bool add_tag(LogTagType tag) { assert(_ntags < LogTag::MaxTags, "Can't have more tags than MaxTags!"); + for (size_t i = 0; i < _ntags; i++) { + if (_tags[_ncombinations][i] == tag) { + return false; + } + } _tags[_ncombinations][_ntags++] = tag; + return true; } void set_level(LogLevelType level) { diff -r 90c87069b39c -r 7ca02bd6fbf6 hotspot/test/native/logging/test_logTagLevelExpression.cpp --- a/hotspot/test/native/logging/test_logTagLevelExpression.cpp Fri Sep 02 09:49:10 2016 +0200 +++ b/hotspot/test/native/logging/test_logTagLevelExpression.cpp Fri Sep 02 11:18:04 2016 +0200 @@ -33,7 +33,7 @@ const char* invalid_substr[] = { "=", "+", " ", "+=", "+=*", "*+", " +", "**", "++", ".", ",", ",," ",+", " *", "all+", "all*", "+all", "+all=Warning", "==Info", "=InfoWarning", - "BadTag+", "logging++", "logging*+", ",=", "gc+gc+gc+gc+gc+gc" + "BadTag+", "logging++", "logging*+", ",=", "gc+gc+" }; const char* valid_expression[] = { "all", "gc", "gc,logging", "gc+logging", "logging+gc", "logging+gc,gc", "logging+gc*", "gc=trace",