{"action":"created","issue":{"url":"https://api.github.com/repos/Sable/soot/issues/1045","repository_url":"https://api.github.com/repos/Sable/soot","labels_url":"https://api.github.com/repos/Sable/soot/issues/1045/labels{/name}","comments_url":"https://api.github.com/repos/Sable/soot/issues/1045/comments","events_url":"https://api.github.com/repos/Sable/soot/issues/1045/events","html_url":"https://github.com/Sable/soot/issues/1045","id":371625650,"node_id":"MDU6SXNzdWUzNzE2MjU2NTA=","number":1045,"title":"Quotes used on keywords in Method.toString","user":{"login":"kalhauge","id":1182166,"node_id":"MDQ6VXNlcjExODIxNjY=","avatar_url":"https://avatars1.githubusercontent.com/u/1182166?v=4","gravatar_id":"","url":"https://api.github.com/users/kalhauge","html_url":"https://github.com/kalhauge","followers_url":"https://api.github.com/users/kalhauge/followers","following_url":"https://api.github.com/users/kalhauge/following{/other_user}","gists_url":"https://api.github.com/users/kalhauge/gists{/gist_id}","starred_url":"https://api.github.com/users/kalhauge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalhauge/subscriptions","organizations_url":"https://api.github.com/users/kalhauge/orgs","repos_url":"https://api.github.com/users/kalhauge/repos","events_url":"https://api.github.com/users/kalhauge/events{/privacy}","received_events_url":"https://api.github.com/users/kalhauge/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-18T17:06:14Z","updated_at":"2018-10-31T15:27:19Z","closed_at":"2018-10-31T15:27:19Z","author_association":"NONE","body":"I have been writing the following code to output the reachable methods \r\nof a program. The problem is that the packages in the Method.toString \r\nformat has some keywords quoted with \" ' \".\r\n\r\nThe analysis looks like this:\r\n\r\n```java\r\nimport java.util.Map;\r\nimport java.util.Iterator;\r\nimport java.io.IOException;\r\nimport java.io.BufferedWriter;\r\nimport java.io.FileWriter;\r\n\r\nimport soot.Main;\r\nimport soot.PackManager;\r\nimport soot.Transform;\r\nimport soot.SceneTransformer;\r\n\r\npublic class SootReachableMethod {\r\n  public static void main(String[] args) {\r\n    PackManager.v().getPack(\"wjtp\").add(new Transform(\"wjtp.reachable-methods\", new SceneTransformer() {\r\n      protected void internalTransform(String phase, Map<String, String> options) {\r\n        try { \r\n          String fileName = options.getOrDefault(\"output\", \"reachable-methods.txt\");\r\n          BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));\r\n          Iterator x = soot.Scene.v().getReachableMethods().listener();\r\n          while (x.hasNext()) { \r\n            writer.write(x.next().toString());\r\n            writer.write(\"\\n\");\r\n          }\r\n          writer.close();\r\n        } catch (IOException e) { \r\n          e.printStackTrace();\r\n        }\r\n      }}));\r\n    soot.Main.main(args);\r\n  }\r\n}\r\n```\r\n\r\nWhich we can complie to the folder`analysis/`.\r\n\r\nNow analysing the following code (in the package annotation/) compiled to `build/`:\r\n\r\n```java\r\npackage annotation;\r\n\r\npublic class Main {\r\n\tpublic static void main(String [] argv) { \r\n\t\tannotation(new Main());\t\r\n\t}\r\n\r\n\tpublic static Main annotation(Main m) {\r\n\t\treturn m;\r\n\t}\r\n}\r\n```\r\n\r\nWe can run the analysis with this:\r\n\r\n```bash\r\njava -cp soot-3.1.0-jar-with-dependencies.jar:analysis\\\r\n  -pp -w -cp build -f n -p cg.spark on -app annotation.Main\r\ngrep annotation reachable-methods.txt\r\n```\r\n\r\nIt should produce\r\n\r\n```\r\n<annotation.Main: void main(java.lang.String[])>\r\n<annotation.Main: annotation.Main annotation(annotation.Main)>\r\n<annotation.Main: void <init>()>\r\n<sun.reflect.annotation.TypeAnnotation$TypeAnnotationTargetInfo: java.lang.String toString()>\r\n<sun.reflect.annotation.AnnotationType: java.lang.String toString()>\r\n<sun.reflect.annotation.TypeAnnotation: java.lang.String toString()>\r\n```\r\n\r\nbut produces:\r\n\r\n```\r\n<'annotation'.Main: void main(java.lang.String[])>\r\n<'annotation'.Main: 'annotation'.Main 'annotation'('annotation'.Main)>\r\n<'annotation'.Main: void <init>()>\r\n<sun.reflect.'annotation'.TypeAnnotation$TypeAnnotationTargetInfo: java.lang.String toString()>\r\n<sun.reflect.'annotation'.AnnotationType: java.lang.String toString()>\r\n<sun.reflect.'annotation'.TypeAnnotation: java.lang.String toString()>\r\n```\r\n\r\n## Version\r\n\r\nSoot version 3.1.0, sha256: 0q86sin27ddgk8snv1zxac2fi4vvqm9i8x9wv1dvjs8p4dncz368\r\n"},"comment":{"url":"https://api.github.com/repos/Sable/soot/issues/comments/434731321","html_url":"https://github.com/Sable/soot/issues/1045#issuecomment-434731321","issue_url":"https://api.github.com/repos/Sable/soot/issues/1045","id":434731321,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDczMTMyMQ==","user":{"login":"kalhauge","id":1182166,"node_id":"MDQ6VXNlcjExODIxNjY=","avatar_url":"https://avatars1.githubusercontent.com/u/1182166?v=4","gravatar_id":"","url":"https://api.github.com/users/kalhauge","html_url":"https://github.com/kalhauge","followers_url":"https://api.github.com/users/kalhauge/followers","following_url":"https://api.github.com/users/kalhauge/following{/other_user}","gists_url":"https://api.github.com/users/kalhauge/gists{/gist_id}","starred_url":"https://api.github.com/users/kalhauge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalhauge/subscriptions","organizations_url":"https://api.github.com/users/kalhauge/orgs","repos_url":"https://api.github.com/users/kalhauge/repos","events_url":"https://api.github.com/users/kalhauge/events{/privacy}","received_events_url":"https://api.github.com/users/kalhauge/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T15:27:19Z","updated_at":"2018-10-31T15:27:19Z","author_association":"NONE","body":"Thank you very much! I'll close the issue."}}
{"actor":{"display_login":"kalhauge"}}