{"action":"created","comment":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/57040812","id":57040812,"diff_hunk":"@@ -101,12 +109,85 @@ public void updateSettings(ProjectSettingsChangedEvent event) {\n     }\n \n     /**\n-     * If there are no NTPublishOperation steps, we can shut down NetworkTables\n+     * If there are no NTPublishAnnotatedOperation steps, we can shut down NetworkTables\n      */\n     @Subscribe\n     public void disableNetworkTables(StepRemovedEvent event) {\n-        if (!pipeline.getSteps().stream().anyMatch(step -> step.getOperation() instanceof NTPublishOperation)) {\n-            NetworkTable.shutdown();\n+        if (!pipeline.getSteps().stream().anyMatch(step -> step.getOperation() instanceof NTPublishAnnotatedOperation)) {\n+            synchronized (NetworkTable.class) {\n+                NetworkTable.shutdown();\n+            }\n+        }\n+    }\n+\n+    private static final class NTPublisher<P> extends MapNetworkPublisher<P> {\n+        private final ImmutableSet<String> keys;\n+        private Optional<String> name = Optional.empty();\n+\n+        protected NTPublisher(Set<String> keys) {\n+            super(keys);\n+            this.keys = ImmutableSet.copyOf(keys);\n+        }\n+\n+        @Override\n+        protected void publishNameChanged(Optional<String> oldName, String newName) {\n+            if (oldName.isPresent()) {\n+                deleteOldTable(oldName.get());\n+            }\n+            this.name = Optional.of(newName);\n+        }\n+\n+        @Override\n+        protected void doPublish(Map<String, P> publishValueMap) {\n+            publishValueMap.forEach(getTable()::putValue);\n+            Sets.difference(keys, publishValueMap.entrySet()).forEach(getTable()::delete);\n+        }\n+\n+        @Override\n+        protected void doPublishSingle(P value) {\n+            checkNotNull(value, \"value cannot be null\");\n+            getRootTable().putValue(name.get(), value);\n+        }\n+\n+        @Override\n+        public void doPublish() {\n+            deleteOldTable(name.get());\n         }\n+\n+\n+        private void deleteOldTable(String tableName) {","path":"core/src/main/java/edu/wpi/grip/core/operations/network/networktables/NTManager.java","position":109,"original_position":109,"commit_id":"f2b5be855fb1455777cabf15bc30609e8b242c56","original_commit_id":"f2b5be855fb1455777cabf15bc30609e8b242c56","user":{"login":"WPIRoboticsProjects-Bot","id":14011429,"avatar_url":"https://avatars.githubusercontent.com/u/14011429?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects-Bot","html_url":"https://github.com/WPIRoboticsProjects-Bot","followers_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects-Bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Use one line for each declaration, it enhances code readability.](https://www.codacy.com/app/WPIRoboticsProjects/GRIP/file/2294555495/issues/source?bid=2943107&fileBranchId=3145104#l159)","created_at":"2016-03-22T18:18:44Z","updated_at":"2016-03-22T18:18:44Z","html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/527#discussion_r57040812","pull_request_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/527","_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/57040812"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/527#discussion_r57040812"},"pull_request":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/527"}}},"pull_request":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/527","id":60620968,"html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/527","diff_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/527.diff","patch_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/527.patch","issue_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/527","number":527,"state":"open","locked":false,"title":"GRIP publish as a ROS Node","user":{"login":"JLLeitschuh","id":1323708,"avatar_url":"https://avatars.githubusercontent.com/u/1323708?v=3","gravatar_id":"","url":"https://api.github.com/users/JLLeitschuh","html_url":"https://github.com/JLLeitschuh","followers_url":"https://api.github.com/users/JLLeitschuh/followers","following_url":"https://api.github.com/users/JLLeitschuh/following{/other_user}","gists_url":"https://api.github.com/users/JLLeitschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/JLLeitschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JLLeitschuh/subscriptions","organizations_url":"https://api.github.com/users/JLLeitschuh/orgs","repos_url":"https://api.github.com/users/JLLeitschuh/repos","events_url":"https://api.github.com/users/JLLeitschuh/events{/privacy}","received_events_url":"https://api.github.com/users/JLLeitschuh/received_events","type":"User","site_admin":false},"body":"Makes it possible to publish GRIP data to ROS topics","created_at":"2016-02-25T03:47:46Z","updated_at":"2016-03-22T18:18:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e4390bcef1475673125f1ecf684351fa5e03df5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/527/commits","review_comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/527/comments","review_comment_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/527/comments","statuses_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/f2b5be855fb1455777cabf15bc30609e8b242c56","head":{"label":"JLLeitschuh:feat/rosNetworkPublishing","ref":"feat/rosNetworkPublishing","sha":"f2b5be855fb1455777cabf15bc30609e8b242c56","user":{"login":"JLLeitschuh","id":1323708,"avatar_url":"https://avatars.githubusercontent.com/u/1323708?v=3","gravatar_id":"","url":"https://api.github.com/users/JLLeitschuh","html_url":"https://github.com/JLLeitschuh","followers_url":"https://api.github.com/users/JLLeitschuh/followers","following_url":"https://api.github.com/users/JLLeitschuh/following{/other_user}","gists_url":"https://api.github.com/users/JLLeitschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/JLLeitschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JLLeitschuh/subscriptions","organizations_url":"https://api.github.com/users/JLLeitschuh/orgs","repos_url":"https://api.github.com/users/JLLeitschuh/repos","events_url":"https://api.github.com/users/JLLeitschuh/events{/privacy}","received_events_url":"https://api.github.com/users/JLLeitschuh/received_events","type":"User","site_admin":false},"repo":{"id":41511491,"name":"GRIP","full_name":"JLLeitschuh/GRIP","owner":{"login":"JLLeitschuh","id":1323708,"avatar_url":"https://avatars.githubusercontent.com/u/1323708?v=3","gravatar_id":"","url":"https://api.github.com/users/JLLeitschuh","html_url":"https://github.com/JLLeitschuh","followers_url":"https://api.github.com/users/JLLeitschuh/followers","following_url":"https://api.github.com/users/JLLeitschuh/following{/other_user}","gists_url":"https://api.github.com/users/JLLeitschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/JLLeitschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JLLeitschuh/subscriptions","organizations_url":"https://api.github.com/users/JLLeitschuh/orgs","repos_url":"https://api.github.com/users/JLLeitschuh/repos","events_url":"https://api.github.com/users/JLLeitschuh/events{/privacy}","received_events_url":"https://api.github.com/users/JLLeitschuh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JLLeitschuh/GRIP","description":"Program for rapidly developing computer vision applications","fork":true,"url":"https://api.github.com/repos/JLLeitschuh/GRIP","forks_url":"https://api.github.com/repos/JLLeitschuh/GRIP/forks","keys_url":"https://api.github.com/repos/JLLeitschuh/GRIP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JLLeitschuh/GRIP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JLLeitschuh/GRIP/teams","hooks_url":"https://api.github.com/repos/JLLeitschuh/GRIP/hooks","issue_events_url":"https://api.github.com/repos/JLLeitschuh/GRIP/issues/events{/number}","events_url":"https://api.github.com/repos/JLLeitschuh/GRIP/events","assignees_url":"https://api.github.com/repos/JLLeitschuh/GRIP/assignees{/user}","branches_url":"https://api.github.com/repos/JLLeitschuh/GRIP/branches{/branch}","tags_url":"https://api.github.com/repos/JLLeitschuh/GRIP/tags","blobs_url":"https://api.github.com/repos/JLLeitschuh/GRIP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JLLeitschuh/GRIP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JLLeitschuh/GRIP/git/refs{/sha}","trees_url":"https://api.github.com/repos/JLLeitschuh/GRIP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JLLeitschuh/GRIP/statuses/{sha}","languages_url":"https://api.github.com/repos/JLLeitschuh/GRIP/languages","stargazers_url":"https://api.github.com/repos/JLLeitschuh/GRIP/stargazers","contributors_url":"https://api.github.com/repos/JLLeitschuh/GRIP/contributors","subscribers_url":"https://api.github.com/repos/JLLeitschuh/GRIP/subscribers","subscription_url":"https://api.github.com/repos/JLLeitschuh/GRIP/subscription","commits_url":"https://api.github.com/repos/JLLeitschuh/GRIP/commits{/sha}","git_commits_url":"https://api.github.com/repos/JLLeitschuh/GRIP/git/commits{/sha}","comments_url":"https://api.github.com/repos/JLLeitschuh/GRIP/comments{/number}","issue_comment_url":"https://api.github.com/repos/JLLeitschuh/GRIP/issues/comments{/number}","contents_url":"https://api.github.com/repos/JLLeitschuh/GRIP/contents/{+path}","compare_url":"https://api.github.com/repos/JLLeitschuh/GRIP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JLLeitschuh/GRIP/merges","archive_url":"https://api.github.com/repos/JLLeitschuh/GRIP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JLLeitschuh/GRIP/downloads","issues_url":"https://api.github.com/repos/JLLeitschuh/GRIP/issues{/number}","pulls_url":"https://api.github.com/repos/JLLeitschuh/GRIP/pulls{/number}","milestones_url":"https://api.github.com/repos/JLLeitschuh/GRIP/milestones{/number}","notifications_url":"https://api.github.com/repos/JLLeitschuh/GRIP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JLLeitschuh/GRIP/labels{/name}","releases_url":"https://api.github.com/repos/JLLeitschuh/GRIP/releases{/id}","deployments_url":"https://api.github.com/repos/JLLeitschuh/GRIP/deployments","created_at":"2015-08-27T21:09:02Z","updated_at":"2016-01-24T17:43:05Z","pushed_at":"2016-03-22T18:15:32Z","git_url":"git://github.com/JLLeitschuh/GRIP.git","ssh_url":"git@github.com:JLLeitschuh/GRIP.git","clone_url":"https://github.com/JLLeitschuh/GRIP.git","svn_url":"https://github.com/JLLeitschuh/GRIP","homepage":null,"size":20735,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"WPIRoboticsProjects:master","ref":"master","sha":"6ef68aa99aab26fcd42e659be2d8960a1e9f4690","user":{"login":"WPIRoboticsProjects","id":14004340,"avatar_url":"https://avatars.githubusercontent.com/u/14004340?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects","html_url":"https://github.com/WPIRoboticsProjects","followers_url":"https://api.github.com/users/WPIRoboticsProjects/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects/received_events","type":"Organization","site_admin":false},"repo":{"id":41505521,"name":"GRIP","full_name":"WPIRoboticsProjects/GRIP","owner":{"login":"WPIRoboticsProjects","id":14004340,"avatar_url":"https://avatars.githubusercontent.com/u/14004340?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects","html_url":"https://github.com/WPIRoboticsProjects","followers_url":"https://api.github.com/users/WPIRoboticsProjects/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WPIRoboticsProjects/GRIP","description":"Program for rapidly developing computer vision applications","fork":false,"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP","forks_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/forks","keys_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/teams","hooks_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/hooks","issue_events_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/events{/number}","events_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/events","assignees_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/assignees{/user}","branches_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/branches{/branch}","tags_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/tags","blobs_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/refs{/sha}","trees_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/{sha}","languages_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/languages","stargazers_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/stargazers","contributors_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/contributors","subscribers_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/subscribers","subscription_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/subscription","commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/commits{/sha}","git_commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/commits{/sha}","comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/comments{/number}","issue_comment_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/comments{/number}","contents_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/contents/{+path}","compare_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/merges","archive_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/downloads","issues_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues{/number}","pulls_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls{/number}","milestones_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/milestones{/number}","notifications_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/labels{/name}","releases_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/releases{/id}","deployments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/deployments","created_at":"2015-08-27T18:59:07Z","updated_at":"2016-03-21T15:12:15Z","pushed_at":"2016-03-22T18:15:32Z","git_url":"git://github.com/WPIRoboticsProjects/GRIP.git","ssh_url":"git@github.com:WPIRoboticsProjects/GRIP.git","clone_url":"https://github.com/WPIRoboticsProjects/GRIP.git","svn_url":"https://github.com/WPIRoboticsProjects/GRIP","homepage":"http://wpiroboticsprojects.github.io/GRIP","size":43980,"stargazers_count":91,"watchers_count":91,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"open_issues_count":97,"forks":38,"open_issues":97,"watchers":91,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/527"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/527"},"issue":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/527"},"comments":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/527/comments"},"review_comments":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/527/comments"},"review_comment":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/527/commits"},"statuses":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/f2b5be855fb1455777cabf15bc30609e8b242c56"}}}}