8000 Error parsing JDK 8 dumps · Issue #6 · irockel/tda · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Error parsing JDK 8 dumps #6
Closed
Closed
@irockel

Description

@irockel

While parsing of JDK 8 dump files i have got an error:

Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "5 os_prio=0"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Long.parseLong(Long.java:419)
    at java.lang.Long.<init>(Long.java:678)
    at com.pironet.tda.utils.ThreadsTableModel.getValueAt(ThreadsTableModel.java:80)
    at com.pironet.tda.utils.TableSorter.getValueAt(TableSorter.java:285)

Because of there an os_prio clumn between prio and tid columns present.
I have made a stupid fix and problem has gone. See below.

Index: src/java/com/pironet/tda/SunJDKParser.java
===================================================================
--- src/java/com/pironet/tda/SunJDKParser.java  (revision 4)
+++ src/java/com/pironet/tda/SunJDKParser.java  (revision 5)
@@ -1029,7 +1029,10 @@
             String strippedToken = name.substring(name.lastIndexOf('"') + 1);

             if (strippedToken.indexOf("tid=") >= 0) {
-                tokens[2] = strippedToken.substring(strippedToken.indexOf("prio=") + 5, strippedToken.indexOf("tid=") - 1);
+                final int tidIndex = strippedToken.indexOf("tid=") - 1;
+                final int osPrioIndex = strippedToken.indexOf("os_prio=") - 1;
+                final int endIndex = osPrioIndex > 0 ? osPrioIndex : tidIndex;
+                tokens[2] = strippedToken.substring(strippedToken.indexOf("prio=") + 5, endIndex);
             } else {
                 tokens[2] = strippedToken.substring(strippedToken.indexOf("prio=") + 5);
             }

Merged from here: https://java.net/jira/browse/TDA-42

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0