{"action":"closed","issue":{"url":"https://api.github.com/repos/INRIA/spoon/issues/631","repository_url":"https://api.github.com/repos/INRIA/spoon","labels_url":"https://api.github.com/repos/INRIA/spoon/issues/631/labels{/name}","comments_url":"https://api.github.com/repos/INRIA/spoon/issues/631/comments","events_url":"https://api.github.com/repos/INRIA/spoon/issues/631/events","html_url":"https://github.com/INRIA/spoon/issues/631","id":151126071,"number":631,"title":"Ternary Operator in Constructors Fails.","user":{"login":"retuxx","id":317428,"avatar_url":"https://avatars.githubusercontent.com/u/317428?v=3","gravatar_id":"","url":"https://api.github.com/users/retuxx","html_url":"https://github.com/retuxx","followers_url":"https://api.github.com/users/retuxx/followers","following_url":"https://api.github.com/users/retuxx/following{/other_user}","gists_url":"https://api.github.com/users/retuxx/gists{/gist_id}","starred_url":"https://api.github.com/users/retuxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retuxx/subscriptions","organizations_url":"https://api.github.com/users/retuxx/orgs","repos_url":"https://api.github.com/users/retuxx/repos","events_url":"https://api.github.com/users/retuxx/events{/privacy}","received_events_url":"https://api.github.com/users/retuxx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-26T12:53:27Z","updated_at":"2016-05-09T07:25:31Z","closed_at":"2016-05-09T07:25:31Z","body":"The following example does not work with spoon 5.1.0 (The code itself is not useful, it's for demonstration purpose only):\r\n\r\n```java\r\nimport java.util.Date;\r\n\r\npublic class TernaryOperator {\r\n\r\n    private Date currentDate;\r\n\r\n    public TernaryOperator(Date date) {\r\n        currentDate = new Date(date == null ? null : date);\r\n    }\r\n}\r\n```\r\n\r\n\r\nIf I build the model with `Launcher#buildModel()` the following exception is thrown:\r\n\r\n```java\r\njava.lang.RuntimeException: arg\r\n```\r\n\r\nI found that spoon does not correctly handle ternary operators used in constructors. The exception is thrown in `CtReferenceImpl#setSimpleName(String simplename)`."}}