Format all Java files with google-java-format 1.7 Change-Id: I6bfacdcd1a19d67b5ca5f7752eaa34eed6a66578
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/GitCommitCacheModule.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/GitCommitCacheModule.java index d54a17b..fe93a9c 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/GitCommitCacheModule.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/GitCommitCacheModule.java
@@ -13,8 +13,6 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork; -import java.util.List; - import com.google.gerrit.extensions.events.GitReferenceUpdatedListener; import com.google.gerrit.extensions.events.NewProjectCreatedListener; import com.google.gerrit.extensions.registration.DynamicSet; @@ -23,17 +21,16 @@ import com.googlesource.gerrit.plugins.branchnetwork.data.GitCommitCache; import com.googlesource.gerrit.plugins.branchnetwork.data.GitCommitCacheRefresh; import com.googlesource.gerrit.plugins.branchnetwork.data.json.Commit; +import java.util.List; public class GitCommitCacheModule extends CacheModule { @Override protected void configure() { - cache(GitCommitCache.GRAPH_DATA_CACHE, String.class, - new TypeLiteral<List<Commit>>() {}).loader(GitCommitCache.class); + cache(GitCommitCache.GRAPH_DATA_CACHE, String.class, new TypeLiteral<List<Commit>>() {}) + .loader(GitCommitCache.class); - DynamicSet.bind(binder(), GitReferenceUpdatedListener.class).to( - GitCommitCacheRefresh.class); - DynamicSet.bind(binder(), NewProjectCreatedListener.class).to( - GitCommitCacheRefresh.class); + DynamicSet.bind(binder(), GitReferenceUpdatedListener.class).to(GitCommitCacheRefresh.class); + DynamicSet.bind(binder(), NewProjectCreatedListener.class).to(GitCommitCacheRefresh.class); } }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/GitGraphServlet.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/GitGraphServlet.java index 8248982..e96678b 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/GitGraphServlet.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/GitGraphServlet.java
@@ -13,19 +13,6 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork.canvas; -import java.io.IOException; -import java.io.PrintWriter; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.eclipse.jgit.errors.RepositoryNotFoundException; -import org.eclipse.jgit.lib.Repository; - import com.google.gerrit.common.data.GitwebType; import com.google.gerrit.extensions.annotations.PluginCanonicalWebUrl; import com.google.gerrit.extensions.restapi.AuthException; @@ -39,6 +26,16 @@ import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; +import java.io.IOException; +import java.io.PrintWriter; +import java.net.MalformedURLException; +import java.net.URL; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.eclipse.jgit.errors.RepositoryNotFoundException; +import org.eclipse.jgit.lib.Repository; @Singleton public class GitGraphServlet extends HttpServlet { @@ -54,15 +51,15 @@ private final PermissionBackend permissionBackend; @Inject - public GitGraphServlet(@PluginCanonicalWebUrl String url, + public GitGraphServlet( + @PluginCanonicalWebUrl String url, GitwebConfig gitWebConfig, final GitRepositoryManager repoManager, Provider<CurrentUser> user, PermissionBackend permissionBackend) throws MalformedURLException { this.canonicalPath = new URL(url).getPath(); - this.pluginCanonicalWebUrl = - url.substring(0, url.length() - (canonicalPath.length() - 1)); + this.pluginCanonicalWebUrl = url.substring(0, url.length() - (canonicalPath.length() - 1)); this.repoManager = repoManager; this.gitWebConfig = gitWebConfig; this.user = user; @@ -111,11 +108,9 @@ } } - String networkMetaUrl = - String.format("%1$snetwork_meta/%2$s/", canonicalPath, repoName); + String networkMetaUrl = String.format("%1$snetwork_meta/%2$s/", canonicalPath, repoName); String networkDataChunkUrl = - String.format("%1$snetwork_data_chunk/%2$s/?nethash=", canonicalPath, - repoName); + String.format("%1$snetwork_data_chunk/%2$s/?nethash=", canonicalPath, repoName); GitwebType type = gitWebConfig.getGitwebType(); if (type == null) { @@ -127,20 +122,25 @@ .replaceAll("\\$\\{project\\}", repoName) .replaceAll("\\$\\{commit\\}", "{2}"); String projectPattern = - gitWebConfig.getUrl() - + type.getProject() - .replaceAll("\\$\\{project\\}", repoName); + gitWebConfig.getUrl() + type.getProject().replaceAll("\\$\\{project\\}", repoName); commitUrlPattern = - (commitUrlPattern.startsWith("/") ? commitUrlPattern : pluginCanonicalWebUrl - + commitUrlPattern); + (commitUrlPattern.startsWith("/") + ? commitUrlPattern + : pluginCanonicalWebUrl + commitUrlPattern); projectPattern = - (projectPattern.startsWith("/") ? projectPattern : pluginCanonicalWebUrl - + projectPattern); + (projectPattern.startsWith("/") + ? projectPattern + : pluginCanonicalWebUrl + projectPattern); String header = - "<html>\n" + "<head>\n" + "<style type=\"text/css\">\n" - + "div#progress\n" + "{\n" + "position:absolute;\n" + "left:" + "<html>\n" + + "<head>\n" + + "<style type=\"text/css\">\n" + + "div#progress\n" + + "{\n" + + "position:absolute;\n" + + "left:" + (width - PROGRESS_BAR_WIDTH) / 2 + "px;\n" + "top:" @@ -165,22 +165,41 @@ + "</div>" + "<div id=\"graph\">"; String javaScript = - "<script type=\"text/javascript\" src=\"" + canonicalPath + "<script type=\"text/javascript\" src=\"" + + canonicalPath + "static/jquery-1.4.2.min.js\"></script>\n" - + "<script type=\"text/javascript\" src=\"" + canonicalPath + + "<script type=\"text/javascript\" src=\"" + + canonicalPath + "static/network.js\"></script>\n" + "<script type=\"text/javascript\">" + "$(document).ready( function() {\n" - + "new NetworkCanvas('network-canvas', " + width + ", " + height - + " , null, null, null,\n" + "'" + commitUrlPattern + "',\n" - + "'" + projectPattern + "',\n" + "'" + networkMetaUrl + "',\n" - + "'" + networkDataChunkUrl + "');\n" + "});\n" + "</script>\n"; + + "new NetworkCanvas('network-canvas', " + + width + + ", " + + height + + " , null, null, null,\n" + + "'" + + commitUrlPattern + + "',\n" + + "'" + + projectPattern + + "',\n" + + "'" + + networkMetaUrl + + "',\n" + + "'" + + networkDataChunkUrl + + "');\n" + + "});\n" + + "</script>\n"; String canvas = - "<canvas id=\"network-canvas\" width=\"" + width + "\" height=\"" - + height + "\" style=\"cursor: default; \"></canvas>"; + "<canvas id=\"network-canvas\" width=\"" + + width + + "\" height=\"" + + height + + "\" style=\"cursor: default; \"></canvas>"; String footer = "</div>" + "</body>\n" + "</html>\n"; - out.println(naked ? (javaScript + canvas) - : (header + javaScript + canvas + footer)); + out.println(naked ? (javaScript + canvas) : (header + javaScript + canvas + footer)); } } finally { out.close();
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/JsonService.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/JsonService.java index 8f64110..4b13fc5 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/JsonService.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/JsonService.java
@@ -13,15 +13,6 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork.canvas; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; @@ -29,6 +20,13 @@ import com.google.gson.JsonSerializer; import com.google.gson.stream.JsonWriter; import com.googlesource.gerrit.plugins.branchnetwork.data.json.Parent; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; public class JsonService extends HttpServlet { private static final long serialVersionUID = -909762366548464514L; @@ -36,20 +34,21 @@ private static Gson getGson() { GsonBuilder gsonBuilder = new GsonBuilder(); - gsonBuilder.registerTypeAdapter(Parent.class, new JsonSerializer<Parent>() { - @Override - public JsonElement serialize(Parent src, Type typeOfSrc, - JsonSerializationContext context) { - return src.toJson(); - } - }); + gsonBuilder.registerTypeAdapter( + Parent.class, + new JsonSerializer<Parent>() { + @Override + public JsonElement serialize( + Parent src, Type typeOfSrc, JsonSerializationContext context) { + return src.toJson(); + } + }); return gsonBuilder.create(); } protected void returnJsonResponse(HttpServletResponse resp, Object data) throws UnsupportedEncodingException, IOException { - JsonWriter writer = - new JsonWriter(new OutputStreamWriter(resp.getOutputStream(), "UTF-8")); + JsonWriter writer = new JsonWriter(new OutputStreamWriter(resp.getOutputStream(), "UTF-8")); try { gson.toJson(data, data.getClass(), writer); } finally { @@ -62,8 +61,7 @@ String reqURI = req.getRequestURI(); int servletPathPos = reqURI.indexOf(servletPath); - String projectName = - reqURI.substring(servletPathPos + servletPath.length()); + String projectName = reqURI.substring(servletPathPos + servletPath.length()); if (projectName.startsWith("/")) { projectName = projectName.substring(1); }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/NetworkDataChunkService.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/NetworkDataChunkService.java index f4e705d..f62784c 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/NetworkDataChunkService.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/NetworkDataChunkService.java
@@ -13,14 +13,6 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork.canvas; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.ExecutionException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import com.google.common.cache.LoadingCache; import com.google.inject.Inject; import com.google.inject.Singleton; @@ -28,6 +20,12 @@ import com.googlesource.gerrit.plugins.branchnetwork.data.GitCommitCache; import com.googlesource.gerrit.plugins.branchnetwork.data.json.Commit; import com.googlesource.gerrit.plugins.branchnetwork.data.json.Data; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; @Singleton public class NetworkDataChunkService extends JsonService { @@ -39,7 +37,8 @@ @Inject public NetworkDataChunkService( - @Named(GitCommitCache.GRAPH_DATA_CACHE) final LoadingCache<String, List<Commit>> networkGraphDataCache) { + @Named(GitCommitCache.GRAPH_DATA_CACHE) + final LoadingCache<String, List<Commit>> networkGraphDataCache) { this.networkGraphDataCache = networkGraphDataCache; } @@ -53,8 +52,8 @@ } } - public void printJson(HttpServletRequest req, HttpServletResponse resp, - String project) throws IOException, ExecutionException { + public void printJson(HttpServletRequest req, HttpServletResponse resp, String project) + throws IOException, ExecutionException { String domainRepoName = req.getParameter("nethash"); @@ -68,11 +67,9 @@ String end = req.getParameter("end"); if (end != null) endInt = Integer.parseInt(end); - if ((endInt - startInt) > MAX_COMMIT_CHUNK_LEN) - startInt = endInt - MAX_COMMIT_CHUNK_LEN; + if ((endInt - startInt) > MAX_COMMIT_CHUNK_LEN) startInt = endInt - MAX_COMMIT_CHUNK_LEN; Data data = new Data(commits.subList(startInt, endInt + 1)); returnJsonResponse(resp, data); } - }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/NetworkMetaService.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/NetworkMetaService.java index 374245e..486cc05 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/NetworkMetaService.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/canvas/NetworkMetaService.java
@@ -13,19 +13,17 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork.canvas; -import java.io.IOException; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import com.google.inject.Inject; import com.google.inject.Singleton; import com.googlesource.gerrit.plugins.branchnetwork.data.GitCommitCache; import com.googlesource.gerrit.plugins.branchnetwork.data.json.Head; +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; @Singleton public class NetworkMetaService extends JsonService { @@ -40,9 +38,7 @@ this.gitCommitCache = gitCommitCache; } - /** - * Beans intended to be used for JSON serialisation - */ + /** Beans intended to be used for JSON serialisation */ public static class MetaData { public List<Block> blocks = new LinkedList<Block>(); public List<String> dates = new LinkedList<String>(); @@ -81,8 +77,8 @@ returnRepositoryGraphMetaDataAsJson(req, resp, getProjectName(req)); } - public void returnRepositoryGraphMetaDataAsJson(HttpServletRequest req, - HttpServletResponse resp, String project) throws IOException { + public void returnRepositoryGraphMetaDataAsJson( + HttpServletRequest req, HttpServletResponse resp, String project) throws IOException { MetaData metaData = new MetaData(); @@ -95,8 +91,7 @@ int maxTime = dates.size(); List<Head> heads = gitCommitCache.getHeads(project); - metaData.focus = - maxTime < COMMITS_FIRST_IN_FOCUS ? 0 : maxTime - COMMITS_FIRST_IN_FOCUS; + metaData.focus = maxTime < COMMITS_FIRST_IN_FOCUS ? 0 : maxTime - COMMITS_FIRST_IN_FOCUS; laneCount = gitCommitCache.getBranchesPlotLanesCount(project); metaData.blocks.add(new Block(project, laneCount, 0)); @@ -106,5 +101,4 @@ returnJsonResponse(resp, metaData); } - }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/GitCommitCache.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/GitCommitCache.java index a8b81b2..1fc8cb0 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/GitCommitCache.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/GitCommitCache.java
@@ -13,22 +13,20 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork.data; -import java.io.IOException; -import java.text.ParseException; -import java.util.List; - import com.google.common.cache.CacheLoader; import com.google.inject.Inject; import com.google.inject.Singleton; import com.googlesource.gerrit.plugins.branchnetwork.data.json.Commit; import com.googlesource.gerrit.plugins.branchnetwork.data.json.Head; +import java.io.IOException; +import java.text.ParseException; +import java.util.List; @Singleton public class GitCommitCache extends CacheLoader<String, List<Commit>> { public static final String GRAPH_DATA_CACHE = "NetworkGraphDataCache"; - @Inject - private JGitFacade git; + @Inject private JGitFacade git; public List<Head> getHeads(String project) throws IOException { return git.getHeadsForRepository(project); @@ -46,5 +44,4 @@ public int getBranchesPlotLanesCount(String project) throws IOException { return git.getBranchesPlotLanesCount(project); } - }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/GitCommitCacheRefresh.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/GitCommitCacheRefresh.java index 6ec6825..546cba1 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/GitCommitCacheRefresh.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/GitCommitCacheRefresh.java
@@ -13,23 +13,22 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork.data; -import java.util.List; - import com.google.common.cache.LoadingCache; import com.google.gerrit.extensions.events.GitReferenceUpdatedListener; import com.google.gerrit.extensions.events.NewProjectCreatedListener; import com.google.inject.Inject; import com.google.inject.name.Named; import com.googlesource.gerrit.plugins.branchnetwork.data.json.Commit; +import java.util.List; -public class GitCommitCacheRefresh implements GitReferenceUpdatedListener, - NewProjectCreatedListener { +public class GitCommitCacheRefresh + implements GitReferenceUpdatedListener, NewProjectCreatedListener { private LoadingCache<String, List<Commit>> networkGraphDataCache; @Inject public GitCommitCacheRefresh( - @Named(GitCommitCache.GRAPH_DATA_CACHE) final LoadingCache<String, - List<Commit>> networkGraphDataCache) { + @Named(GitCommitCache.GRAPH_DATA_CACHE) + final LoadingCache<String, List<Commit>> networkGraphDataCache) { this.networkGraphDataCache = networkGraphDataCache; }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java index f0395b3..70d1091 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java
@@ -13,6 +13,13 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork.data; +import com.google.gerrit.reviewdb.client.Project.NameKey; +import com.google.gerrit.server.git.GitRepositoryManager; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import com.googlesource.gerrit.plugins.branchnetwork.data.json.Commit; +import com.googlesource.gerrit.plugins.branchnetwork.data.json.Head; +import com.googlesource.gerrit.plugins.branchnetwork.data.json.Parent; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; @@ -20,7 +27,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; - import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Ref; @@ -33,14 +39,6 @@ import org.eclipse.jgit.revwalk.RevCommitList; import org.eclipse.jgit.revwalk.RevSort; -import com.google.gerrit.reviewdb.client.Project.NameKey; -import com.google.gerrit.server.git.GitRepositoryManager; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import com.googlesource.gerrit.plugins.branchnetwork.data.json.Commit; -import com.googlesource.gerrit.plugins.branchnetwork.data.json.Head; -import com.googlesource.gerrit.plugins.branchnetwork.data.json.Parent; - @Singleton public class JGitFacade { private final GitRepositoryManager repoManager; @@ -51,8 +49,7 @@ } public List<Commit> logData(String repository) throws IOException { - final Repository repo = - repoManager.openRepository(NameKey.parse(repository)); + final Repository repo = repoManager.openRepository(NameKey.parse(repository)); final PlotWalk walk = new PlotWalk(repo); try { @@ -151,8 +148,7 @@ } private List<Head> getHeadsForRepository(Repository repo) throws IOException { - Map<String, Ref> headRefs = - repo.getRefDatabase().getRefs(Constants.R_HEADS); + Map<String, Ref> headRefs = repo.getRefDatabase().getRefs(Constants.R_HEADS); List<Head> heads = new LinkedList<Head>(); for (String headName : headRefs.keySet()) { @@ -167,7 +163,7 @@ public int getBranchesPlotLanesCount(String repoName) throws IOException { try (Repository repo = repoManager.openRepository(NameKey.parse(repoName)); - PlotWalk walk = new PlotWalk(repo);) { + PlotWalk walk = new PlotWalk(repo); ) { ObjectId headId = repo.resolve(Constants.HEAD); if (headId == null) return 0;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Commit.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Commit.java index fcd5a16..507e548 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Commit.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Commit.java
@@ -16,89 +16,87 @@ import java.util.ArrayList; import java.util.List; -public class Commit { +public class Commit { - private String author; - private List<Parent> parents = new ArrayList<Parent>(); - private int time; - private String date; - private String id; - private int space; - private String email; - private String message; + private String author; + private List<Parent> parents = new ArrayList<Parent>(); + private int time; + private String date; + private String id; + private int space; + private String email; + private String message; - public String getAuthor() { - return author; - } + public String getAuthor() { + return author; + } - public List<Parent> getParents() { - return parents; - } + public List<Parent> getParents() { + return parents; + } - public int getTime() { - return time; - } + public int getTime() { + return time; + } - public String getDate() { - return date; - } + public String getDate() { + return date; + } - public String getId() { - return id; - } + public String getId() { + return id; + } - public int getSpace() { - return space; - } + public int getSpace() { + return space; + } - public String getEmail() { - return email; - } + public String getEmail() { + return email; + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } - public void addParent(Parent parent) { - this.parents.add(parent); - } + public void addParent(Parent parent) { + this.parents.add(parent); + } + public void setAuthor(String author) { + this.author = author; + } - public void setAuthor(String author) { - this.author = author; - } + public void setParents(List<Parent> parents) { + this.parents = parents; + } - public void setParents(List<Parent> parents) { - this.parents = parents; - } + public void setTime(int time) { + this.time = time; + } - public void setTime(int time) { - this.time = time; - } + public void setDate(String date) { + this.date = date; + } - public void setDate(String date) { - this.date = date; - } + public void setId(String id) { + this.id = id; + } - public void setId(String id) { - this.id = id; - } + public void setSpace(int space) { + this.space = space; + } - public void setSpace(int space) { - this.space = space; - } + public void setEmail(String email) { + this.email = email; + } - public void setEmail(String email) { - this.email = email; - } + public void setMessage(String message) { + this.message = message; + } - public void setMessage(String message) { - this.message = message; - } - - @Override - public String toString() { + @Override + public String toString() { return id + " (" + date + ")"; - } - + } }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Data.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Data.java index 9185372..376d3e6 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Data.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Data.java
@@ -30,4 +30,4 @@ public void addCommit(Commit commit) { commits.add(commit); } -} \ No newline at end of file +}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Head.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Head.java index 4b69845..7d18403 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Head.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Head.java
@@ -13,7 +13,7 @@ // limitations under the License. package com.googlesource.gerrit.plugins.branchnetwork.data.json; -public class Head { +public class Head { private String name; private String id;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Parent.java b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Parent.java index 7a3e59d..8123352 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Parent.java +++ b/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/json/Parent.java
@@ -19,43 +19,41 @@ public class Parent { - private String id; + private String id; - private int time; + private int time; - private int space; + private int space; - public void setId(String id) { - this.id = id; - } + public void setId(String id) { + this.id = id; + } - public String getId() { - return id; - } + public String getId() { + return id; + } - public void setTime(int time) { - this.time = time; - } + public void setTime(int time) { + this.time = time; + } - public int getTime() { - return time; - } + public int getTime() { + return time; + } - public void setSpace(int space) { - this.space = space; - } + public void setSpace(int space) { + this.space = space; + } - public int getSpace() { - return space; - } + public int getSpace() { + return space; + } - public JsonElement toJson() { - JsonArray jsonOut = new JsonArray(); - jsonOut.add(new JsonPrimitive(id)); - jsonOut.add(new JsonPrimitive(time)); - jsonOut.add(new JsonPrimitive(space)); - return jsonOut; - } - - + public JsonElement toJson() { + JsonArray jsonOut = new JsonArray(); + jsonOut.add(new JsonPrimitive(id)); + jsonOut.add(new JsonPrimitive(time)); + jsonOut.add(new JsonPrimitive(space)); + return jsonOut; + } }