diff --git a/test/hotspot/jtreg/serviceability/dcmd/compiler/CodeCacheTest.java b/test/hotspot/jtreg/serviceability/dcmd/compiler/CodeCacheTest.java index 6600590700d..157c1713ec2 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/compiler/CodeCacheTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/compiler/CodeCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -113,7 +113,6 @@ public class CodeCacheTest { // Get output from dcmd (diagnostic command) OutputAnalyzer output = executor.execute("Compiler.codecache"); Iterator lines = output.asLines().iterator(); - lines.next(); // skip timestamp // Validate code cache segments String line; diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/ClassHierarchyTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/ClassHierarchyTest.java index e962d9b83cf..4dcdeb003bf 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/ClassHierarchyTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/ClassHierarchyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,18 +54,15 @@ public class ClassHierarchyTest { // |--DcmdTestClass$$Lambda/4081552/0xa529fbb0 // > VM.class_hierarchy DcmdBaseClass - // 2025-01-01 10:59:59 // java.lang.Object/null // |--DcmdBaseClass/0xa4abcd48 // > VM.class_hierarchy DcmdBaseClass -s - // 2025-01-01 10:59:59 // java.lang.Object/null // |--DcmdBaseClass/0xa4abcd48 // | |--DcmdTestClass/0xa4abcd48 // > VM.class_hierarchy DcmdBaseClass -i -s - // 2025-01-01 10:59:59 // java.lang.Object/null // |--DcmdBaseClass/0xa4abcd48 // | implements Intf2/0xa4abcd48 (declared intf) @@ -114,14 +111,13 @@ public class ClassHierarchyTest { // Verify the output for the simple hierachry of just DcmdBaseClass. output = executor.execute("VM.class_hierarchy DcmdBaseClass"); lines = output.asLines().iterator(); - lines.next(); // skip timestamp i = 0; while (lines.hasNext()) { String line = lines.next(); Matcher m = expected_lines[i].matcher(line); i++; if (!m.matches()) { - Assert.fail("Failed. Expected line #%d \"%s\" to match \"%s\"".formatted(i, line, expected_lines[i].pattern())); + Assert.fail("Failed to match line #" + i + ": " + line); } // Should only be two lines of output in this form. if (i == 2) break; @@ -134,14 +130,13 @@ public class ClassHierarchyTest { // Verify the output for the full hierarchy of DcmdBaseClass, but without interfaces. output = executor.execute("VM.class_hierarchy DcmdBaseClass -s"); lines = output.asLines().iterator(); - lines.next(); // skip timestamp i = 0; while (lines.hasNext()) { String line = lines.next(); Matcher m = expected_lines[i].matcher(line); i++; if (!m.matches()) { - Assert.fail("Failed. Expected line #%d \"%s\" to match \"%s\"".formatted(i, line, expected_lines[i].pattern())); + Assert.fail("Failed to match line #" + i + ": " + line); } // "implements" lines should not be in this output. if (i == 2 || i == 4) i += 2; @@ -154,7 +149,6 @@ public class ClassHierarchyTest { // Verify the output for the full hierarchy of DcmdBaseClass, including interfaces. output = executor.execute("VM.class_hierarchy DcmdBaseClass -i -s"); lines = output.asLines().iterator(); - lines.next(); // skip timestamp i = 0; String classLoaderAddr = null; while (lines.hasNext()) {