mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8178347: Process and ProcessHandle getPid method name inconsistency
Reviewed-by: hseigel
This commit is contained in:
parent
35d89151e8
commit
6f92b33cc9
14 changed files with 26 additions and 26 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -67,7 +67,7 @@ public class Testlibadimalloc {
|
|||
|
||||
// Start the process, get the pid and then wait for the test to finish
|
||||
Process process = builder.start();
|
||||
long pid = process.getPid();
|
||||
long pid = process.pid();
|
||||
int retval = process.waitFor();
|
||||
|
||||
// make sure the SEGVOverflow test crashed
|
||||
|
|
|
@ -80,7 +80,7 @@ public class AttachSetGetFlag {
|
|||
try {
|
||||
waitForReady(target);
|
||||
|
||||
int pid = (int)target.getPid();
|
||||
int pid = (int)target.pid();
|
||||
|
||||
HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class AttachSetGetFlag {
|
|||
try {
|
||||
waitForReady(target);
|
||||
|
||||
int pid = (int)target.getPid();
|
||||
int pid = (int)target.pid();
|
||||
|
||||
HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -78,7 +78,7 @@ public class DaemonThreadTest {
|
|||
thread.start();
|
||||
|
||||
// Run jstack tool and collect the output
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||
ToolResults results = jstackTool.measure();
|
||||
|
||||
// Analyze the jstack output for the correct thread type
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -96,7 +96,7 @@ public class SpreadLockTest {
|
|||
debuggee.start();
|
||||
|
||||
// Collect output from the jstack tool
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||
ToolResults results1 = jstackTool.measure();
|
||||
|
||||
// Go to method b()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -61,7 +61,7 @@ public class ThreadNamesTest {
|
|||
thread.start();
|
||||
|
||||
// Run jstack tool and collect the output
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||
ToolResults results = jstackTool.measure();
|
||||
|
||||
// Analyze the jstack output for the strange thread name
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -95,7 +95,7 @@ public class TraveledLockTest {
|
|||
debuggee.start();
|
||||
|
||||
// Collect output from the jstack tool
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||
ToolResults results1 = jstackTool.measure();
|
||||
|
||||
// Go to method b()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -105,7 +105,7 @@ public class WaitNotifyThreadTest {
|
|||
waitThread.start();
|
||||
|
||||
// Collect output from the jstack tool
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||
ToolResults results = jstackTool.measure();
|
||||
|
||||
// Analyze the jstack output for the patterns needed
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -38,7 +38,7 @@ public class GcCapacityTest {
|
|||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// We will be running "jstat -gc" tool
|
||||
JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().getPid());
|
||||
JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().pid());
|
||||
|
||||
// Run once and get the results asserting that they are reasonable
|
||||
JstatGcCapacityResults measurement1 = jstatGcTool.measure();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -41,7 +41,7 @@ public class GcCauseTest01 {
|
|||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// We will be running "jstat -gc" tool
|
||||
JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid());
|
||||
JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().pid());
|
||||
|
||||
// Run once and get the results asserting that they are reasonable
|
||||
JstatGcCauseResults measurement1 = jstatGcTool.measure();
|
||||
|
|
|
@ -38,6 +38,6 @@ import utils.*;
|
|||
public class GcCauseTest02 {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new GarbageProducerTest(new JstatGcCauseTool(ProcessHandle.current().getPid())).run();
|
||||
new GarbageProducerTest(new JstatGcCauseTool(ProcessHandle.current().pid())).run();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -41,7 +41,7 @@ public class GcCauseTest03 {
|
|||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// We will be running "jstat -gc" tool
|
||||
JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid());
|
||||
JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().pid());
|
||||
|
||||
System.gc();
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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,7 @@ public class GcNewTest {
|
|||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// We will be running "jstat -gc" tool
|
||||
JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().getPid());
|
||||
JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().pid());
|
||||
|
||||
// Run once and get the results asserting that they are reasonable
|
||||
JstatGcNewResults measurement1 = jstatGcTool.measure();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, 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
|
||||
|
@ -44,7 +44,7 @@ public class GcTest01 {
|
|||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// We will be running "jstat -gc" tool
|
||||
JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid());
|
||||
JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().pid());
|
||||
|
||||
// Run once and get the results asserting that they are reasonable
|
||||
JstatGcResults measurement1 = jstatGcTool.measure();
|
||||
|
|
|
@ -38,6 +38,6 @@ import utils.*;
|
|||
public class GcTest02 {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new GarbageProducerTest(new JstatGcTool(ProcessHandle.current().getPid())).run();
|
||||
new GarbageProducerTest(new JstatGcTool(ProcessHandle.current().pid())).run();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue