aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java16
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();