We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 419bb40 commit b69c69dCopy full SHA for b69c69d
internal-api/src/main/java/datadog/trace/util/PidHelper.java
@@ -142,12 +142,15 @@ public static Set<String> getJavaPids() {
142
// Hotspot,
143
// but they are directories for J9.
144
// This also makes sense as defensive programming.
145
- try {
146
- Integer.parseInt(name);
147
- return true;
148
- } catch (Exception e) {
+ if (name.isEmpty()) {
149
return false;
150
}
+ for (int i = 0; i < name.length(); i++) {
+ if (!Character.isDigit(name.charAt(i))) {
+ return false;
151
+ }
152
153
+ return true;
154
})
155
.collect(Collectors.toSet());
156
} catch (IOException e) {
0 commit comments