Skip to content

Commit 9f8de22

Browse files
committed
8327793: Deprecate jstatd for removal
Reviewed-by: alanb, cjplummer
1 parent dbf5a9a commit 9f8de22

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/jdk.jstatd/share/classes/module-info.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
3232
* @moduleGraph
3333
* @since 9
3434
*/
35+
@Deprecated(since="24", forRemoval=true)
3536
module jdk.jstatd {
3637
requires java.rmi;
3738
requires jdk.internal.jvmstat;

src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,8 @@ public static void main(String[] args) {
8080
int rmiPort = 0;
8181
int argc = 0;
8282

83+
System.err.println("WARNING: jstatd is deprecated and will be removed in a future release.");
84+
8385
for ( ; (argc < args.length) && (args[argc].startsWith("-")); argc++) {
8486
String arg = args[argc];
8587

test/jdk/sun/tools/jstatd/JstatdTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ private void runTest(boolean useShortSyntax) throws Throwable {
356356
OutputAnalyzer output = jstatdThread.getOutput();
357357
List<String> stdout = output.asLinesWithoutVMWarnings();
358358
output.reportDiagnosticSummary();
359-
assertEquals(stdout.size(), 1, "Output should contain one line");
359+
assertEquals(stdout.size(), 2, "Output should contain two lines"); // includes deprecation warning
360360
assertTrue(stdout.get(0).startsWith("jstatd started"), "List should start with 'jstatd started'");
361361
assertNotEquals(output.getExitValue(), 0,
362362
"jstatd process exited with unexpected exit code");

0 commit comments

Comments
 (0)