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

@ -177,7 +177,7 @@ public abstract class AbstractDaemonTest {
private final TestRule testRunner =
new TestRule() {
@Override
public Statement apply(final Statement base, final Description description) {
public Statement apply(Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {

View File

@ -191,7 +191,7 @@ public class AcceptanceTestRequestScope {
static final Scope REQUEST =
new Scope() {
@Override
public <T> Provider<T> scope(final Key<T> key, final Provider<T> creator) {
public <T> Provider<T> scope(Key<T> key, Provider<T> creator) {
return new Provider<T>() {
@Override
public T get() {

View File

@ -58,8 +58,7 @@ public class EventRecorder {
}
}
public EventRecorder(
DynamicSet<UserScopedEventListener> eventListeners, final IdentifiedUser user) {
public EventRecorder(DynamicSet<UserScopedEventListener> eventListeners, IdentifiedUser user) {
recordedEvents = LinkedListMultimap.create();
eventListenerRegistration =

View File

@ -56,7 +56,7 @@ public class GitUtil {
private static final AtomicInteger testRepoCount = new AtomicInteger();
private static final int TEST_REPO_WINDOW_DAYS = 2;
public static void initSsh(final TestAccount a) {
public static void initSsh(TestAccount a) {
final Properties config = new Properties();
config.put("StrictHostKeyChecking", "no");
JSch.setConfig(config);

View File

@ -95,7 +95,7 @@ class InProcessProtocol extends TestProtocol<Context> {
private static final Scope REQUEST =
new Scope() {
@Override
public <T> Provider<T> scope(final Key<T> key, final Provider<T> creator) {
public <T> Provider<T> scope(Key<T> key, Provider<T> creator) {
return new Provider<T>() {
@Override
public T get() {
@ -242,8 +242,7 @@ class InProcessProtocol extends TestProtocol<Context> {
}
@Override
public UploadPack create(Context req, final Repository repo)
throws ServiceNotAuthorizedException {
public UploadPack create(Context req, Repository repo) throws ServiceNotAuthorizedException {
// Set the request context, but don't bother unsetting, since we don't
// have an easy way to run code when this instance is done being used.
// Each operation is run in its own thread, so we don't need to recover
@ -300,8 +299,7 @@ class InProcessProtocol extends TestProtocol<Context> {
}
@Override
public ReceivePack create(final Context req, Repository db)
throws ServiceNotAuthorizedException {
public ReceivePack create(Context req, Repository db) throws ServiceNotAuthorizedException {
// Set the request context, but don't bother unsetting, since we don't
// have an easy way to run code when this instance is done being used.
// Each operation is run in its own thread, so we don't need to recover

View File

@ -360,7 +360,7 @@ public class PushOneCommit {
return new Result(ref, pushHead(testRepo, ref, tag != null, force, pushOptions), c, subject);
}
public void setTag(final Tag tag) {
public void setTag(Tag tag) {
this.tag = tag;
}

View File

@ -575,7 +575,7 @@ public class GetRelatedIT extends AbstractDaemonTest {
return result;
}
private void clearGroups(final PatchSet.Id psId) throws Exception {
private void clearGroups(PatchSet.Id psId) throws Exception {
try (BatchUpdate bu = batchUpdateFactory.create(db, project, user(user), TimeUtil.nowTs())) {
bu.addOp(
psId.getParentKey(),

View File

@ -22,11 +22,11 @@ package com.google.gerrit.server.query;
public class QueryParseException extends Exception {
private static final long serialVersionUID = 1L;
public QueryParseException(final String message) {
public QueryParseException(String message) {
super(message);
}
public QueryParseException(final String msg, final Throwable why) {
public QueryParseException(String msg, Throwable why) {
super(msg, why);
}
}

View File

@ -115,7 +115,7 @@ class H2CacheFactory implements PersistentCacheFactory, LifecycleListener {
@Override
public void start() {
if (executor != null) {
for (final H2CacheImpl<?, ?> cache : caches) {
for (H2CacheImpl<?, ?> cache : caches) {
executor.execute(cache::start);
@SuppressWarnings("unused")
Future<?> possiblyIgnoredError =

View File

@ -150,7 +150,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
}
@Override
public void put(final K key, V val) {
public void put(K key, V val) {
final ValueHolder<V> h = new ValueHolder<>(val);
h.created = TimeUtil.nowMs();
mem.put(key, h);
@ -159,7 +159,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
@SuppressWarnings("unchecked")
@Override
public void invalidate(final Object key) {
public void invalidate(Object key) {
if (keyType.getRawType().isInstance(key) && store.mightContain((K) key)) {
executor.execute(() -> store.invalidate((K) key));
}
@ -201,7 +201,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
store.close();
}
void prune(final ScheduledExecutorService service) {
void prune(ScheduledExecutorService service) {
store.prune(mem);
Calendar cal = Calendar.getInstance();
@ -239,7 +239,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
}
@Override
public ValueHolder<V> load(final K key) throws Exception {
public ValueHolder<V> load(K key) throws Exception {
if (store.mightContain(key)) {
ValueHolder<V> h = store.getIfPresent(key);
if (h != null) {

View File

@ -17,11 +17,11 @@ package com.google.gerrit.common;
public class Die extends RuntimeException {
private static final long serialVersionUID = 1L;
public Die(final String why) {
public Die(String why) {
super(why);
}
public Die(final String why, final Throwable cause) {
public Die(String why, Throwable cause) {
super(why, cause);
}
}

View File

@ -39,18 +39,18 @@ public class FileUtil {
return !Arrays.equals(curVers, newVers);
}
public static void mkdir(final File path) {
public static void mkdir(File path) {
if (!path.isDirectory() && !path.mkdir()) {
throw new Die("Cannot make directory " + path);
}
}
public static void chmod(final int mode, final Path path) {
public static void chmod(int mode, Path path) {
// TODO(dborowitz): Is there a portable way to do this with NIO?
chmod(mode, path.toFile());
}
public static void chmod(final int mode, final File path) {
public static void chmod(int mode, File path) {
path.setReadable(false, false /* all */);
path.setWritable(false, false /* all */);
path.setExecutable(false, false /* all */);

View File

@ -32,7 +32,7 @@ import java.util.Set;
@GwtIncompatible("Unemulated methods in Class and OutputStream")
public final class IoUtil {
public static void copyWithThread(final InputStream src, final OutputStream dst) {
public static void copyWithThread(InputStream src, OutputStream dst) {
new Thread("IoUtil-Copy") {
@Override
public void run() {

View File

@ -55,7 +55,7 @@ public class PageLinks {
return "/c/" + c + ",edit/";
}
public static String toChange(final Change.Id c) {
public static String toChange(Change.Id c) {
return "/c/" + c + "/";
}
@ -72,15 +72,15 @@ public class PageLinks {
return u;
}
public static String toChange(final PatchSet.Id ps) {
public static String toChange(PatchSet.Id ps) {
return "/c/" + ps.getParentKey() + "/" + ps.getId();
}
public static String toProject(final Project.NameKey p) {
public static String toProject(Project.NameKey p) {
return ADMIN_PROJECTS + p.get();
}
public static String toProjectAcceess(final Project.NameKey p) {
public static String toProjectAcceess(Project.NameKey p) {
return "/admin/projects/" + p.get() + ",access";
}
@ -100,7 +100,7 @@ public class PageLinks {
return toChangeQuery(op("assignee", fullname));
}
public static String toCustomDashboard(final String params) {
public static String toCustomDashboard(String params) {
return "/dashboard/?" + params;
}

View File

@ -26,7 +26,7 @@ import java.util.Set;
public class ProjectAccessUtil {
public static List<AccessSection> mergeSections(List<AccessSection> src) {
Map<String, AccessSection> map = new LinkedHashMap<>();
for (final AccessSection section : src) {
for (AccessSection section : src) {
if (section.getPermissions().isEmpty()) {
continue;
}
@ -44,21 +44,21 @@ public class ProjectAccessUtil {
public static List<AccessSection> removeEmptyPermissionsAndSections(
final List<AccessSection> src) {
final Set<AccessSection> sectionsToRemove = new HashSet<>();
for (final AccessSection section : src) {
for (AccessSection section : src) {
final Set<Permission> permissionsToRemove = new HashSet<>();
for (final Permission permission : section.getPermissions()) {
for (Permission permission : section.getPermissions()) {
if (permission.getRules().isEmpty()) {
permissionsToRemove.add(permission);
}
}
for (final Permission permissionToRemove : permissionsToRemove) {
for (Permission permissionToRemove : permissionsToRemove) {
section.remove(permissionToRemove);
}
if (section.getPermissions().isEmpty()) {
sectionsToRemove.add(section);
}
}
for (final AccessSection sectionToRemove : sectionsToRemove) {
for (AccessSection sectionToRemove : sectionsToRemove) {
src.remove(sectionToRemove);
}
return src;

View File

@ -30,7 +30,7 @@ public class RawInputUtil {
return create(content.getBytes(UTF_8));
}
public static RawInput create(final byte[] bytes, final String contentType) {
public static RawInput create(byte[] bytes, String contentType) {
Preconditions.checkNotNull(bytes);
Preconditions.checkArgument(bytes.length > 0);
return new RawInput() {
@ -51,11 +51,11 @@ public class RawInputUtil {
};
}
public static RawInput create(final byte[] bytes) {
public static RawInput create(byte[] bytes) {
return create(bytes, "application/octet-stream");
}
public static RawInput create(final HttpServletRequest req) {
public static RawInput create(HttpServletRequest req) {
return new RawInput() {
@Override
public String getContentType() {

View File

@ -121,7 +121,7 @@ public class AccessSection extends RefConfigSection implements Comparable<Access
}
@Override
public boolean equals(final Object obj) {
public boolean equals(Object obj) {
if (!super.equals(obj) || !(obj instanceof AccessSection)) {
return false;
}

View File

@ -31,7 +31,7 @@ public class AccountInfo {
* <p>This constructor should only be a last-ditch effort, when the usual account lookup has
* failed and a stale account id has been discovered in the data store.
*/
public AccountInfo(final Account.Id id) {
public AccountInfo(Account.Id id) {
this.id = id;
}
@ -40,7 +40,7 @@ public class AccountInfo {
*
* @param a the data store record holding the specific account details.
*/
public AccountInfo(final Account a) {
public AccountInfo(Account a) {
id = a.getId();
fullName = a.getFullName();
preferredEmail = a.getPreferredEmail();
@ -66,7 +66,7 @@ public class AccountInfo {
return preferredEmail;
}
public void setPreferredEmail(final String email) {
public void setPreferredEmail(String email) {
preferredEmail = email;
}

View File

@ -29,7 +29,7 @@ public class FilenameComparator implements Comparator<String> {
private FilenameComparator() {}
@Override
public int compare(final String path1, final String path2) {
public int compare(String path1, String path2) {
if (Patch.COMMIT_MSG.equals(path1) && Patch.COMMIT_MSG.equals(path2)) {
return 0;
} else if (Patch.COMMIT_MSG.equals(path1)) {

View File

@ -29,7 +29,7 @@ public class GroupDescriptions {
return null;
}
public static GroupDescription.Internal forAccountGroup(final AccountGroup group) {
public static GroupDescription.Internal forAccountGroup(AccountGroup group) {
return new GroupDescription.Internal() {
@Override
public AccountGroup.UUID getGroupUUID() {

View File

@ -31,7 +31,7 @@ public class GroupInfo {
* <p>This constructor should only be a last-ditch effort, when the usual group lookup has failed
* and a stale group id has been discovered in the data store.
*/
public GroupInfo(final AccountGroup.UUID uuid) {
public GroupInfo(AccountGroup.UUID uuid) {
this.uuid = uuid;
}

View File

@ -274,7 +274,7 @@ public class LabelType {
return byValue.get(value);
}
public LabelValue getValue(final PatchSetApproval ca) {
public LabelValue getValue(PatchSetApproval ca) {
initByValue();
return byValue.get(ca.getValue());
}
@ -282,7 +282,7 @@ public class LabelType {
private void initByValue() {
if (byValue == null) {
byValue = new HashMap<>();
for (final LabelValue v : values) {
for (LabelValue v : values) {
byValue.put(v.getValue(), v);
}
}

View File

@ -29,7 +29,7 @@ public class LabelTypes {
protected LabelTypes() {}
public LabelTypes(final List<? extends LabelType> approvals) {
public LabelTypes(List<? extends LabelType> approvals) {
labelTypes = Collections.unmodifiableList(new ArrayList<>(approvals));
}

View File

@ -24,7 +24,7 @@ import java.util.Map;
/** Performs replacements on strings such as <code>Hello ${user}</code>. */
public class ParameterizedString {
/** Obtain a string which has no parameters and always produces the value. */
public static ParameterizedString asis(final String constant) {
public static ParameterizedString asis(String constant) {
return new ParameterizedString(new Constant(constant));
}
@ -37,14 +37,14 @@ public class ParameterizedString {
this(new Constant(""));
}
private ParameterizedString(final Constant c) {
private ParameterizedString(Constant c) {
pattern = c.text;
rawPattern = c.text;
patternOps = Collections.<Format>singletonList(c);
parameters = Collections.emptyList();
}
public ParameterizedString(final String pattern) {
public ParameterizedString(String pattern) {
final StringBuilder raw = new StringBuilder();
final List<Parameter> prs = new ArrayList<>(4);
final List<Format> ops = new ArrayList<>(4);
@ -103,7 +103,7 @@ public class ParameterizedString {
}
/** Convert a map of parameters into a value array for binding. */
public String[] bind(final Map<String, String> params) {
public String[] bind(Map<String, String> params) {
final String[] r = new String[parameters.size()];
for (int i = 0; i < r.length; i++) {
final StringBuilder b = new StringBuilder();
@ -114,15 +114,15 @@ public class ParameterizedString {
}
/** Format this string by performing the variable replacements. */
public String replace(final Map<String, String> params) {
public String replace(Map<String, String> params) {
final StringBuilder r = new StringBuilder();
for (final Format f : patternOps) {
for (Format f : patternOps) {
f.format(r, params);
}
return r.toString();
}
public Builder replace(final String name, final String value) {
public Builder replace(String name, String value) {
return new Builder().replace(name, value);
}
@ -134,7 +134,7 @@ public class ParameterizedString {
public final class Builder {
private final Map<String, String> params = new HashMap<>();
public Builder replace(final String name, final String value) {
public Builder replace(String name, String value) {
params.put(name, value);
return this;
}
@ -152,7 +152,7 @@ public class ParameterizedString {
private static class Constant extends Format {
private final String text;
Constant(final String text) {
Constant(String text) {
this.text = text;
}
@ -166,7 +166,7 @@ public class ParameterizedString {
private final String name;
private final List<Function> functions;
Parameter(final String parameter) {
Parameter(String parameter) {
// "parameter[.functions...]" -> (parameter, functions...)
final List<String> names = Arrays.asList(parameter.split("\\."));
final List<Function> functs = new ArrayList<>(names.size());

View File

@ -262,7 +262,7 @@ public class Permission implements Comparable<Permission> {
}
@Override
public boolean equals(final Object obj) {
public boolean equals(Object obj) {
if (!(obj instanceof Permission)) {
return false;
}

View File

@ -278,7 +278,7 @@ public class PermissionRule implements Comparable<PermissionRule> {
}
@Override
public boolean equals(final Object obj) {
public boolean equals(Object obj) {
if (!(obj instanceof PermissionRule)) {
return false;
}

View File

@ -46,7 +46,7 @@ public abstract class RefConfigSection {
}
@Override
public boolean equals(final Object obj) {
public boolean equals(Object obj) {
if (!(obj instanceof RefConfigSection)) {
return false;
}

View File

@ -22,7 +22,7 @@ public class SshHostKey {
protected SshHostKey() {}
public SshHostKey(final String hi, final String hk, final String fp) {
public SshHostKey(String hi, String hk, String fp) {
hostIdent = hi;
hostKey = hk;
fingerprint = fp;

View File

@ -22,23 +22,23 @@ public class NoSuchGroupException extends Exception {
public static final String MESSAGE = "Group Not Found: ";
public NoSuchGroupException(final AccountGroup.Id key) {
public NoSuchGroupException(AccountGroup.Id key) {
this(key, null);
}
public NoSuchGroupException(final AccountGroup.UUID key) {
public NoSuchGroupException(AccountGroup.UUID key) {
this(key, null);
}
public NoSuchGroupException(final AccountGroup.Id key, final Throwable why) {
public NoSuchGroupException(AccountGroup.Id key, Throwable why) {
super(MESSAGE + key.toString(), why);
}
public NoSuchGroupException(final AccountGroup.UUID key, final Throwable why) {
public NoSuchGroupException(AccountGroup.UUID key, Throwable why) {
super(MESSAGE + key.toString(), why);
}
public NoSuchGroupException(final AccountGroup.NameKey k, final Throwable why) {
public NoSuchGroupException(AccountGroup.NameKey k, Throwable why) {
super(MESSAGE + k.toString(), why);
}
@ -46,7 +46,7 @@ public class NoSuchGroupException extends Exception {
this(who, null);
}
public NoSuchGroupException(String who, final Throwable why) {
public NoSuchGroupException(String who, Throwable why) {
super(MESSAGE + who, why);
}
}

View File

@ -20,7 +20,7 @@ public class UpdateParentFailedException extends Exception {
public static final String MESSAGE = "Update Parent Project Failed: ";
public UpdateParentFailedException(final String message, final Throwable why) {
public UpdateParentFailedException(String message, Throwable why) {
super(MESSAGE + ": " + message, why);
}
}

View File

@ -39,7 +39,7 @@ public abstract class FactoryModule extends AbstractModule {
*
* @param factory interface which specifies the bean factory method.
*/
protected void factory(final Class<?> factory) {
protected void factory(Class<?> factory) {
install(new FactoryModuleBuilder().build(factory));
}
}

View File

@ -186,7 +186,7 @@ public class DynamicSet<T> implements Iterable<T> {
* @param item item to check whether or not it is contained.
* @return {@code true} if this set contains the given item.
*/
public boolean contains(final T item) {
public boolean contains(T item) {
Iterator<T> iterator = iterator();
while (iterator.hasNext()) {
T candidate = iterator.next();
@ -203,7 +203,7 @@ public class DynamicSet<T> implements Iterable<T> {
* @param item the item to add to the collection. Must not be null.
* @return handle to remove the item at a later point in time.
*/
public RegistrationHandle add(final T item) {
public RegistrationHandle add(T item) {
return add(Providers.of(item));
}
@ -213,7 +213,7 @@ public class DynamicSet<T> implements Iterable<T> {
* @param item the item to add to the collection. Must not be null.
* @return handle to remove the item at a later point in time.
*/
public RegistrationHandle add(final Provider<T> item) {
public RegistrationHandle add(Provider<T> item) {
final AtomicReference<Provider<T>> ref = new AtomicReference<>(item);
items.add(ref);
return new RegistrationHandle() {

View File

@ -30,7 +30,7 @@ public class PrivateInternals_DynamicMapImpl<T> extends DynamicMap<T> {
* @param item the item to add to the collection. Must not be null.
* @return handle to remove the item at a later point in time.
*/
public RegistrationHandle put(String pluginName, String exportName, final Provider<T> item) {
public RegistrationHandle put(String pluginName, String exportName, Provider<T> item) {
final NamePair key = new NamePair(pluginName, exportName);
items.put(key, item);
return new RegistrationHandle() {

View File

@ -62,7 +62,7 @@ public class CopyableLabel extends Composite implements HasText {
return flashEnabled;
}
public static void setFlashEnabled(final boolean on) {
public static void setFlashEnabled(boolean on) {
flashEnabled = on;
}
@ -87,7 +87,7 @@ public class CopyableLabel extends Composite implements HasText {
*
* @param str initial content
*/
public CopyableLabel(final String str) {
public CopyableLabel(String str) {
this(str, true);
}
@ -98,7 +98,7 @@ public class CopyableLabel extends Composite implements HasText {
* @param showLabel if true, the content is shown, if false it is hidden from view and only the
* copy icon is displayed.
*/
public CopyableLabel(final String str, final boolean showLabel) {
public CopyableLabel(String str, boolean showLabel) {
content = new FlowPanel();
initWidget(content);
@ -111,7 +111,7 @@ public class CopyableLabel extends Composite implements HasText {
textLabel.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
showTextBox();
}
});
@ -160,7 +160,7 @@ public class CopyableLabel extends Composite implements HasText {
* @param text the new preview text, should be shorter than the original text which would be
* copied to the clipboard.
*/
public void setPreviewText(final String text) {
public void setPreviewText(String text) {
if (textLabel != null) {
textLabel.setText(text);
}
@ -206,7 +206,7 @@ public class CopyableLabel extends Composite implements HasText {
}
@Override
public void setText(final String newText) {
public void setText(String newText) {
text = newText;
visibleLen = newText.length();
@ -229,7 +229,7 @@ public class CopyableLabel extends Composite implements HasText {
textBox.addKeyPressHandler(
new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
if (event.isControlKeyDown() || event.isMetaKeyDown()) {
switch (event.getCharCode()) {
case 'c':
@ -237,7 +237,7 @@ public class CopyableLabel extends Composite implements HasText {
textBox.addKeyUpHandler(
new KeyUpHandler() {
@Override
public void onKeyUp(final KeyUpEvent event) {
public void onKeyUp(KeyUpEvent event) {
Scheduler.get()
.scheduleDeferred(
new Command() {
@ -256,7 +256,7 @@ public class CopyableLabel extends Composite implements HasText {
textBox.addBlurHandler(
new BlurHandler() {
@Override
public void onBlur(final BlurEvent event) {
public void onBlur(BlurEvent event) {
hideTextBox();
}
});

View File

@ -38,19 +38,18 @@ public class CssLinker extends AbstractLinker {
}
@Override
public ArtifactSet link(
final TreeLogger logger, final LinkerContext context, final ArtifactSet artifacts)
public ArtifactSet link(final TreeLogger logger, LinkerContext context, ArtifactSet artifacts)
throws UnableToCompleteException {
final ArtifactSet returnTo = new ArtifactSet();
int index = 0;
final HashMap<String, PublicResource> css = new HashMap<>();
for (final StandardStylesheetReference ssr :
for (StandardStylesheetReference ssr :
artifacts.<StandardStylesheetReference>find(StandardStylesheetReference.class)) {
css.put(ssr.getSrc(), null);
}
for (final PublicResource pr : artifacts.<PublicResource>find(PublicResource.class)) {
for (PublicResource pr : artifacts.<PublicResource>find(PublicResource.class)) {
if (css.containsKey(pr.getPartialPath())) {
css.put(pr.getPartialPath(), new CssPubRsrc(name(logger, pr), pr));
}
@ -74,8 +73,7 @@ public class CssLinker extends AbstractLinker {
return returnTo;
}
private String name(final TreeLogger logger, final PublicResource r)
throws UnableToCompleteException {
private String name(TreeLogger logger, PublicResource r) throws UnableToCompleteException {
byte[] out;
try (ByteArrayOutputStream tmp = new ByteArrayOutputStream();
InputStream in = r.getContents(logger)) {
@ -105,13 +103,13 @@ public class CssLinker extends AbstractLinker {
private static final long serialVersionUID = 1L;
private final PublicResource src;
CssPubRsrc(final String partialPath, final PublicResource r) {
CssPubRsrc(String partialPath, PublicResource r) {
super(StandardLinkerContext.class, partialPath);
src = r;
}
@Override
public InputStream getContents(final TreeLogger logger) throws UnableToCompleteException {
public InputStream getContents(TreeLogger logger) throws UnableToCompleteException {
return src.getContents(logger);
}

View File

@ -34,7 +34,7 @@ public final class CompoundKeyCommand extends KeyCommand {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
GlobalKey.temporaryWithTimeout(set);
}
}

View File

@ -30,7 +30,7 @@ public class GlobalKey {
public static final KeyPressHandler STOP_PROPAGATION =
new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
event.stopPropagation();
}
};
@ -50,7 +50,7 @@ public class GlobalKey {
.addKeyPressHandler(
new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
final KeyCommandSet s = active.live;
if (s != active.all) {
active.live = active.all;
@ -78,19 +78,19 @@ public class GlobalKey {
restoreGlobal =
new CloseHandler<PopupPanel>() {
@Override
public void onClose(final CloseEvent<PopupPanel> event) {
public void onClose(CloseEvent<PopupPanel> event) {
active = global;
}
};
}
}
static void temporaryWithTimeout(final KeyCommandSet s) {
static void temporaryWithTimeout(KeyCommandSet s) {
active.live = s;
restoreTimer.schedule(250);
}
public static void dialog(final PopupPanel panel) {
public static void dialog(PopupPanel panel) {
initEvents();
initDialog();
assert panel.isShowing();
@ -110,7 +110,7 @@ public class GlobalKey {
KeyDownEvent.getType());
}
public static HandlerRegistration addApplication(final Widget widget, final KeyCommand appKey) {
public static HandlerRegistration addApplication(Widget widget, KeyCommand appKey) {
initEvents();
final State state = stateFor(widget);
state.add(appKey);
@ -122,7 +122,7 @@ public class GlobalKey {
};
}
public static HandlerRegistration add(final Widget widget, final KeyCommandSet cmdSet) {
public static HandlerRegistration add(Widget widget, KeyCommandSet cmdSet) {
initEvents();
final State state = stateFor(widget);
state.add(cmdSet);
@ -144,7 +144,7 @@ public class GlobalKey {
return global;
}
public static void filter(final KeyCommandFilter filter) {
public static void filter(KeyCommandFilter filter) {
active.filter(filter);
if (active != global) {
global.filter(filter);
@ -159,7 +159,7 @@ public class GlobalKey {
final KeyCommandSet all;
KeyCommandSet live;
State(final Widget r) {
State(Widget r) {
root = r;
app = new KeyCommandSet(KeyConstants.I.applicationSection());
@ -171,25 +171,25 @@ public class GlobalKey {
live = all;
}
void add(final KeyCommand k) {
void add(KeyCommand k) {
app.add(k);
all.add(k);
}
void remove(final KeyCommand k) {
void remove(KeyCommand k) {
app.remove(k);
all.remove(k);
}
void add(final KeyCommandSet s) {
void add(KeyCommandSet s) {
all.add(s);
}
void remove(final KeyCommandSet s) {
void remove(KeyCommandSet s) {
all.remove(s);
}
void filter(final KeyCommandFilter f) {
void filter(KeyCommandFilter f) {
all.filter(f);
}
}

View File

@ -27,7 +27,7 @@ public class HidePopupPanelCommand extends KeyCommand {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
panel.hide();
}
}

View File

@ -25,7 +25,7 @@ public abstract class KeyCommand implements KeyPressHandler {
public static final int M_META = 4 << 16;
public static final int M_SHIFT = 8 << 16;
public static boolean same(final KeyCommand a, final KeyCommand b) {
public static boolean same(KeyCommand a, KeyCommand b) {
return a.getClass() == b.getClass() && a.helpText.equals(b.helpText) && a.sibling == b.sibling;
}
@ -33,11 +33,11 @@ public abstract class KeyCommand implements KeyPressHandler {
private final String helpText;
KeyCommand sibling;
public KeyCommand(final int mask, final int key, final String help) {
public KeyCommand(int mask, int key, String help) {
this(mask, (char) key, help);
}
public KeyCommand(final int mask, final char key, final String help) {
public KeyCommand(int mask, char key, String help) {
assert help != null;
keyMask = mask | key;
helpText = help;
@ -88,12 +88,12 @@ public abstract class KeyCommand implements KeyPressHandler {
return b;
}
private void modifier(final SafeHtmlBuilder b, final String name) {
private void modifier(SafeHtmlBuilder b, String name) {
namedKey(b, name);
b.append(" + ");
}
private void namedKey(final SafeHtmlBuilder b, final String name) {
private void namedKey(SafeHtmlBuilder b, String name) {
b.append('<');
b.openSpan();
b.setStyleName(KeyResources.I.css().helpKey());

View File

@ -33,7 +33,7 @@ public class KeyCommandSet implements KeyPressHandler {
this("");
}
public KeyCommandSet(final String setName) {
public KeyCommandSet(String setName) {
map = new HashMap<>();
name = setName;
}
@ -42,7 +42,7 @@ public class KeyCommandSet implements KeyPressHandler {
return name;
}
public void setName(final String setName) {
public void setName(String setName) {
assert setName != null;
name = setName;
}
@ -62,7 +62,7 @@ public class KeyCommandSet implements KeyPressHandler {
b.sibling = a;
}
public void add(final KeyCommand k) {
public void add(KeyCommand k) {
assert !map.containsKey(k.keyMask)
: "Key " + k.describeKeyStroke().asString() + " already registered";
if (!map.containsKey(k.keyMask)) {
@ -70,38 +70,38 @@ public class KeyCommandSet implements KeyPressHandler {
}
}
public void remove(final KeyCommand k) {
public void remove(KeyCommand k) {
assert map.get(k.keyMask) == k;
map.remove(k.keyMask);
}
public void add(final KeyCommandSet set) {
public void add(KeyCommandSet set) {
if (sets == null) {
sets = new ArrayList<>();
}
assert !sets.contains(set);
sets.add(set);
for (final KeyCommand k : set.map.values()) {
for (KeyCommand k : set.map.values()) {
add(k);
}
}
public void remove(final KeyCommandSet set) {
public void remove(KeyCommandSet set) {
assert sets != null;
assert sets.contains(set);
sets.remove(set);
for (final KeyCommand k : set.map.values()) {
for (KeyCommand k : set.map.values()) {
remove(k);
}
}
public void filter(final KeyCommandFilter filter) {
public void filter(KeyCommandFilter filter) {
if (sets != null) {
for (final KeyCommandSet s : sets) {
for (KeyCommandSet s : sets) {
s.filter(filter);
}
}
for (final Iterator<KeyCommand> i = map.values().iterator(); i.hasNext(); ) {
for (Iterator<KeyCommand> i = map.values().iterator(); i.hasNext(); ) {
final KeyCommand kc = i.next();
if (!filter.include(kc)) {
i.remove();
@ -120,7 +120,7 @@ public class KeyCommandSet implements KeyPressHandler {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
final KeyCommand k = map.get(toMask(event));
if (k != null) {
event.preventDefault();
@ -129,7 +129,7 @@ public class KeyCommandSet implements KeyPressHandler {
}
}
static int toMask(final KeyPressEvent event) {
static int toMask(KeyPressEvent event) {
int mask = event.getUnicodeCharCode();
if (mask == 0) {
mask = event.getNativeEvent().getKeyCode();

View File

@ -51,7 +51,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
closer.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
hide();
}
});
@ -84,7 +84,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
}
@Override
public void setVisible(final boolean show) {
public void setVisible(boolean show) {
super.setVisible(show);
if (show) {
focus.setFocus(true);
@ -92,7 +92,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
if (KeyCommandSet.toMask(event) == ShowHelpCommand.INSTANCE.keyMask) {
// Block the '?' key from triggering us to show right after
// we just hide ourselves.
@ -104,16 +104,16 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
}
@Override
public void onKeyDown(final KeyDownEvent event) {
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
hide();
}
}
private void populate(final Grid lists) {
private void populate(Grid lists) {
int[] end = new int[5];
int column = 0;
for (final KeyCommandSet set : combinedSetsByName()) {
for (KeyCommandSet set : combinedSetsByName()) {
int row = end[column];
row = formatGroup(lists, row, column, set);
end[column] = row;
@ -131,7 +131,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
*/
private static Collection<KeyCommandSet> combinedSetsByName() {
LinkedHashMap<String, KeyCommandSet> byName = new LinkedHashMap<>();
for (final KeyCommandSet set : GlobalKey.active.all.getSets()) {
for (KeyCommandSet set : GlobalKey.active.all.getSets()) {
KeyCommandSet v = byName.get(set.getName());
if (v == null) {
v = new KeyCommandSet(set.getName());
@ -142,7 +142,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
return byName.values();
}
private int formatGroup(final Grid lists, int row, final int col, final KeyCommandSet set) {
private int formatGroup(Grid lists, int row, int col, KeyCommandSet set) {
if (set.isEmpty()) {
return row;
}
@ -157,8 +157,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
return formatKeys(lists, row, col, set, null);
}
private int formatKeys(
final Grid lists, int row, final int col, final KeyCommandSet set, final SafeHtml prefix) {
private int formatKeys(final Grid lists, int row, int col, KeyCommandSet set, SafeHtml prefix) {
final CellFormatter fmt = lists.getCellFormatter();
final List<KeyCommand> keys = sort(set);
if (lists.getRowCount() < row + keys.size()) {
@ -228,7 +227,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
return row;
}
private List<KeyCommand> sort(final KeyCommandSet set) {
private List<KeyCommand> sort(KeyCommandSet set) {
final List<KeyCommand> keys = new ArrayList<>(set.getKeys());
Collections.sort(
keys,

View File

@ -22,7 +22,7 @@ public class NpTextBox extends TextBox {
addKeyPressHandler(GlobalKey.STOP_PROPAGATION);
}
public NpTextBox(final Element element) {
public NpTextBox(Element element) {
super(element);
addKeyPressHandler(GlobalKey.STOP_PROPAGATION);
}

View File

@ -40,7 +40,7 @@ public class ShowHelpCommand extends KeyCommand {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
if (current != null) {
// Already open? Close the dialog.
//
@ -52,7 +52,7 @@ public class ShowHelpCommand extends KeyCommand {
help.addCloseHandler(
new CloseHandler<PopupPanel>() {
@Override
public void onClose(final CloseEvent<PopupPanel> event) {
public void onClose(CloseEvent<PopupPanel> event) {
current = null;
BUS.fireEvent(new FocusEvent() {});
}
@ -61,7 +61,7 @@ public class ShowHelpCommand extends KeyCommand {
help.setPopupPositionAndShow(
new PositionCallback() {
@Override
public void setPosition(final int pWidth, final int pHeight) {
public void setPosition(int pWidth, int pHeight) {
final int left = (Window.getClientWidth() - pWidth) >> 1;
final int wLeft = Window.getScrollLeft();
final int wTop = Window.getScrollTop();

View File

@ -41,7 +41,7 @@ public class ProgressBar extends Composite {
}
/** Create a bar displaying the specified message. */
public ProgressBar(final String text) {
public ProgressBar(String text) {
if (text == null || text.length() == 0) {
callerText = "";
} else {
@ -68,7 +68,7 @@ public class ProgressBar extends Composite {
}
/** Update the bar's percent completion. */
public void setValue(final int pComplete) {
public void setValue(int pComplete) {
assert 0 <= pComplete && pComplete <= 100;
value = pComplete;
bar.setWidth(2 * pComplete + "px");

View File

@ -38,7 +38,7 @@ class AttMap {
private Tag tag = ANY;
private int live;
void reset(final String tagName) {
void reset(String tagName) {
tag = TAGS.get(tagName.toLowerCase());
if (tag == null) {
tag = ANY;
@ -46,7 +46,7 @@ class AttMap {
live = 0;
}
void onto(final Buffer raw, final SafeHtmlBuilder esc) {
void onto(Buffer raw, SafeHtmlBuilder esc) {
for (int i = 0; i < live; i++) {
final String v = values.get(i);
if (v.length() > 0) {
@ -70,7 +70,7 @@ class AttMap {
return "";
}
void set(String name, final String value) {
void set(String name, String value) {
name = name.toLowerCase();
tag.assertSafe(name, value);
@ -91,7 +91,7 @@ class AttMap {
}
}
private static void assertNotJavascriptUrl(final String value) {
private static void assertNotJavascriptUrl(String value) {
if (value.startsWith("#")) {
// common in GWT, and safe, so bypass further checks

View File

@ -22,37 +22,37 @@ final class BufferDirect implements Buffer {
}
@Override
public void append(final boolean v) {
public void append(boolean v) {
strbuf.append(v);
}
@Override
public void append(final char v) {
public void append(char v) {
strbuf.append(v);
}
@Override
public void append(final int v) {
public void append(int v) {
strbuf.append(v);
}
@Override
public void append(final long v) {
public void append(long v) {
strbuf.append(v);
}
@Override
public void append(final float v) {
public void append(float v) {
strbuf.append(v);
}
@Override
public void append(final double v) {
public void append(double v) {
strbuf.append(v);
}
@Override
public void append(final String v) {
public void append(String v) {
strbuf.append(v);
}

View File

@ -17,42 +17,42 @@ package com.google.gwtexpui.safehtml.client;
final class BufferSealElement implements Buffer {
private final SafeHtmlBuilder shb;
BufferSealElement(final SafeHtmlBuilder safeHtmlBuilder) {
BufferSealElement(SafeHtmlBuilder safeHtmlBuilder) {
shb = safeHtmlBuilder;
}
@Override
public void append(final boolean v) {
public void append(boolean v) {
shb.sealElement().append(v);
}
@Override
public void append(final char v) {
public void append(char v) {
shb.sealElement().append(v);
}
@Override
public void append(final double v) {
public void append(double v) {
shb.sealElement().append(v);
}
@Override
public void append(final float v) {
public void append(float v) {
shb.sealElement().append(v);
}
@Override
public void append(final int v) {
public void append(int v) {
shb.sealElement().append(v);
}
@Override
public void append(final long v) {
public void append(long v) {
shb.sealElement().append(v);
}
@Override
public void append(final String v) {
public void append(String v) {
shb.sealElement().append(v);
}

View File

@ -45,11 +45,11 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
request,
new Callback() {
@Override
public void onSuggestionsReady(final Request request, final Response response) {
public void onSuggestionsReady(Request request, Response response) {
final String qpat = getQueryPattern(request.getQuery());
final boolean html = isHTML();
final ArrayList<Suggestion> r = new ArrayList<>();
for (final Suggestion s : response.getSuggestions()) {
for (Suggestion s : response.getSuggestions()) {
r.add(new BoldSuggestion(qpat, s, html));
}
cb.onSuggestionsReady(request, new Response(r));
@ -57,7 +57,7 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
});
}
protected String getQueryPattern(final String query) {
protected String getQueryPattern(String query) {
return query;
}
@ -77,7 +77,7 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
private final Suggestion suggestion;
private final String displayString;
BoldSuggestion(final String qstr, final Suggestion s, final boolean html) {
BoldSuggestion(String qstr, Suggestion s, boolean html) {
suggestion = s;
String ds = s.getDisplayString();

View File

@ -79,17 +79,17 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
}
/** @return the existing HTML property of a widget. */
public static SafeHtml get(final HasHTML t) {
public static SafeHtml get(HasHTML t) {
return new SafeHtmlString(t.getHTML());
}
/** @return the existing HTML text, wrapped in a safe buffer. */
public static SafeHtml asis(final String htmlText) {
public static SafeHtml asis(String htmlText) {
return new SafeHtmlString(htmlText);
}
/** Set the HTML property of a widget. */
public static <T extends HasHTML> T set(final T e, final SafeHtml str) {
public static <T extends HasHTML> T set(T e, SafeHtml str) {
e.setHTML(str.asString());
return e;
}
@ -106,13 +106,12 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
}
/** @return the existing inner HTML of a table cell. */
public static SafeHtml get(final HTMLTable t, final int row, final int col) {
public static SafeHtml get(HTMLTable t, int row, int col) {
return new SafeHtmlString(t.getHTML(row, col));
}
/** Set the inner HTML of a table cell. */
public static <T extends HTMLTable> T set(
final T t, final int row, final int col, final SafeHtml str) {
public static <T extends HTMLTable> T set(final T t, int row, int col, SafeHtml str) {
t.setHTML(row, col, str.asString());
return t;
}
@ -140,13 +139,13 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
*/
public SafeHtml wikify() {
final SafeHtmlBuilder r = new SafeHtmlBuilder();
for (final String p : linkify().asString().split("\n\n")) {
for (String p : linkify().asString().split("\n\n")) {
if (isQuote(p)) {
wikifyQuote(r, p);
} else if (isPreFormat(p)) {
r.openElement("p");
for (final String line : p.split("\n")) {
for (String line : p.split("\n")) {
r.openSpan();
r.setStyleName(RESOURCES.css().wikiPreFormat());
r.append(asis(line));
@ -167,7 +166,7 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
return r.toSafeHtml();
}
private void wikifyList(final SafeHtmlBuilder r, final String p) {
private void wikifyList(SafeHtmlBuilder r, String p) {
boolean in_ul = false;
boolean in_p = false;
for (String line : p.split("\n")) {
@ -232,11 +231,11 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
return p.startsWith("&gt; ") || p.startsWith(" &gt; ");
}
private static boolean isPreFormat(final String p) {
private static boolean isPreFormat(String p) {
return p.contains("\n ") || p.contains("\n\t") || p.startsWith(" ") || p.startsWith("\t");
}
private static boolean isList(final String p) {
private static boolean isList(String p) {
return p.contains("\n- ") || p.contains("\n* ") || p.startsWith("- ") || p.startsWith("* ");
}
@ -252,7 +251,7 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
* {@code $<i>n</i>}.
* @return a new string, after the replacement has been made.
*/
public SafeHtml replaceFirst(final String regex, final String repl) {
public SafeHtml replaceFirst(String regex, String repl) {
return new SafeHtmlString(asString().replaceFirst(regex, repl));
}
@ -268,7 +267,7 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
* {@code $<i>n</i>}.
* @return a new string, after the replacements have been made.
*/
public SafeHtml replaceAll(final String regex, final String repl) {
public SafeHtml replaceAll(String regex, String repl) {
return new SafeHtmlString(asString().replaceAll(regex, repl));
}

View File

@ -49,12 +49,12 @@ public class SafeHtmlBuilder extends SafeHtml {
return !isEmpty();
}
public SafeHtmlBuilder append(final boolean in) {
public SafeHtmlBuilder append(boolean in) {
cb.append(in);
return this;
}
public SafeHtmlBuilder append(final char in) {
public SafeHtmlBuilder append(char in) {
switch (in) {
case '&':
cb.append("&amp;");
@ -83,22 +83,22 @@ public class SafeHtmlBuilder extends SafeHtml {
return this;
}
public SafeHtmlBuilder append(final int in) {
public SafeHtmlBuilder append(int in) {
cb.append(in);
return this;
}
public SafeHtmlBuilder append(final long in) {
public SafeHtmlBuilder append(long in) {
cb.append(in);
return this;
}
public SafeHtmlBuilder append(final float in) {
public SafeHtmlBuilder append(float in) {
cb.append(in);
return this;
}
public SafeHtmlBuilder append(final double in) {
public SafeHtmlBuilder append(double in) {
cb.append(in);
return this;
}
@ -112,7 +112,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append already safe HTML as-is, avoiding double escaping. */
public SafeHtmlBuilder append(final SafeHtml in) {
public SafeHtmlBuilder append(SafeHtml in) {
if (in != null) {
cb.append(in.asString());
}
@ -120,7 +120,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the string, escaping unsafe characters. */
public SafeHtmlBuilder append(final String in) {
public SafeHtmlBuilder append(String in) {
if (in != null) {
impl.escapeStr(this, in);
}
@ -128,7 +128,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the string, escaping unsafe characters. */
public SafeHtmlBuilder append(final StringBuilder in) {
public SafeHtmlBuilder append(StringBuilder in) {
if (in != null) {
append(in.toString());
}
@ -136,7 +136,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the string, escaping unsafe characters. */
public SafeHtmlBuilder append(final StringBuffer in) {
public SafeHtmlBuilder append(StringBuffer in) {
if (in != null) {
append(in.toString());
}
@ -144,7 +144,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the result of toString(), escaping unsafe characters. */
public SafeHtmlBuilder append(final Object in) {
public SafeHtmlBuilder append(Object in) {
if (in != null) {
append(in.toString());
}
@ -152,7 +152,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the string, escaping unsafe characters. */
public SafeHtmlBuilder append(final CharSequence in) {
public SafeHtmlBuilder append(CharSequence in) {
if (in != null) {
escapeCS(this, in);
}
@ -167,7 +167,7 @@ public class SafeHtmlBuilder extends SafeHtml {
*
* @param tagName name of the HTML element to open.
*/
public SafeHtmlBuilder openElement(final String tagName) {
public SafeHtmlBuilder openElement(String tagName) {
assert isElementName(tagName);
cb.append("<");
cb.append(tagName);
@ -187,7 +187,7 @@ public class SafeHtmlBuilder extends SafeHtml {
* @return the attribute value, as a string. The empty string if the attribute has not been
* assigned a value. The returned string is the raw (unescaped) value.
*/
public String getAttribute(final String name) {
public String getAttribute(String name) {
assert isAttributeName(name);
assert cb == sBuf;
return att.get(name);
@ -200,7 +200,7 @@ public class SafeHtmlBuilder extends SafeHtml {
* @param value value to assign; any existing value is replaced. The value is escaped (if
* necessary) during the assignment.
*/
public SafeHtmlBuilder setAttribute(final String name, final String value) {
public SafeHtmlBuilder setAttribute(String name, String value) {
assert isAttributeName(name);
assert cb == sBuf;
att.set(name, value != null ? value : "");
@ -213,7 +213,7 @@ public class SafeHtmlBuilder extends SafeHtml {
* @param name name of the attribute to set.
* @param value value to assign, any existing value is replaced.
*/
public SafeHtmlBuilder setAttribute(final String name, final int value) {
public SafeHtmlBuilder setAttribute(String name, int value) {
return setAttribute(name, String.valueOf(value));
}
@ -227,7 +227,7 @@ public class SafeHtmlBuilder extends SafeHtml {
* @param name name of the attribute to append onto.
* @param value additional value to append.
*/
public SafeHtmlBuilder appendAttribute(final String name, String value) {
public SafeHtmlBuilder appendAttribute(String name, String value) {
if (value != null && value.length() > 0) {
final String e = getAttribute(name);
return setAttribute(name, e.length() > 0 ? e + " " + value : value);
@ -236,17 +236,17 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Set the height attribute of the current element. */
public SafeHtmlBuilder setHeight(final int height) {
public SafeHtmlBuilder setHeight(int height) {
return setAttribute("height", height);
}
/** Set the width attribute of the current element. */
public SafeHtmlBuilder setWidth(final int width) {
public SafeHtmlBuilder setWidth(int width) {
return setAttribute("width", width);
}
/** Set the CSS class name for this element. */
public SafeHtmlBuilder setStyleName(final String style) {
public SafeHtmlBuilder setStyleName(String style) {
assert isCssName(style);
return setAttribute("class", style);
}
@ -256,7 +256,7 @@ public class SafeHtmlBuilder extends SafeHtml {
*
* <p>If no CSS class name has been specified yet, this method initializes it to the single name.
*/
public SafeHtmlBuilder addStyleName(final String style) {
public SafeHtmlBuilder addStyleName(String style) {
assert isCssName(style);
return appendAttribute("class", style);
}
@ -281,7 +281,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append a closing tag for the named element. */
public SafeHtmlBuilder closeElement(final String name) {
public SafeHtmlBuilder closeElement(String name) {
assert isElementName(name);
cb.append("</");
cb.append(name);
@ -362,7 +362,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append "&lt;param name=... value=... /&gt;". */
public SafeHtmlBuilder paramElement(final String name, final String value) {
public SafeHtmlBuilder paramElement(String name, String value) {
openElement("param");
setAttribute("name", name);
setAttribute("value", value);
@ -379,21 +379,21 @@ public class SafeHtmlBuilder extends SafeHtml {
return cb.toString();
}
private static void escapeCS(final SafeHtmlBuilder b, final CharSequence in) {
private static void escapeCS(SafeHtmlBuilder b, CharSequence in) {
for (int i = 0; i < in.length(); i++) {
b.append(in.charAt(i));
}
}
private static boolean isElementName(final String name) {
private static boolean isElementName(String name) {
return name.matches("^[a-zA-Z][a-zA-Z0-9_-]*$");
}
private static boolean isAttributeName(final String name) {
private static boolean isAttributeName(String name) {
return isElementName(name);
}
private static boolean isCssName(final String name) {
private static boolean isCssName(String name) {
return isElementName(name);
}
@ -403,14 +403,14 @@ public class SafeHtmlBuilder extends SafeHtml {
private static class ServerImpl extends Impl {
@Override
void escapeStr(final SafeHtmlBuilder b, final String in) {
void escapeStr(SafeHtmlBuilder b, String in) {
SafeHtmlBuilder.escapeCS(b, in);
}
}
private static class ClientImpl extends Impl {
@Override
void escapeStr(final SafeHtmlBuilder b, final String in) {
void escapeStr(SafeHtmlBuilder b, String in) {
b.cb.append(escape(in));
}

View File

@ -18,7 +18,7 @@ package com.google.gwtexpui.safehtml.client;
class SafeHtmlString extends SafeHtml {
private final String html;
SafeHtmlString(final String h) {
SafeHtmlString(String h) {
html = h;
}

View File

@ -48,14 +48,13 @@ import javax.servlet.http.HttpServletResponse;
*/
public class CacheControlFilter implements Filter {
@Override
public void init(final FilterConfig config) {}
public void init(FilterConfig config) {}
@Override
public void destroy() {}
@Override
public void doFilter(
final ServletRequest sreq, final ServletResponse srsp, final FilterChain chain)
public void doFilter(final ServletRequest sreq, ServletResponse srsp, FilterChain chain)
throws IOException, ServletException {
final HttpServletRequest req = (HttpServletRequest) sreq;
final HttpServletResponse rsp = (HttpServletResponse) srsp;
@ -70,7 +69,7 @@ public class CacheControlFilter implements Filter {
chain.doFilter(req, rsp);
}
private static boolean cacheForever(final String pathInfo, final HttpServletRequest req) {
private static boolean cacheForever(String pathInfo, HttpServletRequest req) {
if (pathInfo.endsWith(".cache.html")
|| pathInfo.endsWith(".cache.gif")
|| pathInfo.endsWith(".cache.png")
@ -87,14 +86,14 @@ public class CacheControlFilter implements Filter {
return false;
}
private static boolean nocache(final String pathInfo) {
private static boolean nocache(String pathInfo) {
if (pathInfo.endsWith(".nocache.js")) {
return true;
}
return false;
}
private static String pathInfo(final HttpServletRequest req) {
private static String pathInfo(HttpServletRequest req) {
final String uri = req.getRequestURI();
final String ctx = req.getContextPath();
return uri.startsWith(ctx) ? uri.substring(ctx.length()) : uri;

View File

@ -28,11 +28,11 @@ public class AutoCenterDialogBox extends DialogBox {
this(false);
}
public AutoCenterDialogBox(final boolean autoHide) {
public AutoCenterDialogBox(boolean autoHide) {
this(autoHide, true);
}
public AutoCenterDialogBox(final boolean autoHide, final boolean modal) {
public AutoCenterDialogBox(boolean autoHide, boolean modal) {
super(autoHide, modal);
}
@ -43,7 +43,7 @@ public class AutoCenterDialogBox extends DialogBox {
Window.addResizeHandler(
new ResizeHandler() {
@Override
public void onResize(final ResizeEvent event) {
public void onResize(ResizeEvent event) {
final int w = event.getWidth();
final int h = event.getHeight();
AutoCenterDialogBox.this.onResize(w, h);
@ -71,7 +71,7 @@ public class AutoCenterDialogBox extends DialogBox {
* @param width new browser window width
* @param height new browser window height
*/
protected void onResize(final int width, final int height) {
protected void onResize(int width, int height) {
if (isAttached()) {
center();
}

View File

@ -51,7 +51,7 @@ public class ViewSite<V extends View> extends Composite {
*
* @param view the next view to display.
*/
public void setView(final V view) {
public void setView(V view) {
if (next != null) {
main.remove(next);
}
@ -67,10 +67,10 @@ public class ViewSite<V extends View> extends Composite {
*
* @param view the view being displayed.
*/
protected void onShowView(final V view) {}
protected void onShowView(V view) {}
@SuppressWarnings("unchecked")
final void swap(final View v) {
final void swap(View v) {
if (next != null && next.getWidget() == v) {
if (current != null) {
main.remove(current);

View File

@ -280,11 +280,11 @@ public class SafeHtmlBuilderTest {
new SafeHtmlBuilder().openElement("form").setAttribute("action", href);
}
private static String escape(final char c) {
private static String escape(char c) {
return new SafeHtmlBuilder().append(c).asString();
}
private static String escape(final String c) {
private static String escape(String c) {
return new SafeHtmlBuilder().append(c).asString();
}
}

View File

@ -90,7 +90,7 @@ public class DateFormatter {
}
/** Format a date using the locale's medium length format. */
public String mediumFormat(final Date dt) {
public String mediumFormat(Date dt) {
if (dt == null) {
return "";
}

View File

@ -40,7 +40,7 @@ public class NativeMap<T extends JavaScriptObject> extends JavaScriptObject {
/** Loop through the result map and set asProperty on the children. */
public static <T extends JavaScriptObject, M extends NativeMap<T>>
AsyncCallback<M> copyKeysIntoChildren(final String asProperty, AsyncCallback<M> callback) {
AsyncCallback<M> copyKeysIntoChildren(String asProperty, AsyncCallback<M> callback) {
return new TransformCallback<M, M>(callback) {
@Override
protected M transform(M result) {

View File

@ -38,7 +38,7 @@ public final class NativeString extends JavaScriptObject {
public native String asString() /*-{ return this.s; }-*/;
public static AsyncCallback<NativeString> unwrap(final AsyncCallback<String> cb) {
public static AsyncCallback<NativeString> unwrap(AsyncCallback<String> cb) {
return new AsyncCallback<NativeString>() {
@Override
public void onSuccess(NativeString result) {

View File

@ -35,7 +35,7 @@ public class Natives {
return Collections.emptySet();
}
public static List<String> asList(final JsArrayString arr) {
public static List<String> asList(JsArrayString arr) {
if (arr == null) {
return null;
}
@ -59,7 +59,7 @@ public class Natives {
};
}
public static <T extends JavaScriptObject> List<T> asList(final JsArray<T> arr) {
public static <T extends JavaScriptObject> List<T> asList(JsArray<T> arr) {
if (arr == null) {
return null;
}

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());
}

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