From 699e71e76b15081baf746c6ce9c9144f7e5f1ff9 Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 30 Sep 2013 09:30:04 -0400 Subject: Trim trailing whitespace and organize imports Change-Id: I9f91138b20219be6e3c4b28251487df262bff6cc --- .../com/gitblit/utils/GitBlitDiffFormatter.java | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java') diff --git a/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java b/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java index 8ca42854..47ff143a 100644 --- a/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java +++ b/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java @@ -34,9 +34,9 @@ import com.gitblit.utils.DiffUtils.DiffStat; /** * Generates an html snippet of a diff in Gitblit's style, tracks changed paths, * and calculates diff stats. - * + * * @author James Moger - * + * */ public class GitBlitDiffFormatter extends DiffFormatter { @@ -47,22 +47,22 @@ public class GitBlitDiffFormatter extends DiffFormatter { private PathChangeModel currentPath; private int left, right; - + public GitBlitDiffFormatter(OutputStream os, String commitId) { super(os); this.os = os; this.diffStat = new DiffStat(commitId); } - + @Override public void format(DiffEntry ent) throws IOException { currentPath = diffStat.addPath(ent); super.format(ent); } - + /** * Output a hunk header - * + * * @param aStartLine * within first source * @param aEndLine @@ -88,7 +88,7 @@ public class GitBlitDiffFormatter extends DiffFormatter { left = aStartLine + 1; right = bStartLine + 1; } - + protected void writeRange(final char prefix, final int begin, final int cnt) throws IOException { os.write(' '); os.write(prefix); @@ -127,7 +127,7 @@ public class GitBlitDiffFormatter extends DiffFormatter { throws IOException { // update entry diffstat currentPath.update(prefix); - + // output diff os.write("".getBytes()); switch (prefix) { @@ -162,7 +162,7 @@ public class GitBlitDiffFormatter extends DiffFormatter { /** * Workaround function for complex private methods in DiffFormatter. This * sets the html for the diff headers. - * + * * @return */ public String getHtml() { @@ -191,10 +191,10 @@ public class GitBlitDiffFormatter extends DiffFormatter { } else { // use a line = line.substring("diff --git ".length()).trim(); - line = line.substring(line.startsWith("\"a/") ? 3 : 2); + line = line.substring(line.startsWith("\"a/") ? 3 : 2); line = line.substring(0, line.indexOf(" b/") > -1 ? line.indexOf(" b/") : line.indexOf("\"b/")).trim(); } - + if (line.charAt(0) == '"') { line = line.substring(1); } @@ -205,7 +205,7 @@ public class GitBlitDiffFormatter extends DiffFormatter { sb.append("\n"); inFile = false; } - + sb.append(MessageFormat.format("
", line)).append(line).append("
"); sb.append("
"); sb.append(""); @@ -229,7 +229,7 @@ public class GitBlitDiffFormatter extends DiffFormatter { sb.append("
"); return sb.toString(); } - + public DiffStat getDiffStat() { return diffStat; } -- cgit v1.2.3