diff options
author | Luck <git@lucko.me> | 2020-03-26 10:42:17 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2020-03-26 10:42:17 +0000 |
commit | 93f8b0fa68417c4a876be79aac8aee359ad1a25d (patch) | |
tree | 2b319685ce32392b1f93666f2d3ea8348337f8c8 /spark-common/src | |
parent | b86549b9ffcaeccdc15e965616a58a7d1ef0bcf6 (diff) | |
download | spark-93f8b0fa68417c4a876be79aac8aee359ad1a25d.tar.gz spark-93f8b0fa68417c4a876be79aac8aee359ad1a25d.tar.bz2 spark-93f8b0fa68417c4a876be79aac8aee359ad1a25d.zip |
Fix heapsummary type parsing
Diffstat (limited to 'spark-common/src')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java | 16 |
1 files changed, 15 insertions, 1 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 002ff72..56958d1 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 @@ -70,6 +70,20 @@ public final class HeapDumpSummary { } /** + * Converts type descriptors to their class name. + * + * @param type the type + * @return the class name + */ + private static String typeToClassName(String type) { + try { + return Type.getType(type).getClassName(); + } catch (IllegalArgumentException e) { + return type; + } + } + + /** * Creates a new heap dump based on the current VM. * * @return the created heap dump @@ -95,7 +109,7 @@ public final class HeapDumpSummary { Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2)), Long.parseLong(matcher.group(3)), - Type.getType(matcher.group(4)).getClassName() + typeToClassName(matcher.group(4)) ); } catch (Exception e) { new IllegalArgumentException("Exception parsing line: " + line, e).printStackTrace(); |