diff --git a/test/hotspot/jtreg/vmTestbase/jit/escape/LockElision/MatMul/MatMul.java b/test/hotspot/jtreg/vmTestbase/jit/escape/LockElision/MatMul/MatMul.java index cf20b0df8a0..8d1a5fac9ae 100644 --- a/test/hotspot/jtreg/vmTestbase/jit/escape/LockElision/MatMul/MatMul.java +++ b/test/hotspot/jtreg/vmTestbase/jit/escape/LockElision/MatMul/MatMul.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -85,7 +85,7 @@ public class MatMul { } public int run() { - log = new Log(System.out, verbose); + log = new Log(System.out); log.display("Parallel matrix multiplication test"); Matrix a = Matrix.randomMatrix(dim); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001.java index 015643f3a18..142d6387610 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001.java @@ -73,7 +73,6 @@ public class launchnosuspend001 { argHandler = new ArgumentHandler(args); log = new Log(this.out, argHandler); - //log.enableVerbose(true); } private PrintStream out; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter_tagged/HeapFilter.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter_tagged/HeapFilter.java index 91f315ee7a9..b690955307e 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter_tagged/HeapFilter.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter_tagged/HeapFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -49,7 +49,6 @@ public class HeapFilter extends DebugeeClass { log = new Log(out, argHandler); testObjects = new Object[]{new TaggedClass(), new UntaggedClass()}; - log.enableVerbose(true); log.display("Verifying reachable objects."); status = checkStatus(status); testObjects = null; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001.java index 702a5a79379..a9e75bb7cec 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -40,7 +40,6 @@ public class isexceeded001 { public static int run(String[] argv, PrintStream out) { ArgumentHandler argHandler = new ArgumentHandler(argv); Log log = new Log(out, argHandler); - log.enableVerbose(true); monitor = Monitor.getMemoryMonitor(log, argHandler); List pools = monitor.getMemoryPoolMBeans(); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java index 390bfdd6251..a684c03e67a 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -47,7 +47,6 @@ public class isexceeded001 { public static int run(String[] argv, PrintStream out) { ArgumentHandler argHandler = new ArgumentHandler(argv); Log log = new Log(out, argHandler); - log.enableVerbose(true); // show log output MemoryMonitor monitor = Monitor.getMemoryMonitor(log, argHandler); List pools = monitor.getMemoryPoolMBeans(); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/lowmem/lowmem001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/lowmem/lowmem001.java index d698e5aec83..67f0d17f561 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/lowmem/lowmem001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/lowmem/lowmem001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -58,7 +58,7 @@ public class lowmem001 extends ThreadedGCTest { @Override public void run() { - Log log = new Log(System.out, true); + Log log = new Log(System.out); // System.err is duplicated into buffer // it should be empty MyStream stream = new MyStream(System.err); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java b/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java index e5750182495..dbaa1e6646c 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java @@ -29,22 +29,15 @@ import java.io.IOException; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringReader; -import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.HashSet; import java.util.Vector; -import nsk.share.test.LazyFormatString; /** - * This class helps to print test-execution trace messages - * and filter them when execution mode is not verbose. - *
- * Verbose mode if defined by providing -verbose command line
- * option, handled by ArgumentParser. Use verbose()
- * method to determine which mode is used.
+ * This class helps to print test-execution trace messages.
*
* Log provides with two main methods to print messages:
*
Log.Logger class.
*
- * @see #verbose()
* @see #complain(String)
* @see #display(String)
* @see ArgumentParser
@@ -72,18 +64,6 @@ public class Log {
*/
private PrintStream out = null;
- /**
- * Is log-mode verbose?
- * Always enabled.
- */
- private final boolean verbose = true;
-
- /**
- * Should log messages prefixed with timestamps?
- * Always enabled.
- */
- private final boolean timestamp = true;
-
/**
* Names for trace levels
*/
@@ -188,41 +168,14 @@ public class Log {
/**
* Incarnate new Log for the given stream; and
- * either for verbose or for non-verbose mode accordingly to
- * the given verbose key.
- */
- public Log(PrintStream stream, boolean verbose) {
- this(stream);
- }
-
- /**
- * Incarnate new Log for the given stream; and
- * either for verbose or for non-verbose mode accordingly to
* the given argsHandler.
*/
public Log(PrintStream stream, ArgumentParser argsParser) {
- this(stream, argsParser.verbose());
traceLevel = argsParser.getTraceLevel();
}
/////////////////////////////////////////////////////////////////
- /**
- * Return true if log mode is verbose.
- */
- public boolean verbose() {
- return verbose;
- }
-
- /**
- * Enable or disable verbose mode for printing messages.
- */
- public void enableVerbose(boolean enable) {
- if (!enable) {
- throw new RuntimeException("The non-verbose logging is not supported.");
- }
- }
-
public int getTraceLevel() {
return traceLevel;
}
@@ -266,9 +219,6 @@ public class Log {
@Deprecated
public synchronized void println(String message) {
doPrint(message);
- if (!verbose()) {
- keepLog(composeLine(message));
- }
}
/**
@@ -282,9 +232,6 @@ public class Log {
*/
@Deprecated
public synchronized void comment(String message) {
- if (!verbose()) {
- doPrint(message);
- }
}
/**
@@ -314,17 +261,10 @@ public class Log {
}
/**
- * Print message to the assigned output stream,
- * if log mode is verbose. The message will be lost,
- * if execution mode is non-verbose, and there is no error messages
- * printed.
+ * Print message to the assigned output stream.
*/
public synchronized void display(Object message) {
- if (verbose()) {
- doPrint(message.toString());
- } else {
- keepLog(composeLine(message.toString()));
- }
+ doPrint(message.toString());
}
/**
@@ -333,15 +273,6 @@ public class Log {
* into errorsBuffer.
*/
public synchronized void complain(Object message) {
- if (!verbose()) {
- PrintStream stream = findOutStream();
- stream.println("#> ");
- stream.println("#> WARNING: switching log to verbose mode,");
- stream.println("#> because error is complained");
- stream.println("#> ");
- stream.flush();
- enableVerbose(true);
- }
String msgStr = message.toString();
printError(msgStr);
@@ -406,10 +337,7 @@ public class Log {
/////////////////////////////////////////////////////////////////
/**
- * Redirect log to the given stream, and switch
- * log mode to verbose.
- * Prints errors summary to current stream, cancel current stream
- * and switches to new stream. Turns on verbose mode for new stream.
+ * Redirect log to the given stream.
*
* @deprecated This method is obsolete.
*/
@@ -430,20 +358,6 @@ public class Log {
logBuffer.clear();
}
- /**
- * Print all messages from log buffer which were hidden because
- * of non-verbose mode,
- */
- private synchronized void flushLogBuffer() {
- if (!logBuffer.isEmpty()) {
- PrintStream stream = findOutStream();
- for (int i = 0; i < logBuffer.size(); i++) {
- stream.println(logBuffer.elementAt(i));
- }
- stream.flush();
- }
- }
-
/**
* Return out stream if defined or Sytem.err otherwise;
* print a warning message when System.err is used first time.
@@ -468,18 +382,15 @@ public class Log {
* Compose line to print possible prefixing it with timestamp.
*/
private String composeLine(String message) {
- if (timestamp) {
- long time = System.currentTimeMillis();
- long ms = time % 1000;
- time /= 1000;
- long secs = time % 60;
- time /= 60;
- long mins = time % 60;
- time /= 60;
- long hours = time % 24;
- return "[" + hours + ":" + mins + ":" + secs + "." + ms + "] " + message;
- }
- return message;
+ long time = System.currentTimeMillis();
+ long ms = time % 1000;
+ time /= 1000;
+ long secs = time % 60;
+ time /= 60;
+ long mins = time % 60;
+ time /= 60;
+ long hours = time % 24;
+ return "[" + hours + ":" + mins + ":" + secs + "." + ms + "] " + message;
}
/**
@@ -513,13 +424,6 @@ public class Log {
}
}
- /**
- * Keep the given log message into logBuffer.
- */
- private synchronized void keepLog(String message) {
- logBuffer.addElement(message);
- }
-
/**
* This class can be used as a base for each class that use Log
* for print messages and errors.
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AODTestRunner.java b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AODTestRunner.java
index bde40cc7e20..9899c762a7a 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AODTestRunner.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AODTestRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -68,7 +68,7 @@ public class AODTestRunner {
protected AODRunnerArgParser argParser;
protected AODTestRunner(String[] args) {
- log = new Log(System.out, true);
+ log = new Log(System.out);
argParser = createArgParser(args);
}
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AbstractJarAgent.java b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AbstractJarAgent.java
index 3fa3141a8cd..fb02327a422 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AbstractJarAgent.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AbstractJarAgent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -157,7 +157,7 @@ abstract public class AbstractJarAgent {
if (name == null)
throw new TestBug("Agent name wasn't specified");
- log = new Log(System.out, true);
+ log = new Log(System.out);
}
/*
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java
index bb726453e9b..c8fb3bf2663 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java
@@ -39,7 +39,7 @@ it sends signal that it is ready for test and waits for signal permitting finish
*/
public class DummyTargetApplication {
- protected Log log = new Log(System.out, true);
+ protected Log log = new Log(System.out);
protected AODTargetArgParser argParser;
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java
index 6f80033dff5..0b5acfb24ba 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java
@@ -213,7 +213,7 @@ public class TargetApplicationWaitingAgents {
if (targetApplicationInitialized)
throw new TestBug("TargetApplication already initialized");
- log = new Log(System.out, true);
+ log = new Log(System.out);
argParser = createArgParser(args);
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITest.java b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITest.java
index c8d26b6ea1f..d9b847e110d 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITest.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -87,7 +87,7 @@ public class JVMTITest {
AgentsAttacher attacher = new AgentsAttacher(Utils.findCurrentVMIdUsingJPS(jdkPath),
agents,
- new Log(System.out, true));
+ new Log(System.out));
attacher.attachAgents();
}
}
diff --git a/test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/Parentheses.java b/test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/Parentheses.java
index 66546e9b13f..219af51045a 100644
--- a/test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/Parentheses.java
+++ b/test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/Parentheses.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -69,7 +69,7 @@ public class Parentheses {
public void run() throws IOException, ReflectiveOperationException {
- log = new Log(System.out, verbose);
+ log = new Log(System.out);
InstructionSequence instructionSequence = null;
for (int i = 0; i < iterations * stressOptions.getIterationsFactor(); i++) {