1
1
/*
2
- * Copyright (c) 2004, 2021 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2004, 2022 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
44
44
public class LocalVmManager {
45
45
private FilenameFilter userDirFilter ;
46
46
private FilenameFilter userDirFileFilter ;
47
- private FilenameFilter oldtmpFileFilter ;
48
47
49
48
/**
50
49
* Creates a LocalVmManager instance for the local system.
@@ -53,7 +52,7 @@ public class LocalVmManager {
53
52
* has appropriate permissions.
54
53
*/
55
54
public LocalVmManager () {
56
- // 1.4.2 and later: The files are in {tmpdir}/hsperfdata_{any_user_name}/[0-9]+
55
+ // The files are in {tmpdir}/hsperfdata_{any_user_name}/[0-9]+
57
56
Pattern userDirPattern = Pattern .compile (PerfDataFile .userDirNamePattern );
58
57
userDirFilter = new FilenameFilter () {
59
58
public boolean accept (File dir , String name ) {
@@ -67,15 +66,6 @@ public boolean accept(File dir, String name) {
67
66
return userDirFilePattern .matcher (name ).matches ();
68
67
}
69
68
};
70
-
71
- // 1.4.1 (or earlier?): the files are stored directly under {tmpdir}/ with
72
- // the following pattern.
73
- Pattern oldtmpFilePattern = Pattern .compile (PerfDataFile .tmpFileNamePattern );
74
- oldtmpFileFilter = new FilenameFilter () {
75
- public boolean accept (File dir , String name ) {
76
- return oldtmpFilePattern .matcher (name ).matches ();
77
- }
78
- };
79
69
}
80
70
81
71
/**
@@ -100,7 +90,7 @@ public synchronized Set<Integer> activeVms() {
100
90
}
101
91
102
92
103
- // 1.4.2 and later: Look for the files {tmpdir}/hsperfdata_{any_user_name}/[0-9]+
93
+ // Look for the files {tmpdir}/hsperfdata_{any_user_name}/[0-9]+
104
94
// that are readable by the current user.
105
95
File [] dirs = tmpdir .listFiles (userDirFilter );
106
96
for (File subDir : dirs ) {
@@ -121,20 +111,6 @@ public synchronized Set<Integer> activeVms() {
121
111
}
122
112
}
123
113
}
124
-
125
- // look for any 1.4.1 files that are readable by the current user.
126
- File [] files = tmpdir .listFiles (oldtmpFileFilter );
127
- if (files != null ) {
128
- for (File file : files ) {
129
- if (file .isFile () && file .canRead ()) {
130
- int vmid = PerfDataFile .getLocalVmId (file );
131
- if (vmid != -1 ) {
132
- jvmSet .add (vmid );
133
- }
134
- }
135
- }
136
- }
137
-
138
114
}
139
115
return jvmSet ;
140
116
}
0 commit comments