Skip to content

Commit

Permalink
refactored data clumps
Browse files Browse the repository at this point in the history
  • Loading branch information
compf committed Jun 17, 2024
1 parent 7aad678 commit 28e413e
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions core/src/main/java/hudson/util/ProcessTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,12 @@ abstract static class ProcfsUnix extends Unix {
/**
* A process.
*/
public abstract class UnixProcess extends OSProcess {
public abstract class UnixProcess extends OSProcess implements Serializable {

protected int ppid;
protected EnvVars envVars;
protected List<String> arguments;

protected UnixProcess(int pid) {
super(pid);
}
Expand Down Expand Up @@ -877,9 +882,6 @@ protected LinuxProcess createProcess(int pid) throws IOException {
}

class LinuxProcess extends UnixProcess {
private int ppid = -1;
private EnvVars envVars;
private List<String> arguments;

LinuxProcess(int pid) throws IOException {
super(pid);
Expand Down Expand Up @@ -1001,13 +1003,11 @@ private class AIXProcess extends UnixProcess {
*/
private final boolean b64;

private final int ppid;

private final long pr_envp;
private final long pr_argp;
private final int argc;
private EnvVars envVars;
private List<String> arguments;


private AIXProcess(int pid) throws IOException {
super(pid);
Expand Down Expand Up @@ -1327,7 +1327,6 @@ private class SolarisProcess extends UnixProcess {
*/
private final boolean b64;

private final int ppid;
/**
* Address of the environment vector.
*/
Expand All @@ -1337,8 +1336,7 @@ private class SolarisProcess extends UnixProcess {
*/
private final long argp;
private final int argc;
private EnvVars envVars;
private List<String> arguments;


private SolarisProcess(int pid) throws IOException {
super(pid);
Expand Down Expand Up @@ -1596,9 +1594,6 @@ private static class Darwin extends Unix {
}

private class DarwinProcess extends UnixProcess {
private final int ppid;
private EnvVars envVars;
private List<String> arguments;

DarwinProcess(int pid, int ppid) {
super(pid);
Expand Down Expand Up @@ -1881,9 +1876,6 @@ private static class FreeBSD extends Unix {

private class FreeBSDProcess extends UnixProcess {

private final int ppid;
private EnvVars envVars;
private List<String> arguments;

FreeBSDProcess(int pid, int ppid) {
super(pid);
Expand Down Expand Up @@ -1934,7 +1926,7 @@ public synchronized EnvVars getEnvironmentVariables() {

@Override
@NonNull
public List<String> getArguments() {
public synchronized List<String> getArguments() {
if (arguments != null) {
return arguments;
}
Expand Down

0 comments on commit 28e413e

Please sign in to comment.