Skip to content

Commit 65f188f

Browse files
author
Roger Riggs
committed
8354334: Remove @valuebased from ProcessHandle
Reviewed-by: liach
1 parent cc34135 commit 65f188f

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

src/java.base/share/classes/java/lang/ProcessHandle.java

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2025, 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
@@ -89,7 +89,6 @@
8989
* @see Process
9090
* @since 9
9191
*/
92-
@jdk.internal.ValueBased
9392
public interface ProcessHandle extends Comparable<ProcessHandle> {
9493

9594
/**
@@ -114,7 +113,7 @@ public interface ProcessHandle extends Comparable<ProcessHandle> {
114113
* @throws UnsupportedOperationException if the implementation
115114
* does not support this operation
116115
*/
117-
public static Optional<ProcessHandle> of(long pid) {
116+
static Optional<ProcessHandle> of(long pid) {
118117
return ProcessHandleImpl.get(pid);
119118
}
120119

@@ -126,7 +125,7 @@ public static Optional<ProcessHandle> of(long pid) {
126125
* @throws UnsupportedOperationException if the implementation
127126
* does not support this operation
128127
*/
129-
public static ProcessHandle current() {
128+
static ProcessHandle current() {
130129
return ProcessHandleImpl.current();
131130
}
132131

@@ -204,21 +203,21 @@ static Stream<ProcessHandle> allProcesses() {
204203
* and actions if the value is available.
205204
* @since 9
206205
*/
207-
public interface Info {
206+
interface Info {
208207
/**
209208
* Returns the executable pathname of the process.
210209
*
211210
* @return an {@code Optional<String>} of the executable pathname
212211
* of the process
213212
*/
214-
public Optional<String> command();
213+
Optional<String> command();
215214

216215
/**
217216
* Returns the command line of the process.
218217
* <p>
219218
* If {@link #command command()} and {@link #arguments arguments()} return
220219
* non-empty optionals, this is simply a convenience method which concatenates
221-
* the values of the two functions separated by spaces. Otherwise it will return a
220+
* the values of the two functions separated by spaces. Otherwise, it will return a
222221
* best-effort, platform dependent representation of the command line.
223222
*
224223
* @apiNote Note that the returned executable pathname and the
@@ -233,7 +232,7 @@ public interface Info {
233232
* @return an {@code Optional<String>} of the command line
234233
* of the process
235234
*/
236-
public Optional<String> commandLine();
235+
Optional<String> commandLine();
237236

238237
/**
239238
* Returns an array of Strings of the arguments of the process.
@@ -244,28 +243,28 @@ public interface Info {
244243
*
245244
* @return an {@code Optional<String[]>} of the arguments of the process
246245
*/
247-
public Optional<String[]> arguments();
246+
Optional<String[]> arguments();
248247

249248
/**
250249
* Returns the start time of the process.
251250
*
252251
* @return an {@code Optional<Instant>} of the start time of the process
253252
*/
254-
public Optional<Instant> startInstant();
253+
Optional<Instant> startInstant();
255254

256255
/**
257256
* Returns the total cputime accumulated of the process.
258257
*
259258
* @return an {@code Optional<Duration>} for the accumulated total cputime
260259
*/
261-
public Optional<Duration> totalCpuDuration();
260+
Optional<Duration> totalCpuDuration();
262261

263262
/**
264263
* Return the user of the process.
265264
*
266265
* @return an {@code Optional<String>} for the user of the process
267266
*/
268-
public Optional<String> user();
267+
Optional<String> user();
269268
}
270269

271270
/**
@@ -285,13 +284,11 @@ public interface Info {
285284
* {@link java.util.concurrent.CompletableFuture#isDone done} or to
286285
* {@link java.util.concurrent.Future#get() wait} for it to terminate.
287286
* {@link java.util.concurrent.Future#cancel(boolean) Cancelling}
288-
* the CompleteableFuture does not affect the Process.
287+
* the {@linkplain CompletableFuture CompletableFuture} does not affect the Process.
289288
* @apiNote
290289
* The process may be observed to have terminated with {@link #isAlive}
291-
* before the ComputableFuture is completed and dependent actions are invoked.
292-
*
290+
* before the {@code CompletableFuture} is completed and dependent actions are invoked.
293291
* @return a new {@code CompletableFuture<ProcessHandle>} for the ProcessHandle
294-
*
295292
* @throws IllegalStateException if the process is the current process
296293
*/
297294
CompletableFuture<ProcessHandle> onExit();

0 commit comments

Comments
 (0)