{"action":"opened","issue":{"url":"https://api.github.com/repos/java-decompiler/jd-gui/issues/120","repository_url":"https://api.github.com/repos/java-decompiler/jd-gui","labels_url":"https://api.github.com/repos/java-decompiler/jd-gui/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/java-decompiler/jd-gui/issues/120/comments","events_url":"https://api.github.com/repos/java-decompiler/jd-gui/issues/120/events","html_url":"https://github.com/java-decompiler/jd-gui/issues/120","id":143004836,"number":120,"title":"Incorrect decompile when ternary operator is used","user":{"login":"petarov","id":547597,"avatar_url":"https://avatars.githubusercontent.com/u/547597?v=3","gravatar_id":"","url":"https://api.github.com/users/petarov","html_url":"https://github.com/petarov","followers_url":"https://api.github.com/users/petarov/followers","following_url":"https://api.github.com/users/petarov/following{/other_user}","gists_url":"https://api.github.com/users/petarov/gists{/gist_id}","starred_url":"https://api.github.com/users/petarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petarov/subscriptions","organizations_url":"https://api.github.com/users/petarov/orgs","repos_url":"https://api.github.com/users/petarov/repos","events_url":"https://api.github.com/users/petarov/events{/privacy}","received_events_url":"https://api.github.com/users/petarov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-23T16:09:35Z","updated_at":"2016-03-23T16:09:35Z","closed_at":null,"body":"Hi!\r\n\r\nBelow is a very simple program that doesn't look quite right when decompiled. This outputs `true`, if both dates are `null`.\r\n\r\n```java\r\n\tpublic static void main(String[] args) {\r\n\t\tDate date1 = null;\r\n\t\tDate date2 = null;\r\n\t\tSystem.out.println(isSameDate(date1, date2));\r\n\t}\r\n\r\n\tprivate static boolean isSameDate(Date date1, Date date2) {\r\n\t\treturn date1 == null ? date2 == null : date1.equals(date2);\r\n\t}\r\n```\r\n\r\nWhen that byte code gets decompiled through JD the method `isSameDate` results in the following ternary operator transformation, which assumes a wrong result.\r\n\r\n```java\r\n  private static boolean isSameDate(Date date1, Date date2)\r\n  {\r\n    return date1 == null ? false : date2 == null ? true : date1.equals(date2);\r\n  }\r\n```\r\n\r\nBtw, I love JD :trophy: \r\n"}}