Remove unnecessary final modifiers

Change-Id: I32794046d557db051234b33d8b50d5d939bbbf1f
This commit is contained in:
David Ostrovsky
2017-04-02 08:16:35 +02:00
committed by David Pursehouse
parent c8f90f1604
commit eca086a537
22 changed files with 54 additions and 67 deletions

View File

@@ -68,12 +68,7 @@ abstract class ChunkManager {
colorLines(cm, LineClassWhere.WRAP, color, line, line + cnt);
}
void colorLines(
final CodeMirror cm,
final LineClassWhere where,
final String className,
final int start,
final int end) {
void colorLines(CodeMirror cm, LineClassWhere where, String className, int start, int end) {
if (start < end) {
for (int line = start; line < end; line++) {
cm.addLineClass(line, where, className);

View File

@@ -261,7 +261,7 @@ abstract class CommentManager {
abstract SortedMap<Integer, CommentGroup> getMapForNav(DisplaySide side);
Runnable commentNav(final CodeMirror src, final Direction dir) {
Runnable commentNav(CodeMirror src, Direction dir) {
return () -> {
// Every comment appears in both side maps as a linked pair.
// It is only necessary to search one side to find a comment

View File

@@ -637,7 +637,7 @@ abstract class DiffScreen extends Screen {
abstract void setSyntaxHighlighting(boolean b);
void setContext(final int context) {
void setContext(int context) {
operation(
() -> {
skipManager.removeAll();

View File

@@ -442,7 +442,7 @@ public class PreferencesBox extends Composite {
@UiHandler("mode")
void onMode(@SuppressWarnings("unused") ChangeEvent e) {
final String mode = getSelectedMode();
String mode = getSelectedMode();
prefs.syntaxHighlighting(true);
syntaxHighlighting.setValue(true, false);
new ModeInjector()
@@ -525,7 +525,7 @@ public class PreferencesBox extends Composite {
@UiHandler("theme")
void onTheme(@SuppressWarnings("unused") ChangeEvent e) {
final Theme newTheme = getSelectedTheme();
Theme newTheme = getSelectedTheme();
prefs.theme(newTheme);
if (view != null) {
ThemeLoader.loadTheme(

View File

@@ -180,8 +180,8 @@ public class SideBySide extends DiffScreen {
};
}
private void display(final CommentsCollections comments) {
final DiffInfo diff = getDiff();
private void display(CommentsCollections comments) {
DiffInfo diff = getDiff();
setThemeStyles(prefs.theme().isDark());
setShowIntraline(prefs.intralineDifference());
if (prefs.showLineNumbers()) {
@@ -313,8 +313,8 @@ public class SideBySide extends DiffScreen {
}
@Override
Runnable updateActiveLine(final CodeMirror cm) {
final CodeMirror other = otherCm(cm);
Runnable updateActiveLine(CodeMirror cm) {
CodeMirror other = otherCm(cm);
return () -> {
// The rendering of active lines has to be deferred. Reflow
// caused by adding and removing styles chokes Firefox when arrow
@@ -345,13 +345,13 @@ public class SideBySide extends DiffScreen {
};
}
private Runnable moveCursorToSide(final CodeMirror cmSrc, DisplaySide sideDst) {
final CodeMirror cmDst = getCmFromSide(sideDst);
private Runnable moveCursorToSide(CodeMirror cmSrc, DisplaySide sideDst) {
CodeMirror cmDst = getCmFromSide(sideDst);
if (cmDst == cmSrc) {
return () -> {};
}
final DisplaySide sideSrc = cmSrc.side();
DisplaySide sideSrc = cmSrc.side();
return () -> {
if (cmSrc.extras().hasActiveLine()) {
cmDst.setCursor(

View File

@@ -245,7 +245,7 @@ class SideBySideChunkManager extends ChunkManager {
}
@Override
Runnable diffChunkNav(final CodeMirror cm, final Direction dir) {
Runnable diffChunkNav(CodeMirror cm, Direction dir) {
return () -> {
int line = cm.extras().hasActiveLine() ? cm.getLineNumber(cm.extras().activeLine()) : 0;
int res =

View File

@@ -133,7 +133,7 @@ public class Unified extends DiffScreen {
}
@Override
void registerCmEvents(final CodeMirror cm) {
void registerCmEvents(CodeMirror cm) {
super.registerCmEvents(cm);
cm.on(
@@ -164,8 +164,8 @@ public class Unified extends DiffScreen {
};
}
private void display(final CommentsCollections comments) {
final DiffInfo diff = getDiff();
private void display(CommentsCollections comments) {
DiffInfo diff = getDiff();
setThemeStyles(prefs.theme().isDark());
setShowIntraline(prefs.intralineDifference());
if (prefs.showLineNumbers()) {
@@ -307,7 +307,7 @@ public class Unified extends DiffScreen {
}
@Override
Runnable updateActiveLine(final CodeMirror cm) {
Runnable updateActiveLine(CodeMirror cm) {
return () -> {
// The rendering of active lines has to be deferred. Reflow
// caused by adding and removing styles chokes Firefox when arrow

View File

@@ -213,7 +213,7 @@ class UnifiedChunkManager extends ChunkManager {
}
@Override
Runnable diffChunkNav(final CodeMirror cm, final Direction dir) {
Runnable diffChunkNav(CodeMirror cm, Direction dir) {
return () -> {
int line = cm.extras().hasActiveLine() ? cm.getLineNumber(cm.extras().activeLine()) : 0;
int res =

View File

@@ -468,7 +468,7 @@ public class EditScreen extends Screen {
cmEdit.setOption(option, value);
}
void setTheme(final Theme newTheme) {
void setTheme(Theme newTheme) {
cmBase.operation(
() -> {
cmBase.setOption("theme", newTheme.name().toLowerCase());
@@ -494,7 +494,7 @@ public class EditScreen extends Screen {
cmEdit.setOption("lineNumbers", show);
}
void setShowWhitespaceErrors(final boolean show) {
void setShowWhitespaceErrors(boolean show) {
cmBase.operation(
() -> {
cmBase.setOption("showTrailingSpace", show);