Remove redundant 'final' modifiers

The 'final' modifier is redundant on private members, and
on members of 'final' classes.

Change-Id: Ib89f00f3c839cc58be26bc58a2acae8d095bcbc7
This commit is contained in:
David Pursehouse 2016-04-12 10:45:26 +09:00
parent cbc52bd366
commit e7996de77f
15 changed files with 68 additions and 68 deletions

View File

@ -246,7 +246,7 @@ public class PostGpgKeys implements RestModifyView<AccountResource, Input> {
}
}
private final AccountExternalId.Key toExtIdKey(byte[] fp) {
private AccountExternalId.Key toExtIdKey(byte[] fp) {
return new AccountExternalId.Key(
AccountExternalId.SCHEME_GPGKEY,
BaseEncoding.base16().encode(fp));

View File

@ -156,7 +156,7 @@ public class GitwebInfo extends JavaScriptObject {
return url() + pattern.replace(p);
}
private final String encode(String segment) {
private String encode(String segment) {
if (type().urlEncode()) {
return URL.encodeQueryString(type().replacePathSeparator(segment));
} else {

View File

@ -30,16 +30,16 @@ public final class NativeString extends JavaScriptObject {
}
}-*/;
static final NativeString wrap(String s) {
static NativeString wrap(String s) {
return wrap0(TYPE, s);
}
private static native NativeString wrap0(JavaScriptObject T, String s)
/*-{ return new T(s) }-*/;
public final native String asString() /*-{ return this.s; }-*/;
public native String asString() /*-{ return this.s; }-*/;
public static final AsyncCallback<NativeString>
public static AsyncCallback<NativeString>
unwrap(final AsyncCallback<String> cb) {
return new AsyncCallback<NativeString>() {
@Override
@ -54,7 +54,7 @@ public final class NativeString extends JavaScriptObject {
};
}
public static final boolean is(JavaScriptObject o) {
public static boolean is(JavaScriptObject o) {
return is(TYPE, o);
}

View File

@ -236,14 +236,14 @@ public class ApiGlue {
}
}
private static final String getPluginName() {
private static String getPluginName() {
if (pluginName != null) {
return pluginName;
}
return PluginName.fromUrl(PluginName.getCallerUrl());
}
private static final void go(String urlOrToken) {
private static void go(String urlOrToken) {
if (urlOrToken.startsWith("http:")
|| urlOrToken.startsWith("https:")
|| urlOrToken.startsWith("//")) {
@ -253,35 +253,35 @@ public class ApiGlue {
}
}
private static final void refresh() {
private static void refresh() {
Gerrit.display(History.getToken());
}
private static final ServerInfo getServerInfo() {
private static ServerInfo getServerInfo() {
return Gerrit.info();
}
private static final AccountInfo getCurrentUser() {
private static AccountInfo getCurrentUser() {
return Gerrit.getUserAccount();
}
private static final GeneralPreferences getUserPreferences() {
private static GeneralPreferences getUserPreferences() {
return Gerrit.getUserPreferences();
}
private static final void refreshUserPreferences() {
private static void refreshUserPreferences() {
Gerrit.refreshUserPreferences();
}
private static final void refreshMenuBar() {
private static void refreshMenuBar() {
Gerrit.refreshMenuBar();
}
private static final boolean isSignedIn() {
private static boolean isSignedIn() {
return Gerrit.isSignedIn();
}
private static final void showError(String message) {
private static void showError(String message) {
new ErrorDialog(message).center();
}

View File

@ -62,19 +62,19 @@ final class HtmlTemplate {
};
}-*/;
private static final String css(String css) {
private static String css(String css) {
String name = DOM.createUniqueId();
StyleInjector.inject("." + name + "{" + css + "}");
return name;
}
private static final String id(IdMap idMap, String key) {
private static String id(IdMap idMap, String key) {
String id = DOM.createUniqueId();
idMap.put(id, key);
return " id='" + id + "'";
}
private static final String html(ReplacementMap opts, String id) {
private static String html(ReplacementMap opts, String id) {
int d = id.indexOf('.');
if (0 < d) {
String name = id.substring(0, d);
@ -84,7 +84,7 @@ final class HtmlTemplate {
return new SafeHtmlBuilder().append(opts.str(id)).asString();
}
private static final Node parseHtml(
private static Node parseHtml(
String html,
IdMap ids,
ReplacementMap opts,

View File

@ -26,14 +26,14 @@ final class Plugin extends JavaScriptObject {
return create(TYPE, url, name);
}
final native String url() /*-{ return this._scriptUrl }-*/;
final native String name() /*-{ return this.name }-*/;
native String url() /*-{ return this._scriptUrl }-*/;
native String name() /*-{ return this.name }-*/;
final native boolean loaded() /*-{ return this._success || this._failure != null }-*/;
final native Exception failure() /*-{ return this._failure }-*/;
final native void failure(Exception e) /*-{ this._failure = e }-*/;
final native boolean success() /*-{ return this._success || false }-*/;
final native void _initialized() /*-{ this._success = true }-*/;
native boolean loaded() /*-{ return this._success || this._failure != null }-*/;
native Exception failure() /*-{ return this._failure }-*/;
native void failure(Exception e) /*-{ this._failure = e }-*/;
native boolean success() /*-{ return this._success || false }-*/;
native void _initialized() /*-{ this._success = true }-*/;
private static native Plugin create(JavaScriptObject T, String u, String n)
/*-{ return new T(u,n) }-*/;

View File

@ -51,7 +51,7 @@ public class QueryScreen extends PagedSingleListScreen implements
protected AsyncCallback<ChangeList> loadCallback() {
return new GerritCallback<ChangeList>() {
@Override
public final void onSuccess(ChangeList result) {
public void onSuccess(ChangeList result) {
if (isAttached()) {
if (result.length() == 1 && isSingleQuery(query)) {
ChangeInfo c = result.get(0);

View File

@ -45,7 +45,7 @@ public class DiffInfo extends JavaScriptObject {
return filterWebLinks(DiffView.UNIFIED_DIFF);
}
private final List<WebLinkInfo> filterWebLinks(DiffView diffView) {
private List<WebLinkInfo> filterWebLinks(DiffView diffView) {
List<WebLinkInfo> filteredDiffWebLinks = new LinkedList<>();
List<DiffWebLinkInfo> allDiffWebLinks = Natives.asList(webLinks());
if (allDiffWebLinks != null) {

View File

@ -69,7 +69,7 @@ public class ThemeLoader {
}
}
private static final ExternalTextResource findTheme(Theme theme) {
private static ExternalTextResource findTheme(Theme theme) {
for (ExternalTextResource r : THEMES) {
if (theme.name().toLowerCase().equals(r.getName())) {
return r;

View File

@ -116,7 +116,7 @@ class Libraries {
return doGet(cfg, name, key, true);
}
private static final String doGet(Config cfg, String name, String key,
private static String doGet(Config cfg, String name, String key,
boolean required) {
String val = cfg.getString("library", name, key);
if ((val == null || val.isEmpty()) && required) {

View File

@ -39,48 +39,48 @@ public final class Plugin extends JavaScriptObject {
}
/** Installed name of the plugin. */
public final String getName() {
public String getName() {
return getPluginName();
}
/** Installed name of the plugin. */
public final native String getPluginName()
public native String getPluginName()
/*-{ return this.getPluginName() }-*/;
/** Navigate the UI to the screen identified by the token. */
public final native void go(String token)
public native void go(String token)
/*-{ return this.go(token) }-*/;
/** Refresh the current UI. */
public final native void refresh()
public native void refresh()
/*-{ return this.refresh() }-*/;
/** Refresh Gerrit's menu bar. */
public final native void refreshMenuBar()
public native void refreshMenuBar()
/*-{ return this.refreshMenuBar() }-*/;
/** @return the preferences of the currently signed in user, the default preferences if not signed in */
public final native GeneralPreferences getUserPreferences()
public native GeneralPreferences getUserPreferences()
/*-{ return this.getUserPreferences() }-*/;
/** Refresh the user preferences of the current user. */
public final native void refreshUserPreferences()
public native void refreshUserPreferences()
/*-{ return this.refreshUserPreferences() }-*/;
/** @return the server info */
public final native ServerInfo getServerInfo()
public native ServerInfo getServerInfo()
/*-{ return this.getServerInfo() }-*/;
/** @return the current user */
public final native AccountInfo getCurrentUser()
public native AccountInfo getCurrentUser()
/*-{ return this.getCurrentUser() }-*/;
/** Check if user is signed in. */
public final native boolean isSignedIn()
public native boolean isSignedIn()
/*-{ return this.isSignedIn() }-*/;
/** Show message in Gerrit's ErrorDialog. */
public final native void showError(String message)
public native void showError(String message)
/*-{ return this.showError(message) }-*/;
/**
@ -90,7 +90,7 @@ public final class Plugin extends JavaScriptObject {
* regular expression matching use {@code screenRegex()} .
* @param entry callback function invoked to create the screen widgets.
*/
public final void screen(String token, Screen.EntryPoint entry) {
public void screen(String token, Screen.EntryPoint entry) {
screen(token, wrap(entry));
}
@ -105,7 +105,7 @@ public final class Plugin extends JavaScriptObject {
* {@code Screen} object passed into the {@code Screen.EntryPoint}.
* @param entry callback function invoked to create the screen widgets.
*/
public final void screenRegex(String regex, Screen.EntryPoint entry) {
public void screenRegex(String regex, Screen.EntryPoint entry) {
screenRegex(regex, wrap(entry));
}
@ -118,7 +118,7 @@ public final class Plugin extends JavaScriptObject {
* @param token literal anchor token appearing after the plugin name.
* @param entry callback function invoked to create the settings screen widgets.
*/
public final void settingsScreen(String token, String menu, Screen.EntryPoint entry) {
public void settingsScreen(String token, String menu, Screen.EntryPoint entry) {
settingsScreen(token, menu, wrap(entry));
}
@ -132,7 +132,7 @@ public final class Plugin extends JavaScriptObject {
* registered.
* @param entry callback function invoked to create the panel widgets.
*/
public final void panel(GerritUiExtensionPoint extensionPoint, Panel.EntryPoint entry) {
public void panel(GerritUiExtensionPoint extensionPoint, Panel.EntryPoint entry) {
panel(extensionPoint.name(), wrap(entry));
}

View File

@ -60,20 +60,20 @@ public class Panel extends SimplePanel {
}
static final class Context extends JavaScriptObject {
final native Element body() /*-{ return this.body }-*/;
native Element body() /*-{ return this.body }-*/;
final native String get(String k) /*-{ return this.p[k]; }-*/;
final native int getInt(String k, int d) /*-{
native String get(String k) /*-{ return this.p[k]; }-*/;
native int getInt(String k, int d) /*-{
return this.p.hasOwnProperty(k) ? this.p[k] : d
}-*/;
final native int getBoolean(String k, boolean d) /*-{
native int getBoolean(String k, boolean d) /*-{
return this.p.hasOwnProperty(k) ? this.p[k] : d
}-*/;
final native JavaScriptObject getObject(String k)
native JavaScriptObject getObject(String k)
/*-{ return this.p[k]; }-*/;
final native void detach(Panel p) /*-{
native void detach(Panel p) /*-{
this.onUnload($entry(function(){
p.@com.google.gwt.user.client.ui.Widget::onDetach()();
}));

View File

@ -62,12 +62,12 @@ public final class Screen extends SimplePanel {
}
static final class Context extends JavaScriptObject {
final native Element body() /*-{ return this.body }-*/;
final native JsArrayString token_match() /*-{ return this.token_match }-*/;
final native void show() /*-{ this.show() }-*/;
final native void setTitle(String t) /*-{ this.setTitle(t) }-*/;
final native void setWindowTitle(String t) /*-{ this.setWindowTitle(t) }-*/;
final native void detach(Screen s) /*-{
native Element body() /*-{ return this.body }-*/;
native JsArrayString token_match() /*-{ return this.token_match }-*/;
native void show() /*-{ this.show() }-*/;
native void setTitle(String t) /*-{ this.setTitle(t) }-*/;
native void setWindowTitle(String t) /*-{ this.setWindowTitle(t) }-*/;
native void detach(Screen s) /*-{
this.onUnload($entry(function(){
s.@com.google.gwt.user.client.ui.Widget::onDetach()();
}));
@ -87,7 +87,7 @@ public final class Screen extends SimplePanel {
}
/** @return the token suffix after {@code "/#/x/plugin-name/"}. */
public final String getToken() {
public String getToken() {
return getToken(0);
}
@ -96,12 +96,12 @@ public final class Screen extends SimplePanel {
* group 0 is the entire token, see {@link #getToken()}.
* @return the token from the regex match group.
*/
public final String getToken(int group) {
public String getToken(int group) {
return ctx.token_match().get(group);
}
/** @return total number of token groups. */
public final int getTokenGroups() {
public int getTokenGroups() {
return ctx.token_match().length();
}
@ -110,7 +110,7 @@ public final class Screen extends SimplePanel {
*
* @param titleText text to display above the widget.
*/
public final void setPageTitle(String titleText) {
public void setPageTitle(String titleText) {
ctx.setTitle(titleText);
}
@ -119,7 +119,7 @@ public final class Screen extends SimplePanel {
*
* @param titleText text to display in the window title bar.
*/
public final void setWindowTitle(String titleText) {
public void setWindowTitle(String titleText) {
ctx.setWindowTitle(titleText);
}
@ -128,13 +128,13 @@ public final class Screen extends SimplePanel {
*
* @param w child containing the content.
*/
public final void show(Widget w) {
public void show(Widget w) {
setWidget(w);
ctx.show();
}
/** Show this screen in the web interface. */
public final void show() {
public void show() {
ctx.show();
}
}

View File

@ -21,11 +21,11 @@ public final class HostPlatform {
private static final boolean win32 = computeWin32();
/** @return true if this JVM is running on a Windows platform. */
public static final boolean isWin32() {
public static boolean isWin32() {
return win32;
}
private static final boolean computeWin32() {
private static boolean computeWin32() {
final String osDotName =
AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override

View File

@ -289,7 +289,7 @@ public abstract class BaseCommand implements Command {
}
}
private final boolean isAdminHighPriorityCommand() {
private boolean isAdminHighPriorityCommand() {
return getClass().getAnnotation(AdminHighPriorityCommand.class) != null;
}