Remove 'final' from method signatures across gerrit.

Change-Id: I986a5507aa26ceb28305a7b08991e85238bde0e3
This commit is contained in:
Han-Wen Nienhuys
2017-06-13 18:10:03 +02:00
committed by Edwin Kempin
parent 64e43c24ef
commit b0fb0a7a96
424 changed files with 1381 additions and 1465 deletions

View File

@@ -24,8 +24,7 @@ public class EditList {
private final int aSize;
private final int bSize;
public EditList(
final List<Edit> edits, final int contextLines, final int aSize, final int bSize) {
public EditList(final List<Edit> edits, int contextLines, int aSize, int bSize) {
this.edits = edits;
this.context = contextLines;
this.aSize = aSize;
@@ -65,7 +64,7 @@ public class EditList {
};
}
private int findCombinedEnd(final int i) {
private int findCombinedEnd(int i) {
int end = i + 1;
while (end < edits.size() && (combineA(end) || combineB(end))) {
end++;
@@ -73,14 +72,14 @@ public class EditList {
return end - 1;
}
private boolean combineA(final int i) {
private boolean combineA(int i) {
final Edit s = edits.get(i);
final Edit e = edits.get(i - 1);
// + 1 to prevent '... skipping 1 common line ...' messages.
return s.getBeginA() - e.getEndA() <= 2 * context + 1;
}
private boolean combineB(final int i) {
private boolean combineB(int i) {
final int s = edits.get(i).getBeginB();
final int e = edits.get(i - 1).getEndB();
// + 1 to prevent '... skipping 1 common line ...' messages.
@@ -98,7 +97,7 @@ public class EditList {
private final int aEnd;
private final int bEnd;
private Hunk(final int ci, final int ei) {
private Hunk(int ci, int ei) {
curIdx = ci;
endIdx = ei;
curEdit = edits.get(curIdx);
@@ -172,7 +171,7 @@ public class EditList {
return aCur < aEnd || bCur < bEnd;
}
private boolean in(final Edit edit) {
private boolean in(Edit edit) {
return aCur < edit.getEndA() || bCur < edit.getEndB();
}
}

View File

@@ -31,11 +31,11 @@ public class SparseFileContent {
return size;
}
public void setSize(final int s) {
public void setSize(int s) {
size = s;
}
public String get(final int idx) {
public String get(int idx) {
final String line = getLine(idx);
if (line == null) {
throw new ArrayIndexOutOfBoundsException(idx);
@@ -43,7 +43,7 @@ public class SparseFileContent {
return line;
}
public boolean contains(final int idx) {
public boolean contains(int idx) {
return getLine(idx) != null;
}
@@ -51,7 +51,7 @@ public class SparseFileContent {
return ranges.isEmpty() ? size() : ranges.get(0).base;
}
public int next(final int idx) {
public int next(int idx) {
// Most requests are sequential in nature, fetching the next
// line from the current range, or the immediate next range.
//
@@ -106,7 +106,7 @@ public class SparseFileContent {
return size();
}
private String getLine(final int idx) {
private String getLine(int idx) {
// Most requests are sequential in nature, fetching the next
// line from the current range, or the next range.
//
@@ -148,7 +148,7 @@ public class SparseFileContent {
return null;
}
public void addLine(final int i, final String content) {
public void addLine(int i, String content) {
final Range r;
if (!ranges.isEmpty() && i == last().end()) {
r = last();
@@ -180,14 +180,14 @@ public class SparseFileContent {
protected int base;
protected List<String> lines;
private Range(final int b) {
private Range(int b) {
base = b;
lines = new ArrayList<>();
}
protected Range() {}
private String get(final int i) {
private String get(int i) {
return lines.get(i - base);
}
@@ -195,7 +195,7 @@ public class SparseFileContent {
return base + lines.size();
}
private boolean contains(final int i) {
private boolean contains(int i) {
return base <= i && i < end();
}