{"action":"created","issue":{"url":"https://api.github.com/repos/typetools/checker-framework/issues/848","repository_url":"https://api.github.com/repos/typetools/checker-framework","labels_url":"https://api.github.com/repos/typetools/checker-framework/issues/848/labels{/name}","comments_url":"https://api.github.com/repos/typetools/checker-framework/issues/848/comments","events_url":"https://api.github.com/repos/typetools/checker-framework/issues/848/events","html_url":"https://github.com/typetools/checker-framework/pull/848","id":166351661,"number":848,"title":"Refactor AnnotatedTypeFactory: Use lazy initialization in getSupportedTypeQualifiers()","user":{"login":"CharlesZ-Chen","id":7701109,"avatar_url":"https://avatars.githubusercontent.com/u/7701109?v=3","gravatar_id":"","url":"https://api.github.com/users/CharlesZ-Chen","html_url":"https://github.com/CharlesZ-Chen","followers_url":"https://api.github.com/users/CharlesZ-Chen/followers","following_url":"https://api.github.com/users/CharlesZ-Chen/following{/other_user}","gists_url":"https://api.github.com/users/CharlesZ-Chen/gists{/gist_id}","starred_url":"https://api.github.com/users/CharlesZ-Chen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharlesZ-Chen/subscriptions","organizations_url":"https://api.github.com/users/CharlesZ-Chen/orgs","repos_url":"https://api.github.com/users/CharlesZ-Chen/repos","events_url":"https://api.github.com/users/CharlesZ-Chen/events{/privacy}","received_events_url":"https://api.github.com/users/CharlesZ-Chen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-19T14:52:14Z","updated_at":"2016-07-19T22:54:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/typetools/checker-framework/pulls/848","html_url":"https://github.com/typetools/checker-framework/pull/848","diff_url":"https://github.com/typetools/checker-framework/pull/848.diff","patch_url":"https://github.com/typetools/checker-framework/pull/848.patch"},"body":"`AnnotatedTypeFactory#createSupportedTypeQualifiers()` is an overridable method, and should avoid using it in constructor.\r\n\r\nCurrently using it in constructor would cause NullPointer Exception in `InferenceAnnotatedTypeFactory#createSupportedTypeQualifiers()` if `InferenceAnnotatedTypeFactory` doesn't use the deprecated method `InferenceMain#getRealTypeFactory()`.\r\n\r\nAs a solution, I change code to create supported type qualifiers by using lazy initialization, i.e. creating an empty set for `supportedQuals` during constructor, and creating the real supported qualifiers when `AnnotatedTypeFactory#getSupportedTypeQualifiers()` get called.\r\n\r\nThis PR is created after another round of code check."},"comment":{"url":"https://api.github.com/repos/typetools/checker-framework/issues/comments/233790971","html_url":"https://github.com/typetools/checker-framework/pull/848#issuecomment-233790971","issue_url":"https://api.github.com/repos/typetools/checker-framework/issues/848","id":233790971,"user":{"login":"wmdietl","id":6699136,"avatar_url":"https://avatars.githubusercontent.com/u/6699136?v=3","gravatar_id":"","url":"https://api.github.com/users/wmdietl","html_url":"https://github.com/wmdietl","followers_url":"https://api.github.com/users/wmdietl/followers","following_url":"https://api.github.com/users/wmdietl/following{/other_user}","gists_url":"https://api.github.com/users/wmdietl/gists{/gist_id}","starred_url":"https://api.github.com/users/wmdietl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmdietl/subscriptions","organizations_url":"https://api.github.com/users/wmdietl/orgs","repos_url":"https://api.github.com/users/wmdietl/repos","events_url":"https://api.github.com/users/wmdietl/events{/privacy}","received_events_url":"https://api.github.com/users/wmdietl/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T22:54:33Z","updated_at":"2016-07-19T22:54:33Z","body":"This change is to remove the discouraged uses and instead implement the functionality cleanly.\r\nSimilar changes would be good for other methods - calling instance methods in constructors can lead to problems. We fixed the one problem we're running into."}}
{"actor":{"display_login":"wmdietl"}}