{"action":"created","issue":{"url":"https://api.github.com/repos/lhillah/pnmlframework/issues/1","labels_url":"https://api.github.com/repos/lhillah/pnmlframework/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/lhillah/pnmlframework/issues/1/comments","events_url":"https://api.github.com/repos/lhillah/pnmlframework/issues/1/events","html_url":"https://github.com/lhillah/pnmlframework/issues/1","id":110265544,"number":1,"title":"Wrong class name on PnmlExport.exportObject","user":{"login":"abelgomez","id":5593904,"avatar_url":"https://avatars.githubusercontent.com/u/5593904?v=3","gravatar_id":"","url":"https://api.github.com/users/abelgomez","html_url":"https://github.com/abelgomez","followers_url":"https://api.github.com/users/abelgomez/followers","following_url":"https://api.github.com/users/abelgomez/following{/other_user}","gists_url":"https://api.github.com/users/abelgomez/gists{/gist_id}","starred_url":"https://api.github.com/users/abelgomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abelgomez/subscriptions","organizations_url":"https://api.github.com/users/abelgomez/orgs","repos_url":"https://api.github.com/users/abelgomez/repos","events_url":"https://api.github.com/users/abelgomez/events{/privacy}","received_events_url":"https://api.github.com/users/abelgomez/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-07T16:31:15Z","updated_at":"2015-10-08T10:20:16Z","closed_at":"2015-10-08T10:19:28Z","body":"On line 188 of PnmlExport, in the method `void fr.lip6.move.pnml.framework.general.PnmlExport.exportObject(EObject object, String filepath) throws ...` the following statement is used to get the \"native class canonical name\":\r\n\r\n```\r\nfinal String classname = object.getClass().getCanonicalName();\r\n```\r\n\r\nHowever, when this statement is executed on an instance of, for example `fr.lip6.move.pnml.pnmlcoremodel.PetriNetDoc`, it returns the implementation class (i.e. `fr.lip6.move.pnml.pnmlcoremodel.impl.PetriNetDocImpl`).\r\n\r\nThus, the next instruction (`OfficialPNMLFileType.getByNativeClassName(classname)`) fails, since it seems to expect the interface name (`fr.lip6.move.pnml.pnmlcoremodel.PetriNetDoc`) instead of the implementation name (`fr.lip6.move.pnml.pnmlcoremodel.impl.PetriNetDocImpl`).\r\n\r\nThe enumeration `OfficialPNMLFileType` stores the interface name as the native class name.\r\n\r\nTo get the right class name so that the instruction `OfficialPNMLFileType.getByNativeClassName(classname)` can find the official PNML type, the following instruction should be used instead:\r\n\r\n```\r\nfinal String classname = object.eClass().getInstanceClassName();\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/lhillah/pnmlframework/issues/comments/146486177","html_url":"https://github.com/lhillah/pnmlframework/issues/1#issuecomment-146486177","issue_url":"https://api.github.com/repos/lhillah/pnmlframework/issues/1","id":146486177,"user":{"login":"abelgomez","id":5593904,"avatar_url":"https://avatars.githubusercontent.com/u/5593904?v=3","gravatar_id":"","url":"https://api.github.com/users/abelgomez","html_url":"https://github.com/abelgomez","followers_url":"https://api.github.com/users/abelgomez/followers","following_url":"https://api.github.com/users/abelgomez/following{/other_user}","gists_url":"https://api.github.com/users/abelgomez/gists{/gist_id}","starred_url":"https://api.github.com/users/abelgomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abelgomez/subscriptions","organizations_url":"https://api.github.com/users/abelgomez/orgs","repos_url":"https://api.github.com/users/abelgomez/repos","events_url":"https://api.github.com/users/abelgomez/events{/privacy}","received_events_url":"https://api.github.com/users/abelgomez/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T10:20:16Z","updated_at":"2015-10-08T10:20:16Z","body":"Solved in https://github.com/lhillah/pnmlframework/pull/2"}}