diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index 4e8164c77..080af97cb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java @@ -1713,17 +1713,7 @@ private String getProcDesc() { } private long getPID() { - String processName = java.lang.management.ManagementFactory - .getRuntimeMXBean().getName(); - if (processName != null && processName.length() > 0) { - try { - return Long.parseLong(processName.split("@")[0]); //$NON-NLS-1$ - } catch (Exception e) { - return 0; - } - } - - return 0; + return ProcessHandle.current().pid(); } private String getHostName() {