11/*
2- * Copyright (c) 2004, 2018 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2004, 2021 , 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
4545 */
4646public class LocalVmManager {
4747 private String userName ; // user name for monitored jvm
48- private List <String > tmpdirs ;
4948 private Pattern userPattern ;
5049 private Matcher userMatcher ;
5150 private FilenameFilter userFilter ;
@@ -77,9 +76,7 @@ public LocalVmManager() {
7776 public LocalVmManager (String user ) {
7877 this .userName = user ;
7978
80-
8179 if (userName == null ) {
82- tmpdirs = PerfDataFile .getTempDirectories (null , 0 );
8380 userPattern = Pattern .compile (PerfDataFile .userDirNamePattern );
8481 userMatcher = userPattern .matcher ("" );
8582
@@ -89,8 +86,6 @@ public boolean accept(File dir, String name) {
8986 return userMatcher .lookingAt ();
9087 }
9188 };
92- } else {
93- tmpdirs = PerfDataFile .getTempDirectories (userName , 0 );
9489 }
9590
9691 filePattern = Pattern .compile (PerfDataFile .fileNamePattern );
@@ -134,6 +129,7 @@ public synchronized Set<Integer> activeVms() {
134129 * we'd see strange file names being matched by the matcher.
135130 */
136131 Set <Integer > jvmSet = new HashSet <Integer >();
132+ List <String > tmpdirs = PerfDataFile .getTempDirectories (userName , 0 );
137133
138134 for (String dir : tmpdirs ) {
139135 File tmpdir = new File (dir );
0 commit comments