{"action":"closed","issue":{"url":"https://api.github.com/repos/jbachorik/btrace/issues/179","labels_url":"https://api.github.com/repos/jbachorik/btrace/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/jbachorik/btrace/issues/179/comments","events_url":"https://api.github.com/repos/jbachorik/btrace/issues/179/events","html_url":"https://github.com/jbachorik/btrace/issues/179","id":114238258,"number":179,"title":"RuntimeException while trying to printfield values","user":{"login":"AbhishekPuligundla","id":13863514,"avatar_url":"https://avatars.githubusercontent.com/u/13863514?v=3","gravatar_id":"","url":"https://api.github.com/users/AbhishekPuligundla","html_url":"https://github.com/AbhishekPuligundla","followers_url":"https://api.github.com/users/AbhishekPuligundla/followers","following_url":"https://api.github.com/users/AbhishekPuligundla/following{/other_user}","gists_url":"https://api.github.com/users/AbhishekPuligundla/gists{/gist_id}","starred_url":"https://api.github.com/users/AbhishekPuligundla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbhishekPuligundla/subscriptions","organizations_url":"https://api.github.com/users/AbhishekPuligundla/orgs","repos_url":"https://api.github.com/users/AbhishekPuligundla/repos","events_url":"https://api.github.com/users/AbhishekPuligundla/events{/privacy}","received_events_url":"https://api.github.com/users/AbhishekPuligundla/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jbachorik/btrace/labels/BTRACE","name":"BTRACE","color":"46e08b"},{"url":"https://api.github.com/repos/jbachorik/btrace/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jbachorik/btrace/labels/Core","name":"Core","color":"b62938"},{"url":"https://api.github.com/repos/jbachorik/btrace/labels/doc","name":"doc","color":"7c2c98"}],"state":"closed","locked":false,"assignee":{"login":"jbachorik","id":738413,"avatar_url":"https://avatars.githubusercontent.com/u/738413?v=3","gravatar_id":"","url":"https://api.github.com/users/jbachorik","html_url":"https://github.com/jbachorik","followers_url":"https://api.github.com/users/jbachorik/followers","following_url":"https://api.github.com/users/jbachorik/following{/other_user}","gists_url":"https://api.github.com/users/jbachorik/gists{/gist_id}","starred_url":"https://api.github.com/users/jbachorik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbachorik/subscriptions","organizations_url":"https://api.github.com/users/jbachorik/orgs","repos_url":"https://api.github.com/users/jbachorik/repos","events_url":"https://api.github.com/users/jbachorik/events{/privacy}","received_events_url":"https://api.github.com/users/jbachorik/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/jbachorik/btrace/milestones/17","html_url":"https://github.com/jbachorik/btrace/milestones/1.3.4","labels_url":"https://api.github.com/repos/jbachorik/btrace/milestones/17/labels","id":1255999,"number":17,"title":"1.3.4","description":null,"creator":{"login":"jbachorik","id":738413,"avatar_url":"https://avatars.githubusercontent.com/u/738413?v=3","gravatar_id":"","url":"https://api.github.com/users/jbachorik","html_url":"https://github.com/jbachorik","followers_url":"https://api.github.com/users/jbachorik/followers","following_url":"https://api.github.com/users/jbachorik/following{/other_user}","gists_url":"https://api.github.com/users/jbachorik/gists{/gist_id}","starred_url":"https://api.github.com/users/jbachorik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbachorik/subscriptions","organizations_url":"https://api.github.com/users/jbachorik/orgs","repos_url":"https://api.github.com/users/jbachorik/repos","events_url":"https://api.github.com/users/jbachorik/events{/privacy}","received_events_url":"https://api.github.com/users/jbachorik/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":15,"state":"open","created_at":"2015-08-14T22:50:43Z","updated_at":"2015-11-07T11:43:33Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-10-30T10:08:28Z","updated_at":"2015-11-07T11:43:33Z","closed_at":"2015-11-07T11:43:33Z","body":"The source file is :+1: \r\n\r\n\r\nimport java.io.*;\r\nimport java.util.HashMap;\r\nclass FirstClass\r\n{\r\n\tString name;\r\n\tint id;\r\n\tFirstClass(String name, int value)\r\n\t{\r\n\t\tthis.name=name;\r\n\t\tthis.id=value;\r\n\t}\r\n}\r\npublic class SecondClass\r\n{\r\n\tHashMap<String, HashMap<Integer,FirstClass>> map1;\r\n\tpublic static void main(String args[])\r\n\t{\r\n\t\t\r\n\t\ttry{ Thread.sleep(20000); }catch(Exception e){}\r\n\t\tSecondClass object1 =new SecondClass();\r\n\t}\r\n\tSecondClass()\r\n\t{\r\n\t\tmap1 =new HashMap<String, HashMap<Integer,FirstClass>>();\r\n\t\tHashMap<Integer,FirstClass> map2 = new HashMap<Integer,FirstClass>();\r\n\t\tmap2.put(1,new FirstClass(\"a\",2));\r\n\t\ttry{ Thread.sleep(5000); }catch(Exception e){}\r\n\t\tmap2.put(2,new FirstClass(\"b\",3));\r\n\t\tmap2.put(3,new FirstClass(\"c\",4));\r\n\t\tmap1.put(\"Hello\",map2);\r\n\t\t\r\n\t}\r\n}\r\n\r\n\r\n\r\n\r\nThe script file is : \r\n\r\n\r\nimport com.sun.btrace.annotations.*;\r\nimport static com.sun.btrace.BTraceUtils.*;\r\nimport com.sun.btrace.*;\r\nimport java.util.*;\r\n@BTrace\r\npublic class TraceClass\r\n{\r\n\t@OnMethod(clazz=\"SecondClass\",method=\"/.*/\",location=@Location(value=Kind.NEW,clazz=\"/.*/\",where=Where.AFTER ))\r\n\tpublic static void traceMethod123456(@Self Object obj,String instanceclassname)\r\n\t{\r\n\t\tprintln(\"New Class\");\r\n\t\tprintln(classOf(obj));\r\n\t\tprintln(instanceclassname);\r\n\t\tClass cl=classForName(instanceclassname);\r\n\t\tprintFields(classOf(cl));\r\n\t}\r\n}\r\n\r\n\r\n\r\n\r\nThe result is : \r\n\r\nNew Class\r\nclass SecondClass\r\njava.util.HashMap\r\n{cachedConstructor=null, newInstanceCallerCache=null, name=java.lang.Class, refl\r\nectionData=java.lang.ref.SoftReference@5c647e05, classRedefinedCount=0, genericI\r\nnfo=null, enumConstants=null, enumConstantDirectory=null, annotationData=java.la\r\nng.Class$AnnotationData@33909752, annotationType=null, classValueMap=null, }\r\nNew Class\r\nclass SecondClass\r\njava.util.HashMap\r\n{cachedConstructor=null, newInstanceCallerCache=null, name=java.lang.Class, refl\r\nectionData=java.lang.ref.SoftReference@5c647e05, classRedefinedCount=0, genericI\r\nnfo=null, enumConstants=null, enumConstantDirectory=null, annotationData=java.la\r\nng.Class$AnnotationData@33909752, annotationType=null, classValueMap=null, }\r\nNew Class\r\nclass SecondClass\r\nFirstClass\r\njava.lang.RuntimeException: java.lang.ClassNotFoundException: FirstClass\r\n        at com.sun.btrace.BTraceUtils.translate(BTraceUtils.java:6561)\r\n        at com.sun.btrace.BTraceUtils.access$300(BTraceUtils.java:61)\r\n        at com.sun.btrace.BTraceUtils$Reflective.classForName(BTraceUtils.java:5\r\n316)\r\n        at com.sun.btrace.BTraceUtils$Reflective.classForName(BTraceUtils.java:5\r\n305)\r\n        at com.sun.btrace.BTraceUtils.classForName(BTraceUtils.java:456)\r\n        at SecondClass.$btrace$TraceClass$traceMethod123456(SecondClass.java)\r\n        at SecondClass.<init>(SecondClass.java:26)\r\n        at SecondClass.main(Unknown Source)\r\nCaused by: java.lang.ClassNotFoundException: FirstClass\r\n        at java.lang.Class.forName0(Native Method)\r\n        at java.lang.Class.forName(Class.java:348)\r\n        at com.sun.btrace.BTraceUtils$Reflective.classForName(BTraceUtils.java:5\r\n314)\r\n        ... 5 more\r\n\r\n\r\nhow can i print the object and field values of the new class while using Kind.NEW"}}