From aaa03b1cde9595afacfecd1a24e4540eda40a02a Mon Sep 17 00:00:00 2001 From: Luck Date: Wed, 15 May 2019 17:02:27 +0100 Subject: Add try..catch around the parsing of each heap dump summary entry --- .../me/lucko/spark/common/heapdump/HeapDumpSummary.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'spark-common/src/main/java/me/lucko/spark/common') 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())); -- cgit