{"action":"created","issue":{"url":"https://api.github.com/repos/aragozin/jvm-tools/issues/34","repository_url":"https://api.github.com/repos/aragozin/jvm-tools","labels_url":"https://api.github.com/repos/aragozin/jvm-tools/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/aragozin/jvm-tools/issues/34/comments","events_url":"https://api.github.com/repos/aragozin/jvm-tools/issues/34/events","html_url":"https://github.com/aragozin/jvm-tools/issues/34","id":334509084,"node_id":"MDU6SXNzdWUzMzQ1MDkwODQ=","number":34,"title":"Strings in Java 10","user":{"login":"stefan-reich","id":4520515,"node_id":"MDQ6VXNlcjQ1MjA1MTU=","avatar_url":"https://avatars1.githubusercontent.com/u/4520515?v=4","gravatar_id":"","url":"https://api.github.com/users/stefan-reich","html_url":"https://github.com/stefan-reich","followers_url":"https://api.github.com/users/stefan-reich/followers","following_url":"https://api.github.com/users/stefan-reich/following{/other_user}","gists_url":"https://api.github.com/users/stefan-reich/gists{/gist_id}","starred_url":"https://api.github.com/users/stefan-reich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefan-reich/subscriptions","organizations_url":"https://api.github.com/users/stefan-reich/orgs","repos_url":"https://api.github.com/users/stefan-reich/repos","events_url":"https://api.github.com/users/stefan-reich/events{/privacy}","received_events_url":"https://api.github.com/users/stefan-reich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-21T14:03:21Z","updated_at":"2018-06-21T16:32:02Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI am using your library in a [Java-based OS](http://BotCompany.de) to find memory leaks automatically.\r\n\r\nOne small thing. I believe the library is not fully adapted to Java 10? It generally seems to work, don't get me wrong :+1: \r\n\r\nThe issue I have is with the method org.gridkit.jvmtool.heapdump.HeapWalker.stringValue():\r\n\r\n```\r\n    public static String stringValue(Instance obj) {\r\n        if (obj == null) {\r\n            return null;\r\n        }\r\n        if (!\"java.lang.String\".equals(obj.getJavaClass().getName())) {\r\n            throw new IllegalArgumentException(\"Is not a string: \" + obj.getInstanceId() + \" (\" + obj.getJavaClass().getName() + \")\");\r\n        }\r\n        char[] text = null;\r\n        int offset = 0;\r\n        int len = -1;\r\n        for(FieldValue f: obj.getFieldValues()) {\r\n            Field ff = f.getField();\r\n            if (\"value\".equals(ff.getName())) {\r\n                PrimitiveArrayInstance chars = (PrimitiveArrayInstance) ((ObjectFieldValue)f).getInstance();\r\n                text = new char[chars.getLength()];\r\n                for(int i = 0; i != text.length; ++i) {\r\n                    text[i] = ((String)chars.getValues().get(i)).charAt(0);\r\n                }\r\n            }\r\n            // fields below were removed in Java 7\r\n            else if (\"offset\".equals(ff.getName())) {\r\n                offset = Integer.valueOf(f.getValue());\r\n            }\r\n            else if (\"count\".equals(ff.getName())) {\r\n                len = Integer.valueOf(f.getValue());\r\n            }\r\n        }\r\n\r\n        if (len < 0) {\r\n            len = text.length;\r\n        }\r\n\r\n        return new String(text, offset, len);\r\n    }\r\n```\r\n\r\nwhich clearly is pre-JDK 10 code. Any intention to upgrade this?\r\n\r\nMany greetings,\r\nStefan\r\nBotCompany.de\r\n\r\nEdit: In fact, I might just do this myself..."},"comment":{"url":"https://api.github.com/repos/aragozin/jvm-tools/issues/comments/399165570","html_url":"https://github.com/aragozin/jvm-tools/issues/34#issuecomment-399165570","issue_url":"https://api.github.com/repos/aragozin/jvm-tools/issues/34","id":399165570,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTE2NTU3MA==","user":{"login":"stefan-reich","id":4520515,"node_id":"MDQ6VXNlcjQ1MjA1MTU=","avatar_url":"https://avatars1.githubusercontent.com/u/4520515?v=4","gravatar_id":"","url":"https://api.github.com/users/stefan-reich","html_url":"https://github.com/stefan-reich","followers_url":"https://api.github.com/users/stefan-reich/followers","following_url":"https://api.github.com/users/stefan-reich/following{/other_user}","gists_url":"https://api.github.com/users/stefan-reich/gists{/gist_id}","starred_url":"https://api.github.com/users/stefan-reich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefan-reich/subscriptions","organizations_url":"https://api.github.com/users/stefan-reich/orgs","repos_url":"https://api.github.com/users/stefan-reich/repos","events_url":"https://api.github.com/users/stefan-reich/events{/privacy}","received_events_url":"https://api.github.com/users/stefan-reich/received_events","type":"User","site_admin":false},"created_at":"2018-06-21T16:32:02Z","updated_at":"2018-06-21T16:32:02Z","author_association":"NONE","body":"Pull request: https://github.com/aragozin/jvm-tools/pull/35"}}
{"actor":{"display_login":"stefan-reich"}}