File tree 1 file changed +2
-4
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2012-2020 the original author or authors.
2
+ * Copyright 2012-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
20
20
import java .io .FileNotFoundException ;
21
21
import java .io .FileWriter ;
22
22
import java .io .IOException ;
23
- import java .lang .management .ManagementFactory ;
24
23
import java .nio .file .Files ;
25
24
import java .nio .file .attribute .PosixFilePermission ;
26
25
import java .util .Set ;
@@ -51,8 +50,7 @@ protected ApplicationPid(String pid) {
51
50
52
51
private String getPid () {
53
52
try {
54
- String jvmName = ManagementFactory .getRuntimeMXBean ().getName ();
55
- return jvmName .split ("@" )[0 ];
53
+ return Long .toString (ProcessHandle .current ().pid ());
56
54
}
57
55
catch (Throwable ex ) {
58
56
return null ;
You can’t perform that action at this time.
0 commit comments