diff options
author | Luck <git@lucko.me> | 2019-05-15 17:02:27 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2019-05-15 17:02:27 +0100 |
commit | aaa03b1cde9595afacfecd1a24e4540eda40a02a (patch) | |
tree | 102b563a08b8d2238fe3d235067d17c1ec45819c /spark-common/src/main/java/me/lucko/spark/common | |
parent | 5d52a42508bb6d3e8ada40ff65746301fd42a4a4 (diff) | |
download | spark-aaa03b1cde9595afacfecd1a24e4540eda40a02a.tar.gz spark-aaa03b1cde9595afacfecd1a24e4540eda40a02a.tar.bz2 spark-aaa03b1cde9595afacfecd1a24e4540eda40a02a.zip |
Add try..catch around the parsing of each heap dump summary entry
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java index 6021d92..867dcc6 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java +++ b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java @@ -90,12 +90,17 @@ public final class HeapDumpSummary { return null; } - return new Entry( - Integer.parseInt(matcher.group(1)), - Integer.parseInt(matcher.group(2)), - Long.parseLong(matcher.group(3)), - TypeDescriptors.getJavaType(matcher.group(4)) - ); + try { + return new Entry( + Integer.parseInt(matcher.group(1)), + Integer.parseInt(matcher.group(2)), + Long.parseLong(matcher.group(3)), + TypeDescriptors.getJavaType(matcher.group(4)) + ); + } catch (Exception e) { + e.printStackTrace(); + return null; + } }) .filter(Objects::nonNull) .collect(Collectors.toList())); |