GitHub PullRequestReviewCommentEvent at 2014-04-09 08:28:30
Repository: openmicroscopy
Actor: mtbc
Payload: {"comment":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/comments/11426799","id":11426799,"diff_hunk":"@@ -0,0 +1,95 @@\n+/*\n+ * Copyright (C) 2014 University of Dundee & Open Microscopy Environment.\n+ * All rights reserved.\n+ *\n+ * This program is free software; you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation; either version 2 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License along\n+ * with this program; if not, write to the Free Software Foundation, Inc.,\n+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+ */\n+\n+package org.openmicroscopy.shoola.agents.metadata;\n+\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Set;\n+\n+import pojos.DataObject;\n+import pojos.FileAnnotationData;\n+\n+/** \n+ * Holds the result of a FileAnnotationCheck, i. e.\n+ * the {@link DataObject}s each {@link FileAnnotationData} is linked to\n+ *\n+ * @author Dominik Lindner &nbsp;&nbsp;&nbsp;&nbsp;\n+ * <a href=\"mailto:d.lindner@dundee.ac.uk\">d.lindner@dundee.ac.uk</a>\n+ * @since 5.0\n+ */\n+public class FileAnnotationCheckResult {\n+\n+    /** Map holding the results; key: {@link FileAnnotationData}, value: List of {@link DataObject}s the {@link FileAnnotationData} is linked to */\n+    private Map<FileAnnotationData, List<DataObject>> linkMap = new HashMap<FileAnnotationData, List<DataObject>>();\n+\n+    /**\n+     * Get all {@link DataObject}s the given {@link FileAnnotationData} is linked to.\n+     * This method will never return null, but rather will return an empty list.\n+     * @param fd The {@link FileAnnotationData}\n+     * @return See above.\n+     */\n+    public List<DataObject> getLinks(FileAnnotationData fd) {\n+        List<DataObject> existingLinks = this.linkMap.get(fd);\n+        if (existingLinks == null) {\n+            existingLinks = new ArrayList<DataObject>();","path":"components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/FileAnnotationCheckResult.java","position":53,"original_position":53,"commit_id":"d8b32be470c5af1049db261e102c1942356278c0","original_commit_id":"d8b32be470c5af1049db261e102c1942356278c0","user":{"login":"mtbc","id":2630707,"avatar_url":"https://avatars.githubusercontent.com/u/2630707?","gravatar_id":"dd3abf4ce82fd7321089540d5ff28796","url":"https://api.github.com/users/mtbc","html_url":"https://github.com/mtbc","followers_url":"https://api.github.com/users/mtbc/followers","following_url":"https://api.github.com/users/mtbc/following{/other_user}","gists_url":"https://api.github.com/users/mtbc/gists{/gist_id}","starred_url":"https://api.github.com/users/mtbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtbc/subscriptions","organizations_url":"https://api.github.com/users/mtbc/orgs","repos_url":"https://api.github.com/users/mtbc/repos","events_url":"https://api.github.com/users/mtbc/events{/privacy}","received_events_url":"https://api.github.com/users/mtbc/received_events","type":"User","site_admin":false},"body":"Does this have to be mutable? If not, consider `java.util.Collections.emptyList()` which avoids the heap allocation.","created_at":"2014-04-09T08:28:30Z","updated_at":"2014-04-09T08:28:30Z","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/2268#discussion_r11426799","pull_request_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/2268","_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/comments/11426799"},"html":{"href":"https://github.com/openmicroscopy/openmicroscopy/pull/2268#discussion_r11426799"},"pull_request":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/2268"}}}}