{"action":"created","issue":{"url":"https://api.github.com/repos/jbosstm/narayana/issues/1047","repository_url":"https://api.github.com/repos/jbosstm/narayana","labels_url":"https://api.github.com/repos/jbosstm/narayana/issues/1047/labels{/name}","comments_url":"https://api.github.com/repos/jbosstm/narayana/issues/1047/comments","events_url":"https://api.github.com/repos/jbosstm/narayana/issues/1047/events","html_url":"https://github.com/jbosstm/narayana/pull/1047","id":170378177,"number":1047,"title":"[JBTM-2730] Static code analysis issue: default encoding","user":{"login":"ochaloup","id":1104559,"avatar_url":"https://avatars.githubusercontent.com/u/1104559?v=3","gravatar_id":"","url":"https://api.github.com/users/ochaloup","html_url":"https://github.com/ochaloup","followers_url":"https://api.github.com/users/ochaloup/followers","following_url":"https://api.github.com/users/ochaloup/following{/other_user}","gists_url":"https://api.github.com/users/ochaloup/gists{/gist_id}","starred_url":"https://api.github.com/users/ochaloup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ochaloup/subscriptions","organizations_url":"https://api.github.com/users/ochaloup/orgs","repos_url":"https://api.github.com/users/ochaloup/repos","events_url":"https://api.github.com/users/ochaloup/events{/privacy}","received_events_url":"https://api.github.com/users/ochaloup/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jbosstm/narayana/labels/Ready%20For%20Review","name":"Ready For Review","color":"006b75"}],"state":"open","locked":false,"assignee":{"login":"gytis","id":196395,"avatar_url":"https://avatars.githubusercontent.com/u/196395?v=3","gravatar_id":"","url":"https://api.github.com/users/gytis","html_url":"https://github.com/gytis","followers_url":"https://api.github.com/users/gytis/followers","following_url":"https://api.github.com/users/gytis/following{/other_user}","gists_url":"https://api.github.com/users/gytis/gists{/gist_id}","starred_url":"https://api.github.com/users/gytis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gytis/subscriptions","organizations_url":"https://api.github.com/users/gytis/orgs","repos_url":"https://api.github.com/users/gytis/repos","events_url":"https://api.github.com/users/gytis/events{/privacy}","received_events_url":"https://api.github.com/users/gytis/received_events","type":"User","site_admin":false},"assignees":[{"login":"gytis","id":196395,"avatar_url":"https://avatars.githubusercontent.com/u/196395?v=3","gravatar_id":"","url":"https://api.github.com/users/gytis","html_url":"https://github.com/gytis","followers_url":"https://api.github.com/users/gytis/followers","following_url":"https://api.github.com/users/gytis/following{/other_user}","gists_url":"https://api.github.com/users/gytis/gists{/gist_id}","starred_url":"https://api.github.com/users/gytis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gytis/subscriptions","organizations_url":"https://api.github.com/users/gytis/orgs","repos_url":"https://api.github.com/users/gytis/repos","events_url":"https://api.github.com/users/gytis/events{/privacy}","received_events_url":"https://api.github.com/users/gytis/received_events","type":"User","site_admin":false}],"milestone":null,"comments":60,"created_at":"2016-08-10T09:58:02Z","updated_at":"2016-08-15T20:54:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jbosstm/narayana/pulls/1047","html_url":"https://github.com/jbosstm/narayana/pull/1047","diff_url":"https://github.com/jbosstm/narayana/pull/1047.diff","patch_url":"https://github.com/jbosstm/narayana/pull/1047.patch"},"body":"This PR fixes a bug came from static code analysis:\r\n21994 Dm: Dubious method used In org.jboss.narayana.osgi.jta.internal.ObjStoreBrowserImpl.ObjStoreBrowserImpl (com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser): Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable)\r\n\r\nThe reason why the using default encoding could cause problems is that code behaves differently depending on the platform it runs on. Especially this is harmful if the data flows from one platform to another.\r\n\r\nSystem default encoding could differ based on OS and geographical location.\r\nJava uses parameter `-Dfile.encoding` to change default encoding to be different from system one. Value of this parameter is used whenever default encoding is needed to be used for program calls.\r\n\r\nOne example which come to my mind specifically with TM is if JVM crash occurs and object store is moved from one machine to another. Base on how node identifier is set it occurs that is decoded differently on each machine and that way transactions won't be recovered as the newly started node will not identify that is responsible for in-doubt ones.\r\n\r\nIt is considered bad practice to rely on the default platform encoding.\r\n\r\n !BLACKTIE"},"comment":{"url":"https://api.github.com/repos/jbosstm/narayana/issues/comments/239926160","html_url":"https://github.com/jbosstm/narayana/pull/1047#issuecomment-239926160","issue_url":"https://api.github.com/repos/jbosstm/narayana/issues/1047","id":239926160,"user":{"login":"jbosstm-bot","id":2427192,"avatar_url":"https://avatars.githubusercontent.com/u/2427192?v=3","gravatar_id":"","url":"https://api.github.com/users/jbosstm-bot","html_url":"https://github.com/jbosstm-bot","followers_url":"https://api.github.com/users/jbosstm-bot/followers","following_url":"https://api.github.com/users/jbosstm-bot/following{/other_user}","gists_url":"https://api.github.com/users/jbosstm-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/jbosstm-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbosstm-bot/subscriptions","organizations_url":"https://api.github.com/users/jbosstm-bot/orgs","repos_url":"https://api.github.com/users/jbosstm-bot/repos","events_url":"https://api.github.com/users/jbosstm-bot/events{/privacy}","received_events_url":"https://api.github.com/users/jbosstm-bot/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T20:54:52Z","updated_at":"2016-08-15T20:54:52Z","body":"Started testing this pull request with MAIN profile: http://albany.eng.hst.ams2.redhat.com/job/btny-pulls-narayana-jdk8/PROFILE=MAIN,jdk=jdk8.latest,label=linux/1607/"}}
{"actor":{"display_login":"jbosstm-bot"}}