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

@@ -29,7 +29,7 @@ public class ConfirmationDialog extends AutoCenterDialogBox {
private Button okButton;
public ConfirmationDialog(
final String dialogTitle, final SafeHtml message, final ConfirmationCallback callback) {
final String dialogTitle, SafeHtml message, ConfirmationCallback callback) {
super(/* auto hide */ false, /* modal */ true);
setGlassEnabled(true);
setText(dialogTitle);

View File

@@ -170,7 +170,7 @@ public class Dispatcher {
return p.toString();
}
public static String toGroup(final AccountGroup.Id id) {
public static String toGroup(AccountGroup.Id id) {
return ADMIN_GROUPS + id.toString();
}
@@ -293,7 +293,7 @@ public class Dispatcher {
return r;
}
private static void dashboard(final String token) {
private static void dashboard(String token) {
String rest = skip(token);
if (rest.matches("[0-9]+")) {
Gerrit.display(token, new AccountDashboardScreen(Account.Id.parse(rest)));
@@ -319,7 +319,7 @@ public class Dispatcher {
Gerrit.display(token, new NotFoundScreen());
}
private static void projects(final String token) {
private static void projects(String token) {
String rest = skip(token);
int c = rest.indexOf(DASHBOARDS);
if (0 <= c) {
@@ -366,7 +366,7 @@ public class Dispatcher {
Gerrit.display(token, new NotFoundScreen());
}
private static void change(final String token) {
private static void change(String token) {
String rest = skip(token);
int c = rest.lastIndexOf(',');
String panel = null;
@@ -456,7 +456,7 @@ public class Dispatcher {
return new PatchSet.Id(id, psIdStr.equals("edit") ? 0 : Integer.parseInt(psIdStr));
}
private static void extension(final String token) {
private static void extension(String token) {
ExtensionScreen view = new ExtensionScreen(skip(token));
if (view.isFound()) {
Gerrit.display(token, view);
@@ -533,7 +533,7 @@ public class Dispatcher {
});
}
private static void codemirrorForEdit(final String token, final Patch.Key id, final int line) {
private static void codemirrorForEdit(String token, Patch.Key id, int line) {
GWT.runAsync(
new AsyncSplit(token) {
@Override
@@ -839,7 +839,7 @@ public class Dispatcher {
}
}
private static void docSearch(final String token) {
private static void docSearch(String token) {
GWT.runAsync(
new AsyncSplit(token) {
@Override

View File

@@ -86,19 +86,19 @@ public class ErrorDialog extends PopupPanel {
}
/** Create a dialog box to show a single message string. */
public ErrorDialog(final String message) {
public ErrorDialog(String message) {
this();
body.add(new Label(message));
}
/** Create a dialog box to show a single message string. */
public ErrorDialog(final SafeHtml message) {
public ErrorDialog(SafeHtml message) {
this();
body.add(message.toBlockWidget());
}
/** Create a dialog box to nicely format an exception. */
public ErrorDialog(final Throwable what) {
public ErrorDialog(Throwable what) {
this();
String hdr;
@@ -151,7 +151,7 @@ public class ErrorDialog extends PopupPanel {
}
}
public ErrorDialog setText(final String t) {
public ErrorDialog setText(String t) {
text.setText(t);
return this;
}

View File

@@ -170,7 +170,7 @@ public class Gerrit implements EntryPoint {
*
* @param token location to parse, load, and render.
*/
public static void display(final String token) {
public static void display(String token) {
if (body.getView() == null || !body.getView().displayToken(token)) {
dispatcher.display(token);
updateUiLink(token);
@@ -191,7 +191,7 @@ public class Gerrit implements EntryPoint {
* @param token location that refers to {@code view}.
* @param view the view to load.
*/
public static void display(final String token, final Screen view) {
public static void display(String token, Screen view) {
if (view.isRequiresSignIn() && !isSignedIn()) {
doSignIn(token);
} else {
@@ -217,7 +217,7 @@ public class Gerrit implements EntryPoint {
*
* @param token new location that is already visible.
*/
public static void updateImpl(final String token) {
public static void updateImpl(String token) {
History.newItem(token, false);
dispatchHistoryHooks(token);
}
@@ -226,7 +226,7 @@ public class Gerrit implements EntryPoint {
searchPanel.setText(query);
}
public static void setWindowTitle(final Screen screen, final String text) {
public static void setWindowTitle(Screen screen, String text) {
if (screen == body.getView()) {
if (text == null || text.length() == 0) {
Window.setTitle(M.windowTitle1(myHost));
@@ -428,7 +428,7 @@ public class Gerrit implements EntryPoint {
}
@Override
public String decode(final String e) {
public String decode(String e) {
return URL.decodeQueryString(e);
}
@@ -476,7 +476,7 @@ public class Gerrit implements EntryPoint {
cbg.addFinal(
new GerritCallback<HostPageData>() {
@Override
public void onSuccess(final HostPageData result) {
public void onSuccess(HostPageData result) {
Document.get().getElementById("gerrit_hostpagedata").removeFromParent();
myTheme = result.theme;
isNoteDbEnabled = result.isNoteDbEnabled;
@@ -957,7 +957,7 @@ public class Gerrit implements EntryPoint {
return docSearch;
}
private static void getDocIndex(final AsyncCallback<DocInfo> cb) {
private static void getDocIndex(AsyncCallback<DocInfo> cb) {
RequestBuilder req = new RequestBuilder(RequestBuilder.HEAD, GWT.getHostPageBaseURL() + INDEX);
req.setCallback(
new RequestCallback() {
@@ -1031,22 +1031,21 @@ public class Gerrit implements EntryPoint {
menuRight.add(fp);
}
private static Anchor anchor(final String text, final String to) {
private static Anchor anchor(String text, String to) {
final Anchor a = new Anchor(text, to);
a.setStyleName(RESOURCES.css().menuItem());
Roles.getMenuitemRole().set(a.getElement());
return a;
}
private static LinkMenuItem addLink(
final LinkMenuBar m, final String text, final String historyToken) {
private static LinkMenuItem addLink(final LinkMenuBar m, String text, String historyToken) {
LinkMenuItem i = new LinkMenuItem(text, historyToken);
m.addItem(i);
return i;
}
private static void insertLink(
final LinkMenuBar m, final String text, final String historyToken, final int beforeIndex) {
final LinkMenuBar m, String text, String historyToken, int beforeIndex) {
m.insertItem(new LinkMenuItem(text, historyToken), beforeIndex);
}
@@ -1090,7 +1089,7 @@ public class Gerrit implements EntryPoint {
return i;
}
private static void addDocLink(final LinkMenuBar m, final String text, final String href) {
private static void addDocLink(LinkMenuBar m, String text, String href) {
final Anchor atag = anchor(text, docUrl + href);
atag.setTarget("_blank");
m.add(atag);

View File

@@ -37,27 +37,27 @@ public class JumpKeys {
}
}
static void register(final Widget body) {
static void register(Widget body) {
final KeyCommandSet jumps = new KeyCommandSet();
jumps.add(
new KeyCommand(0, 'o', Gerrit.C.jumpAllOpen()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:open"));
}
});
jumps.add(
new KeyCommand(0, 'm', Gerrit.C.jumpAllMerged()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:merged"));
}
});
jumps.add(
new KeyCommand(0, 'a', Gerrit.C.jumpAllAbandoned()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:abandoned"));
}
});
@@ -66,35 +66,35 @@ public class JumpKeys {
jumps.add(
new KeyCommand(0, 'i', Gerrit.C.jumpMine()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.MINE);
}
});
jumps.add(
new KeyCommand(0, 'd', Gerrit.C.jumpMineDrafts()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("owner:self is:draft"));
}
});
jumps.add(
new KeyCommand(0, 'c', Gerrit.C.jumpMineDraftComments()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("has:draft"));
}
});
jumps.add(
new KeyCommand(0, 'w', Gerrit.C.jumpMineWatched()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("is:watched status:open"));
}
});
jumps.add(
new KeyCommand(0, 's', Gerrit.C.jumpMineStarred()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("is:starred"));
}
});

View File

@@ -28,7 +28,7 @@ public class RpcStatus implements RpcStartHandler, RpcCompleteHandler {
private static int hideDepth;
/** Execute code, hiding the RPCs they execute from being shown visually. */
public static void hide(final Runnable run) {
public static void hide(Runnable run) {
try {
hideDepth++;
run.run();
@@ -49,7 +49,7 @@ public class RpcStatus implements RpcStartHandler, RpcCompleteHandler {
}
@Override
public void onRpcStart(final RpcStartEvent event) {
public void onRpcStart(RpcStartEvent event) {
onRpcStart();
}
@@ -62,7 +62,7 @@ public class RpcStatus implements RpcStartHandler, RpcCompleteHandler {
}
@Override
public void onRpcComplete(final RpcCompleteEvent event) {
public void onRpcComplete(RpcCompleteEvent event) {
onRpcComplete();
}

View File

@@ -48,7 +48,7 @@ class SearchPanel extends Composite {
searchBox.addKeyPressHandler(
new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
if (!suggestionDisplay.isSuggestionSelected) {
doSearch();
@@ -92,7 +92,7 @@ class SearchPanel extends Composite {
body.add(searchButton);
}
void setText(final String query) {
void setText(String query) {
searchBox.setText(query);
}
@@ -105,7 +105,7 @@ class SearchPanel extends Composite {
this,
new KeyCommand(0, '/', Gerrit.C.keySearch()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
event.preventDefault();
searchBox.setFocus(true);
searchBox.selectAll();

View File

@@ -44,13 +44,12 @@ public class SearchSuggestOracle extends HighlightSuggestOracle {
"cc:"),
new AccountSuggestOracle() {
@Override
public void onRequestSuggestions(final Request request, final Callback done) {
public void onRequestSuggestions(Request request, Callback done) {
super.onRequestSuggestions(
request,
new Callback() {
@Override
public void onSuggestionsReady(
final Request request, final Response response) {
public void onSuggestionsReady(final Request request, Response response) {
if ("self".startsWith(request.getQuery())) {
final ArrayList<SuggestOracle.Suggestion> r =
new ArrayList<>(response.getSuggestions().size() + 1);
@@ -192,7 +191,7 @@ public class SearchSuggestOracle extends HighlightSuggestOracle {
return;
}
for (final ParamSuggester ps : paramSuggester) {
for (ParamSuggester ps : paramSuggester) {
if (ps.applicable(lastWord)) {
ps.suggest(lastWord, request, done);
return;
@@ -211,7 +210,7 @@ public class SearchSuggestOracle extends HighlightSuggestOracle {
done.onSuggestionsReady(request, new Response(r));
}
private String getLastWord(final String query) {
private String getLastWord(String query) {
final int lastSpace = query.lastIndexOf(' ');
if (lastSpace == query.length() - 1) {
return null;
@@ -223,7 +222,7 @@ public class SearchSuggestOracle extends HighlightSuggestOracle {
}
@Override
protected String getQueryPattern(final String query) {
protected String getQueryPattern(String query) {
return super.getQueryPattern(getLastWord(query));
}
@@ -258,18 +257,18 @@ public class SearchSuggestOracle extends HighlightSuggestOracle {
private final List<String> operators;
private final SuggestOracle parameterSuggestionOracle;
ParamSuggester(final List<String> operators, final SuggestOracle parameterSuggestionOracle) {
ParamSuggester(List<String> operators, SuggestOracle parameterSuggestionOracle) {
this.operators = operators;
this.parameterSuggestionOracle = parameterSuggestionOracle;
}
boolean applicable(final String query) {
boolean applicable(String query) {
final String operator = getApplicableOperator(query, operators);
return operator != null && query.length() > operator.length();
}
private String getApplicableOperator(final String lastWord, final List<String> operators) {
for (final String operator : operators) {
private String getApplicableOperator(String lastWord, List<String> operators) {
for (String operator : operators) {
if (lastWord.startsWith(operator)) {
return operator;
}
@@ -277,17 +276,17 @@ public class SearchSuggestOracle extends HighlightSuggestOracle {
return null;
}
void suggest(final String lastWord, final Request request, final Callback done) {
void suggest(String lastWord, Request request, Callback done) {
final String operator = getApplicableOperator(lastWord, operators);
parameterSuggestionOracle.requestSuggestions(
new Request(lastWord.substring(operator.length()), request.getLimit()),
new Callback() {
@Override
public void onSuggestionsReady(final Request req, final Response response) {
public void onSuggestionsReady(Request req, Response response) {
final String query = request.getQuery();
final List<SearchSuggestOracle.Suggestion> r =
new ArrayList<>(response.getSuggestions().size());
for (final SearchSuggestOracle.Suggestion s : response.getSuggestions()) {
for (SearchSuggestOracle.Suggestion s : response.getSuggestions()) {
r.add(
new SearchSuggestion(
s.getDisplayString(),
@@ -298,7 +297,7 @@ public class SearchSuggestOracle extends HighlightSuggestOracle {
done.onSuggestionsReady(request, new Response(r));
}
private String quoteIfNeeded(final String s) {
private String quoteIfNeeded(String s) {
if (!s.matches("^\\S*$")) {
return "\"" + s + "\"";
}

View File

@@ -189,7 +189,7 @@ public class StringListPanel extends FlowPanel implements HasEnabled {
return v;
}
private void populate(final int row, List<String> values) {
private void populate(int row, List<String> values) {
FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().leftMostCell());

View File

@@ -31,7 +31,7 @@ public class AccessMap extends NativeMap<ProjectAccessInfo> {
api.get(NativeMap.copyKeysIntoChildren(callback));
}
public static void get(final Project.NameKey project, final AsyncCallback<ProjectAccessInfo> cb) {
public static void get(Project.NameKey project, AsyncCallback<ProjectAccessInfo> cb) {
get(
Collections.singleton(project),
new AsyncCallback<AccessMap>() {

View File

@@ -91,7 +91,7 @@ class ContactPanelShort extends Composite {
registerNewEmail.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doRegisterNewEmail();
}
});
@@ -148,7 +148,7 @@ class ContactPanelShort extends Composite {
save.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doSave();
}
});
@@ -156,7 +156,7 @@ class ContactPanelShort extends Composite {
emailPick.addChangeHandler(
new ChangeHandler() {
@Override
public void onChange(final ChangeEvent event) {
public void onChange(ChangeEvent event) {
final int idx = emailPick.getSelectedIndex();
final String v = 0 <= idx ? emailPick.getValue(idx) : null;
if (Util.C.buttonOpenRegisterNewEmail().equals(v)) {
@@ -249,7 +249,7 @@ class ContactPanelShort extends Composite {
void display() {}
protected void row(final Grid info, final int row, final String name, final Widget field) {
protected void row(Grid info, int row, String name, Widget field) {
info.setText(row, labelIdx, name);
info.setWidget(row, fieldIdx, field);
info.getCellFormatter().addStyleName(row, 0, Gerrit.RESOURCES.css().header());
@@ -279,7 +279,7 @@ class ContactPanelShort extends Composite {
form.addSubmitHandler(
new FormPanel.SubmitHandler() {
@Override
public void onSubmit(final SubmitEvent event) {
public void onSubmit(SubmitEvent event) {
event.cancel();
final String addr = inEmail.getText().trim();
if (!addr.contains("@")) {
@@ -310,7 +310,7 @@ class ContactPanelShort extends Composite {
}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
inEmail.setEnabled(true);
register.setEnabled(true);
if (caught.getMessage().startsWith(EmailException.MESSAGE)) {
@@ -331,7 +331,7 @@ class ContactPanelShort extends Composite {
register.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
form.submit();
}
});

View File

@@ -49,7 +49,7 @@ public class MyIdentitiesScreen extends SettingsScreen {
deleteIdentity.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
identites.deleteChecked();
}
});
@@ -60,7 +60,7 @@ public class MyIdentitiesScreen extends SettingsScreen {
linkIdentity.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
Location.assign(Gerrit.loginRedirect(History.getToken()) + "?link");
}
});
@@ -167,7 +167,7 @@ public class MyIdentitiesScreen extends SettingsScreen {
deleteIdentity.setEnabled(on);
}
void display(final JsArray<ExternalIdInfo> results) {
void display(JsArray<ExternalIdInfo> results) {
List<ExternalIdInfo> idList = Natives.asList(results);
Collections.sort(idList);
@@ -175,13 +175,13 @@ public class MyIdentitiesScreen extends SettingsScreen {
table.removeRow(table.getRowCount() - 1);
}
for (final ExternalIdInfo k : idList) {
for (ExternalIdInfo k : idList) {
addOneId(k);
}
updateDeleteButton();
}
void addOneId(final ExternalIdInfo k) {
void addOneId(ExternalIdInfo k) {
if (k.isUsername()) {
// Don't display the username as an identity here.
return;

View File

@@ -111,7 +111,7 @@ public class MyOAuthTokenScreen extends SettingsScreen {
});
}
private void display(final GeneralPreferences prefs) {
private void display(GeneralPreferences prefs) {
AccountApi.self()
.view("oauthtoken")
.get(

View File

@@ -104,7 +104,7 @@ public class MyPasswordScreen extends SettingsScreen {
}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
if (RestApi.isNotFound(caught)) {
Gerrit.getUserAccount().username(null);
display();
@@ -121,7 +121,7 @@ public class MyPasswordScreen extends SettingsScreen {
enableUI(true);
}
private void row(final Grid info, final int row, final String name, final Widget field) {
private void row(Grid info, int row, String name, Widget field) {
final CellFormatter fmt = info.getCellFormatter();
if (LocaleInfo.getCurrentLocale().isRTL()) {
info.setText(row, 1, name);
@@ -146,7 +146,7 @@ public class MyPasswordScreen extends SettingsScreen {
}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
enableUI(true);
}
});

View File

@@ -74,7 +74,7 @@ public class MyPreferencesScreen extends SettingsScreen {
showSiteHeader = new CheckBox(Util.C.showSiteHeader());
useFlashClipboard = new CheckBox(Util.C.useFlashClipboard());
maximumPageSize = new ListBox();
for (final int v : PAGESIZE_CHOICES) {
for (int v : PAGESIZE_CHOICES) {
maximumPageSize.addItem(Util.M.rowsPerPage(v), String.valueOf(v));
}
@@ -241,7 +241,7 @@ public class MyPreferencesScreen extends SettingsScreen {
save.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doSave();
}
});
@@ -290,7 +290,7 @@ public class MyPreferencesScreen extends SettingsScreen {
});
}
private void enable(final boolean on) {
private void enable(boolean on) {
showSiteHeader.setEnabled(on);
useFlashClipboard.setEnabled(on);
maximumPageSize.setEnabled(on);
@@ -351,19 +351,18 @@ public class MyPreferencesScreen extends SettingsScreen {
myMenus.display(values);
}
private void setListBox(final ListBox f, final int defaultValue, final int currentValue) {
private void setListBox(ListBox f, int defaultValue, int currentValue) {
setListBox(f, String.valueOf(defaultValue), String.valueOf(currentValue));
}
private <T extends Enum<?>> void setListBox(
final ListBox f, final T defaultValue, final T currentValue) {
private <T extends Enum<?>> void setListBox(final ListBox f, T defaultValue, T currentValue) {
setListBox(
f,
defaultValue != null ? defaultValue.name() : "",
currentValue != null ? currentValue.name() : "");
}
private void setListBox(final ListBox f, final String defaultValue, final String currentValue) {
private void setListBox(ListBox f, String defaultValue, String currentValue) {
final int n = f.getItemCount();
for (int i = 0; i < n; i++) {
if (f.getValue(i).equals(currentValue)) {
@@ -376,7 +375,7 @@ public class MyPreferencesScreen extends SettingsScreen {
}
}
private int getListBox(final ListBox f, final int defaultValue) {
private int getListBox(ListBox f, int defaultValue) {
final int idx = f.getSelectedIndex();
if (0 <= idx) {
return Short.parseShort(f.getValue(idx));
@@ -384,7 +383,7 @@ public class MyPreferencesScreen extends SettingsScreen {
return defaultValue;
}
private <T extends Enum<?>> T getListBox(final ListBox f, final T defaultValue, T[] all) {
private <T extends Enum<?>> T getListBox(ListBox f, T defaultValue, T[] all) {
final int idx = f.getSelectedIndex();
if (0 <= idx) {
String v = f.getValue(idx);

View File

@@ -91,7 +91,7 @@ public class MyProfileScreen extends SettingsScreen {
display();
}
private void infoRow(final int row, final String name) {
private void infoRow(int row, String name) {
info.setText(row, labelIdx, name);
info.getCellFormatter().addStyleName(row, 0, Gerrit.RESOURCES.css().header());
}

View File

@@ -129,7 +129,7 @@ public class MyWatchedProjectsScreen extends SettingsScreen {
addNew.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doAddNew();
}
});
@@ -138,7 +138,7 @@ public class MyWatchedProjectsScreen extends SettingsScreen {
browse.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
int top = grid.getAbsoluteTop() - 50; // under page header
// Try to place it to the right of everything else, but not
// right justified
@@ -158,7 +158,7 @@ public class MyWatchedProjectsScreen extends SettingsScreen {
delSel.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
watchesTab.deleteChecked();
}
});

View File

@@ -97,7 +97,7 @@ public class MyWatchesTable extends FancyFlexTable<ProjectWatchInfo> {
return infos;
}
public void insertWatch(final ProjectWatchInfo k) {
public void insertWatch(ProjectWatchInfo k) {
final String newName = k.project();
int row = 1;
for (; row < table.getRowCount(); row++) {
@@ -112,7 +112,7 @@ public class MyWatchesTable extends FancyFlexTable<ProjectWatchInfo> {
populate(row, k);
}
public void display(final JsArray<ProjectWatchInfo> result) {
public void display(JsArray<ProjectWatchInfo> result) {
while (2 < table.getRowCount()) {
table.removeRow(table.getRowCount() - 1);
}
@@ -125,7 +125,7 @@ public class MyWatchesTable extends FancyFlexTable<ProjectWatchInfo> {
}
}
protected void populate(final int row, final ProjectWatchInfo info) {
protected void populate(int row, ProjectWatchInfo info) {
final FlowPanel fp = new FlowPanel();
fp.add(new ProjectLink(info.project(), new Project.NameKey(info.project())));
if (info.filter() != null) {
@@ -156,13 +156,13 @@ public class MyWatchesTable extends FancyFlexTable<ProjectWatchInfo> {
}
protected void addNotifyButton(
final ProjectWatchInfo.Type type, final ProjectWatchInfo info, final int row, final int col) {
final ProjectWatchInfo.Type type, ProjectWatchInfo info, int row, int col) {
final CheckBox cbox = new CheckBox();
cbox.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
final Boolean oldVal = info.notify(type);
info.notify(type, cbox.getValue());
cbox.setEnabled(false);

View File

@@ -66,7 +66,7 @@ public class NewAgreementScreen extends AccountScreen {
this(null);
}
public NewAgreementScreen(final String token) {
public NewAgreementScreen(String token) {
nextToken = token != null ? token : PageLinks.SETTINGS_AGREEMENTS;
}
@@ -122,7 +122,7 @@ public class NewAgreementScreen extends AccountScreen {
submit.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doSign();
}
});
@@ -156,7 +156,7 @@ public class NewAgreementScreen extends AccountScreen {
}
radios.add(hdr);
for (final AgreementInfo cla : available) {
for (AgreementInfo cla : available) {
final RadioButton r = new RadioButton("cla_id", cla.name());
r.addStyleName(Gerrit.RESOURCES.css().contributorAgreementButton());
radios.add(r);
@@ -170,7 +170,7 @@ public class NewAgreementScreen extends AccountScreen {
r.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
showCLA(cla);
}
});

View File

@@ -31,7 +31,7 @@ import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
public class RegisterScreen extends AccountScreen {
private final String nextToken;
public RegisterScreen(final String next) {
public RegisterScreen(String next) {
nextToken = next;
}

View File

@@ -24,7 +24,7 @@ import com.google.gwt.user.client.ui.Label;
import com.google.gwtexpui.clippy.client.CopyableLabel;
class SshHostKeyPanel extends Composite {
SshHostKeyPanel(final SshHostKey info) {
SshHostKeyPanel(SshHostKey info) {
final FlowPanel body = new FlowPanel();
body.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanel());
body.add(new SmallHeading(Util.C.sshHostKeyTitle()));

View File

@@ -68,7 +68,7 @@ class SshPanel extends Composite {
showAddKeyBlock.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
showAddKeyBlock(true);
}
});
@@ -82,7 +82,7 @@ class SshPanel extends Composite {
deleteKey.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
keys.deleteChecked();
}
});
@@ -114,7 +114,7 @@ class SshPanel extends Composite {
clearNew.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
addTxt.setText("");
addTxt.setFocus(true);
}
@@ -125,7 +125,7 @@ class SshPanel extends Composite {
addNew.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doAddNew();
}
});
@@ -135,7 +135,7 @@ class SshPanel extends Composite {
closeAddKeyBlock.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
showAddKeyBlock(false);
}
});
@@ -151,7 +151,7 @@ class SshPanel extends Composite {
initWidget(body);
}
void setKeyTableVisible(final boolean on) {
void setKeyTableVisible(boolean on) {
keys.setVisible(on);
deleteKey.setVisible(on);
closeAddKeyBlock.setVisible(on);
@@ -166,7 +166,7 @@ class SshPanel extends Composite {
txt,
new GerritCallback<SshKeyInfo>() {
@Override
public void onSuccess(final SshKeyInfo k) {
public void onSuccess(SshKeyInfo k) {
addNew.setEnabled(true);
addTxt.setText("");
keys.addOneKey(k);
@@ -178,7 +178,7 @@ class SshPanel extends Composite {
}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
addNew.setEnabled(true);
if (isInvalidSshKey(caught)) {
@@ -189,7 +189,7 @@ class SshPanel extends Composite {
}
}
private boolean isInvalidSshKey(final Throwable caught) {
private boolean isInvalidSshKey(Throwable caught) {
if (caught instanceof InvalidSshKeyException) {
return true;
}
@@ -207,9 +207,9 @@ class SshPanel extends Composite {
Gerrit.SYSTEM_SVC.daemonHostKeys(
new GerritCallback<List<SshHostKey>>() {
@Override
public void onSuccess(final List<SshHostKey> result) {
public void onSuccess(List<SshHostKey> result) {
serverKeys.clear();
for (final SshHostKey keyInfo : result) {
for (SshHostKey keyInfo : result) {
serverKeys.add(new SshHostKeyPanel(keyInfo));
}
if (++loadCount == 2) {
@@ -238,7 +238,7 @@ class SshPanel extends Composite {
void display() {}
private void showAddKeyBlock(final boolean show) {
private void showAddKeyBlock(boolean show) {
showAddKeyBlock.setVisible(!show);
addKeyBlock.setVisible(show);
}
@@ -312,7 +312,7 @@ class SshPanel extends Composite {
}
}
void display(final List<SshKeyInfo> result) {
void display(List<SshKeyInfo> result) {
if (result.isEmpty()) {
setKeyTableVisible(false);
showAddKeyBlock(true);
@@ -320,7 +320,7 @@ class SshPanel extends Composite {
while (1 < table.getRowCount()) {
table.removeRow(table.getRowCount() - 1);
}
for (final SshKeyInfo k : result) {
for (SshKeyInfo k : result) {
addOneKey(k);
}
setKeyTableVisible(true);
@@ -328,7 +328,7 @@ class SshPanel extends Composite {
}
}
void addOneKey(final SshKeyInfo k) {
void addOneKey(SshKeyInfo k) {
final FlexCellFormatter fmt = table.getFlexCellFormatter();
final int row = table.getRowCount();
table.insertRow(row);
@@ -378,7 +378,7 @@ class SshPanel extends Composite {
}
}
static String elide(final String s, final int len) {
static String elide(String s, int len) {
if (s == null || s.length() < len || len <= 10) {
return s;
}

View File

@@ -75,7 +75,7 @@ class UsernameField extends Composite {
setUserName.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
confirmSetUserName();
}
});
@@ -143,14 +143,14 @@ class UsernameField extends Composite {
});
}
private void enableUI(final boolean on) {
private void enableUI(boolean on) {
userNameTxt.setEnabled(on);
setUserName.setEnabled(on);
}
private static final class UserNameValidator implements KeyPressHandler {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
final char code = event.getCharCode();
final int nativeCode = event.getNativeEvent().getKeyCode();
switch (nativeCode) {

View File

@@ -24,7 +24,7 @@ import com.google.gerrit.common.PageLinks;
public class ValidateEmailScreen extends AccountScreen {
private final String magicToken;
public ValidateEmailScreen(final String magicToken) {
public ValidateEmailScreen(String magicToken) {
this.magicToken = magicToken;
}
@@ -41,7 +41,7 @@ public class ValidateEmailScreen extends AccountScreen {
magicToken,
new ScreenLoadCallback<VoidResult>(this) {
@Override
protected void preDisplay(final VoidResult result) {}
protected void preDisplay(VoidResult result) {}
@Override
protected void postDisplay() {

View File

@@ -204,7 +204,7 @@ public class AccessSectionEditor extends Composite
}
}
void setEditing(final boolean editing) {
void setEditing(boolean editing) {
this.editing = editing;
}
@@ -236,7 +236,7 @@ public class AccessSectionEditor extends Composite
}
}
private void addPermission(final String permissionName, final List<String> permissionList) {
private void addPermission(String permissionName, List<String> permissionList) {
if (value.getPermission(permissionName) != null) {
return;
}

View File

@@ -48,7 +48,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
private CheckBox visibleToAllCheckBox;
private Button saveGroupOptions;
public AccountGroupInfoScreen(final GroupInfo toShow, final String token) {
public AccountGroupInfoScreen(GroupInfo toShow, String token) {
super(toShow, token);
}
@@ -62,7 +62,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
initGroupOptions();
}
private void enableForm(final boolean canModify) {
private void enableForm(boolean canModify) {
groupNameTxt.setEnabled(canModify);
ownerTxt.setEnabled(canModify);
descTxt.setEnabled(canModify);
@@ -91,14 +91,14 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
saveName.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
final String newName = groupNameTxt.getText().trim();
GroupApi.renameGroup(
getGroupUUID(),
newName,
new GerritCallback<com.google.gerrit.client.VoidResult>() {
@Override
public void onSuccess(final com.google.gerrit.client.VoidResult result) {
public void onSuccess(com.google.gerrit.client.VoidResult result) {
saveName.setEnabled(false);
setPageTitle(AdminMessages.I.group(newName));
groupNameTxt.setText(newName);
@@ -129,7 +129,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
saveOwner.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
final String newOwner = ownerTxt.getText().trim();
if (newOwner.length() > 0) {
AccountGroup.UUID ownerUuid = accountGroupOracle.getUUID(newOwner);
@@ -139,7 +139,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
ownerId,
new GerritCallback<GroupInfo>() {
@Override
public void onSuccess(final GroupInfo result) {
public void onSuccess(GroupInfo result) {
updateOwnerGroup(result);
saveOwner.setEnabled(false);
}
@@ -166,14 +166,14 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
saveDesc.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
final String txt = descTxt.getText().trim();
GroupApi.setGroupDescription(
getGroupUUID(),
txt,
new GerritCallback<VoidResult>() {
@Override
public void onSuccess(final VoidResult result) {
public void onSuccess(VoidResult result) {
saveDesc.setEnabled(false);
}
});
@@ -199,13 +199,13 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
saveGroupOptions.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
GroupApi.setGroupOptions(
getGroupUUID(),
visibleToAllCheckBox.getValue(),
new GerritCallback<VoidResult>() {
@Override
public void onSuccess(final VoidResult result) {
public void onSuccess(VoidResult result) {
saveGroupOptions.setEnabled(false);
}
});
@@ -220,7 +220,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
}
@Override
protected void display(final GroupInfo group, final boolean canModify) {
protected void display(GroupInfo group, boolean canModify) {
groupUUIDLabel.setText(group.getGroupUUID().get());
groupNameTxt.setText(group.name());
ownerTxt.setText(

View File

@@ -59,7 +59,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
private FlowPanel noMembersInfo;
private AccountGroupSuggestOracle accountGroupSuggestOracle;
public AccountGroupMembersScreen(final GroupInfo toShow, final String token) {
public AccountGroupMembersScreen(GroupInfo toShow, String token) {
super(toShow, token);
}
@@ -71,7 +71,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
initNoMembersInfo();
}
private void enableForm(final boolean canModify) {
private void enableForm(boolean canModify) {
addMemberBox.setEnabled(canModify);
members.setEnabled(canModify);
addIncludeBox.setEnabled(canModify);
@@ -88,7 +88,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
addMemberBox.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doAddNewMember();
}
});
@@ -100,7 +100,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
delMember.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
members.deleteChecked();
}
});
@@ -124,7 +124,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
addIncludeBox.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doAddNewInclude();
}
});
@@ -136,7 +136,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
delInclude.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
includes.deleteChecked();
}
});
@@ -157,7 +157,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
}
@Override
protected void display(final GroupInfo group, final boolean canModify) {
protected void display(GroupInfo group, boolean canModify) {
if (AccountGroup.isInternalGroup(group.getGroupUUID())) {
members.display(Natives.asList(group.members()));
includes.display(Natives.asList(group.includes()));
@@ -184,14 +184,14 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
nameEmail,
new GerritCallback<AccountInfo>() {
@Override
public void onSuccess(final AccountInfo memberInfo) {
public void onSuccess(AccountInfo memberInfo) {
addMemberBox.setEnabled(true);
addMemberBox.setText("");
members.insert(memberInfo);
}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
addMemberBox.setEnabled(true);
super.onFailure(caught);
}
@@ -215,14 +215,14 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
uuid.get(),
new GerritCallback<GroupInfo>() {
@Override
public void onSuccess(final GroupInfo result) {
public void onSuccess(GroupInfo result) {
addIncludeBox.setEnabled(true);
addIncludeBox.setText("");
includes.insert(result);
}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
addIncludeBox.setEnabled(true);
super.onFailure(caught);
}
@@ -242,7 +242,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
}
void setEnabled(final boolean enabled) {
void setEnabled(boolean enabled) {
this.enabled = enabled;
for (int row = 1; row < table.getRowCount(); row++) {
final AccountInfo i = getRowItem(row);
@@ -266,7 +266,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
ids,
new GerritCallback<VoidResult>() {
@Override
public void onSuccess(final VoidResult result) {
public void onSuccess(VoidResult result) {
for (int row = 1; row < table.getRowCount(); ) {
final AccountInfo i = getRowItem(row);
if (i != null && ids.contains(i._accountId())) {
@@ -280,12 +280,12 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
}
}
void display(final List<AccountInfo> result) {
void display(List<AccountInfo> result) {
while (1 < table.getRowCount()) {
table.removeRow(table.getRowCount() - 1);
}
for (final AccountInfo i : result) {
for (AccountInfo i : result) {
final int row = table.getRowCount();
table.insertRow(row);
applyDataRowStyle(row);
@@ -323,7 +323,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
}
}
void populate(final int row, final AccountInfo i) {
void populate(int row, AccountInfo i) {
CheckBox checkBox = new CheckBox();
table.setWidget(row, 1, checkBox);
checkBox.setEnabled(enabled);
@@ -352,7 +352,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
}
void setEnabled(final boolean enabled) {
void setEnabled(boolean enabled) {
this.enabled = enabled;
for (int row = 1; row < table.getRowCount(); row++) {
final GroupInfo i = getRowItem(row);
@@ -376,7 +376,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
ids,
new GerritCallback<VoidResult>() {
@Override
public void onSuccess(final VoidResult result) {
public void onSuccess(VoidResult result) {
for (int row = 1; row < table.getRowCount(); ) {
final GroupInfo i = getRowItem(row);
if (i != null && ids.contains(i.getGroupUUID())) {
@@ -395,7 +395,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
table.removeRow(table.getRowCount() - 1);
}
for (final GroupInfo i : list) {
for (GroupInfo i : list) {
final int row = table.getRowCount();
table.insertRow(row);
applyDataRowStyle(row);
@@ -427,7 +427,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
}
}
void populate(final int row, final GroupInfo i) {
void populate(int row, GroupInfo i) {
final FlexCellFormatter fmt = table.getFlexCellFormatter();
AccountGroup.UUID uuid = i.getGroupUUID();

View File

@@ -32,7 +32,7 @@ public abstract class AccountGroupScreen extends MenuScreen {
private final String membersTabToken;
private final String auditLogTabToken;
public AccountGroupScreen(final GroupInfo toShow, final String token) {
public AccountGroupScreen(GroupInfo toShow, String token) {
setRequiresSignIn(true);
this.group = toShow;
@@ -47,7 +47,7 @@ public abstract class AccountGroupScreen extends MenuScreen {
AccountGroup.isInternalGroup(group.getGroupUUID()));
}
private String getTabToken(final String token, final String tab) {
private String getTabToken(String token, String tab) {
if (token.startsWith("/admin/groups/uuid-")) {
return toGroup(group.getGroupUUID(), tab);
}
@@ -91,7 +91,7 @@ public abstract class AccountGroupScreen extends MenuScreen {
return group.getOwnerUUID();
}
protected void setMembersTabVisible(final boolean visible) {
protected void setMembersTabVisible(boolean visible) {
setLinkVisible(membersTabToken, visible);
}
}

View File

@@ -26,7 +26,7 @@ import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.PopupPanel;
class CreateChangeAction {
static void call(final Button b, final String project) {
static void call(Button b, String project) {
// TODO Replace CreateChangeDialog with a nicer looking display.
b.setEnabled(false);
new CreateChangeDialog(new Project.NameKey(project)) {

View File

@@ -125,7 +125,7 @@ public class CreateGroupScreen extends Screen {
addNew.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doCreateGroup();
}
});
@@ -146,7 +146,7 @@ public class CreateGroupScreen extends Screen {
newName,
new GerritCallback<GroupInfo>() {
@Override
public void onSuccess(final GroupInfo result) {
public void onSuccess(GroupInfo result) {
History.newItem(Dispatcher.toGroup(result.getGroupId(), AccountGroupScreen.MEMBERS));
}

View File

@@ -181,7 +181,7 @@ public class CreateProjectScreen extends Screen {
create.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doCreateProject();
}
});
@@ -190,7 +190,7 @@ public class CreateProjectScreen extends Screen {
browse.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
int top = grid.getAbsoluteTop() - 50; // under page header
// Try to place it to the right of everything else, but not
// right justified
@@ -219,7 +219,7 @@ public class CreateProjectScreen extends Screen {
}
@Override
protected void populate(final int row, final ProjectInfo k) {
protected void populate(int row, ProjectInfo k) {
populateState(row, k);
final Anchor projectLink = new Anchor(k.name());
projectLink.addClickHandler(
@@ -252,7 +252,7 @@ public class CreateProjectScreen extends Screen {
});
}
private void addGrid(final VerticalPanel fp) {
private void addGrid(VerticalPanel fp) {
grid = new Grid(2, 3);
grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
grid.setText(0, 0, AdminConstants.I.columnProjectName() + ":");
@@ -295,7 +295,7 @@ public class CreateProjectScreen extends Screen {
});
}
private void enableForm(final boolean enabled) {
private void enableForm(boolean enabled) {
project.setEnabled(enabled);
create.setEnabled(enabled);
parent.setEnabled(enabled);

View File

@@ -24,7 +24,7 @@ import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gwt.user.client.ui.Button;
public class EditConfigAction {
static void call(final Button b, final String project) {
static void call(Button b, String project) {
b.setEnabled(false);
ChangeApi.createChange(

View File

@@ -43,7 +43,7 @@ public class GroupTable extends NavigationTable<GroupInfo> {
this(null);
}
public GroupTable(final String pointerId) {
public GroupTable(String pointerId) {
super(AdminConstants.I.groupItemHelp());
setSavePointerId(pointerId);
@@ -70,12 +70,12 @@ public class GroupTable extends NavigationTable<GroupInfo> {
}
@Override
protected Object getRowItemKey(final GroupInfo item) {
protected Object getRowItemKey(GroupInfo item) {
return item.getGroupId();
}
@Override
protected void onOpenRow(final int row) {
protected void onOpenRow(int row) {
GroupInfo groupInfo = getRowItem(row);
if (isInteralGroup(groupInfo)) {
History.newItem(Dispatcher.toGroup(groupInfo.getGroupId()));
@@ -121,7 +121,7 @@ public class GroupTable extends NavigationTable<GroupInfo> {
}
}
void populate(final int row, final GroupInfo k, final String toHighlight) {
void populate(int row, GroupInfo k, String toHighlight) {
if (k.url() != null) {
if (isInteralGroup(k)) {
table.setWidget(
@@ -152,7 +152,7 @@ public class GroupTable extends NavigationTable<GroupInfo> {
setRowItem(row, k);
}
private boolean isInteralGroup(final GroupInfo groupInfo) {
private boolean isInteralGroup(GroupInfo groupInfo) {
return groupInfo != null && groupInfo.url().startsWith("#" + PageLinks.ADMIN_GROUPS);
}
}

View File

@@ -205,7 +205,7 @@ public class PermissionEditor extends Composite
addStage2.getStyle().setDisplay(Display.NONE);
}
private void addGroup(final GroupReference ref) {
private void addGroup(GroupReference ref) {
if (ref.getUUID() != null) {
if (value.getRule(ref) == null) {
PermissionRule newRule = value.getRule(ref, true);

View File

@@ -45,7 +45,7 @@ public class PluginListScreen extends PluginScreen {
PluginMap.all(
new ScreenLoadCallback<PluginMap>(this) {
@Override
protected void preDisplay(final PluginMap result) {
protected void preDisplay(PluginMap result) {
pluginTable.display(result);
}
});
@@ -75,12 +75,12 @@ public class PluginListScreen extends PluginScreen {
fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
}
void display(final PluginMap plugins) {
void display(PluginMap plugins) {
while (1 < table.getRowCount()) {
table.removeRow(table.getRowCount() - 1);
}
for (final PluginInfo p : Natives.asList(plugins.values())) {
for (PluginInfo p : Natives.asList(plugins.values())) {
final int row = table.getRowCount();
table.insertRow(row);
applyDataRowStyle(row);
@@ -88,7 +88,7 @@ public class PluginListScreen extends PluginScreen {
}
}
void populate(final int row, final PluginInfo plugin) {
void populate(int row, PluginInfo plugin) {
if (plugin.disabled() || plugin.indexUrl() == null) {
table.setText(row, 1, plugin.name());
} else {

View File

@@ -134,7 +134,7 @@ public class ProjectAccessEditor extends Composite
@Override
public void setDelegate(EditorDelegate<ProjectAccess> delegate) {}
void setEditing(final boolean editing) {
void setEditing(boolean editing) {
this.editing = editing;
addSection.setVisible(editing);
}

View File

@@ -91,7 +91,7 @@ public class ProjectAccessScreen extends ProjectScreen {
private NativeMap<CapabilityInfo> capabilityMap;
public ProjectAccessScreen(final Project.NameKey toShow) {
public ProjectAccessScreen(Project.NameKey toShow) {
super(toShow);
}
@@ -211,7 +211,7 @@ public class ProjectAccessScreen extends ProjectScreen {
displayReadOnly(newAccess);
} else {
error.add(new Label(Gerrit.C.projectAccessError()));
for (final String diff : diffs) {
for (String diff : diffs) {
error.add(new Label(diff));
}
if (access.canUpload()) {

View File

@@ -82,7 +82,7 @@ public class ProjectBranchesScreen extends PaginatedProjectScreen {
private NpTextBox filterTxt;
private Query query;
public ProjectBranchesScreen(final Project.NameKey toShow) {
public ProjectBranchesScreen(Project.NameKey toShow) {
super(toShow);
}
@@ -165,7 +165,7 @@ public class ProjectBranchesScreen extends PaginatedProjectScreen {
addBranch.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
doAddNewBranch();
}
});
@@ -179,7 +179,7 @@ public class ProjectBranchesScreen extends PaginatedProjectScreen {
delBranch.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
branchTable.deleteChecked();
}
});
@@ -283,7 +283,7 @@ public class ProjectBranchesScreen extends PaginatedProjectScreen {
new ConfirmationCallback() {
@Override
public void onOk() {
//do nothing
// do nothing
}
});
confirmationDialog.center();
@@ -384,7 +384,7 @@ public class ProjectBranchesScreen extends PaginatedProjectScreen {
confirmationDialog.center();
}
private void deleteBranches(final Set<String> branches) {
private void deleteBranches(Set<String> branches) {
ProjectApi.deleteBranches(
getProjectKey(),
branches,
@@ -473,7 +473,7 @@ public class ProjectBranchesScreen extends PaginatedProjectScreen {
setRowItem(row, k);
}
private void setHeadRevision(final int row, final int column, final String rev) {
private void setHeadRevision(int row, int column, String rev) {
AccessMap.get(
getProjectKey(),
new GerritCallback<ProjectAccessInfo>() {
@@ -488,7 +488,7 @@ public class ProjectBranchesScreen extends PaginatedProjectScreen {
});
}
private Widget getHeadRevisionWidget(final String headRevision) {
private Widget getHeadRevisionWidget(String headRevision) {
FlowPanel p = new FlowPanel();
final InlineLabel l = new InlineLabel(headRevision);
final Image edit = new Image(Gerrit.RESOURCES.edit());

View File

@@ -25,7 +25,7 @@ public class ProjectDashboardsScreen extends ProjectScreen {
private DashboardsTable dashes;
Project.NameKey project;
public ProjectDashboardsScreen(final Project.NameKey project) {
public ProjectDashboardsScreen(Project.NameKey project) {
super(project);
this.project = project;
}

View File

@@ -100,7 +100,7 @@ public class ProjectInfoScreen extends ProjectScreen {
private OnEditEnabler saveEnabler;
public ProjectInfoScreen(final Project.NameKey toShow) {
public ProjectInfoScreen(Project.NameKey toShow) {
super(toShow);
}
@@ -228,7 +228,7 @@ public class ProjectInfoScreen extends ProjectScreen {
grid.add(AdminConstants.I.headingProjectState(), state);
submitType = new ListBox();
for (final SubmitType type : SubmitType.values()) {
for (SubmitType type : SubmitType.values()) {
submitType.addItem(Util.toLongString(type), type.name());
}
submitType.addChangeHandler(
@@ -320,7 +320,7 @@ public class ProjectInfoScreen extends ProjectScreen {
grid.addHtml(AdminConstants.I.useSignedOffBy(), signedOffBy);
}
private void setSubmitType(final SubmitType newSubmitType) {
private void setSubmitType(SubmitType newSubmitType) {
int index = -1;
if (submitType != null) {
for (int i = 0; i < submitType.getItemCount(); i++) {
@@ -334,7 +334,7 @@ public class ProjectInfoScreen extends ProjectScreen {
}
}
private void setState(final ProjectState newState) {
private void setState(ProjectState newState) {
if (state != null) {
for (int i = 0; i < state.getItemCount(); i++) {
if (newState.name().equals(state.getValue(i))) {

View File

@@ -91,11 +91,11 @@ public class ProjectListScreen extends PaginatedProjectScreen {
}
@Override
protected void onOpenRow(final int row) {
protected void onOpenRow(int row) {
History.newItem(link(getRowItem(row)));
}
private String link(final ProjectInfo item) {
private String link(ProjectInfo item) {
return Dispatcher.toProject(item.name_key());
}

View File

@@ -37,7 +37,7 @@ public abstract class ProjectScreen extends Screen {
private final Project.NameKey name;
public ProjectScreen(final Project.NameKey toShow) {
public ProjectScreen(Project.NameKey toShow) {
name = toShow;
}

View File

@@ -276,7 +276,7 @@ public class ProjectTagsScreen extends PaginatedProjectScreen {
new ConfirmationCallback() {
@Override
public void onOk() {
//do nothing
// do nothing
}
});
confirmationDialog.center();
@@ -376,7 +376,7 @@ public class ProjectTagsScreen extends PaginatedProjectScreen {
confirmationDialog.center();
}
private void deleteTags(final Set<String> tags) {
private void deleteTags(Set<String> tags) {
ProjectApi.deleteTags(
getProjectKey(),
tags,

View File

@@ -30,7 +30,7 @@ public class Util {
AdminResources.I.css().ensureInjected();
}
public static String toLongString(final SubmitType type) {
public static String toLongString(SubmitType type) {
if (type == null) {
return "";
}
@@ -52,7 +52,7 @@ public class Util {
}
}
public static String toLongString(final ProjectState type) {
public static String toLongString(ProjectState type) {
if (type == null) {
return "";
}

View File

@@ -176,7 +176,7 @@ public class ActionContext extends JavaScriptObject {
* The same as {@link #get(RestApi, JavaScriptObject)} but without converting a {@link
* NativeString} result to String.
*/
static final void getRaw(RestApi api, final JavaScriptObject cb) {
static final void getRaw(RestApi api, JavaScriptObject cb) {
api.get(wrapRaw(cb));
}
@@ -268,7 +268,7 @@ public class ActionContext extends JavaScriptObject {
api.delete(wrapRaw(cb));
}
private static GerritCallback<JavaScriptObject> wrap(final JavaScriptObject cb) {
private static GerritCallback<JavaScriptObject> wrap(JavaScriptObject cb) {
return new GerritCallback<JavaScriptObject>() {
@Override
public void onSuccess(JavaScriptObject result) {
@@ -282,7 +282,7 @@ public class ActionContext extends JavaScriptObject {
};
}
private static GerritCallback<JavaScriptObject> wrapRaw(final JavaScriptObject cb) {
private static GerritCallback<JavaScriptObject> wrapRaw(JavaScriptObject cb) {
return new GerritCallback<JavaScriptObject>() {
@Override
public void onSuccess(JavaScriptObject result) {

View File

@@ -36,7 +36,7 @@ class DefaultActions {
invoke(action, api, callback(PageLinks.toProject(project)));
}
private static AsyncCallback<JavaScriptObject> callback(final String target) {
private static AsyncCallback<JavaScriptObject> callback(String target) {
return new GerritCallback<JavaScriptObject>() {
@Override
public void onSuccess(JavaScriptObject in) {

View File

@@ -140,7 +140,7 @@ public class Assignee extends Composite {
onCloseForm();
}
private void editAssignee(final String assignee) {
private void editAssignee(String assignee) {
if (assignee.trim().isEmpty()) {
ChangeApi.deleteAssignee(
changeId.get(),

View File

@@ -45,8 +45,7 @@ public class ChangeActions {
ChangeApi.unmarkPrivate(id.get(), cs(id, draftButtons));
}
public static GerritCallback<JavaScriptObject> cs(
final Change.Id id, final Button... draftButtons) {
public static GerritCallback<JavaScriptObject> cs(final Change.Id id, Button... draftButtons) {
setEnabled(false, draftButtons);
return new GerritCallback<JavaScriptObject>() {
@Override
@@ -67,7 +66,7 @@ public class ChangeActions {
};
}
private static AsyncCallback<JavaScriptObject> mine(final Button... draftButtons) {
private static AsyncCallback<JavaScriptObject> mine(Button... draftButtons) {
setEnabled(false, draftButtons);
return new GerritCallback<JavaScriptObject>() {
@Override

View File

@@ -308,7 +308,7 @@ public class ChangeScreen extends Screen {
group.addFinal(
new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(final ChangeInfo info) {
public void onSuccess(ChangeInfo info) {
info.init();
initCurrentRevision(info);
final RevisionInfo rev = info.revision(revision);
@@ -586,7 +586,7 @@ public class ChangeScreen extends Screen {
downloadAction = new DownloadAction(info, revision, style, headerLine, download);
}
private void initProjectLinks(final ChangeInfo info) {
private void initProjectLinks(ChangeInfo info) {
projectSettingsLink.setHref("#" + PageLinks.toProject(info.projectNameKey()));
projectSettings.addDomHandler(
new ClickHandler() {
@@ -987,7 +987,7 @@ public class ChangeScreen extends Screen {
}
}
private void loadConfigInfo(final ChangeInfo info, DiffObject base) {
private void loadConfigInfo(ChangeInfo info, DiffObject base) {
final RevisionInfo rev = info.revision(revision);
if (base.isAutoMerge() && !initCurrentRevision(info).isMerge()) {
Gerrit.display(getToken(), new NotFoundScreen());
@@ -1026,7 +1026,7 @@ public class ChangeScreen extends Screen {
group.done();
}
private void loadConfigInfo(final ChangeInfo info, RevisionInfo rev) {
private void loadConfigInfo(ChangeInfo info, RevisionInfo rev) {
if (loaded) {
return;
}
@@ -1207,7 +1207,7 @@ public class ChangeScreen extends Screen {
return r;
}
private void loadCommit(final RevisionInfo rev, CallbackGroup group) {
private void loadCommit(RevisionInfo rev, CallbackGroup group) {
if (rev.isEdit() || rev.commit() != null) {
return;
}

View File

@@ -36,8 +36,7 @@ public class EditActions {
ChangeApi.rebaseEdit(id.get(), cs(id, editButtons));
}
public static GerritCallback<JavaScriptObject> cs(
final Change.Id id, final Button... editButtons) {
public static GerritCallback<JavaScriptObject> cs(final Change.Id id, Button... editButtons) {
setEnabled(false, editButtons);
return new GerritCallback<JavaScriptObject>() {
@Override

View File

@@ -218,7 +218,7 @@ public class Hashtags extends Composite {
}
}
private void addHashtag(final String hashtags) {
private void addHashtag(String hashtags) {
ChangeApi.hashtags(changeId.get())
.post(
PostInput.create(hashtags, null),

View File

@@ -125,7 +125,7 @@ public class LocalComments {
public static void saveInlineComments() {
final StorageBackend storage = new StorageBackend();
for (final String cookie : storage.getKeys()) {
for (String cookie : storage.getKeys()) {
if (isInlineComment(cookie)) {
InlineComment input = getInlineComment(cookie);
if (input.commentInfo.id() == null) {

View File

@@ -37,7 +37,7 @@ class PathSuggestOracle extends HighlightSuggestOracle {
}
@Override
protected void onRequestSuggestions(final Request req, final Callback cb) {
protected void onRequestSuggestions(Request req, Callback cb) {
RestApi api = ChangeApi.revision(changeId.get(), revision.name()).view("files");
if (req.getQuery() != null) {
api.addParameter("q", req.getQuery() == null ? "" : req.getQuery());

View File

@@ -198,7 +198,7 @@ public class RelatedChanges extends TabPanel {
getTab(Tab.SUBMITTED_TOGETHER).setShowSubmittable(true);
}
void set(final ChangeInfo info, final String revision) {
void set(ChangeInfo info, String revision) {
if (info.status().isOpen()) {
setForOpenChange(info, revision);
}
@@ -246,7 +246,7 @@ public class RelatedChanges extends TabPanel {
}
}
private void setForOpenChange(final ChangeInfo info, final String revision) {
private void setForOpenChange(ChangeInfo info, String revision) {
if (info.mergeable()) {
StringBuilder conflictsQuery = new StringBuilder();
conflictsQuery.append("status:open");

View File

@@ -229,7 +229,7 @@ public class ReplyBox extends Composite {
}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
if (RestApi.isNotSignedIn(caught)) {
lc.setReplyComment(message.getText());
}

View File

@@ -27,8 +27,7 @@ import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.PopupPanel;
class RevertAction {
static void call(
final Button b, final Change.Id id, final String revision, final String commitSubject) {
static void call(final Button b, Change.Id id, String revision, String commitSubject) {
// TODO Replace ActionDialog with a nicer looking display.
b.setEnabled(false);
new TextAreaActionDialog(Util.C.revertChangeTitle(), Util.C.headingRevertMessage()) {

View File

@@ -34,7 +34,7 @@ public class ReviewerSuggestOracle extends HighlightSuggestOracle {
private Change.Id changeId;
@Override
protected void onRequestSuggestions(final Request req, final Callback cb) {
protected void onRequestSuggestions(Request req, Callback cb) {
ChangeApi.suggestReviewers(changeId.get(), req.getQuery(), req.getLimit(), false)
.get(
new GerritCallback<JsArray<SuggestReviewerInfo>>() {
@@ -56,7 +56,7 @@ public class ReviewerSuggestOracle extends HighlightSuggestOracle {
}
@Override
public void requestDefaultSuggestions(final Request req, final Callback cb) {
public void requestDefaultSuggestions(Request req, Callback cb) {
requestSuggestions(req, cb);
}

View File

@@ -151,7 +151,7 @@ public class Reviewers extends Composite {
suggestBox.setServeSuggestionsOnOracle(false);
}
private void addReviewer(final String reviewer, boolean confirmed) {
private void addReviewer(String reviewer, boolean confirmed) {
if (reviewer.isEmpty()) {
return;
}

View File

@@ -50,7 +50,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
private ChangeTable.Section incoming;
private ChangeTable.Section closed;
public AccountDashboardScreen(final Account.Id id) {
public AccountDashboardScreen(Account.Id id) {
ownerId = id;
mine = Gerrit.isSignedIn() && ownerId.equals(Gerrit.getUserAccount().getId());
}
@@ -64,7 +64,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
keysNavigation.add(
new KeyCommand(0, 'R', Util.C.keyReloadSearch()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(getToken());
}
});

View File

@@ -114,7 +114,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
table.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
final Cell cell = table.getCellForEvent(event);
if (cell == null) {
return;
@@ -133,18 +133,18 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
}
@Override
protected Object getRowItemKey(final ChangeInfo item) {
protected Object getRowItemKey(ChangeInfo item) {
return item.legacyId();
}
@Override
protected void onOpenRow(final int row) {
protected void onOpenRow(int row) {
final ChangeInfo c = getRowItem(row);
final Change.Id id = c.legacyId();
Gerrit.display(PageLinks.toChange(id));
}
private void insertNoneRow(final int row) {
private void insertNoneRow(int row) {
insertRow(row);
table.setText(row, 0, Util.C.changeTableNone());
final FlexCellFormatter fmt = table.getFlexCellFormatter();
@@ -152,13 +152,13 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
fmt.setStyleName(row, 0, Gerrit.RESOURCES.css().emptySection());
}
private void insertChangeRow(final int row) {
private void insertChangeRow(int row) {
insertRow(row);
applyDataRowStyle(row);
}
@Override
protected void applyDataRowStyle(final int row) {
protected void applyDataRowStyle(int row) {
super.applyDataRowStyle(row);
final CellFormatter fmt = table.getCellFormatter();
fmt.addStyleName(row, C_STAR, Gerrit.RESOURCES.css().iconCell());
@@ -225,7 +225,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
}
}
private void populateChangeRow(final int row, final ChangeInfo c, boolean highlightUnreviewed) {
private void populateChangeRow(int row, ChangeInfo c, boolean highlightUnreviewed) {
CellFormatter fmt = table.getCellFormatter();
if (Gerrit.isSignedIn()) {
table.setWidget(row, C_STAR, StarredChanges.createIcon(c.legacyId(), c.starred()));
@@ -416,7 +416,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
return hex.length() == 1 ? "0" + hex : hex;
}
public void addSection(final Section s) {
public void addSection(Section s) {
assert s.parent == null;
s.parent = this;
@@ -434,8 +434,8 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
sections.add(s);
}
private int insertRow(final int beforeRow) {
for (final Section s : sections) {
private int insertRow(int beforeRow) {
for (Section s : sections) {
if (beforeRow <= s.titleRow) {
s.titleRow++;
}
@@ -446,8 +446,8 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
return table.insertRow(beforeRow);
}
private void removeRow(final int row) {
for (final Section s : sections) {
private void removeRow(int row) {
for (Section s : sections) {
if (row < s.titleRow) {
s.titleRow--;
}
@@ -464,7 +464,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
int row = getCurrentRow();
ChangeInfo c = getRowItem(row);
if (c != null && Gerrit.isSignedIn()) {
@@ -474,7 +474,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
}
private final class TableChangeLink extends ChangeLink {
private TableChangeLink(final String text, final ChangeInfo c) {
private TableChangeLink(String text, ChangeInfo c) {
super(text, c.legacyId());
}
@@ -498,7 +498,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
this.highlightUnreviewed = value;
}
public void setTitleText(final String text) {
public void setTitleText(String text) {
titleText = text;
titleWidget = null;
if (titleRow >= 0) {
@@ -506,7 +506,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
}
}
public void setTitleWidget(final Widget title) {
public void setTitleWidget(Widget title) {
titleWidget = title;
titleText = null;
if (titleRow >= 0) {

View File

@@ -34,7 +34,7 @@ public class DashboardTable extends ChangeTable {
private List<String> titles;
private List<String> queries;
public DashboardTable(final Screen screen, String params) {
public DashboardTable(Screen screen, String params) {
titles = new ArrayList<>();
queries = new ArrayList<>();
String foreach = null;

View File

@@ -64,7 +64,7 @@ public abstract class PagedSingleListScreen extends Screen {
keysNavigation.add(
new KeyCommand(0, 'R', Util.C.keyReloadSearch()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(getToken());
}
});
@@ -126,7 +126,7 @@ public abstract class PagedSingleListScreen extends Screen {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
if (link.isVisible()) {
History.newItem(link.getTargetHistoryToken());
}

View File

@@ -25,7 +25,7 @@ public class ProjectDashboardScreen extends ProjectScreen implements ChangeListS
private DashboardTable table;
private String params;
public ProjectDashboardScreen(final Project.NameKey toShow, String params) {
public ProjectDashboardScreen(Project.NameKey toShow, String params) {
super(toShow);
this.params = params;
}

View File

@@ -73,7 +73,7 @@ public class StarredChanges {
}
/** Make a key command that toggles the star for a change. */
public static KeyCommand newKeyCommand(final Icon icon) {
public static KeyCommand newKeyCommand(Icon icon) {
return new KeyCommand(0, 's', Util.C.changeTableStar()) {
@Override
public void onKeyPress(KeyPressEvent event) {
@@ -99,7 +99,7 @@ public class StarredChanges {
* Set the starred status of a change. This method broadcasts to all interested UI widgets and
* sends an RPC to the server to record the updated status.
*/
public static void toggleStar(final Change.Id changeId, final boolean newValue) {
public static void toggleStar(Change.Id changeId, boolean newValue) {
pending.put(changeId, newValue);
fireChangeStarEvent(changeId, newValue);
if (!busy) {

View File

@@ -25,7 +25,7 @@ public class Util {
private static final String SUBJECT_CROP_APPENDIX = "...";
private static final int SUBJECT_CROP_RANGE = 10;
public static String toLongString(final Change.Status status) {
public static String toLongString(Change.Status status) {
if (status == null) {
return "";
}
@@ -62,7 +62,7 @@ public class Util {
* @return the subject, cropped if needed
*/
@SuppressWarnings("deprecation")
public static String cropSubject(final String subject) {
public static String cropSubject(String subject) {
if (subject.length() > SUBJECT_MAX_LENGTH) {
final int maxLength = SUBJECT_MAX_LENGTH - SUBJECT_CROP_APPENDIX.length();
for (int cropPosition = maxLength;

View File

@@ -34,7 +34,7 @@ import java.util.Map;
public class DashboardsTable extends NavigationTable<DashboardInfo> {
Project.NameKey project;
public DashboardsTable(final Project.NameKey project) {
public DashboardsTable(Project.NameKey project) {
super(Util.C.dashboardItem());
this.project = project;
initColumnHeaders();
@@ -96,7 +96,7 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
finishDisplay();
}
protected void insertTitleRow(final int row, String section) {
protected void insertTitleRow(int row, String section) {
table.insertRow(row);
table.setText(row, 0, section);
@@ -106,7 +106,7 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().sectionHeader());
}
protected void insert(final int row, final DashboardInfo k) {
protected void insert(int row, DashboardInfo k) {
table.insertRow(row);
applyDataRowStyle(row);
@@ -121,7 +121,7 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
populate(row, k);
}
protected void populate(final int row, final DashboardInfo k) {
protected void populate(int row, DashboardInfo k) {
if (k.isDefault()) {
table.setWidget(row, 1, new Image(Gerrit.RESOURCES.greenCheck()));
final FlexCellFormatter fmt = table.getFlexCellFormatter();
@@ -147,12 +147,12 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
}
@Override
protected Object getRowItemKey(final DashboardInfo item) {
protected Object getRowItemKey(DashboardInfo item) {
return item.id();
}
@Override
protected void onOpenRow(final int row) {
protected void onOpenRow(int row) {
if (row > 0) {
movePointerTo(row);
}

View File

@@ -412,7 +412,7 @@ abstract class DiffScreen extends Screen {
}
}
private BeforeSelectionChangeHandler onSelectionChange(final CodeMirror cm) {
private BeforeSelectionChangeHandler onSelectionChange(CodeMirror cm) {
return new BeforeSelectionChangeHandler() {
private InsertCommentBubble bubble;
@@ -871,11 +871,11 @@ abstract class DiffScreen extends Screen {
abstract Runnable updateActiveLine(CodeMirror cm);
private GutterClickHandler onGutterClick(final CodeMirror cm) {
private GutterClickHandler onGutterClick(CodeMirror cm) {
return new GutterClickHandler() {
@Override
public void handle(
CodeMirror instance, final int line, final String gutterClass, NativeEvent clickEvent) {
CodeMirror instance, int line, String gutterClass, NativeEvent clickEvent) {
if (Element.as(clickEvent.getEventTarget()).hasClassName(getLineNumberClassName())
&& clickEvent.getButton() == NativeEvent.BUTTON_LEFT
&& !clickEvent.getMetaKey()

View File

@@ -35,7 +35,7 @@ class InsertCommentBubble extends Composite {
@UiField Image icon;
InsertCommentBubble(final CommentManager commentManager, final CodeMirror cm) {
InsertCommentBubble(CommentManager commentManager, CodeMirror cm) {
initWidget(uiBinder.createAndBindUi(this));
addDomHandler(
new ClickHandler() {

View File

@@ -147,8 +147,7 @@ class PatchSetSelectBox extends Composite {
}
}
void setUpBlame(
final CodeMirror cm, final boolean isBase, final PatchSet.Id rev, final String path) {
void setUpBlame(final CodeMirror cm, boolean isBase, PatchSet.Id rev, String path) {
if (!Patch.isMagic(path) && Gerrit.isSignedIn() && Gerrit.info().change().allowBlame()) {
Anchor blameIcon = createBlameIcon();
blameIcon.addClickHandler(

View File

@@ -138,7 +138,7 @@ public class SideBySide extends DiffScreen {
}
@Override
void registerCmEvents(final CodeMirror cm) {
void registerCmEvents(CodeMirror cm) {
super.registerCmEvents(cm);
KeyMap keyMap =

View File

@@ -219,7 +219,7 @@ class SideBySideChunkManager extends ChunkManager {
* @param line line to put the padding below.
* @param len number of lines to pad. Padding is inserted only if {@code len >= 1}.
*/
private void addPadding(CodeMirror cm, int line, final int len) {
private void addPadding(CodeMirror cm, int line, int len) {
if (0 < len) {
Element pad = DOM.createDiv();
pad.setClassName(SideBySideTable.style.padding());

View File

@@ -62,7 +62,7 @@ class SkipBar extends Composite {
private TextMarker textMarker;
private SkipBar otherBar;
SkipBar(SkipManager manager, final CodeMirror cm) {
SkipBar(SkipManager manager, CodeMirror cm) {
this.manager = manager;
this.cm = cm;

View File

@@ -30,7 +30,7 @@ class UpToChangeCommand extends KeyCommand {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChange(revision.getParentKey(), revision.getId()));
}
}

View File

@@ -661,7 +661,7 @@ public class EditScreen extends Screen {
}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
close.setEnabled(true);
}
});

View File

@@ -44,7 +44,7 @@ public class GroupApi {
}
/** Check if the current user is owner of a group */
public static void isGroupOwner(String groupName, final AsyncCallback<Boolean> cb) {
public static void isGroupOwner(String groupName, AsyncCallback<Boolean> cb) {
GroupMap.myOwned(
groupName,
new AsyncCallback<GroupMap>() {
@@ -105,7 +105,7 @@ public class GroupApi {
/** Add members to a group. */
public static void addMembers(
AccountGroup.UUID group, Set<String> members, final AsyncCallback<JsArray<AccountInfo>> cb) {
AccountGroup.UUID group, Set<String> members, AsyncCallback<JsArray<AccountInfo>> cb) {
if (members.size() == 1) {
addMember(
group,
@@ -132,7 +132,7 @@ public class GroupApi {
/** Remove members from a group. */
public static void removeMembers(
AccountGroup.UUID group, Set<Integer> ids, final AsyncCallback<VoidResult> cb) {
AccountGroup.UUID group, Set<Integer> ids, AsyncCallback<VoidResult> cb) {
if (ids.size() == 1) {
members(group).id(ids.iterator().next().toString()).delete(cb);
} else {
@@ -181,7 +181,7 @@ public class GroupApi {
/** Remove included groups from a group. */
public static void removeIncludedGroups(
AccountGroup.UUID group, Set<AccountGroup.UUID> ids, final AsyncCallback<VoidResult> cb) {
AccountGroup.UUID group, Set<AccountGroup.UUID> ids, AsyncCallback<VoidResult> cb) {
if (ids.size() == 1) {
AccountGroup.UUID g = ids.iterator().next();
groups(group).id(g.get()).delete(cb);

View File

@@ -93,7 +93,7 @@ public class ConfigInfoCache {
};
}
private void getImpl(final String name, final AsyncCallback<Entry> cb) {
private void getImpl(String name, AsyncCallback<Entry> cb) {
Entry e = cache.get(name);
if (e != null) {
cb.onSuccess(e);
@@ -116,7 +116,7 @@ public class ConfigInfoCache {
});
}
private void getImpl(final Integer id, final AsyncCallback<Entry> cb) {
private void getImpl(Integer id, AsyncCallback<Entry> cb) {
String name = changeToProject.get(id);
if (name != null) {
getImpl(name, cb);

View File

@@ -176,7 +176,7 @@ public class ProjectApi {
project(name).view("config").put(in, cb);
}
public static void getParent(Project.NameKey name, final AsyncCallback<Project.NameKey> cb) {
public static void getParent(Project.NameKey name, AsyncCallback<Project.NameKey> cb) {
project(name)
.view("parent")
.get(

View File

@@ -65,7 +65,7 @@ public class CallbackGroup {
return add(cb);
}
public <T> Callback<T> add(final AsyncCallback<T> cb) {
public <T> Callback<T> add(AsyncCallback<T> cb) {
checkFinalAdded();
return handleAdd(cb);
}
@@ -75,13 +75,13 @@ public class CallbackGroup {
return handleAdd(cb);
}
public <T> Callback<T> addFinal(final AsyncCallback<T> cb) {
public <T> Callback<T> addFinal(AsyncCallback<T> cb) {
checkFinalAdded();
finalAdded = true;
return handleAdd(cb);
}
public <T> HttpCallback<T> addFinal(final HttpCallback<T> cb) {
public <T> HttpCallback<T> addFinal(HttpCallback<T> cb) {
checkFinalAdded();
finalAdded = true;
return handleAdd(cb);

View File

@@ -32,7 +32,7 @@ public abstract class GerritCallback<T>
implements com.google.gwtjsonrpc.common.AsyncCallback<T>,
com.google.gwt.user.client.rpc.AsyncCallback<T> {
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
showFailure(caught);
}
@@ -77,7 +77,7 @@ public abstract class GerritCallback<T>
return false;
}
protected static boolean isInvalidXSRF(final Throwable caught) {
protected static boolean isInvalidXSRF(Throwable caught) {
return caught instanceof InvocationException
&& caught.getMessage().equals(JsonConstants.ERROR_INVALID_XSRF);
}
@@ -94,17 +94,17 @@ public abstract class GerritCallback<T>
&& caught.getMessage().equals(NoSuchEntityException.MESSAGE));
}
protected static boolean isNoSuchAccount(final Throwable caught) {
protected static boolean isNoSuchAccount(Throwable caught) {
return caught instanceof RemoteJsonException
&& caught.getMessage().startsWith(NoSuchAccountException.MESSAGE);
}
protected static boolean isNameAlreadyUsed(final Throwable caught) {
protected static boolean isNameAlreadyUsed(Throwable caught) {
return caught instanceof RemoteJsonException
&& caught.getMessage().startsWith(NameAlreadyUsedException.MESSAGE);
}
protected static boolean isNoSuchGroup(final Throwable caught) {
protected static boolean isNoSuchGroup(Throwable caught) {
return caught instanceof RemoteJsonException
&& caught.getMessage().startsWith(NoSuchGroupException.MESSAGE);
}

View File

@@ -116,7 +116,7 @@ public class RestApi {
}
@Override
public void onResponseReceived(Request req, final Response res) {
public void onResponseReceived(Request req, Response res) {
int status = res.getStatusCode();
if (status == Response.SC_NO_CONTENT) {
cb.onSuccess(new HttpResponse<T>(res, null, null));
@@ -499,7 +499,7 @@ public class RestApi {
}
}
private static <T extends JavaScriptObject> HttpCallback<T> wrap(final AsyncCallback<T> cb) {
private static <T extends JavaScriptObject> HttpCallback<T> wrap(AsyncCallback<T> cb) {
return new HttpCallback<T>() {
@Override
public void onSuccess(HttpResponse<T> r) {

View File

@@ -24,12 +24,12 @@ import com.google.gerrit.common.errors.NoSuchEntityException;
public abstract class ScreenLoadCallback<T> extends GerritCallback<T> {
private final Screen screen;
public ScreenLoadCallback(final Screen s) {
public ScreenLoadCallback(Screen s) {
screen = s;
}
@Override
public final void onSuccess(final T result) {
public final void onSuccess(T result) {
if (screen.isAttached()) {
preDisplay(result);
screen.display();
@@ -42,7 +42,7 @@ public abstract class ScreenLoadCallback<T> extends GerritCallback<T> {
protected void postDisplay() {}
@Override
public void onFailure(final Throwable caught) {
public void onFailure(Throwable caught) {
if (isSigninFailure(caught)) {
new NotSignedInDialog().center();
} else if (isNoSuchEntity(caught)) {

View File

@@ -32,7 +32,7 @@ public class AccountGroupSuggestOracle extends SuggestAfterTypingNCharsOracle {
private Project.NameKey projectName;
@Override
public void _onRequestSuggestions(final Request req, final Callback callback) {
public void _onRequestSuggestions(Request req, Callback callback) {
GroupMap.suggestAccountGroupForProject(
projectName == null ? null : projectName.get(),
req.getQuery(),
@@ -58,7 +58,7 @@ public class AccountGroupSuggestOracle extends SuggestAfterTypingNCharsOracle {
private static class AccountGroupSuggestion implements SuggestOracle.Suggestion {
private final GroupInfo info;
AccountGroupSuggestion(final GroupInfo k) {
AccountGroupSuggestion(GroupInfo k) {
info = k;
}

View File

@@ -27,7 +27,7 @@ import java.util.List;
/** Suggestion Oracle for Account entities. */
public class AccountSuggestOracle extends SuggestAfterTypingNCharsOracle {
@Override
public void _onRequestSuggestions(final Request req, final Callback cb) {
public void _onRequestSuggestions(Request req, Callback cb) {
AccountApi.suggest(
req.getQuery(),
req.getLimit(),

View File

@@ -29,8 +29,7 @@ public class AddMemberBox extends Composite {
private final Button addMember;
private final RemoteSuggestBox suggestBox;
public AddMemberBox(
final String buttonLabel, final String hint, final SuggestOracle suggestOracle) {
public AddMemberBox(final String buttonLabel, String hint, SuggestOracle suggestOracle) {
addPanel = new FlowPanel();
addMember = new Button(buttonLabel);

View File

@@ -20,13 +20,13 @@ import com.google.gerrit.reviewdb.client.Change;
import com.google.gwt.core.client.GWT;
public class ChangeLink extends InlineHyperlink {
public static String permalink(final Change.Id c) {
public static String permalink(Change.Id c) {
return GWT.getHostPageBaseURL() + c.get();
}
protected Change.Id cid;
public ChangeLink(final String text, final Change.Id c) {
public ChangeLink(String text, Change.Id c) {
super(text, PageLinks.toChange(c));
getElement().setPropertyString("href", permalink(c));
cid = c;

View File

@@ -51,7 +51,7 @@ public abstract class CherryPickDialog extends TextAreaActionDialog {
@Override
protected void onRequestSuggestions(Request request, Callback done) {
List<BranchSuggestion> suggestions = new ArrayList<>();
for (final BranchInfo b : branches) {
for (BranchInfo b : branches) {
if (b.ref().contains(request.getQuery())) {
suggestions.add(new BranchSuggestion(b));
}

View File

@@ -24,7 +24,7 @@ import com.google.gwt.user.client.ui.Anchor;
public class CommandMenuItem extends Anchor implements ClickHandler {
private final Command command;
public CommandMenuItem(final String text, final Command cmd) {
public CommandMenuItem(String text, Command cmd) {
super(text);
setStyleName(Gerrit.RESOURCES.css().menuItem());
Roles.getMenuitemRole().set(getElement());
@@ -33,7 +33,7 @@ public class CommandMenuItem extends Anchor implements ClickHandler {
}
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
setFocus(false);
command.execute();
}

View File

@@ -37,7 +37,7 @@ public abstract class CommentedActionDialog extends AutoCenterDialogBox
protected boolean sent;
public CommentedActionDialog(final String title, final String heading) {
public CommentedActionDialog(String title, String heading) {
super(/* auto hide */ false, /* modal */ true);
setGlassEnabled(true);
setText(title);
@@ -48,7 +48,7 @@ public abstract class CommentedActionDialog extends AutoCenterDialogBox
sendButton.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
enableButtons(false);
onSend();
}
@@ -59,7 +59,7 @@ public abstract class CommentedActionDialog extends AutoCenterDialogBox
cancelButton.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
hide();
}
});

View File

@@ -32,7 +32,7 @@ public class ComplexDisclosurePanel extends Composite
private final DisclosurePanel main;
private final Panel header;
public ComplexDisclosurePanel(final String text, final boolean isOpen) {
public ComplexDisclosurePanel(String text, boolean isOpen) {
// Ick. GWT's DisclosurePanel won't let us subclass it, or do any
// other modification of its header. We're stuck with injecting
// into the DOM directly.
@@ -81,7 +81,7 @@ public class ComplexDisclosurePanel extends Composite
return header;
}
public void setContent(final Widget w) {
public void setContent(Widget w) {
main.setContent(w);
}
@@ -90,12 +90,12 @@ public class ComplexDisclosurePanel extends Composite
}
@Override
public HandlerRegistration addOpenHandler(final OpenHandler<DisclosurePanel> h) {
public HandlerRegistration addOpenHandler(OpenHandler<DisclosurePanel> h) {
return main.addOpenHandler(h);
}
@Override
public HandlerRegistration addCloseHandler(final CloseHandler<DisclosurePanel> h) {
public HandlerRegistration addCloseHandler(CloseHandler<DisclosurePanel> h) {
return main.addCloseHandler(h);
}
@@ -109,7 +109,7 @@ public class ComplexDisclosurePanel extends Composite
*
* @param isOpen {@code true} to open, {@code false} to close
*/
public void setOpen(final boolean isOpen) {
public void setOpen(boolean isOpen) {
main.setOpen(isOpen);
}
}

View File

@@ -48,11 +48,11 @@ public abstract class FancyFlexTable<RowItem> extends Composite {
return new MyFlexTable();
}
protected RowItem getRowItem(final int row) {
protected RowItem getRowItem(int row) {
return FancyFlexTable.<RowItem>getRowItem(table.getCellFormatter().getElement(row, 0));
}
protected void setRowItem(final int row, final RowItem item) {
protected void setRowItem(int row, RowItem item) {
setRowItem(table.getCellFormatter().getElement(row, 0), item);
}
@@ -117,15 +117,15 @@ public abstract class FancyFlexTable<RowItem> extends Composite {
return left;
}
protected void resetHtml(final SafeHtml body) {
for (final Iterator<Widget> i = table.iterator(); i.hasNext(); ) {
protected void resetHtml(SafeHtml body) {
for (Iterator<Widget> i = table.iterator(); i.hasNext(); ) {
i.next();
i.remove();
}
impl.resetHtml(table, body);
}
protected void scrollIntoView(final int topRow, final int endRow) {
protected void scrollIntoView(int topRow, int endRow) {
final CellFormatter fmt = table.getCellFormatter();
final Element top = fmt.getElement(topRow, C_ARROW).getParentElement();
final Element end = fmt.getElement(endRow, C_ARROW).getParentElement();
@@ -164,7 +164,7 @@ public abstract class FancyFlexTable<RowItem> extends Composite {
Document.get().setScrollTop(nTop);
}
protected void applyDataRowStyle(final int newRow) {
protected void applyDataRowStyle(int newRow) {
table.getCellFormatter().addStyleName(newRow, C_ARROW, Gerrit.RESOURCES.css().iconCell());
table.getCellFormatter().addStyleName(newRow, C_ARROW, Gerrit.RESOURCES.css().leftMostCell());
}
@@ -176,7 +176,7 @@ public abstract class FancyFlexTable<RowItem> extends Composite {
* @return the td containing element {@code target}; null if {@code target} is not a member of
* this table.
*/
protected Element getParentCell(final Element target) {
protected Element getParentCell(Element target) {
final Element body = FancyFlexTableImpl.getBodyElement(table);
for (Element td = target; td != null && td != body; td = DOM.getParent(td)) {
// If it's a TD, it might be the one we're looking for.
@@ -192,7 +192,7 @@ public abstract class FancyFlexTable<RowItem> extends Composite {
}
/** @return the row of the child element; -1 if the child is not in the table. */
protected int rowOf(final Element target) {
protected int rowOf(Element target) {
final Element td = getParentCell(target);
if (td == null) {
return -1;
@@ -203,7 +203,7 @@ public abstract class FancyFlexTable<RowItem> extends Composite {
}
/** @return the cell of the child element; -1 if the child is not in the table. */
protected int columnOf(final Element target) {
protected int columnOf(Element target) {
final Element td = getParentCell(target);
if (td == null) {
return -1;

View File

@@ -20,7 +20,7 @@ import com.google.gwt.user.client.ui.HTMLTable;
import com.google.gwtexpui.safehtml.client.SafeHtml;
public class FancyFlexTableImpl {
public void resetHtml(final FlexTable myTable, final SafeHtml body) {
public void resetHtml(FlexTable myTable, SafeHtml body) {
SafeHtml.setInnerHTML(getBodyElement(myTable), body);
}

View File

@@ -23,7 +23,7 @@ import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
public class FancyFlexTableImplIE8 extends FancyFlexTableImpl {
@Override
public void resetHtml(final FlexTable myTable, final SafeHtml bodyHtml) {
public void resetHtml(FlexTable myTable, SafeHtml bodyHtml) {
final Element oldBody = getBodyElement(myTable);
final Element newBody = parseBody(bodyHtml);
assert newBody != null;
@@ -34,7 +34,7 @@ public class FancyFlexTableImplIE8 extends FancyFlexTableImpl {
DOM.appendChild(tableElem, newBody);
}
private static Element parseBody(final SafeHtml body) {
private static Element parseBody(SafeHtml body) {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
b.openElement("table");
b.append(body);

View File

@@ -18,8 +18,7 @@ public class HighlightingInlineHyperlink extends InlineHyperlink {
private String toHighlight;
public HighlightingInlineHyperlink(
final String text, final String token, final String toHighlight) {
public HighlightingInlineHyperlink(final String text, String token, String toHighlight) {
super(text, token);
this.toHighlight = toHighlight;
highlight(text, toHighlight);
@@ -31,7 +30,7 @@ public class HighlightingInlineHyperlink extends InlineHyperlink {
highlight(text, toHighlight);
}
private void highlight(final String text, final String toHighlight) {
private void highlight(String text, String toHighlight) {
setHTML(Util.highlight(text, toHighlight));
}
}

View File

@@ -21,13 +21,13 @@ import com.google.gwt.user.client.ui.InlineHTML;
public class HighlightingProjectsTable extends ProjectsTable {
private String toHighlight;
public void display(final ProjectMap projects, final String toHighlight) {
public void display(ProjectMap projects, String toHighlight) {
this.toHighlight = toHighlight;
super.display(projects);
}
@Override
protected void populate(final int row, final ProjectInfo k) {
protected void populate(int row, ProjectInfo k) {
populateState(row, k);
table.setWidget(
row, ProjectsTable.C_NAME, new InlineHTML(Util.highlight(k.name(), toHighlight)));

View File

@@ -127,7 +127,7 @@ public class HintTextBox extends NpTextBox {
addKeyDownHandler(
new KeyDownHandler() {
@Override
public void onKeyDown(final KeyDownEvent event) {
public void onKeyDown(KeyDownEvent event) {
onKey(event.getNativeKeyCode());
}
});

View File

@@ -35,7 +35,7 @@ public class Hyperlink extends com.google.gwt.user.client.ui.Hyperlink {
* @param token the history token to which it will link, which may not be null (use {@link Anchor}
* instead if you don't need history processing)
*/
public Hyperlink(final String text, final String token) {
public Hyperlink(String text, String token) {
super(text, token);
}
@@ -52,7 +52,7 @@ public class Hyperlink extends com.google.gwt.user.client.ui.Hyperlink {
}
@Override
public void onBrowserEvent(final Event event) {
public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK && impl.handleAsClick(event)) {
event.preventDefault();
go();

View File

@@ -28,7 +28,7 @@ public class InlineHyperlink extends com.google.gwt.user.client.ui.InlineHyperli
* @param text the hyperlink's text
* @param token the history token to which it will link
*/
public InlineHyperlink(final String text, final String token) {
public InlineHyperlink(String text, String token) {
super(text, token);
}
@@ -36,7 +36,7 @@ public class InlineHyperlink extends com.google.gwt.user.client.ui.InlineHyperli
public InlineHyperlink() {}
@Override
public void onBrowserEvent(final Event event) {
public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK && impl.handleAsClick(event)) {
event.preventDefault();
go();

View File

@@ -32,20 +32,20 @@ public class LinkMenuBar extends Composite implements ScreenLoadHandler {
Gerrit.EVENT_BUS.addHandler(ScreenLoadEvent.TYPE, this);
}
public void addItem(final String text, final Command imp) {
public void addItem(String text, Command imp) {
add(new CommandMenuItem(text, imp));
}
public void addItem(final CommandMenuItem i) {
public void addItem(CommandMenuItem i) {
add(i);
}
public void addItem(final LinkMenuItem i) {
public void addItem(LinkMenuItem i) {
i.setMenuBar(this);
add(i);
}
public void insertItem(final LinkMenuItem i, int beforeIndex) {
public void insertItem(LinkMenuItem i, int beforeIndex) {
i.setMenuBar(this);
insert(i, beforeIndex);
}
@@ -66,7 +66,7 @@ public class LinkMenuBar extends Composite implements ScreenLoadHandler {
return null;
}
public void add(final Widget i) {
public void add(Widget i) {
if (body.getWidgetCount() > 0) {
final Widget p = body.getWidget(body.getWidgetCount() - 1);
p.addStyleName(Gerrit.RESOURCES.css().linkMenuItemNotLast());
@@ -74,7 +74,7 @@ public class LinkMenuBar extends Composite implements ScreenLoadHandler {
body.add(i);
}
public void insert(final Widget i, int beforeIndex) {
public void insert(Widget i, int beforeIndex) {
if (body.getWidgetCount() == 0 || body.getWidgetCount() <= beforeIndex) {
add(i);
return;

View File

@@ -21,7 +21,7 @@ import com.google.gwt.dom.client.AnchorElement;
public class LinkMenuItem extends InlineHyperlink implements ScreenLoadHandler {
private LinkMenuBar bar;
public LinkMenuItem(final String text, final String targetHistoryToken) {
public LinkMenuItem(String text, String targetHistoryToken) {
super(text, targetHistoryToken);
setStyleName(Gerrit.RESOURCES.css().menuItem());
Roles.getMenuitemRole().set(getElement());

View File

@@ -54,22 +54,22 @@ public abstract class MenuScreen extends Screen {
}
@Override
protected void add(final Widget w) {
protected void add(Widget w) {
body.add(w);
}
protected void link(final String text, final String target) {
protected void link(String text, String target) {
link(text, target, true);
}
protected void link(final String text, final String target, final boolean visible) {
protected void link(String text, String target, boolean visible) {
final LinkMenuItem item = new LinkMenuItem(text, target);
item.setStyleName(Gerrit.RESOURCES.css().menuItem());
item.setVisible(visible);
menu.add(item);
}
protected void setLinkVisible(final String token, final boolean visible) {
protected void setLinkVisible(String token, boolean visible) {
final LinkMenuItem item = menu.find(token);
item.setVisible(visible);
}

Some files were not shown because too many files have changed in this diff Show More