{"action":"created","issue":{"url":"https://api.github.com/repos/findbugsproject/findbugs/issues/63","labels_url":"https://api.github.com/repos/findbugsproject/findbugs/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/findbugsproject/findbugs/issues/63/comments","events_url":"https://api.github.com/repos/findbugsproject/findbugs/issues/63/events","html_url":"https://github.com/findbugsproject/findbugs/issues/63","id":119696503,"number":63,"title":"False Positive on \"Dls dead local store\"","user":{"login":"jcnoriega","id":10046176,"avatar_url":"https://avatars.githubusercontent.com/u/10046176?v=3","gravatar_id":"","url":"https://api.github.com/users/jcnoriega","html_url":"https://github.com/jcnoriega","followers_url":"https://api.github.com/users/jcnoriega/followers","following_url":"https://api.github.com/users/jcnoriega/following{/other_user}","gists_url":"https://api.github.com/users/jcnoriega/gists{/gist_id}","starred_url":"https://api.github.com/users/jcnoriega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcnoriega/subscriptions","organizations_url":"https://api.github.com/users/jcnoriega/orgs","repos_url":"https://api.github.com/users/jcnoriega/repos","events_url":"https://api.github.com/users/jcnoriega/events{/privacy}","received_events_url":"https://api.github.com/users/jcnoriega/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-01T11:22:11Z","updated_at":"2015-12-19T10:00:11Z","closed_at":null,"body":"Hi there! It appears i have a false positive on this warning. In my Android project, I try to make a file where i'm going to store some profile pictures. I'm doing this on a `singleton` service, inside a `static` method:\r\n```\r\nprivate static File createCameraImageFile() throws IOException {\r\n\t\tfinal String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.getDefault()).format(new Date());\r\n\t\tfinal String cameraPhotoFileName = String.format(\"UMW_PROFILE_%1$s.jpeg\", timeStamp);\r\n\t\tfinal File storageDir = Environment.getExternalStoragePublicDirectory(\r\n\t\t\t\tEnvironment.DIRECTORY_PICTURES);\r\n\t\treturn new File(storageDir, cameraPhotoFileName);\r\n\t}\r\n```\r\nThe warning says I have a `dead local store` on `cameraPhotoName`. I tried deleting the variable and just put it directly in the `return`, like this:\r\n```\r\nprivate static File createCameraImageFile() throws IOException {\r\n\t\tfinal String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.getDefault()).format(new Date());\r\n\t\tfinal File storageDir = Environment.getExternalStoragePublicDirectory(\r\n\t\t\t\tEnvironment.DIRECTORY_PICTURES);\r\n\t\treturn new File(storageDir, String.format(\"UMW_PROFILE_%1$s.jpeg\", timeStamp));\r\n```\r\nBut it would point out that i have a `dead local store` in `timeStamp`. Its seems that it doesnt like local variables! Thank you very much! Cheers"},"comment":{"url":"https://api.github.com/repos/findbugsproject/findbugs/issues/comments/165969423","html_url":"https://github.com/findbugsproject/findbugs/issues/63#issuecomment-165969423","issue_url":"https://api.github.com/repos/findbugsproject/findbugs/issues/63","id":165969423,"user":{"login":"amaembo","id":5114450,"avatar_url":"https://avatars.githubusercontent.com/u/5114450?v=3","gravatar_id":"","url":"https://api.github.com/users/amaembo","html_url":"https://github.com/amaembo","followers_url":"https://api.github.com/users/amaembo/followers","following_url":"https://api.github.com/users/amaembo/following{/other_user}","gists_url":"https://api.github.com/users/amaembo/gists{/gist_id}","starred_url":"https://api.github.com/users/amaembo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaembo/subscriptions","organizations_url":"https://api.github.com/users/amaembo/orgs","repos_url":"https://api.github.com/users/amaembo/repos","events_url":"https://api.github.com/users/amaembo/events{/privacy}","received_events_url":"https://api.github.com/users/amaembo/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T10:00:11Z","updated_at":"2015-12-19T10:00:11Z","body":"I tried to reproduce it on my system, added missing classes see this gist:\r\nhttps://gist.github.com/amaembo/34b32637ca05ff65eeb9\r\n\r\nI see no findbugs reports (except the hardcoded filename) in this file. Can you reproduce it on your system with this file? If not, could you please provide a class file for your original code (ProfilePictureServiceImpl.class) which triggers the findbugs error? Thanks."}}