]> source.dussan.org Git - jgit.git/commitdiff
Cleanup code and Eclipse compile errors in new gitrepo API 22/48522/3
authorAndrey Loskutov <loskutov@gmx.de>
Sun, 24 May 2015 07:31:17 +0000 (09:31 +0200)
committerAndrey Loskutov <loskutov@gmx.de>
Sun, 24 May 2015 08:27:20 +0000 (10:27 +0200)
Commit d3348e introduced few errors in Eclipse.

This commit cleans up the new API:
 - fixes API error in RepoCommand after moving IncludedFileReader type
 - fixes unused imports in RepoCommand & RepoCommandTest
 - fix javadoc errors in ManifestParser & RepoProject
 - makes three (implicitly final) fields in ManifestParser final.

Change-Id: I4185f451d97039d155391f62815bb9d3afe39fa6
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java

index 0caf9c6c27d7f93d28f312ddbe39a248bf473a79..3d86cfd5bb067a1aa647f697b5a90cca0542ec7b 100644 (file)
@@ -49,8 +49,6 @@ import static org.junit.Assert.assertTrue;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
-import java.util.HashSet;
-import java.util.Set;
 
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.junit.JGitTestUtil;
index 2d509381e71cdea798fba495e233a056e04a9de3..ec9fdfa4e278b3f0ffc540ab6ed93cf3a3272b2f 100644 (file)
@@ -83,11 +83,12 @@ public class ManifestParser extends DefaultHandler {
        private final Map<String, String> remotes;
        private final Set<String> plusGroups;
        private final Set<String> minusGroups;
-       private List<RepoProject> projects;
-       private List<RepoProject> filteredProjects;
+       private final List<RepoProject> projects;
+       private final List<RepoProject> filteredProjects;
+       private final IncludedFileReader includedReader;
+
        private String defaultRemote;
        private String defaultRevision;
-       private IncludedFileReader includedReader;
        private int xmlInRead;
        private RepoProject currentProject;
 
@@ -154,6 +155,7 @@ public class ManifestParser extends DefaultHandler {
         * Read the xml file.
         *
         * @param inputStream
+        * @throws IOException
         */
        public void read(InputStream inputStream) throws IOException {
                xmlInRead++;
@@ -295,6 +297,8 @@ public class ManifestParser extends DefaultHandler {
 
        /**
         * Getter for projects.
+        *
+        * @return projects list reference, never null
         */
        public List<RepoProject> getProjects() {
                return projects;
@@ -302,6 +306,8 @@ public class ManifestParser extends DefaultHandler {
 
        /**
         * Getter for filterdProjects.
+        *
+        * @return filtered projects list reference, never null
         */
        public List<RepoProject> getFilteredProjects() {
                return filteredProjects;
index e8a9e18f130821c404be31ce0a73db046599bf0e..d258250fea2c0507f55821ed61bfa641b32ec097 100644 (file)
@@ -46,7 +46,6 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URI;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.List;
@@ -340,7 +339,7 @@ public class RepoCommand extends GitCommand<RevCommit> {
         *
         * @param reader
         * @return this command
-        * @since 3.5
+        * @since 4.0
         */
        public RepoCommand setIncludedFileReader(IncludedFileReader reader) {
                this.includedReader = reader;
index c4648abca2ec81817fda9b8755b1660df6450bb7..dfd4f1bba8b3ba1f39a2547ff470021ed0c11d48 100644 (file)
@@ -96,6 +96,8 @@ public class RepoProject implements Comparable<RepoProject> {
 
                /**
                 * Do the copy file action.
+                *
+                * @throws IOException
                 */
                public void copy() throws IOException {
                        File srcFile = new File(repo.getWorkTree(),
@@ -186,7 +188,11 @@ public class RepoProject implements Comparable<RepoProject> {
        }
 
        /**
-        * Check if this sub repo is the ancestor of another sub repo.
+        * Check if this sub repo is the ancestor of given sub repo.
+        *
+        * @param that
+        *            non null
+        * @return true if this sub repo is the ancestor of given sub repo.
         */
        public boolean isAncestorOf(RepoProject that) {
                return that.getPathWithSlash().startsWith(this.getPathWithSlash());