{"action":"created","comment":{"url":"https://api.github.com/repos/typetools/checker-framework/pulls/comments/58639570","id":58639570,"diff_hunk":"@@ -331,65 +487,131 @@ public void testMethodAnnotations() {\n \n   if (r.nextBoolean()) {\n     lockTheLock();\n-    // Yes, lock reassignments are bad, but for the purposes of this\n-    // experiment they are useful.\n-    @LockHeld ReentrantLock heldLock = lock;\n-    foo = new Object();\n+    foo.field.toString();\n \n     unlockTheLock();\n \n-    //:: error: (assignment.type.incompatible)\n-    @LockHeld ReentrantLock heldLock2 = lock;\n     //:: error: (contracts.precondition.not.satisfied.field)\n-    foo = new Object();\n+    foo.field.toString();\n   }\n   else {\n-    //:: error: (assignment.type.incompatible)\n-    @LockHeld ReentrantLock heldLock = lock;\n     //:: error: (contracts.precondition.not.satisfied.field)\n-    foo = new Object();\n+    foo.field.toString();\n   }\n \n   if (tryToLockTheLock()) {\n-    @LockHeld ReentrantLock heldLock = lock;\n-    foo = new Object();\n+    foo.field.toString();\n   }\n   else {\n-    //:: error: (assignment.type.incompatible)\n-    @LockHeld ReentrantLock heldLock = lock;\n     //:: error: (contracts.precondition.not.satisfied.field)\n-    foo = new Object();\n+    foo.field.toString();\n   }\n \n+  // TODO: An error is raised here because a non-side-effect-free method is called above,","path":"checker/tests/lock/TestTreeKinds.java","position":621,"original_position":621,"commit_id":"cf0e94a162fc6871efd4842022bb97a5e774e0fc","original_commit_id":"5b8f0eb8cee7d8098e618b007adcd0a293e587ec","user":{"login":"jthaine","id":7230054,"avatar_url":"https://avatars.githubusercontent.com/u/7230054?v=3","gravatar_id":"","url":"https://api.github.com/users/jthaine","html_url":"https://github.com/jthaine","followers_url":"https://api.github.com/users/jthaine/followers","following_url":"https://api.github.com/users/jthaine/following{/other_user}","gists_url":"https://api.github.com/users/jthaine/gists{/gist_id}","starred_url":"https://api.github.com/users/jthaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jthaine/subscriptions","organizations_url":"https://api.github.com/users/jthaine/orgs","repos_url":"https://api.github.com/users/jthaine/repos","events_url":"https://api.github.com/users/jthaine/events{/privacy}","received_events_url":"https://api.github.com/users/jthaine/received_events","type":"User","site_admin":false},"body":"Fixed the comment.\r\n`nextBoolean` is defaulted to @ReleasesNoLocks, which while not being @SideEffectFree, is side effect free for the purposes of resetting the estimate of locks that are held.\r\nMethods with side effects are soundly handled but too conservatively. This could be improved by detecting which local variables are definitely not affected by a method call. However this would require tracking of aliases and leaks:\r\n\r\n    final ReentrantLock lock = new ReentrantLock();\r\n    someObject.methodThatReleasesNoLocks(lock);\r\n    someObject.methodThatMayReleaseLocks();\r\n    // lock is not known to be held at this point\r\n\r\nIn the call to `methodThatReleasesNoLocks`, a reference to `lock` may have been stored in `someObject`, and `methodThatMayReleaseLocks()` may release it. ","created_at":"2016-04-06T01:15:50Z","updated_at":"2016-04-06T01:15:50Z","html_url":"https://github.com/typetools/checker-framework/pull/585#discussion_r58639570","pull_request_url":"https://api.github.com/repos/typetools/checker-framework/pulls/585","_links":{"self":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/comments/58639570"},"html":{"href":"https://github.com/typetools/checker-framework/pull/585#discussion_r58639570"},"pull_request":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/585"}}},"pull_request":{"url":"https://api.github.com/repos/typetools/checker-framework/pulls/585","id":58375707,"html_url":"https://github.com/typetools/checker-framework/pull/585","diff_url":"https://github.com/typetools/checker-framework/pull/585.diff","patch_url":"https://github.com/typetools/checker-framework/pull/585.patch","issue_url":"https://api.github.com/repos/typetools/checker-framework/issues/585","number":585,"state":"open","locked":false,"title":"Lock Checker implementation providing value protection semantics","user":{"login":"jthaine","id":7230054,"avatar_url":"https://avatars.githubusercontent.com/u/7230054?v=3","gravatar_id":"","url":"https://api.github.com/users/jthaine","html_url":"https://github.com/jthaine","followers_url":"https://api.github.com/users/jthaine/followers","following_url":"https://api.github.com/users/jthaine/following{/other_user}","gists_url":"https://api.github.com/users/jthaine/gists{/gist_id}","starred_url":"https://api.github.com/users/jthaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jthaine/subscriptions","organizations_url":"https://api.github.com/users/jthaine/orgs","repos_url":"https://api.github.com/users/jthaine/repos","events_url":"https://api.github.com/users/jthaine/events{/privacy}","received_events_url":"https://api.github.com/users/jthaine/received_events","type":"User","site_admin":false},"body":"The documentation for this feature is available in the Lock Checker manual chapter and in the javadocs for the lock annotations in this pull request.","created_at":"2016-02-05T01:13:38Z","updated_at":"2016-04-06T01:15:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"294d7d8656d55f88d442f606849221d790fc792e","assignee":{"login":"jthaine","id":7230054,"avatar_url":"https://avatars.githubusercontent.com/u/7230054?v=3","gravatar_id":"","url":"https://api.github.com/users/jthaine","html_url":"https://github.com/jthaine","followers_url":"https://api.github.com/users/jthaine/followers","following_url":"https://api.github.com/users/jthaine/following{/other_user}","gists_url":"https://api.github.com/users/jthaine/gists{/gist_id}","starred_url":"https://api.github.com/users/jthaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jthaine/subscriptions","organizations_url":"https://api.github.com/users/jthaine/orgs","repos_url":"https://api.github.com/users/jthaine/repos","events_url":"https://api.github.com/users/jthaine/events{/privacy}","received_events_url":"https://api.github.com/users/jthaine/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/typetools/checker-framework/pulls/585/commits","review_comments_url":"https://api.github.com/repos/typetools/checker-framework/pulls/585/comments","review_comment_url":"https://api.github.com/repos/typetools/checker-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/typetools/checker-framework/issues/585/comments","statuses_url":"https://api.github.com/repos/typetools/checker-framework/statuses/cf0e94a162fc6871efd4842022bb97a5e774e0fc","head":{"label":"typetools:lock-checker-february-new-complete-changes","ref":"lock-checker-february-new-complete-changes","sha":"cf0e94a162fc6871efd4842022bb97a5e774e0fc","user":{"login":"typetools","id":12883499,"avatar_url":"https://avatars.githubusercontent.com/u/12883499?v=3","gravatar_id":"","url":"https://api.github.com/users/typetools","html_url":"https://github.com/typetools","followers_url":"https://api.github.com/users/typetools/followers","following_url":"https://api.github.com/users/typetools/following{/other_user}","gists_url":"https://api.github.com/users/typetools/gists{/gist_id}","starred_url":"https://api.github.com/users/typetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typetools/subscriptions","organizations_url":"https://api.github.com/users/typetools/orgs","repos_url":"https://api.github.com/users/typetools/repos","events_url":"https://api.github.com/users/typetools/events{/privacy}","received_events_url":"https://api.github.com/users/typetools/received_events","type":"Organization","site_admin":false},"repo":{"id":38488726,"name":"checker-framework","full_name":"typetools/checker-framework","owner":{"login":"typetools","id":12883499,"avatar_url":"https://avatars.githubusercontent.com/u/12883499?v=3","gravatar_id":"","url":"https://api.github.com/users/typetools","html_url":"https://github.com/typetools","followers_url":"https://api.github.com/users/typetools/followers","following_url":"https://api.github.com/users/typetools/following{/other_user}","gists_url":"https://api.github.com/users/typetools/gists{/gist_id}","starred_url":"https://api.github.com/users/typetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typetools/subscriptions","organizations_url":"https://api.github.com/users/typetools/orgs","repos_url":"https://api.github.com/users/typetools/repos","events_url":"https://api.github.com/users/typetools/events{/privacy}","received_events_url":"https://api.github.com/users/typetools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/typetools/checker-framework","description":"Pluggable type-checking for Java","fork":false,"url":"https://api.github.com/repos/typetools/checker-framework","forks_url":"https://api.github.com/repos/typetools/checker-framework/forks","keys_url":"https://api.github.com/repos/typetools/checker-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/typetools/checker-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/typetools/checker-framework/teams","hooks_url":"https://api.github.com/repos/typetools/checker-framework/hooks","issue_events_url":"https://api.github.com/repos/typetools/checker-framework/issues/events{/number}","events_url":"https://api.github.com/repos/typetools/checker-framework/events","assignees_url":"https://api.github.com/repos/typetools/checker-framework/assignees{/user}","branches_url":"https://api.github.com/repos/typetools/checker-framework/branches{/branch}","tags_url":"https://api.github.com/repos/typetools/checker-framework/tags","blobs_url":"https://api.github.com/repos/typetools/checker-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/typetools/checker-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/typetools/checker-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/typetools/checker-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/typetools/checker-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/typetools/checker-framework/languages","stargazers_url":"https://api.github.com/repos/typetools/checker-framework/stargazers","contributors_url":"https://api.github.com/repos/typetools/checker-framework/contributors","subscribers_url":"https://api.github.com/repos/typetools/checker-framework/subscribers","subscription_url":"https://api.github.com/repos/typetools/checker-framework/subscription","commits_url":"https://api.github.com/repos/typetools/checker-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/typetools/checker-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/typetools/checker-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/typetools/checker-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/typetools/checker-framework/contents/{+path}","compare_url":"https://api.github.com/repos/typetools/checker-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/typetools/checker-framework/merges","archive_url":"https://api.github.com/repos/typetools/checker-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/typetools/checker-framework/downloads","issues_url":"https://api.github.com/repos/typetools/checker-framework/issues{/number}","pulls_url":"https://api.github.com/repos/typetools/checker-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/typetools/checker-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/typetools/checker-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/typetools/checker-framework/labels{/name}","releases_url":"https://api.github.com/repos/typetools/checker-framework/releases{/id}","deployments_url":"https://api.github.com/repos/typetools/checker-framework/deployments","created_at":"2015-07-03T11:09:17Z","updated_at":"2016-04-03T20:50:58Z","pushed_at":"2016-04-05T17:11:20Z","git_url":"git://github.com/typetools/checker-framework.git","ssh_url":"git@github.com:typetools/checker-framework.git","clone_url":"https://github.com/typetools/checker-framework.git","svn_url":"https://github.com/typetools/checker-framework","homepage":"http://checkerframework.org/","size":179074,"stargazers_count":96,"watchers_count":96,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":161,"forks":33,"open_issues":161,"watchers":96,"default_branch":"master"}},"base":{"label":"typetools:lock-checker-february-new-jdk-lock-changes-only","ref":"lock-checker-february-new-jdk-lock-changes-only","sha":"08727d527d7731e93ea2f63eda3a9a29489f3f96","user":{"login":"typetools","id":12883499,"avatar_url":"https://avatars.githubusercontent.com/u/12883499?v=3","gravatar_id":"","url":"https://api.github.com/users/typetools","html_url":"https://github.com/typetools","followers_url":"https://api.github.com/users/typetools/followers","following_url":"https://api.github.com/users/typetools/following{/other_user}","gists_url":"https://api.github.com/users/typetools/gists{/gist_id}","starred_url":"https://api.github.com/users/typetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typetools/subscriptions","organizations_url":"https://api.github.com/users/typetools/orgs","repos_url":"https://api.github.com/users/typetools/repos","events_url":"https://api.github.com/users/typetools/events{/privacy}","received_events_url":"https://api.github.com/users/typetools/received_events","type":"Organization","site_admin":false},"repo":{"id":38488726,"name":"checker-framework","full_name":"typetools/checker-framework","owner":{"login":"typetools","id":12883499,"avatar_url":"https://avatars.githubusercontent.com/u/12883499?v=3","gravatar_id":"","url":"https://api.github.com/users/typetools","html_url":"https://github.com/typetools","followers_url":"https://api.github.com/users/typetools/followers","following_url":"https://api.github.com/users/typetools/following{/other_user}","gists_url":"https://api.github.com/users/typetools/gists{/gist_id}","starred_url":"https://api.github.com/users/typetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typetools/subscriptions","organizations_url":"https://api.github.com/users/typetools/orgs","repos_url":"https://api.github.com/users/typetools/repos","events_url":"https://api.github.com/users/typetools/events{/privacy}","received_events_url":"https://api.github.com/users/typetools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/typetools/checker-framework","description":"Pluggable type-checking for Java","fork":false,"url":"https://api.github.com/repos/typetools/checker-framework","forks_url":"https://api.github.com/repos/typetools/checker-framework/forks","keys_url":"https://api.github.com/repos/typetools/checker-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/typetools/checker-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/typetools/checker-framework/teams","hooks_url":"https://api.github.com/repos/typetools/checker-framework/hooks","issue_events_url":"https://api.github.com/repos/typetools/checker-framework/issues/events{/number}","events_url":"https://api.github.com/repos/typetools/checker-framework/events","assignees_url":"https://api.github.com/repos/typetools/checker-framework/assignees{/user}","branches_url":"https://api.github.com/repos/typetools/checker-framework/branches{/branch}","tags_url":"https://api.github.com/repos/typetools/checker-framework/tags","blobs_url":"https://api.github.com/repos/typetools/checker-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/typetools/checker-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/typetools/checker-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/typetools/checker-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/typetools/checker-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/typetools/checker-framework/languages","stargazers_url":"https://api.github.com/repos/typetools/checker-framework/stargazers","contributors_url":"https://api.github.com/repos/typetools/checker-framework/contributors","subscribers_url":"https://api.github.com/repos/typetools/checker-framework/subscribers","subscription_url":"https://api.github.com/repos/typetools/checker-framework/subscription","commits_url":"https://api.github.com/repos/typetools/checker-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/typetools/checker-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/typetools/checker-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/typetools/checker-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/typetools/checker-framework/contents/{+path}","compare_url":"https://api.github.com/repos/typetools/checker-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/typetools/checker-framework/merges","archive_url":"https://api.github.com/repos/typetools/checker-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/typetools/checker-framework/downloads","issues_url":"https://api.github.com/repos/typetools/checker-framework/issues{/number}","pulls_url":"https://api.github.com/repos/typetools/checker-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/typetools/checker-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/typetools/checker-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/typetools/checker-framework/labels{/name}","releases_url":"https://api.github.com/repos/typetools/checker-framework/releases{/id}","deployments_url":"https://api.github.com/repos/typetools/checker-framework/deployments","created_at":"2015-07-03T11:09:17Z","updated_at":"2016-04-03T20:50:58Z","pushed_at":"2016-04-05T17:11:20Z","git_url":"git://github.com/typetools/checker-framework.git","ssh_url":"git@github.com:typetools/checker-framework.git","clone_url":"https://github.com/typetools/checker-framework.git","svn_url":"https://github.com/typetools/checker-framework","homepage":"http://checkerframework.org/","size":179074,"stargazers_count":96,"watchers_count":96,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":161,"forks":33,"open_issues":161,"watchers":96,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/585"},"html":{"href":"https://github.com/typetools/checker-framework/pull/585"},"issue":{"href":"https://api.github.com/repos/typetools/checker-framework/issues/585"},"comments":{"href":"https://api.github.com/repos/typetools/checker-framework/issues/585/comments"},"review_comments":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/585/comments"},"review_comment":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/typetools/checker-framework/pulls/585/commits"},"statuses":{"href":"https://api.github.com/repos/typetools/checker-framework/statuses/cf0e94a162fc6871efd4842022bb97a5e774e0fc"}}}}