diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java index 32147e86d17..27256facaf6 100644 --- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java +++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java @@ -377,10 +377,8 @@ public static void main(String[] args) { forceDeduplication(ageThreshold, FullGC); - if (!waitForDeduplication(dupString3, baseString)) { - if (getValue(dupString3) != getValue(internedString)) { - throw new RuntimeException("String 3 doesn't match either"); - } + if (!waitForDeduplication(dupString3, internedString)) { + throw new RuntimeException("Deduplication has not occurred for string 3"); } if (afterInternedValue != getValue(dupString2)) {