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 = private final TestRule testRunner =
new TestRule() { new TestRule() {
@Override @Override
public Statement apply(final Statement base, final Description description) { public Statement apply(Statement base, Description description) {
return new Statement() { return new Statement() {
@Override @Override
public void evaluate() throws Throwable { public void evaluate() throws Throwable {

View File

@ -191,7 +191,7 @@ public class AcceptanceTestRequestScope {
static final Scope REQUEST = static final Scope REQUEST =
new Scope() { new Scope() {
@Override @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>() { return new Provider<T>() {
@Override @Override
public T get() { public T get() {

View File

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

View File

@ -56,7 +56,7 @@ public class GitUtil {
private static final AtomicInteger testRepoCount = new AtomicInteger(); private static final AtomicInteger testRepoCount = new AtomicInteger();
private static final int TEST_REPO_WINDOW_DAYS = 2; 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(); final Properties config = new Properties();
config.put("StrictHostKeyChecking", "no"); config.put("StrictHostKeyChecking", "no");
JSch.setConfig(config); JSch.setConfig(config);

View File

@ -95,7 +95,7 @@ class InProcessProtocol extends TestProtocol<Context> {
private static final Scope REQUEST = private static final Scope REQUEST =
new Scope() { new Scope() {
@Override @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>() { return new Provider<T>() {
@Override @Override
public T get() { public T get() {
@ -242,8 +242,7 @@ class InProcessProtocol extends TestProtocol<Context> {
} }
@Override @Override
public UploadPack create(Context req, final Repository repo) public UploadPack create(Context req, Repository repo) throws ServiceNotAuthorizedException {
throws ServiceNotAuthorizedException {
// Set the request context, but don't bother unsetting, since we don't // 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. // 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 // 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 @Override
public ReceivePack create(final Context req, Repository db) public ReceivePack create(Context req, Repository db) throws ServiceNotAuthorizedException {
throws ServiceNotAuthorizedException {
// Set the request context, but don't bother unsetting, since we don't // 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. // 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 // 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); 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; this.tag = tag;
} }

View File

@ -575,7 +575,7 @@ public class GetRelatedIT extends AbstractDaemonTest {
return result; 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())) { try (BatchUpdate bu = batchUpdateFactory.create(db, project, user(user), TimeUtil.nowTs())) {
bu.addOp( bu.addOp(
psId.getParentKey(), psId.getParentKey(),

View File

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

View File

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

View File

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

View File

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

View File

@ -39,18 +39,18 @@ public class FileUtil {
return !Arrays.equals(curVers, newVers); return !Arrays.equals(curVers, newVers);
} }
public static void mkdir(final File path) { public static void mkdir(File path) {
if (!path.isDirectory() && !path.mkdir()) { if (!path.isDirectory() && !path.mkdir()) {
throw new Die("Cannot make directory " + path); 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? // TODO(dborowitz): Is there a portable way to do this with NIO?
chmod(mode, path.toFile()); 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.setReadable(false, false /* all */);
path.setWritable(false, false /* all */); path.setWritable(false, false /* all */);
path.setExecutable(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") @GwtIncompatible("Unemulated methods in Class and OutputStream")
public final class IoUtil { 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") { new Thread("IoUtil-Copy") {
@Override @Override
public void run() { public void run() {

View File

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

View File

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

View File

@ -30,7 +30,7 @@ public class RawInputUtil {
return create(content.getBytes(UTF_8)); 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.checkNotNull(bytes);
Preconditions.checkArgument(bytes.length > 0); Preconditions.checkArgument(bytes.length > 0);
return new RawInput() { 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"); return create(bytes, "application/octet-stream");
} }
public static RawInput create(final HttpServletRequest req) { public static RawInput create(HttpServletRequest req) {
return new RawInput() { return new RawInput() {
@Override @Override
public String getContentType() { public String getContentType() {

View File

@ -121,7 +121,7 @@ public class AccessSection extends RefConfigSection implements Comparable<Access
} }
@Override @Override
public boolean equals(final Object obj) { public boolean equals(Object obj) {
if (!super.equals(obj) || !(obj instanceof AccessSection)) { if (!super.equals(obj) || !(obj instanceof AccessSection)) {
return false; 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 * <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. * 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; this.id = id;
} }
@ -40,7 +40,7 @@ public class AccountInfo {
* *
* @param a the data store record holding the specific account details. * @param a the data store record holding the specific account details.
*/ */
public AccountInfo(final Account a) { public AccountInfo(Account a) {
id = a.getId(); id = a.getId();
fullName = a.getFullName(); fullName = a.getFullName();
preferredEmail = a.getPreferredEmail(); preferredEmail = a.getPreferredEmail();
@ -66,7 +66,7 @@ public class AccountInfo {
return preferredEmail; return preferredEmail;
} }
public void setPreferredEmail(final String email) { public void setPreferredEmail(String email) {
preferredEmail = email; preferredEmail = email;
} }

View File

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

View File

@ -29,7 +29,7 @@ public class GroupDescriptions {
return null; return null;
} }
public static GroupDescription.Internal forAccountGroup(final AccountGroup group) { public static GroupDescription.Internal forAccountGroup(AccountGroup group) {
return new GroupDescription.Internal() { return new GroupDescription.Internal() {
@Override @Override
public AccountGroup.UUID getGroupUUID() { 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 * <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. * 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; this.uuid = uuid;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,23 +22,23 @@ public class NoSuchGroupException extends Exception {
public static final String MESSAGE = "Group Not Found: "; public static final String MESSAGE = "Group Not Found: ";
public NoSuchGroupException(final AccountGroup.Id key) { public NoSuchGroupException(AccountGroup.Id key) {
this(key, null); this(key, null);
} }
public NoSuchGroupException(final AccountGroup.UUID key) { public NoSuchGroupException(AccountGroup.UUID key) {
this(key, null); this(key, null);
} }
public NoSuchGroupException(final AccountGroup.Id key, final Throwable why) { public NoSuchGroupException(AccountGroup.Id key, Throwable why) {
super(MESSAGE + key.toString(), 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); 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); super(MESSAGE + k.toString(), why);
} }
@ -46,7 +46,7 @@ public class NoSuchGroupException extends Exception {
this(who, null); this(who, null);
} }
public NoSuchGroupException(String who, final Throwable why) { public NoSuchGroupException(String who, Throwable why) {
super(MESSAGE + who, 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 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); 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. * @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)); 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. * @param item item to check whether or not it is contained.
* @return {@code true} if this set contains the given item. * @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(); Iterator<T> iterator = iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
T candidate = iterator.next(); 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. * @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. * @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)); 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. * @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. * @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); final AtomicReference<Provider<T>> ref = new AtomicReference<>(item);
items.add(ref); items.add(ref);
return new RegistrationHandle() { 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. * @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. * @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); final NamePair key = new NamePair(pluginName, exportName);
items.put(key, item); items.put(key, item);
return new RegistrationHandle() { return new RegistrationHandle() {

View File

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

View File

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

View File

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

View File

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

View File

@ -27,7 +27,7 @@ public class HidePopupPanelCommand extends KeyCommand {
} }
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
panel.hide(); 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_META = 4 << 16;
public static final int M_SHIFT = 8 << 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; 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; private final String helpText;
KeyCommand sibling; 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); 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; assert help != null;
keyMask = mask | key; keyMask = mask | key;
helpText = help; helpText = help;
@ -88,12 +88,12 @@ public abstract class KeyCommand implements KeyPressHandler {
return b; return b;
} }
private void modifier(final SafeHtmlBuilder b, final String name) { private void modifier(SafeHtmlBuilder b, String name) {
namedKey(b, name); namedKey(b, name);
b.append(" + "); b.append(" + ");
} }
private void namedKey(final SafeHtmlBuilder b, final String name) { private void namedKey(SafeHtmlBuilder b, String name) {
b.append('<'); b.append('<');
b.openSpan(); b.openSpan();
b.setStyleName(KeyResources.I.css().helpKey()); b.setStyleName(KeyResources.I.css().helpKey());

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,11 +45,11 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
request, request,
new Callback() { new Callback() {
@Override @Override
public void onSuggestionsReady(final Request request, final Response response) { public void onSuggestionsReady(Request request, Response response) {
final String qpat = getQueryPattern(request.getQuery()); final String qpat = getQueryPattern(request.getQuery());
final boolean html = isHTML(); final boolean html = isHTML();
final ArrayList<Suggestion> r = new ArrayList<>(); final ArrayList<Suggestion> r = new ArrayList<>();
for (final Suggestion s : response.getSuggestions()) { for (Suggestion s : response.getSuggestions()) {
r.add(new BoldSuggestion(qpat, s, html)); r.add(new BoldSuggestion(qpat, s, html));
} }
cb.onSuggestionsReady(request, new Response(r)); 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; return query;
} }
@ -77,7 +77,7 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
private final Suggestion suggestion; private final Suggestion suggestion;
private final String displayString; private final String displayString;
BoldSuggestion(final String qstr, final Suggestion s, final boolean html) { BoldSuggestion(String qstr, Suggestion s, boolean html) {
suggestion = s; suggestion = s;
String ds = s.getDisplayString(); 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. */ /** @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 new SafeHtmlString(t.getHTML());
} }
/** @return the existing HTML text, wrapped in a safe buffer. */ /** @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); return new SafeHtmlString(htmlText);
} }
/** Set the HTML property of a widget. */ /** 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()); e.setHTML(str.asString());
return e; 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. */ /** @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)); return new SafeHtmlString(t.getHTML(row, col));
} }
/** Set the inner HTML of a table cell. */ /** Set the inner HTML of a table cell. */
public static <T extends HTMLTable> T set( public static <T extends HTMLTable> T set(final T t, int row, int col, SafeHtml str) {
final T t, final int row, final int col, final SafeHtml str) {
t.setHTML(row, col, str.asString()); t.setHTML(row, col, str.asString());
return t; return t;
} }
@ -140,13 +139,13 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
*/ */
public SafeHtml wikify() { public SafeHtml wikify() {
final SafeHtmlBuilder r = new SafeHtmlBuilder(); 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)) { if (isQuote(p)) {
wikifyQuote(r, p); wikifyQuote(r, p);
} else if (isPreFormat(p)) { } else if (isPreFormat(p)) {
r.openElement("p"); r.openElement("p");
for (final String line : p.split("\n")) { for (String line : p.split("\n")) {
r.openSpan(); r.openSpan();
r.setStyleName(RESOURCES.css().wikiPreFormat()); r.setStyleName(RESOURCES.css().wikiPreFormat());
r.append(asis(line)); r.append(asis(line));
@ -167,7 +166,7 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
return r.toSafeHtml(); 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_ul = false;
boolean in_p = false; boolean in_p = false;
for (String line : p.split("\n")) { 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; "); 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"); 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("* "); 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>}. * {@code $<i>n</i>}.
* @return a new string, after the replacement has been made. * @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)); 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>}. * {@code $<i>n</i>}.
* @return a new string, after the replacements have been made. * @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)); return new SafeHtmlString(asString().replaceAll(regex, repl));
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -280,11 +280,11 @@ public class SafeHtmlBuilderTest {
new SafeHtmlBuilder().openElement("form").setAttribute("action", href); 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(); 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(); 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. */ /** Format a date using the locale's medium length format. */
public String mediumFormat(final Date dt) { public String mediumFormat(Date dt) {
if (dt == null) { if (dt == null) {
return ""; 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. */ /** Loop through the result map and set asProperty on the children. */
public static <T extends JavaScriptObject, M extends NativeMap<T>> 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) { return new TransformCallback<M, M>(callback) {
@Override @Override
protected M transform(M result) { 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 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>() { return new AsyncCallback<NativeString>() {
@Override @Override
public void onSuccess(NativeString result) { public void onSuccess(NativeString result) {

View File

@ -35,7 +35,7 @@ public class Natives {
return Collections.emptySet(); return Collections.emptySet();
} }
public static List<String> asList(final JsArrayString arr) { public static List<String> asList(JsArrayString arr) {
if (arr == null) { if (arr == null) {
return 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) { if (arr == null) {
return null; return null;
} }

View File

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

View File

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

View File

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

View File

@ -170,7 +170,7 @@ public class Gerrit implements EntryPoint {
* *
* @param token location to parse, load, and render. * @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)) { if (body.getView() == null || !body.getView().displayToken(token)) {
dispatcher.display(token); dispatcher.display(token);
updateUiLink(token); updateUiLink(token);
@ -191,7 +191,7 @@ public class Gerrit implements EntryPoint {
* @param token location that refers to {@code view}. * @param token location that refers to {@code view}.
* @param view the view to load. * @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()) { if (view.isRequiresSignIn() && !isSignedIn()) {
doSignIn(token); doSignIn(token);
} else { } else {
@ -217,7 +217,7 @@ public class Gerrit implements EntryPoint {
* *
* @param token new location that is already visible. * @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); History.newItem(token, false);
dispatchHistoryHooks(token); dispatchHistoryHooks(token);
} }
@ -226,7 +226,7 @@ public class Gerrit implements EntryPoint {
searchPanel.setText(query); 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 (screen == body.getView()) {
if (text == null || text.length() == 0) { if (text == null || text.length() == 0) {
Window.setTitle(M.windowTitle1(myHost)); Window.setTitle(M.windowTitle1(myHost));
@ -428,7 +428,7 @@ public class Gerrit implements EntryPoint {
} }
@Override @Override
public String decode(final String e) { public String decode(String e) {
return URL.decodeQueryString(e); return URL.decodeQueryString(e);
} }
@ -476,7 +476,7 @@ public class Gerrit implements EntryPoint {
cbg.addFinal( cbg.addFinal(
new GerritCallback<HostPageData>() { new GerritCallback<HostPageData>() {
@Override @Override
public void onSuccess(final HostPageData result) { public void onSuccess(HostPageData result) {
Document.get().getElementById("gerrit_hostpagedata").removeFromParent(); Document.get().getElementById("gerrit_hostpagedata").removeFromParent();
myTheme = result.theme; myTheme = result.theme;
isNoteDbEnabled = result.isNoteDbEnabled; isNoteDbEnabled = result.isNoteDbEnabled;
@ -957,7 +957,7 @@ public class Gerrit implements EntryPoint {
return docSearch; 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); RequestBuilder req = new RequestBuilder(RequestBuilder.HEAD, GWT.getHostPageBaseURL() + INDEX);
req.setCallback( req.setCallback(
new RequestCallback() { new RequestCallback() {
@ -1031,22 +1031,21 @@ public class Gerrit implements EntryPoint {
menuRight.add(fp); 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); final Anchor a = new Anchor(text, to);
a.setStyleName(RESOURCES.css().menuItem()); a.setStyleName(RESOURCES.css().menuItem());
Roles.getMenuitemRole().set(a.getElement()); Roles.getMenuitemRole().set(a.getElement());
return a; return a;
} }
private static LinkMenuItem addLink( private static LinkMenuItem addLink(final LinkMenuBar m, String text, String historyToken) {
final LinkMenuBar m, final String text, final String historyToken) {
LinkMenuItem i = new LinkMenuItem(text, historyToken); LinkMenuItem i = new LinkMenuItem(text, historyToken);
m.addItem(i); m.addItem(i);
return i; return i;
} }
private static void insertLink( 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); m.insertItem(new LinkMenuItem(text, historyToken), beforeIndex);
} }
@ -1090,7 +1089,7 @@ public class Gerrit implements EntryPoint {
return i; 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); final Anchor atag = anchor(text, docUrl + href);
atag.setTarget("_blank"); atag.setTarget("_blank");
m.add(atag); 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(); final KeyCommandSet jumps = new KeyCommandSet();
jumps.add( jumps.add(
new KeyCommand(0, 'o', Gerrit.C.jumpAllOpen()) { new KeyCommand(0, 'o', Gerrit.C.jumpAllOpen()) {
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:open")); Gerrit.display(PageLinks.toChangeQuery("status:open"));
} }
}); });
jumps.add( jumps.add(
new KeyCommand(0, 'm', Gerrit.C.jumpAllMerged()) { new KeyCommand(0, 'm', Gerrit.C.jumpAllMerged()) {
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:merged")); Gerrit.display(PageLinks.toChangeQuery("status:merged"));
} }
}); });
jumps.add( jumps.add(
new KeyCommand(0, 'a', Gerrit.C.jumpAllAbandoned()) { new KeyCommand(0, 'a', Gerrit.C.jumpAllAbandoned()) {
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:abandoned")); Gerrit.display(PageLinks.toChangeQuery("status:abandoned"));
} }
}); });
@ -66,35 +66,35 @@ public class JumpKeys {
jumps.add( jumps.add(
new KeyCommand(0, 'i', Gerrit.C.jumpMine()) { new KeyCommand(0, 'i', Gerrit.C.jumpMine()) {
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.MINE); Gerrit.display(PageLinks.MINE);
} }
}); });
jumps.add( jumps.add(
new KeyCommand(0, 'd', Gerrit.C.jumpMineDrafts()) { new KeyCommand(0, 'd', Gerrit.C.jumpMineDrafts()) {
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("owner:self is:draft")); Gerrit.display(PageLinks.toChangeQuery("owner:self is:draft"));
} }
}); });
jumps.add( jumps.add(
new KeyCommand(0, 'c', Gerrit.C.jumpMineDraftComments()) { new KeyCommand(0, 'c', Gerrit.C.jumpMineDraftComments()) {
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("has:draft")); Gerrit.display(PageLinks.toChangeQuery("has:draft"));
} }
}); });
jumps.add( jumps.add(
new KeyCommand(0, 'w', Gerrit.C.jumpMineWatched()) { new KeyCommand(0, 'w', Gerrit.C.jumpMineWatched()) {
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("is:watched status:open")); Gerrit.display(PageLinks.toChangeQuery("is:watched status:open"));
} }
}); });
jumps.add( jumps.add(
new KeyCommand(0, 's', Gerrit.C.jumpMineStarred()) { new KeyCommand(0, 's', Gerrit.C.jumpMineStarred()) {
@Override @Override
public void onKeyPress(final KeyPressEvent event) { public void onKeyPress(KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("is:starred")); Gerrit.display(PageLinks.toChangeQuery("is:starred"));
} }
}); });

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -104,7 +104,7 @@ public class MyPasswordScreen extends SettingsScreen {
} }
@Override @Override
public void onFailure(final Throwable caught) { public void onFailure(Throwable caught) {
if (RestApi.isNotFound(caught)) { if (RestApi.isNotFound(caught)) {
Gerrit.getUserAccount().username(null); Gerrit.getUserAccount().username(null);
display(); display();
@ -121,7 +121,7 @@ public class MyPasswordScreen extends SettingsScreen {
enableUI(true); 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(); final CellFormatter fmt = info.getCellFormatter();
if (LocaleInfo.getCurrentLocale().isRTL()) { if (LocaleInfo.getCurrentLocale().isRTL()) {
info.setText(row, 1, name); info.setText(row, 1, name);
@ -146,7 +146,7 @@ public class MyPasswordScreen extends SettingsScreen {
} }
@Override @Override
public void onFailure(final Throwable caught) { public void onFailure(Throwable caught) {
enableUI(true); enableUI(true);
} }
}); });

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ import com.google.gerrit.common.PageLinks;
public class ValidateEmailScreen extends AccountScreen { public class ValidateEmailScreen extends AccountScreen {
private final String magicToken; private final String magicToken;
public ValidateEmailScreen(final String magicToken) { public ValidateEmailScreen(String magicToken) {
this.magicToken = magicToken; this.magicToken = magicToken;
} }
@ -41,7 +41,7 @@ public class ValidateEmailScreen extends AccountScreen {
magicToken, magicToken,
new ScreenLoadCallback<VoidResult>(this) { new ScreenLoadCallback<VoidResult>(this) {
@Override @Override
protected void preDisplay(final VoidResult result) {} protected void preDisplay(VoidResult result) {}
@Override @Override
protected void postDisplay() { 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; 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) { if (value.getPermission(permissionName) != null) {
return; return;
} }

View File

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

View File

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

View File

@ -32,7 +32,7 @@ public abstract class AccountGroupScreen extends MenuScreen {
private final String membersTabToken; private final String membersTabToken;
private final String auditLogTabToken; private final String auditLogTabToken;
public AccountGroupScreen(final GroupInfo toShow, final String token) { public AccountGroupScreen(GroupInfo toShow, String token) {
setRequiresSignIn(true); setRequiresSignIn(true);
this.group = toShow; this.group = toShow;
@ -47,7 +47,7 @@ public abstract class AccountGroupScreen extends MenuScreen {
AccountGroup.isInternalGroup(group.getGroupUUID())); 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-")) { if (token.startsWith("/admin/groups/uuid-")) {
return toGroup(group.getGroupUUID(), tab); return toGroup(group.getGroupUUID(), tab);
} }
@ -91,7 +91,7 @@ public abstract class AccountGroupScreen extends MenuScreen {
return group.getOwnerUUID(); return group.getOwnerUUID();
} }
protected void setMembersTabVisible(final boolean visible) { protected void setMembersTabVisible(boolean visible) {
setLinkVisible(membersTabToken, 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; import com.google.gwt.user.client.ui.PopupPanel;
class CreateChangeAction { 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. // TODO Replace CreateChangeDialog with a nicer looking display.
b.setEnabled(false); b.setEnabled(false);
new CreateChangeDialog(new Project.NameKey(project)) { new CreateChangeDialog(new Project.NameKey(project)) {

View File

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

View File

@ -181,7 +181,7 @@ public class CreateProjectScreen extends Screen {
create.addClickHandler( create.addClickHandler(
new ClickHandler() { new ClickHandler() {
@Override @Override
public void onClick(final ClickEvent event) { public void onClick(ClickEvent event) {
doCreateProject(); doCreateProject();
} }
}); });
@ -190,7 +190,7 @@ public class CreateProjectScreen extends Screen {
browse.addClickHandler( browse.addClickHandler(
new ClickHandler() { new ClickHandler() {
@Override @Override
public void onClick(final ClickEvent event) { public void onClick(ClickEvent event) {
int top = grid.getAbsoluteTop() - 50; // under page header int top = grid.getAbsoluteTop() - 50; // under page header
// Try to place it to the right of everything else, but not // Try to place it to the right of everything else, but not
// right justified // right justified
@ -219,7 +219,7 @@ public class CreateProjectScreen extends Screen {
} }
@Override @Override
protected void populate(final int row, final ProjectInfo k) { protected void populate(int row, ProjectInfo k) {
populateState(row, k); populateState(row, k);
final Anchor projectLink = new Anchor(k.name()); final Anchor projectLink = new Anchor(k.name());
projectLink.addClickHandler( 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 = new Grid(2, 3);
grid.setStyleName(Gerrit.RESOURCES.css().infoBlock()); grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
grid.setText(0, 0, AdminConstants.I.columnProjectName() + ":"); 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); project.setEnabled(enabled);
create.setEnabled(enabled); create.setEnabled(enabled);
parent.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; import com.google.gwt.user.client.ui.Button;
public class EditConfigAction { public class EditConfigAction {
static void call(final Button b, final String project) { static void call(Button b, String project) {
b.setEnabled(false); b.setEnabled(false);
ChangeApi.createChange( ChangeApi.createChange(

View File

@ -43,7 +43,7 @@ public class GroupTable extends NavigationTable<GroupInfo> {
this(null); this(null);
} }
public GroupTable(final String pointerId) { public GroupTable(String pointerId) {
super(AdminConstants.I.groupItemHelp()); super(AdminConstants.I.groupItemHelp());
setSavePointerId(pointerId); setSavePointerId(pointerId);
@ -70,12 +70,12 @@ public class GroupTable extends NavigationTable<GroupInfo> {
} }
@Override @Override
protected Object getRowItemKey(final GroupInfo item) { protected Object getRowItemKey(GroupInfo item) {
return item.getGroupId(); return item.getGroupId();
} }
@Override @Override
protected void onOpenRow(final int row) { protected void onOpenRow(int row) {
GroupInfo groupInfo = getRowItem(row); GroupInfo groupInfo = getRowItem(row);
if (isInteralGroup(groupInfo)) { if (isInteralGroup(groupInfo)) {
History.newItem(Dispatcher.toGroup(groupInfo.getGroupId())); 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 (k.url() != null) {
if (isInteralGroup(k)) { if (isInteralGroup(k)) {
table.setWidget( table.setWidget(
@ -152,7 +152,7 @@ public class GroupTable extends NavigationTable<GroupInfo> {
setRowItem(row, k); setRowItem(row, k);
} }
private boolean isInteralGroup(final GroupInfo groupInfo) { private boolean isInteralGroup(GroupInfo groupInfo) {
return groupInfo != null && groupInfo.url().startsWith("#" + PageLinks.ADMIN_GROUPS); 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); addStage2.getStyle().setDisplay(Display.NONE);
} }
private void addGroup(final GroupReference ref) { private void addGroup(GroupReference ref) {
if (ref.getUUID() != null) { if (ref.getUUID() != null) {
if (value.getRule(ref) == null) { if (value.getRule(ref) == null) {
PermissionRule newRule = value.getRule(ref, true); PermissionRule newRule = value.getRule(ref, true);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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