{"action":"created","comment":{"url":"https://api.github.com/repos/freenet/fred/pulls/comments/48815313","id":48815313,"diff_hunk":"@@ -473,10 +473,16 @@ public void set(Long val) throws InvalidConfigValueException, NodeNeedRestartExc\n \n \t\t\t@Override\n \t\t\tpublic void onChange(NETWORK_THREAT_LEVEL oldLevel, NETWORK_THREAT_LEVEL newLevel) {\n-\t\t\t\tif(newLevel == NETWORK_THREAT_LEVEL.MAXIMUM)\n-\t\t\t\t\tignoreLocalVsRemoteBandwidthLiability = true;\n-\t\t\t\tif(oldLevel == NETWORK_THREAT_LEVEL.MAXIMUM)\n-\t\t\t\t\tignoreLocalVsRemoteBandwidthLiability = false;\n+\t\t\t\tif(newLevel == NETWORK_THREAT_LEVEL.MAXIMUM) {\n+\t\t\t\t\tsynchronized(NodeStats.this) {\n+\t\t\t\t\t\tignoreLocalVsRemoteBandwidthLiability = true;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\tif(oldLevel == NETWORK_THREAT_LEVEL.MAXIMUM) {\n+\t\t\t\t\tsynchronized(NodeStats.this) {\n+\t\t\t\t\t\tignoreLocalVsRemoteBandwidthLiability = false;\n+\t\t\t\t\t}\n+\t\t\t\t}","path":"src/freenet/node/NodeStats.java","position":17,"original_position":17,"commit_id":"a1873ed0408c78952b8767750a48817a3b5f4fa2","original_commit_id":"a1873ed0408c78952b8767750a48817a3b5f4fa2","user":{"login":"Bombe","id":81599,"avatar_url":"https://avatars.githubusercontent.com/u/81599?v=3","gravatar_id":"","url":"https://api.github.com/users/Bombe","html_url":"https://github.com/Bombe","followers_url":"https://api.github.com/users/Bombe/followers","following_url":"https://api.github.com/users/Bombe/following{/other_user}","gists_url":"https://api.github.com/users/Bombe/gists{/gist_id}","starred_url":"https://api.github.com/users/Bombe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bombe/subscriptions","organizations_url":"https://api.github.com/users/Bombe/orgs","repos_url":"https://api.github.com/users/Bombe/repos","events_url":"https://api.github.com/users/Bombe/events{/privacy}","received_events_url":"https://api.github.com/users/Bombe/received_events","type":"User","site_admin":false},"body":"Also, whitespace after `if` and `synchronized`, please, as these are language constructs and not method calls.","created_at":"2016-01-05T06:16:33Z","updated_at":"2016-01-05T06:16:33Z","html_url":"https://github.com/freenet/fred/pull/455#discussion_r48815313","pull_request_url":"https://api.github.com/repos/freenet/fred/pulls/455","_links":{"self":{"href":"https://api.github.com/repos/freenet/fred/pulls/comments/48815313"},"html":{"href":"https://github.com/freenet/fred/pull/455#discussion_r48815313"},"pull_request":{"href":"https://api.github.com/repos/freenet/fred/pulls/455"}}},"pull_request":{"url":"https://api.github.com/repos/freenet/fred/pulls/455","id":54830595,"html_url":"https://github.com/freenet/fred/pull/455","diff_url":"https://github.com/freenet/fred/pull/455.diff","patch_url":"https://github.com/freenet/fred/pull/455.patch","issue_url":"https://api.github.com/repos/freenet/fred/issues/455","number":455,"state":"open","locked":false,"title":"Simplify disconnected() (low priority)","user":{"login":"toad","id":77427,"avatar_url":"https://avatars.githubusercontent.com/u/77427?v=3","gravatar_id":"","url":"https://api.github.com/users/toad","html_url":"https://github.com/toad","followers_url":"https://api.github.com/users/toad/followers","following_url":"https://api.github.com/users/toad/following{/other_user}","gists_url":"https://api.github.com/users/toad/gists{/gist_id}","starred_url":"https://api.github.com/users/toad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toad/subscriptions","organizations_url":"https://api.github.com/users/toad/orgs","repos_url":"https://api.github.com/users/toad/repos","events_url":"https://api.github.com/users/toad/events{/privacy}","received_events_url":"https://api.github.com/users/toad/received_events","type":"User","site_admin":false},"body":"Simplifies disconnection code and fixes minor concurrency issues. Not urgent, consider for 1472. Old but still valid.","created_at":"2015-12-30T21:21:37Z","updated_at":"2016-01-05T06:16:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a79907e19f1607fb7d5c2fadeb74d1ef1ba12291","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/freenet/fred/pulls/455/commits","review_comments_url":"https://api.github.com/repos/freenet/fred/pulls/455/comments","review_comment_url":"https://api.github.com/repos/freenet/fred/pulls/comments{/number}","comments_url":"https://api.github.com/repos/freenet/fred/issues/455/comments","statuses_url":"https://api.github.com/repos/freenet/fred/statuses/a1873ed0408c78952b8767750a48817a3b5f4fa2","head":{"label":"toad:simplify-disconnected","ref":"simplify-disconnected","sha":"a1873ed0408c78952b8767750a48817a3b5f4fa2","user":{"login":"toad","id":77427,"avatar_url":"https://avatars.githubusercontent.com/u/77427?v=3","gravatar_id":"","url":"https://api.github.com/users/toad","html_url":"https://github.com/toad","followers_url":"https://api.github.com/users/toad/followers","following_url":"https://api.github.com/users/toad/following{/other_user}","gists_url":"https://api.github.com/users/toad/gists{/gist_id}","starred_url":"https://api.github.com/users/toad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toad/subscriptions","organizations_url":"https://api.github.com/users/toad/orgs","repos_url":"https://api.github.com/users/toad/repos","events_url":"https://api.github.com/users/toad/events{/privacy}","received_events_url":"https://api.github.com/users/toad/received_events","type":"User","site_admin":false},"repo":{"id":1028671,"name":"fred-staging","full_name":"toad/fred-staging","owner":{"login":"toad","id":77427,"avatar_url":"https://avatars.githubusercontent.com/u/77427?v=3","gravatar_id":"","url":"https://api.github.com/users/toad","html_url":"https://github.com/toad","followers_url":"https://api.github.com/users/toad/followers","following_url":"https://api.github.com/users/toad/following{/other_user}","gists_url":"https://api.github.com/users/toad/gists{/gist_id}","starred_url":"https://api.github.com/users/toad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toad/subscriptions","organizations_url":"https://api.github.com/users/toad/orgs","repos_url":"https://api.github.com/users/toad/repos","events_url":"https://api.github.com/users/toad/events{/privacy}","received_events_url":"https://api.github.com/users/toad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/toad/fred-staging","description":"Freenet REference Daemon (trunk, writable by all devs)","fork":true,"url":"https://api.github.com/repos/toad/fred-staging","forks_url":"https://api.github.com/repos/toad/fred-staging/forks","keys_url":"https://api.github.com/repos/toad/fred-staging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toad/fred-staging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toad/fred-staging/teams","hooks_url":"https://api.github.com/repos/toad/fred-staging/hooks","issue_events_url":"https://api.github.com/repos/toad/fred-staging/issues/events{/number}","events_url":"https://api.github.com/repos/toad/fred-staging/events","assignees_url":"https://api.github.com/repos/toad/fred-staging/assignees{/user}","branches_url":"https://api.github.com/repos/toad/fred-staging/branches{/branch}","tags_url":"https://api.github.com/repos/toad/fred-staging/tags","blobs_url":"https://api.github.com/repos/toad/fred-staging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toad/fred-staging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toad/fred-staging/git/refs{/sha}","trees_url":"https://api.github.com/repos/toad/fred-staging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toad/fred-staging/statuses/{sha}","languages_url":"https://api.github.com/repos/toad/fred-staging/languages","stargazers_url":"https://api.github.com/repos/toad/fred-staging/stargazers","contributors_url":"https://api.github.com/repos/toad/fred-staging/contributors","subscribers_url":"https://api.github.com/repos/toad/fred-staging/subscribers","subscription_url":"https://api.github.com/repos/toad/fred-staging/subscription","commits_url":"https://api.github.com/repos/toad/fred-staging/commits{/sha}","git_commits_url":"https://api.github.com/repos/toad/fred-staging/git/commits{/sha}","comments_url":"https://api.github.com/repos/toad/fred-staging/comments{/number}","issue_comment_url":"https://api.github.com/repos/toad/fred-staging/issues/comments{/number}","contents_url":"https://api.github.com/repos/toad/fred-staging/contents/{+path}","compare_url":"https://api.github.com/repos/toad/fred-staging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toad/fred-staging/merges","archive_url":"https://api.github.com/repos/toad/fred-staging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toad/fred-staging/downloads","issues_url":"https://api.github.com/repos/toad/fred-staging/issues{/number}","pulls_url":"https://api.github.com/repos/toad/fred-staging/pulls{/number}","milestones_url":"https://api.github.com/repos/toad/fred-staging/milestones{/number}","notifications_url":"https://api.github.com/repos/toad/fred-staging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toad/fred-staging/labels{/name}","releases_url":"https://api.github.com/repos/toad/fred-staging/releases{/id}","created_at":"2010-10-27T13:19:54Z","updated_at":"2015-08-02T21:06:25Z","pushed_at":"2016-01-03T18:53:58Z","git_url":"git://github.com/toad/fred-staging.git","ssh_url":"git@github.com:toad/fred-staging.git","clone_url":"https://github.com/toad/fred-staging.git","svn_url":"https://github.com/toad/fred-staging","homepage":"http://freenetproject.org/","size":45714,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"freenet:next","ref":"next","sha":"042ccff41e0f02adac529d4908cb1f58eba384ac","user":{"login":"freenet","id":77513,"avatar_url":"https://avatars.githubusercontent.com/u/77513?v=3","gravatar_id":"","url":"https://api.github.com/users/freenet","html_url":"https://github.com/freenet","followers_url":"https://api.github.com/users/freenet/followers","following_url":"https://api.github.com/users/freenet/following{/other_user}","gists_url":"https://api.github.com/users/freenet/gists{/gist_id}","starred_url":"https://api.github.com/users/freenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freenet/subscriptions","organizations_url":"https://api.github.com/users/freenet/orgs","repos_url":"https://api.github.com/users/freenet/repos","events_url":"https://api.github.com/users/freenet/events{/privacy}","received_events_url":"https://api.github.com/users/freenet/received_events","type":"Organization","site_admin":false},"repo":{"id":185026,"name":"fred","full_name":"freenet/fred","owner":{"login":"freenet","id":77513,"avatar_url":"https://avatars.githubusercontent.com/u/77513?v=3","gravatar_id":"","url":"https://api.github.com/users/freenet","html_url":"https://github.com/freenet","followers_url":"https://api.github.com/users/freenet/followers","following_url":"https://api.github.com/users/freenet/following{/other_user}","gists_url":"https://api.github.com/users/freenet/gists{/gist_id}","starred_url":"https://api.github.com/users/freenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freenet/subscriptions","organizations_url":"https://api.github.com/users/freenet/orgs","repos_url":"https://api.github.com/users/freenet/repos","events_url":"https://api.github.com/users/freenet/events{/privacy}","received_events_url":"https://api.github.com/users/freenet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/freenet/fred","description":"Freenet REference Daemon","fork":false,"url":"https://api.github.com/repos/freenet/fred","forks_url":"https://api.github.com/repos/freenet/fred/forks","keys_url":"https://api.github.com/repos/freenet/fred/keys{/key_id}","collaborators_url":"https://api.github.com/repos/freenet/fred/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/freenet/fred/teams","hooks_url":"https://api.github.com/repos/freenet/fred/hooks","issue_events_url":"https://api.github.com/repos/freenet/fred/issues/events{/number}","events_url":"https://api.github.com/repos/freenet/fred/events","assignees_url":"https://api.github.com/repos/freenet/fred/assignees{/user}","branches_url":"https://api.github.com/repos/freenet/fred/branches{/branch}","tags_url":"https://api.github.com/repos/freenet/fred/tags","blobs_url":"https://api.github.com/repos/freenet/fred/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/freenet/fred/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/freenet/fred/git/refs{/sha}","trees_url":"https://api.github.com/repos/freenet/fred/git/trees{/sha}","statuses_url":"https://api.github.com/repos/freenet/fred/statuses/{sha}","languages_url":"https://api.github.com/repos/freenet/fred/languages","stargazers_url":"https://api.github.com/repos/freenet/fred/stargazers","contributors_url":"https://api.github.com/repos/freenet/fred/contributors","subscribers_url":"https://api.github.com/repos/freenet/fred/subscribers","subscription_url":"https://api.github.com/repos/freenet/fred/subscription","commits_url":"https://api.github.com/repos/freenet/fred/commits{/sha}","git_commits_url":"https://api.github.com/repos/freenet/fred/git/commits{/sha}","comments_url":"https://api.github.com/repos/freenet/fred/comments{/number}","issue_comment_url":"https://api.github.com/repos/freenet/fred/issues/comments{/number}","contents_url":"https://api.github.com/repos/freenet/fred/contents/{+path}","compare_url":"https://api.github.com/repos/freenet/fred/compare/{base}...{head}","merges_url":"https://api.github.com/repos/freenet/fred/merges","archive_url":"https://api.github.com/repos/freenet/fred/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/freenet/fred/downloads","issues_url":"https://api.github.com/repos/freenet/fred/issues{/number}","pulls_url":"https://api.github.com/repos/freenet/fred/pulls{/number}","milestones_url":"https://api.github.com/repos/freenet/fred/milestones{/number}","notifications_url":"https://api.github.com/repos/freenet/fred/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/freenet/fred/labels{/name}","releases_url":"https://api.github.com/repos/freenet/fred/releases{/id}","created_at":"2009-04-25T01:00:27Z","updated_at":"2015-12-31T02:52:20Z","pushed_at":"2016-01-05T06:04:17Z","git_url":"git://github.com/freenet/fred.git","ssh_url":"git@github.com:freenet/fred.git","clone_url":"https://github.com/freenet/fred.git","svn_url":"https://github.com/freenet/fred","homepage":"https://freenetproject.org/","size":55593,"stargazers_count":203,"watchers_count":203,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":98,"mirror_url":null,"open_issues_count":35,"forks":98,"open_issues":35,"watchers":203,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/freenet/fred/pulls/455"},"html":{"href":"https://github.com/freenet/fred/pull/455"},"issue":{"href":"https://api.github.com/repos/freenet/fred/issues/455"},"comments":{"href":"https://api.github.com/repos/freenet/fred/issues/455/comments"},"review_comments":{"href":"https://api.github.com/repos/freenet/fred/pulls/455/comments"},"review_comment":{"href":"https://api.github.com/repos/freenet/fred/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/freenet/fred/pulls/455/commits"},"statuses":{"href":"https://api.github.com/repos/freenet/fred/statuses/a1873ed0408c78952b8767750a48817a3b5f4fa2"}}}}