Turn on many more Eclipse warnings, and fix them
- Warn on empty statements, e.g. "for (;;);". These may be typos and are easily replaced by "for (;;) {}" which is more explicit. - Warn on field hiding. This allows cleanup of many acceptance test members, at the cost of a couple of renames and the occasional suppression (when the field is in a public nested enum that shadows a public constant). - Warn on unnecessary casts. - Warn on unused declared thrown exceptions. In addition to reducing method signature length and number of imports, this also eliminated some impossible catch blocks. - Warn on missing @Override annotations. - Warn on unused parameters. This is likely the most controversial, as a few relatively common patterns require unused parameters in a way that Eclipse can't ignore. However, it also resulted in cleanup of a lot of unnecessary injections and method parameters, so I think the cost was worth it. Change-Id: I7224be8b1c798613a127c88507e8cce400679e5d
This commit is contained in:
@@ -14,11 +14,11 @@ org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
||||
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
@@ -68,9 +68,9 @@ org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
@@ -78,7 +78,7 @@ org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
|
@@ -40,6 +40,7 @@ import com.google.gerrit.server.OutputFormat;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.change.ChangeJson;
|
||||
import com.google.gerrit.server.config.AllProjectsName;
|
||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.gerrit.server.git.MetaDataUpdate;
|
||||
import com.google.gerrit.server.git.ProjectConfig;
|
||||
import com.google.gerrit.server.project.ProjectCache;
|
||||
@@ -104,6 +105,9 @@ public abstract class AbstractDaemonTest {
|
||||
@Inject
|
||||
protected GroupCache groupCache;
|
||||
|
||||
@Inject
|
||||
protected GitRepositoryManager repoManager;
|
||||
|
||||
protected Git git;
|
||||
protected GerritServer server;
|
||||
protected TestAccount admin;
|
||||
|
@@ -164,8 +164,10 @@ public class AcceptanceTestRequestScope {
|
||||
|
||||
/** Returns exactly one instance per command executed. */
|
||||
static final Scope REQUEST = new Scope() {
|
||||
@Override
|
||||
public <T> Provider<T> scope(final Key<T> key, final Provider<T> creator) {
|
||||
return new Provider<T>() {
|
||||
@Override
|
||||
public T get() {
|
||||
return requireContext().get(key, creator);
|
||||
}
|
||||
|
@@ -27,18 +27,15 @@ import com.google.inject.Injector;
|
||||
import com.google.inject.Key;
|
||||
import com.google.inject.Module;
|
||||
|
||||
import org.eclipse.jgit.errors.ConfigInvalidException;
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
import org.eclipse.jgit.lib.RepositoryCache;
|
||||
import org.eclipse.jgit.util.FS;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.URI;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.concurrent.BrokenBarrierException;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
@@ -53,6 +50,7 @@ public class GerritServer {
|
||||
throws Exception {
|
||||
final CyclicBarrier serverStarted = new CyclicBarrier(2);
|
||||
final Daemon daemon = new Daemon(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
serverStarted.await();
|
||||
@@ -84,6 +82,7 @@ public class GerritServer {
|
||||
site = initSite(cfg);
|
||||
daemonService = Executors.newSingleThreadExecutor();
|
||||
daemonService.submit(new Callable<Void>() {
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
int rc = daemon.main(new String[] {"-d", site.getPath(), "--headless" });
|
||||
if (rc != 0) {
|
||||
@@ -122,8 +121,7 @@ public class GerritServer {
|
||||
return tmp;
|
||||
}
|
||||
|
||||
private static void mergeTestConfig(Config cfg)
|
||||
throws IOException {
|
||||
private static void mergeTestConfig(Config cfg) {
|
||||
String forceEphemeralPort = String.format("%s:0",
|
||||
getLocalHost().getHostName());
|
||||
String url = "http://" + forceEphemeralPort + "/";
|
||||
@@ -157,7 +155,7 @@ public class GerritServer {
|
||||
return (T) f.get(obj);
|
||||
}
|
||||
|
||||
private static InetAddress getLocalHost() throws UnknownHostException {
|
||||
private static InetAddress getLocalHost() {
|
||||
return InetAddress.getLoopbackAddress();
|
||||
}
|
||||
|
||||
@@ -169,7 +167,7 @@ public class GerritServer {
|
||||
private InetSocketAddress httpAddress;
|
||||
|
||||
private GerritServer(Injector testInjector, Daemon daemon,
|
||||
ExecutorService daemonService) throws IOException, ConfigInvalidException {
|
||||
ExecutorService daemonService) {
|
||||
this.testInjector = testInjector;
|
||||
this.daemon = daemon;
|
||||
this.daemonService = daemonService;
|
||||
|
@@ -141,7 +141,7 @@ public class GitUtil {
|
||||
}
|
||||
|
||||
public static void rm(Git gApi, String path)
|
||||
throws GitAPIException, IOException {
|
||||
throws GitAPIException {
|
||||
gApi.rm()
|
||||
.addFilepattern(path)
|
||||
.call();
|
||||
|
@@ -43,7 +43,7 @@ public class HttpResponse {
|
||||
public void consume() throws IllegalStateException, IOException {
|
||||
Reader reader = getReader();
|
||||
if (reader != null) {
|
||||
while (reader.read() != -1);
|
||||
while (reader.read() != -1) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -194,14 +194,14 @@ public class PushOneCommit {
|
||||
private final String ref;
|
||||
private final PushResult result;
|
||||
private final Commit commit;
|
||||
private final String subject;
|
||||
private final String resSubj;
|
||||
|
||||
private Result(String ref, PushResult result, Commit commit,
|
||||
private Result(String ref, PushResult resSubj, Commit commit,
|
||||
String subject) {
|
||||
this.ref = ref;
|
||||
this.result = result;
|
||||
this.result = resSubj;
|
||||
this.commit = commit;
|
||||
this.subject = subject;
|
||||
this.resSubj = subject;
|
||||
}
|
||||
|
||||
public PatchSet.Id getPatchSetId() throws OrmException {
|
||||
@@ -226,7 +226,7 @@ public class PushOneCommit {
|
||||
throws OrmException {
|
||||
Change c =
|
||||
Iterables.getOnlyElement(db.changes().byKey(new Change.Key(commit.getChangeId())).toList());
|
||||
assertEquals(subject, c.getSubject());
|
||||
assertEquals(resSubj, c.getSubject());
|
||||
assertEquals(expectedStatus, c.getStatus());
|
||||
assertEquals(expectedTopic, Strings.emptyToNull(c.getTopic()));
|
||||
assertReviewers(c, expectedReviewers);
|
||||
|
@@ -92,11 +92,11 @@ public class RestSession extends HttpSession {
|
||||
}
|
||||
|
||||
|
||||
public static RawInput newRawInput(String content) throws IOException {
|
||||
public static RawInput newRawInput(String content) {
|
||||
return newRawInput(content.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public static RawInput newRawInput(final byte[] bytes) throws IOException {
|
||||
public static RawInput newRawInput(final byte[] bytes) {
|
||||
Preconditions.checkNotNull(bytes);
|
||||
Preconditions.checkArgument(bytes.length > 0);
|
||||
return new RawInput() {
|
||||
|
@@ -78,9 +78,6 @@ public class ChangeEditIT extends AbstractDaemonTest {
|
||||
@Inject
|
||||
private SchemaFactory<ReviewDb> reviewDbProvider;
|
||||
|
||||
@Inject
|
||||
private PushOneCommit.Factory pushFactory;
|
||||
|
||||
@Inject
|
||||
ChangeEditUtil editUtil;
|
||||
|
||||
@@ -90,7 +87,6 @@ public class ChangeEditIT extends AbstractDaemonTest {
|
||||
@Inject
|
||||
private FileContentUtil fileUtil;
|
||||
|
||||
private ReviewDb db;
|
||||
private Change change;
|
||||
private String changeId;
|
||||
private Change change2;
|
||||
|
@@ -195,14 +195,14 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
||||
|
||||
@Test
|
||||
public void testPushForMasterWithApprovals_ValueOutOfRange() throws GitAPIException,
|
||||
IOException, RestApiException {
|
||||
IOException {
|
||||
PushOneCommit.Result r = pushTo("refs/for/master/%l=Code-Review-3");
|
||||
r.assertErrorStatus("label \"Code-Review\": -3 is not a valid value");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPushForNonExistingBranch() throws GitAPIException,
|
||||
OrmException, IOException {
|
||||
IOException {
|
||||
String branchName = "non-existing";
|
||||
PushOneCommit.Result r = pushTo("refs/for/" + branchName);
|
||||
r.assertErrorStatus("branch " + branchName + " not found");
|
||||
|
@@ -30,7 +30,6 @@ import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.server.ApprovalsUtil;
|
||||
import com.google.gerrit.server.GerritPersonIdent;
|
||||
import com.google.gerrit.server.git.CommitMergeStatus;
|
||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.gerrit.server.notedb.ChangeNotes;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
@@ -51,9 +50,6 @@ import java.io.IOException;
|
||||
|
||||
@NoHttpd
|
||||
public class SubmitOnPushIT extends AbstractDaemonTest {
|
||||
@Inject
|
||||
private GitRepositoryManager repoManager;
|
||||
|
||||
@Inject
|
||||
private ApprovalsUtil approvalsUtil;
|
||||
|
||||
@@ -63,9 +59,6 @@ public class SubmitOnPushIT extends AbstractDaemonTest {
|
||||
@Inject
|
||||
private @GerritPersonIdent PersonIdent serverIdent;
|
||||
|
||||
@Inject
|
||||
private PushOneCommit.Factory pushFactory;
|
||||
|
||||
@Test
|
||||
public void submitOnPush() throws Exception {
|
||||
grant(Permission.SUBMIT, project, "refs/for/refs/heads/master");
|
||||
|
@@ -32,9 +32,7 @@ import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gerrit.reviewdb.client.PatchSet;
|
||||
import com.google.gerrit.reviewdb.client.RefNames;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.edit.ChangeEditModifier;
|
||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.gerrit.server.git.ProjectConfig;
|
||||
import com.google.gerrit.server.notedb.NotesMigration;
|
||||
import com.google.gerrit.server.project.Util;
|
||||
@@ -65,12 +63,6 @@ public class VisibleRefFilterIT extends AbstractDaemonTest {
|
||||
@Inject
|
||||
private NotesMigration notesMigration;
|
||||
|
||||
@Inject
|
||||
private GitRepositoryManager repoManager;
|
||||
|
||||
@Inject
|
||||
private GroupCache groupCache;
|
||||
|
||||
@Inject
|
||||
private ChangeEditModifier editModifier;
|
||||
|
||||
|
@@ -39,7 +39,6 @@ import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.server.ApprovalsUtil;
|
||||
import com.google.gerrit.server.change.ChangeJson.ChangeInfo;
|
||||
import com.google.gerrit.server.change.ChangeJson.LabelInfo;
|
||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.gerrit.server.notedb.ChangeNotes;
|
||||
import com.google.gerrit.server.project.PutConfig;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
@@ -67,10 +66,6 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractSubmit extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private GitRepositoryManager repoManager;
|
||||
|
||||
@Inject
|
||||
private ChangeNotes.Factory notesFactory;
|
||||
|
||||
@@ -212,7 +207,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest {
|
||||
}
|
||||
|
||||
protected void assertSubmitter(String changeId, int psId)
|
||||
throws OrmException, IOException {
|
||||
throws OrmException {
|
||||
ChangeNotes cn = notesFactory.create(
|
||||
Iterables.getOnlyElement(db.changes().byKey(new Change.Key(changeId))));
|
||||
PatchSetApproval submitter = approvalsUtil.getSubmitter(
|
||||
|
@@ -31,9 +31,7 @@ import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupById;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupMember;
|
||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
import com.google.gerrit.server.account.AccountInfo;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.group.AddIncludedGroups;
|
||||
import com.google.gerrit.server.group.AddMembers;
|
||||
import com.google.gerrit.server.group.CreateGroup;
|
||||
@@ -41,12 +39,8 @@ import com.google.gerrit.server.group.GroupJson.GroupInfo;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.gwtorm.server.ResultSet;
|
||||
import com.google.gwtorm.server.SchemaFactory;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -56,25 +50,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class AddRemoveGroupMembersIT extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private SchemaFactory<ReviewDb> reviewDbProvider;
|
||||
|
||||
@Inject
|
||||
private GroupCache groupCache;
|
||||
|
||||
private ReviewDb db;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
db = reviewDbProvider.open();
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
db.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addToNonExistingGroup_NotFound() throws Exception {
|
||||
assertEquals(HttpStatus.SC_NOT_FOUND,
|
||||
|
@@ -22,19 +22,13 @@ import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.RestResponse;
|
||||
import com.google.gerrit.acceptance.RestSession;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.group.CreateGroup;
|
||||
import com.google.gerrit.server.group.GroupJson.GroupInfo;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CreateGroupIT extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private GroupCache groupCache;
|
||||
|
||||
@Test
|
||||
public void testCreateGroup() throws Exception {
|
||||
final String newGroupName = "newGroup";
|
||||
|
@@ -19,19 +19,13 @@ import static com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInf
|
||||
import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.RestResponse;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.group.GroupJson.GroupInfo;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GetGroupIT extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private GroupCache groupCache;
|
||||
|
||||
@Test
|
||||
public void testGetGroup() throws Exception {
|
||||
AccountGroup adminGroup = groupCache.get(new AccountGroup.NameKey("Administrators"));
|
||||
|
@@ -24,7 +24,6 @@ import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.RestResponse;
|
||||
import com.google.gerrit.extensions.restapi.Url;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.group.GroupJson.GroupInfo;
|
||||
import com.google.gerrit.server.group.GroupOptionsInfo;
|
||||
import com.google.gerrit.server.group.PutDescription;
|
||||
@@ -32,16 +31,11 @@ import com.google.gerrit.server.group.PutName;
|
||||
import com.google.gerrit.server.group.PutOptions;
|
||||
import com.google.gerrit.server.group.PutOwner;
|
||||
import com.google.gerrit.server.group.SystemGroupBackend;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.junit.Test;
|
||||
|
||||
public class GroupPropertiesIT extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private GroupCache groupCache;
|
||||
|
||||
@Test
|
||||
public void testGroupName() throws Exception {
|
||||
AccountGroup.NameKey adminGroupName = new AccountGroup.NameKey("Administrators");
|
||||
|
@@ -26,11 +26,9 @@ import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.RestResponse;
|
||||
import com.google.gerrit.common.Nullable;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.group.CreateGroup;
|
||||
import com.google.gerrit.server.group.GroupJson.GroupInfo;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.junit.Test;
|
||||
@@ -39,10 +37,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class ListGroupsIT extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private GroupCache groupCache;
|
||||
|
||||
@Test
|
||||
public void testListAllGroups() throws Exception {
|
||||
Iterable<String> expectedGroups = Iterables.transform(groupCache.all(),
|
||||
|
@@ -31,11 +31,8 @@ import com.google.gerrit.extensions.common.SubmitType;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.reviewdb.client.RefNames;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.gerrit.server.group.SystemGroupBackend;
|
||||
import com.google.gerrit.server.project.ProjectState;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.eclipse.jgit.errors.RepositoryNotFoundException;
|
||||
@@ -51,13 +48,6 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
public class CreateProjectIT extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private GroupCache groupCache;
|
||||
|
||||
@Inject
|
||||
private GitRepositoryManager git;
|
||||
|
||||
@Test
|
||||
public void testCreateProjectApi() throws Exception {
|
||||
final String newProjectName = "newProject";
|
||||
@@ -214,7 +204,8 @@ public class CreateProjectIT extends AbstractDaemonTest {
|
||||
|
||||
private void assertHead(String projectName, String expectedRef)
|
||||
throws RepositoryNotFoundException, IOException {
|
||||
Repository repo = git.openRepository(new Project.NameKey(projectName));
|
||||
Repository repo =
|
||||
repoManager.openRepository(new Project.NameKey(projectName));
|
||||
try {
|
||||
assertEquals(expectedRef, repo.getRef(Constants.HEAD).getTarget()
|
||||
.getName());
|
||||
@@ -225,7 +216,8 @@ public class CreateProjectIT extends AbstractDaemonTest {
|
||||
|
||||
private void assertEmptyCommit(String projectName, String... refs)
|
||||
throws RepositoryNotFoundException, IOException {
|
||||
Repository repo = git.openRepository(new Project.NameKey(projectName));
|
||||
Repository repo =
|
||||
repoManager.openRepository(new Project.NameKey(projectName));
|
||||
RevWalk rw = new RevWalk(repo);
|
||||
TreeWalk tw = new TreeWalk(repo);
|
||||
try {
|
||||
|
@@ -25,9 +25,7 @@ import com.google.gerrit.acceptance.RestResponse;
|
||||
import com.google.gerrit.common.data.AccessSection;
|
||||
import com.google.gerrit.common.data.Permission;
|
||||
import com.google.gerrit.extensions.common.CommitInfo;
|
||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.gerrit.server.git.ProjectConfig;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.eclipse.jgit.junit.TestRepository;
|
||||
@@ -39,9 +37,6 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
public class GetCommitIT extends AbstractDaemonTest {
|
||||
@Inject
|
||||
private GitRepositoryManager repoManager;
|
||||
|
||||
private TestRepository<Repository> repo;
|
||||
|
||||
@Before
|
||||
|
@@ -22,9 +22,7 @@ import static org.junit.Assert.assertEquals;
|
||||
import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.PushOneCommit;
|
||||
import com.google.gerrit.reviewdb.client.RefNames;
|
||||
import com.google.gerrit.server.config.AllProjectsNameProvider;
|
||||
import com.google.gerrit.server.project.ProjectState;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.eclipse.jgit.api.Git;
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
@@ -32,13 +30,6 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ProjectLevelConfigIT extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private AllProjectsNameProvider allProjects;
|
||||
|
||||
@Inject
|
||||
private PushOneCommit.Factory pushFactory;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
fetch(git, RefNames.REFS_CONFIG + ":refs/heads/config");
|
||||
@@ -77,7 +68,7 @@ public class ProjectLevelConfigIT extends AbstractDaemonTest {
|
||||
parentCfg.setString("s2", "ss", "k4", "parentValue4");
|
||||
|
||||
Git parentGit =
|
||||
cloneProject(sshSession.getUrl() + "/" + allProjects.get().get(), false);
|
||||
cloneProject(sshSession.getUrl() + "/" + allProjects.get(), false);
|
||||
fetch(parentGit, RefNames.REFS_CONFIG + ":refs/heads/config");
|
||||
checkout(parentGit, "refs/heads/config");
|
||||
PushOneCommit push =
|
||||
|
@@ -20,18 +20,12 @@ import static org.junit.Assert.assertEquals;
|
||||
import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.RestResponse;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.server.config.AllProjectsNameProvider;
|
||||
import com.google.gerrit.server.project.SetParent;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.junit.Test;
|
||||
|
||||
public class SetParentIT extends AbstractDaemonTest {
|
||||
|
||||
@Inject
|
||||
private AllProjectsNameProvider allProjects;
|
||||
|
||||
@Test
|
||||
public void setParent_Forbidden() throws Exception {
|
||||
String parent = "parent";
|
||||
|
@@ -33,7 +33,6 @@ import com.google.gerrit.server.patch.PatchListCache;
|
||||
import com.google.gerrit.server.patch.PatchListEntry;
|
||||
import com.google.gerrit.server.patch.PatchListKey;
|
||||
import com.google.gerrit.server.patch.PatchListNotAvailableException;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.eclipse.jgit.api.ResetCommand.ResetType;
|
||||
@@ -205,16 +204,16 @@ public class PatchListCacheIT extends AbstractDaemonTest {
|
||||
}
|
||||
|
||||
private List<PatchListEntry> getCurrentPatches(String changeId)
|
||||
throws PatchListNotAvailableException, OrmException, RestApiException {
|
||||
throws PatchListNotAvailableException, RestApiException {
|
||||
return patchListCache.get(getKey(null, getCurrentRevisionId(changeId))).getPatches();
|
||||
}
|
||||
|
||||
private List<PatchListEntry> getPatches(ObjectId revisionIdA, ObjectId revisionIdB)
|
||||
throws PatchListNotAvailableException, OrmException {
|
||||
throws PatchListNotAvailableException {
|
||||
return patchListCache.get(getKey(revisionIdA, revisionIdB)).getPatches();
|
||||
}
|
||||
|
||||
private PatchListKey getKey(ObjectId revisionIdA, ObjectId revisionIdB) throws OrmException {
|
||||
private PatchListKey getKey(ObjectId revisionIdA, ObjectId revisionIdB) {
|
||||
return new PatchListKey(project, revisionIdA, revisionIdB, Whitespace.IGNORE_NONE);
|
||||
}
|
||||
|
||||
|
@@ -25,12 +25,10 @@ import com.google.gerrit.extensions.api.changes.CherryPickInput;
|
||||
import com.google.gerrit.extensions.api.changes.ReviewInput;
|
||||
import com.google.gerrit.extensions.common.ChangeInfo;
|
||||
import com.google.gerrit.extensions.common.LabelInfo;
|
||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.gerrit.server.git.MetaDataUpdate;
|
||||
import com.google.gerrit.server.git.ProjectConfig;
|
||||
import com.google.gerrit.server.notedb.NotesMigration;
|
||||
import com.google.gerrit.testutil.ConfigSuite;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
import org.eclipse.jgit.lib.Repository;
|
||||
@@ -44,9 +42,6 @@ public class LabelTypeIT extends AbstractDaemonTest {
|
||||
return NotesMigration.allEnabledConfig();
|
||||
}
|
||||
|
||||
@Inject
|
||||
private GitRepositoryManager repoManager;
|
||||
|
||||
private LabelType codeReview;
|
||||
|
||||
@Before
|
||||
|
@@ -32,6 +32,7 @@ public class ApprovalDetail {
|
||||
final int owner) {
|
||||
List<ApprovalDetail> sorted = new ArrayList<>(ads);
|
||||
Collections.sort(sorted, new Comparator<ApprovalDetail>() {
|
||||
@Override
|
||||
public int compare(ApprovalDetail o1, ApprovalDetail o2) {
|
||||
int byOwner = (o2.account.get() == owner ? 1 : 0)
|
||||
- (o1.account.get() == owner ? 1 : 0);
|
||||
|
@@ -66,6 +66,7 @@ public class LabelType {
|
||||
return Collections.unmodifiableList(values);
|
||||
}
|
||||
Collections.sort(values, new Comparator<LabelValue>() {
|
||||
@Override
|
||||
public int compare(LabelValue o1, LabelValue o2) {
|
||||
return o1.getValue() - o2.getValue();
|
||||
}
|
||||
|
@@ -42,6 +42,7 @@ public class SubmitTypeRecord {
|
||||
public SubmitType type;
|
||||
public String errorMessage;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(status);
|
||||
|
@@ -194,19 +194,20 @@ public class DynamicItem<T> {
|
||||
}
|
||||
|
||||
private class ReloadableHandle implements ReloadableRegistrationHandle<T> {
|
||||
private final Key<T> key;
|
||||
private final Key<T> handleKey;
|
||||
private final NamedProvider<T> item;
|
||||
private final NamedProvider<T> defaultItem;
|
||||
|
||||
ReloadableHandle(Key<T> key, NamedProvider<T> item, NamedProvider<T> defaultItem) {
|
||||
this.key = key;
|
||||
ReloadableHandle(Key<T> handleKey, NamedProvider<T> item,
|
||||
NamedProvider<T> defaultItem) {
|
||||
this.handleKey = handleKey;
|
||||
this.item = item;
|
||||
this.defaultItem = defaultItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Key<T> getKey() {
|
||||
return key;
|
||||
return handleKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -36,6 +36,7 @@ class DynamicItemProvider<T> implements Provider<DynamicItem<T>> {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicItem<T> get() {
|
||||
return new DynamicItem<>(key, find(injector, type), "gerrit");
|
||||
}
|
||||
|
@@ -139,6 +139,7 @@ public abstract class DynamicMap<T> implements Iterable<DynamicMap.Entry<T>> {
|
||||
}
|
||||
|
||||
/** Iterate through all entries in an undefined order. */
|
||||
@Override
|
||||
public Iterator<Entry<T>> iterator() {
|
||||
final Iterator<Map.Entry<NamePair, Provider<T>>> i =
|
||||
items.entrySet().iterator();
|
||||
|
@@ -32,6 +32,7 @@ class DynamicMapProvider<T> implements Provider<DynamicMap<T>> {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicMap<T> get() {
|
||||
PrivateInternals_DynamicMapImpl<T> m =
|
||||
new PrivateInternals_DynamicMapImpl<>();
|
||||
|
@@ -35,6 +35,7 @@ class DynamicSetProvider<T> implements Provider<DynamicSet<T>> {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicSet<T> get() {
|
||||
return new DynamicSet<>(find(injector, type));
|
||||
}
|
||||
|
@@ -145,6 +145,7 @@ public abstract class BinaryResult implements Closeable {
|
||||
public abstract void writeTo(OutputStream os) throws IOException;
|
||||
|
||||
/** Close the result and release any resources it holds. */
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
}
|
||||
|
||||
|
@@ -19,6 +19,7 @@ import java.util.concurrent.TimeUnit;
|
||||
public class CacheControl {
|
||||
|
||||
public enum Type {
|
||||
@SuppressWarnings("hiding")
|
||||
NONE, PUBLIC, PRIVATE
|
||||
}
|
||||
|
||||
|
@@ -52,6 +52,7 @@ public abstract class Response<T> {
|
||||
public abstract T value();
|
||||
public abstract CacheControl caching();
|
||||
public abstract Response<T> caching(CacheControl c);
|
||||
@Override
|
||||
public abstract String toString();
|
||||
|
||||
private static final class Impl<T> extends Response<T> {
|
||||
@@ -100,6 +101,7 @@ public abstract class Response<T> {
|
||||
return 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object value() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@@ -160,10 +160,12 @@ public class CopyableLabel extends Composite implements HasText {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(final String newText) {
|
||||
text = newText;
|
||||
visibleLen = newText.length();
|
||||
@@ -195,6 +197,7 @@ public class CopyableLabel extends Composite implements HasText {
|
||||
@Override
|
||||
public void onKeyUp(final KeyUpEvent event) {
|
||||
Scheduler.get().scheduleDeferred(new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
hideTextBox();
|
||||
}
|
||||
|
@@ -107,11 +107,13 @@ class AttMap {
|
||||
}
|
||||
|
||||
private static class AnyTag implements Tag {
|
||||
@Override
|
||||
public void assertSafe(String name, String value) {
|
||||
}
|
||||
}
|
||||
|
||||
private static class AnchorTag implements Tag {
|
||||
@Override
|
||||
public void assertSafe(String name, String value) {
|
||||
if ("href".equals(name)) {
|
||||
assertNotJavascriptUrl(value);
|
||||
@@ -120,6 +122,7 @@ class AttMap {
|
||||
}
|
||||
|
||||
private static class FormTag implements Tag {
|
||||
@Override
|
||||
public void assertSafe(String name, String value) {
|
||||
if ("action".equals(name)) {
|
||||
assertNotJavascriptUrl(value);
|
||||
@@ -128,6 +131,7 @@ class AttMap {
|
||||
}
|
||||
|
||||
private static class SrcTag implements Tag {
|
||||
@Override
|
||||
public void assertSafe(String name, String value) {
|
||||
if ("src".equals(name)) {
|
||||
assertNotJavascriptUrl(value);
|
||||
|
@@ -29,5 +29,6 @@ interface Buffer {
|
||||
|
||||
void append(String v);
|
||||
|
||||
@Override
|
||||
String toString();
|
||||
}
|
||||
|
@@ -21,30 +21,37 @@ final class BufferDirect implements Buffer {
|
||||
return strbuf.length() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final boolean v) {
|
||||
strbuf.append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final char v) {
|
||||
strbuf.append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final int v) {
|
||||
strbuf.append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final long v) {
|
||||
strbuf.append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final float v) {
|
||||
strbuf.append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final double v) {
|
||||
strbuf.append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final String v) {
|
||||
strbuf.append(v);
|
||||
}
|
||||
|
@@ -21,30 +21,37 @@ final class BufferSealElement implements Buffer {
|
||||
shb = safeHtmlBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final boolean v) {
|
||||
shb.sealElement().append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final char v) {
|
||||
shb.sealElement().append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final double v) {
|
||||
shb.sealElement().append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final float v) {
|
||||
shb.sealElement().append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final int v) {
|
||||
shb.sealElement().append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final long v) {
|
||||
shb.sealElement().append(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void append(final String v) {
|
||||
shb.sealElement().append(v);
|
||||
}
|
||||
|
@@ -41,6 +41,7 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
|
||||
@Override
|
||||
public final void requestSuggestions(final Request request, final Callback cb) {
|
||||
onRequestSuggestions(request, new Callback() {
|
||||
@Override
|
||||
public void onSuggestionsReady(final Request request,
|
||||
final Response response) {
|
||||
final String qpat = getQueryPattern(request.getQuery());
|
||||
@@ -99,10 +100,12 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
|
||||
private static native String sgi(String inString, String pat, String newHtml)
|
||||
/*-{ return inString.replace(RegExp(pat, 'gi'), newHtml); }-*/;
|
||||
|
||||
@Override
|
||||
public String getDisplayString() {
|
||||
return displayString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReplacementString() {
|
||||
return suggestion.getReplacementString();
|
||||
}
|
||||
|
@@ -44,26 +44,32 @@ public abstract class SafeHtml
|
||||
@Override
|
||||
public SafeHtmlCss css() {
|
||||
return new SafeHtmlCss() {
|
||||
@Override
|
||||
public String wikiList() {
|
||||
return "wikiList";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String wikiPreFormat() {
|
||||
return "wikiPreFormat";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String wikiQuote() {
|
||||
return "wikiQuote";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ensureInjected() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return null;
|
||||
}
|
||||
@@ -335,5 +341,6 @@ public abstract class SafeHtml
|
||||
}
|
||||
|
||||
/** @return a clean HTML string safe for inclusion in any context. */
|
||||
@Override
|
||||
public abstract String asString();
|
||||
}
|
||||
|
@@ -49,12 +49,15 @@ import javax.servlet.http.HttpServletResponse;
|
||||
* </pre>
|
||||
*/
|
||||
public class CacheControlFilter implements Filter {
|
||||
@Override
|
||||
public void init(final FilterConfig config) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(final ServletRequest sreq, final ServletResponse srsp,
|
||||
final FilterChain chain) throws IOException, ServletException {
|
||||
final HttpServletRequest req = (HttpServletRequest) sreq;
|
||||
|
@@ -240,7 +240,7 @@ public class Dispatcher {
|
||||
if (defaultScreenToken != null && !MINE.equals(defaultScreenToken)) {
|
||||
select(defaultScreenToken);
|
||||
} else {
|
||||
Gerrit.display(token, mine(token));
|
||||
Gerrit.display(token, mine());
|
||||
}
|
||||
|
||||
} else if (matchPrefix("/dashboard/", token)) {
|
||||
@@ -433,7 +433,7 @@ public class Dispatcher {
|
||||
Gerrit.display(token, screen);
|
||||
}
|
||||
|
||||
private static Screen mine(final String token) {
|
||||
private static Screen mine() {
|
||||
if (Gerrit.isSignedIn()) {
|
||||
return new AccountDashboardScreen(Gerrit.getUserAccount().getId());
|
||||
|
||||
@@ -644,6 +644,7 @@ public class Dispatcher {
|
||||
private static void publish(final PatchSet.Id ps) {
|
||||
String token = toPublish(ps);
|
||||
new AsyncSplit(token) {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Gerrit.display(token, select());
|
||||
}
|
||||
@@ -670,6 +671,7 @@ public class Dispatcher {
|
||||
Gerrit.getPatchScreenTopView() : topView;
|
||||
|
||||
GWT.runAsync(new AsyncSplit(token) {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Gerrit.display(token, select());
|
||||
}
|
||||
@@ -743,6 +745,7 @@ public class Dispatcher {
|
||||
|
||||
private static void settings(String token) {
|
||||
GWT.runAsync(new AsyncSplit(token) {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Gerrit.display(token, select());
|
||||
}
|
||||
@@ -810,6 +813,7 @@ public class Dispatcher {
|
||||
|
||||
private static void admin(String token) {
|
||||
GWT.runAsync(new AsyncSplit(token) {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (matchExact(ADMIN_GROUPS, token)
|
||||
|| matchExact("/admin/groups", token)) {
|
||||
@@ -983,6 +987,7 @@ public class Dispatcher {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onFailure(Throwable reason) {
|
||||
if (!isReloadUi
|
||||
&& "HTTP download failed with status 404".equals(reason.getMessage())) {
|
||||
@@ -999,6 +1004,7 @@ public class Dispatcher {
|
||||
|
||||
private static void docSearch(final String token) {
|
||||
GWT.runAsync(new AsyncSplit(token) {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Gerrit.display(token, new DocScreen(skip(token)));
|
||||
}
|
||||
|
@@ -657,6 +657,7 @@ public class Gerrit implements EntryPoint {
|
||||
final LinkMenuItem dashboardsMenuItem =
|
||||
new ProjectLinkMenuItem(C.menuProjectsDashboards(),
|
||||
ProjectScreen.DASHBOARDS) {
|
||||
@Override
|
||||
protected boolean match(String token) {
|
||||
return super.match(token) ||
|
||||
(!getTargetHistoryToken().isEmpty() && ("/admin" + token).startsWith(getTargetHistoryToken()));
|
||||
@@ -718,6 +719,7 @@ public class Gerrit implements EntryPoint {
|
||||
|
||||
case OPENID:
|
||||
menuRight.addItem(C.menuRegister(), new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
String t = History.getToken();
|
||||
if (t == null) {
|
||||
@@ -727,6 +729,7 @@ public class Gerrit implements EntryPoint {
|
||||
}
|
||||
});
|
||||
menuRight.addItem(C.menuSignIn(), new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
doSignIn(History.getToken());
|
||||
}
|
||||
@@ -735,6 +738,7 @@ public class Gerrit implements EntryPoint {
|
||||
|
||||
case OPENID_SSO:
|
||||
menuRight.addItem(C.menuSignIn(), new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
doSignIn(History.getToken());
|
||||
}
|
||||
@@ -757,6 +761,7 @@ public class Gerrit implements EntryPoint {
|
||||
menuRight.add(anchor(registerText, cfg.getRegisterUrl()));
|
||||
}
|
||||
menuRight.addItem(C.menuSignIn(), new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
doSignIn(History.getToken());
|
||||
}
|
||||
@@ -769,6 +774,7 @@ public class Gerrit implements EntryPoint {
|
||||
}
|
||||
}
|
||||
ConfigServerApi.topMenus(new GerritCallback<TopMenuList>() {
|
||||
@Override
|
||||
public void onSuccess(TopMenuList result) {
|
||||
List<TopMenu> topMenuExtensions = Natives.asList(result);
|
||||
for (TopMenu menu : topMenuExtensions) {
|
||||
|
@@ -194,6 +194,7 @@ class ContactPanelShort extends Composite {
|
||||
haveEmails = false;
|
||||
|
||||
Util.ACCOUNT_SVC.myAccount(new GerritCallback<Account>() {
|
||||
@Override
|
||||
public void onSuccess(final Account result) {
|
||||
if (!isAttached()) {
|
||||
return;
|
||||
@@ -359,6 +360,7 @@ class ContactPanelShort extends Composite {
|
||||
|
||||
Util.ACCOUNT_SEC.updateContact(newName, newEmail, info,
|
||||
new GerritCallback<Account>() {
|
||||
@Override
|
||||
public void onSuccess(final Account result) {
|
||||
registerNewEmail.setEnabled(true);
|
||||
onSaveSuccess(result);
|
||||
|
@@ -40,6 +40,7 @@ public class MyAgreementsScreen extends SettingsScreen {
|
||||
protected void onLoad() {
|
||||
super.onLoad();
|
||||
Util.ACCOUNT_SVC.myAgreements(new ScreenLoadCallback<AgreementInfo>(this) {
|
||||
@Override
|
||||
public void preDisplay(final AgreementInfo result) {
|
||||
agreements.display(result);
|
||||
}
|
||||
|
@@ -76,6 +76,7 @@ public class MyIdentitiesScreen extends SettingsScreen {
|
||||
super.onLoad();
|
||||
Util.ACCOUNT_SEC
|
||||
.myExternalIds(new ScreenLoadCallback<List<AccountExternalId>>(this) {
|
||||
@Override
|
||||
public void preDisplay(final List<AccountExternalId> result) {
|
||||
identites.display(result);
|
||||
}
|
||||
@@ -126,6 +127,7 @@ public class MyIdentitiesScreen extends SettingsScreen {
|
||||
deleteIdentity.setEnabled(false);
|
||||
Util.ACCOUNT_SEC.deleteExternalIds(keys,
|
||||
new GerritCallback<Set<AccountExternalId.Key>>() {
|
||||
@Override
|
||||
public void onSuccess(final Set<AccountExternalId.Key> removed) {
|
||||
for (int row = 1; row < table.getRowCount();) {
|
||||
final AccountExternalId k = getRowItem(row);
|
||||
|
@@ -213,6 +213,7 @@ public class MyWatchedProjectsScreen extends SettingsScreen {
|
||||
|
||||
Util.ACCOUNT_SVC.addProjectWatch(projectName, filter,
|
||||
new GerritCallback<AccountProjectWatchInfo>() {
|
||||
@Override
|
||||
public void onSuccess(final AccountProjectWatchInfo result) {
|
||||
addNew.setEnabled(true);
|
||||
nameBox.setEnabled(true);
|
||||
|
@@ -67,6 +67,7 @@ public class MyWatchesTable extends FancyFlexTable<AccountProjectWatchInfo> {
|
||||
if (!ids.isEmpty()) {
|
||||
Util.ACCOUNT_SVC.deleteProjectWatches(ids,
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final VoidResult result) {
|
||||
remove(ids);
|
||||
}
|
||||
@@ -165,6 +166,7 @@ public class MyWatchesTable extends FancyFlexTable<AccountProjectWatchInfo> {
|
||||
cbox.setEnabled(false);
|
||||
Util.ACCOUNT_SVC.updateProjectWatch(info.getWatch(),
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final VoidResult result) {
|
||||
cbox.setEnabled(true);
|
||||
}
|
||||
|
@@ -79,6 +79,7 @@ public class NewAgreementScreen extends AccountScreen {
|
||||
protected void onLoad() {
|
||||
super.onLoad();
|
||||
Util.ACCOUNT_SVC.myAgreements(new GerritCallback<AgreementInfo>() {
|
||||
@Override
|
||||
public void onSuccess(AgreementInfo result) {
|
||||
if (isAttached()) {
|
||||
mySigned = new HashSet<>(result.accepted);
|
||||
@@ -88,6 +89,7 @@ public class NewAgreementScreen extends AccountScreen {
|
||||
});
|
||||
Gerrit.SYSTEM_SVC
|
||||
.contributorAgreements(new GerritCallback<List<ContributorAgreement>>() {
|
||||
@Override
|
||||
public void onSuccess(final List<ContributorAgreement> result) {
|
||||
if (isAttached()) {
|
||||
available = result;
|
||||
@@ -224,6 +226,7 @@ public class NewAgreementScreen extends AccountScreen {
|
||||
private void doEnterAgreement() {
|
||||
Util.ACCOUNT_SEC.enterAgreement(current.getName(),
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final VoidResult result) {
|
||||
Gerrit.display(nextToken);
|
||||
}
|
||||
@@ -247,10 +250,12 @@ public class NewAgreementScreen extends AccountScreen {
|
||||
}
|
||||
final RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
|
||||
rb.setCallback(new RequestCallback() {
|
||||
@Override
|
||||
public void onError(Request request, Throwable exception) {
|
||||
new ErrorDialog(exception).center();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponseReceived(Request request, Response response) {
|
||||
final String ct = response.getHeader("Content-Type");
|
||||
if (response.getStatusCode() == 200 && ct != null
|
||||
|
@@ -159,6 +159,7 @@ class SshPanel extends Composite {
|
||||
if (txt != null && txt.length() > 0) {
|
||||
addNew.setEnabled(false);
|
||||
AccountApi.addSshKey("self", txt, new GerritCallback<SshKeyInfo>() {
|
||||
@Override
|
||||
public void onSuccess(final SshKeyInfo k) {
|
||||
addNew.setEnabled(true);
|
||||
addTxt.setText("");
|
||||
@@ -198,6 +199,7 @@ class SshPanel extends Composite {
|
||||
super.onLoad();
|
||||
refreshSshKeys();
|
||||
Gerrit.SYSTEM_SVC.daemonHostKeys(new GerritCallback<List<SshHostKey>>() {
|
||||
@Override
|
||||
public void onSuccess(final List<SshHostKey> result) {
|
||||
serverKeys.clear();
|
||||
for (final SshHostKey keyInfo : result) {
|
||||
@@ -272,6 +274,7 @@ class SshPanel extends Composite {
|
||||
deleteKey.setEnabled(false);
|
||||
AccountApi.deleteSshKeys("self", sequenceNumbers,
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(VoidResult result) {
|
||||
for (int row = 1; row < table.getRowCount();) {
|
||||
final SshKeyInfo k = getRowItem(row);
|
||||
|
@@ -116,6 +116,7 @@ class UsernameField extends Composite {
|
||||
|
||||
Util.ACCOUNT_SEC.changeUserName(newUserName,
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final VoidResult result) {
|
||||
Gerrit.getUserAccount().setUserName(newUserName);
|
||||
userNameLbl.setText(newUserName);
|
||||
|
@@ -96,6 +96,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
|
||||
final String newName = groupNameTxt.getText().trim();
|
||||
GroupApi.renameGroup(getGroupUUID(), newName,
|
||||
new GerritCallback<com.google.gerrit.client.VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final com.google.gerrit.client.VoidResult result) {
|
||||
saveName.setEnabled(false);
|
||||
setPageTitle(Util.M.group(newName));
|
||||
@@ -135,6 +136,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
|
||||
String ownerId = ownerUuid != null ? ownerUuid.get() : newOwner;
|
||||
GroupApi.setGroupOwner(getGroupUUID(), ownerId,
|
||||
new GerritCallback<GroupInfo>() {
|
||||
@Override
|
||||
public void onSuccess(final GroupInfo result) {
|
||||
updateOwnerGroup(result);
|
||||
saveOwner.setEnabled(false);
|
||||
@@ -165,6 +167,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
|
||||
final String txt = descTxt.getText().trim();
|
||||
GroupApi.setGroupDescription(getGroupUUID(), txt,
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final VoidResult result) {
|
||||
saveDesc.setEnabled(false);
|
||||
}
|
||||
@@ -193,6 +196,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
|
||||
public void onClick(final ClickEvent event) {
|
||||
GroupApi.setGroupOptions(getGroupUUID(),
|
||||
visibleToAllCheckBox.getValue(), new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final VoidResult result) {
|
||||
saveGroupOptions.setEnabled(false);
|
||||
}
|
||||
|
@@ -172,6 +172,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
|
||||
addMemberBox.setEnabled(false);
|
||||
GroupApi.addMember(getGroupUUID(), nameEmail,
|
||||
new GerritCallback<AccountInfo>() {
|
||||
@Override
|
||||
public void onSuccess(final AccountInfo memberInfo) {
|
||||
addMemberBox.setEnabled(true);
|
||||
addMemberBox.setText("");
|
||||
@@ -200,6 +201,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
|
||||
addIncludeBox.setEnabled(false);
|
||||
GroupApi.addIncludedGroup(getGroupUUID(), uuid.get(),
|
||||
new GerritCallback<GroupInfo>() {
|
||||
@Override
|
||||
public void onSuccess(final GroupInfo result) {
|
||||
addIncludeBox.setEnabled(true);
|
||||
addIncludeBox.setText("");
|
||||
@@ -248,6 +250,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
|
||||
if (!ids.isEmpty()) {
|
||||
GroupApi.removeMembers(getGroupUUID(), ids,
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final VoidResult result) {
|
||||
for (int row = 1; row < table.getRowCount();) {
|
||||
final AccountInfo i = getRowItem(row);
|
||||
@@ -353,6 +356,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
|
||||
if (!ids.isEmpty()) {
|
||||
GroupApi.removeIncludedGroups(getGroupUUID(), ids,
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(final VoidResult result) {
|
||||
for (int row = 1; row < table.getRowCount();) {
|
||||
final GroupInfo i = getRowItem(row);
|
||||
|
@@ -128,6 +128,7 @@ public class CreateGroupScreen extends Screen {
|
||||
|
||||
addNew.setEnabled(false);
|
||||
GroupApi.createGroup(newName, new GerritCallback<GroupInfo>() {
|
||||
@Override
|
||||
public void onSuccess(final GroupInfo result) {
|
||||
History.newItem(Dispatcher.toGroup(result.getGroupId(),
|
||||
AccountGroupScreen.MEMBERS));
|
||||
|
@@ -133,6 +133,7 @@ public class GroupReferenceBox extends Composite implements
|
||||
suggestBox.setTabIndex(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFocus(boolean focused) {
|
||||
suggestBox.setFocus(focused);
|
||||
}
|
||||
|
@@ -316,6 +316,7 @@ public class ProjectBranchesScreen extends ProjectScreen {
|
||||
private void deleteBranches(final Set<String> branches) {
|
||||
ProjectApi.deleteBranches(getProjectKey(), branches,
|
||||
new GerritCallback<VoidResult>() {
|
||||
@Override
|
||||
public void onSuccess(VoidResult result) {
|
||||
for (int row = 1; row < table.getRowCount();) {
|
||||
BranchInfo k = getRowItem(row);
|
||||
|
@@ -27,16 +27,19 @@ import java.text.ParseException;
|
||||
|
||||
public class RefPatternBox extends ValueBox<String> {
|
||||
private static final Renderer<String> RENDERER = new Renderer<String>() {
|
||||
@Override
|
||||
public String render(String ref) {
|
||||
return ref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(String ref, Appendable dst) throws IOException {
|
||||
dst.append(render(ref));
|
||||
}
|
||||
};
|
||||
|
||||
private static final Parser<String> PARSER = new Parser<String>() {
|
||||
@Override
|
||||
public String parse(CharSequence text) throws ParseException {
|
||||
String ref = text.toString();
|
||||
|
||||
|
@@ -86,6 +86,7 @@ public class ValueEditor<T> extends Composite implements HasEditorErrors<T>,
|
||||
editPanel.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueBoxEditor<T> asEditor() {
|
||||
if (editProxy == null) {
|
||||
editProxy = new EditorProxy();
|
||||
@@ -133,6 +134,7 @@ public class ValueEditor<T> extends Composite implements HasEditorErrors<T>,
|
||||
startHandlers.enabled = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showErrors(List<EditorError> errors) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (EditorError error : errors) {
|
||||
|
@@ -81,6 +81,7 @@ class PluginName {
|
||||
|
||||
/** Extracts URL from the stack frame. */
|
||||
static class PluginNameMoz extends PluginName {
|
||||
@Override
|
||||
String findCallerUrl() {
|
||||
return getUrl(makeException());
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@ class AbandonAction extends ActionMessageBox {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
void send(String message) {
|
||||
ChangeApi.abandon(id.get(), message, new GerritCallback<ChangeInfo>() {
|
||||
@Override
|
||||
|
@@ -256,7 +256,7 @@ class Actions extends Composite {
|
||||
|
||||
@UiHandler("revert")
|
||||
void onRevert(ClickEvent e) {
|
||||
RevertAction.call(revert, changeId, revision, project, subject);
|
||||
RevertAction.call(revert, changeId, revision, subject);
|
||||
}
|
||||
|
||||
private static void a2b(NativeMap<ActionInfo> actions, String a, Button b) {
|
||||
|
@@ -1077,6 +1077,7 @@ public class ChangeScreen2 extends Screen {
|
||||
Gerrit.display(PageLinks.toChange(changeId));
|
||||
}
|
||||
|
||||
@Override
|
||||
void onIgnore(Timestamp newTime) {
|
||||
lastDisplayedUpdate = newTime;
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@ class DownloadAction extends RightSidePopdownAction {
|
||||
info.revision(revision)._number()));
|
||||
}
|
||||
|
||||
@Override
|
||||
Widget getWidget() {
|
||||
return downloadBox;
|
||||
}
|
||||
|
@@ -40,10 +40,12 @@ public class DraftActions {
|
||||
public static GerritCallback<JavaScriptObject> cs(
|
||||
final Change.Id id) {
|
||||
return new GerritCallback<JavaScriptObject>() {
|
||||
@Override
|
||||
public void onSuccess(JavaScriptObject result) {
|
||||
Gerrit.display(PageLinks.toChange(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable err) {
|
||||
if (SubmitFailureDialog.isConflict(err)) {
|
||||
new SubmitFailureDialog(err.getMessage()).center();
|
||||
@@ -57,10 +59,12 @@ public class DraftActions {
|
||||
|
||||
private static AsyncCallback<JavaScriptObject> mine() {
|
||||
return new GerritCallback<JavaScriptObject>() {
|
||||
@Override
|
||||
public void onSuccess(JavaScriptObject result) {
|
||||
Gerrit.display(PageLinks.MINE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable err) {
|
||||
if (SubmitFailureDialog.isConflict(err)) {
|
||||
new SubmitFailureDialog(err.getMessage()).center();
|
||||
|
@@ -39,10 +39,12 @@ public class EditActions {
|
||||
public static GerritCallback<JavaScriptObject> cs(
|
||||
final Change.Id id) {
|
||||
return new GerritCallback<JavaScriptObject>() {
|
||||
@Override
|
||||
public void onSuccess(JavaScriptObject result) {
|
||||
Gerrit.display(PageLinks.toChange(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable err) {
|
||||
if (SubmitFailureDialog.isConflict(err)) {
|
||||
new SubmitFailureDialog(err.getMessage()).center();
|
||||
|
@@ -58,6 +58,7 @@ class EditMessageBox extends Composite {
|
||||
message.getElement().setAttribute("wrap", "off");
|
||||
message.setText("");
|
||||
new TextBoxChangeListener(message) {
|
||||
@Override
|
||||
public void onTextChanged(String newText) {
|
||||
save.setEnabled(!newText.trim()
|
||||
.equals(originalMessage));
|
||||
|
@@ -93,6 +93,7 @@ public class FileTable extends FlowPanel {
|
||||
|
||||
public static enum Mode {
|
||||
REVIEW,
|
||||
@SuppressWarnings("hiding")
|
||||
EDIT
|
||||
}
|
||||
|
||||
@@ -460,7 +461,7 @@ public class FileTable extends FlowPanel {
|
||||
|
||||
private final class DisplayCommand implements RepeatingCommand {
|
||||
private final SafeHtmlBuilder sb = new SafeHtmlBuilder();
|
||||
private final MyTable table;
|
||||
private final MyTable myTable;
|
||||
private final JsArray<FileInfo> list;
|
||||
private final Timestamp myLastReply;
|
||||
private final NativeMap<JsArray<CommentInfo>> comments;
|
||||
@@ -482,16 +483,17 @@ public class FileTable extends FlowPanel {
|
||||
NativeMap<JsArray<CommentInfo>> comments,
|
||||
NativeMap<JsArray<CommentInfo>> drafts,
|
||||
Mode mode) {
|
||||
this.table = new MyTable(map, list);
|
||||
this.myTable = new MyTable(map, list);
|
||||
this.list = list;
|
||||
this.myLastReply = myLastReply;
|
||||
this.comments = comments;
|
||||
this.drafts = drafts;
|
||||
this.hasUser = Gerrit.isSignedIn();
|
||||
this.mode = mode;
|
||||
table.addStyleName(R.css().table());
|
||||
myTable.addStyleName(R.css().table());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute() {
|
||||
boolean attachedNow = isAttached();
|
||||
if (!attached && attachedNow) {
|
||||
@@ -519,9 +521,9 @@ public class FileTable extends FlowPanel {
|
||||
}
|
||||
}
|
||||
footer(sb);
|
||||
table.resetHtml(sb);
|
||||
table.finishDisplay();
|
||||
setTable(table);
|
||||
myTable.resetHtml(sb);
|
||||
myTable.finishDisplay();
|
||||
setTable(myTable);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -33,6 +33,7 @@ class FollowUpAction extends ActionMessageBox {
|
||||
this.base = project + "~" + branch + "~" + key;
|
||||
}
|
||||
|
||||
@Override
|
||||
void send(String message) {
|
||||
ChangeApi.createChange(project, branch, message, base,
|
||||
new GerritCallback<ChangeInfo>() {
|
||||
|
@@ -200,6 +200,7 @@ public class Hashtags extends Composite {
|
||||
ChangeApi.hashtags(changeId.get()).post(
|
||||
PostInput.create(hashtags, null),
|
||||
new GerritCallback<JsArrayString>() {
|
||||
@Override
|
||||
public void onSuccess(JsArrayString result) {
|
||||
hashtagTextBox.setEnabled(true);
|
||||
UIObject.setVisible(error, false);
|
||||
|
@@ -30,6 +30,7 @@ class IncludedInAction extends RightSidePopdownAction {
|
||||
this.includedInBox = new IncludedInBox(changeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
Widget getWidget() {
|
||||
return includedInBox;
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ class PatchSetsAction extends RightSidePopdownAction {
|
||||
this.revisionBox = new PatchSetsBox(changeId, revision);
|
||||
}
|
||||
|
||||
@Override
|
||||
Widget getWidget() {
|
||||
return revisionBox;
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@ class RebaseAction {
|
||||
static void call(final Change.Id id, String revision) {
|
||||
ChangeApi.rebase(id.get(), revision,
|
||||
new GerritCallback<ChangeInfo>() {
|
||||
@Override
|
||||
public void onSuccess(ChangeInfo result) {
|
||||
Gerrit.display(PageLinks.toChange(id));
|
||||
}
|
||||
|
@@ -200,6 +200,7 @@ class RelatedChangesTab implements IsWidget {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute() {
|
||||
if (navList != view || !panel.isAttached()) {
|
||||
// If the user navigated away, we aren't in the DOM anymore.
|
||||
|
@@ -62,6 +62,7 @@ public class RestReviewerSuggestOracle extends SuggestAfterTypingNCharsOracle {
|
||||
this.reviewer = reviewer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayString() {
|
||||
if (reviewer.account() != null) {
|
||||
return FormatUtil.nameEmail(reviewer.account());
|
||||
@@ -72,6 +73,7 @@ public class RestReviewerSuggestOracle extends SuggestAfterTypingNCharsOracle {
|
||||
+ ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReplacementString() {
|
||||
if (reviewer.account() != null) {
|
||||
return FormatUtil.nameEmail(reviewer.account());
|
||||
|
@@ -30,6 +30,7 @@ class RestoreAction extends ActionMessageBox {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
void send(String message) {
|
||||
ChangeApi.restore(id.get(), message, new GerritCallback<ChangeInfo>() {
|
||||
@Override
|
||||
|
@@ -26,7 +26,7 @@ import com.google.gwt.user.client.ui.Button;
|
||||
|
||||
class RevertAction {
|
||||
static void call(Button b, final Change.Id id, final String revision,
|
||||
String project, final String commitSubject) {
|
||||
final String commitSubject) {
|
||||
// TODO Replace ActionDialog with a nicer looking display.
|
||||
b.setEnabled(false);
|
||||
new ActionDialog(b, false,
|
||||
|
@@ -163,6 +163,7 @@ public class Reviewers extends Composite {
|
||||
ChangeApi.reviewers(changeId.get()).post(
|
||||
PostInput.create(reviewer, confirmed),
|
||||
new GerritCallback<PostResult>() {
|
||||
@Override
|
||||
public void onSuccess(PostResult result) {
|
||||
nameTxtBox.setEnabled(true);
|
||||
|
||||
|
@@ -32,10 +32,12 @@ class SubmitAction {
|
||||
ChangeApi.submit(
|
||||
changeId.get(), revisionInfo.name(),
|
||||
new GerritCallback<SubmitInfo>() {
|
||||
@Override
|
||||
public void onSuccess(SubmitInfo result) {
|
||||
redisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable err) {
|
||||
if (SubmitFailureDialog.isConflict(err)) {
|
||||
new SubmitFailureDialog(err.getMessage()).center();
|
||||
|
@@ -254,6 +254,7 @@ public class ApprovalTable extends Composite {
|
||||
ChangeApi.reviewers(lastChange.legacy_id().get()).post(
|
||||
PostInput.create(reviewer, confirmed),
|
||||
new GerritCallback<PostResult>() {
|
||||
@Override
|
||||
public void onSuccess(PostResult result) {
|
||||
addMemberBox.setEnabled(true);
|
||||
addMemberBox.setText("");
|
||||
|
@@ -313,6 +313,7 @@ public class ChangeScreen extends Screen
|
||||
event.getValue().setSubmitTypeRecord(SubmitTypeRecord.OK(
|
||||
SubmitType.valueOf(result.asString())));
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}));
|
||||
}
|
||||
@@ -388,7 +389,9 @@ public class ChangeScreen extends Screen
|
||||
ListChangesOption.CURRENT_REVISION));
|
||||
call.get(cbs2.add(new AsyncCallback<
|
||||
com.google.gerrit.client.changes.ChangeInfo>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
@Override
|
||||
public void onSuccess(
|
||||
com.google.gerrit.client.changes.ChangeInfo result) {
|
||||
i.set(ChangeDetailCache.toChange(result),
|
||||
@@ -398,6 +401,7 @@ public class ChangeScreen extends Screen
|
||||
.merge(ChangeDetailCache.users(result));
|
||||
}}));
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}));
|
||||
ChangeApi.revision(changeId.get(), revId)
|
||||
@@ -416,6 +420,7 @@ public class ChangeScreen extends Screen
|
||||
p.setReviewedByCurrentUser(true);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}));
|
||||
final Set<PatchSet.Id> withDrafts = new HashSet<>();
|
||||
@@ -432,6 +437,7 @@ public class ChangeScreen extends Screen
|
||||
withDrafts.add(id);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}));
|
||||
}
|
||||
@@ -453,6 +459,7 @@ public class ChangeScreen extends Screen
|
||||
withDrafts.add(psId);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}));
|
||||
}
|
||||
@@ -470,6 +477,7 @@ public class ChangeScreen extends Screen
|
||||
p.setCommentCount(result.get(path).length());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}));
|
||||
DiffApi.list(changeId.get(), null, revId,
|
||||
@@ -497,6 +505,7 @@ public class ChangeScreen extends Screen
|
||||
}
|
||||
event.getValue().getCurrentPatchSetDetail().setPatches(list);
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
});
|
||||
ConfigInfoCache.get(
|
||||
@@ -524,6 +533,7 @@ public class ChangeScreen extends Screen
|
||||
public void onSuccess(Void result) {
|
||||
display(event.getValue());
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}).onSuccess(null);
|
||||
}
|
||||
|
@@ -87,6 +87,7 @@ public class CommitMessageBlock extends Composite {
|
||||
sendButton.setEnabled(false);
|
||||
|
||||
new TextBoxChangeListener(message) {
|
||||
@Override
|
||||
public void onTextChanged(String newText) {
|
||||
// Trim the new text so we don't consider trailing
|
||||
// newlines as changes
|
||||
@@ -95,6 +96,7 @@ public class CommitMessageBlock extends Composite {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessageText() {
|
||||
// As we rely on commit message lines ending in LF, we convert CRLF to
|
||||
// LF. Additionally, the commit message should be trimmed to remove any
|
||||
|
@@ -96,6 +96,7 @@ public class DashboardTable extends ChangeTable2 {
|
||||
return unlimitedQuery.toString().trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
@@ -319,10 +319,12 @@ class PatchSetComplexDisclosurePanel extends ComplexDisclosurePanel
|
||||
patchSet.getId().getParentKey().get(),
|
||||
patchSet.getRevision().get(),
|
||||
new GerritCallback<SubmitInfo>() {
|
||||
@Override
|
||||
public void onSuccess(SubmitInfo result) {
|
||||
redisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable err) {
|
||||
if (SubmitFailureDialog.isConflict(err)) {
|
||||
new SubmitFailureDialog(err.getMessage()).center();
|
||||
@@ -480,10 +482,12 @@ class PatchSetComplexDisclosurePanel extends ComplexDisclosurePanel
|
||||
b.setEnabled(false);
|
||||
ChangeApi.deleteChange(patchSet.getId().getParentKey().get(),
|
||||
new GerritCallback<JavaScriptObject>() {
|
||||
@Override
|
||||
public void onSuccess(JavaScriptObject result) {
|
||||
Gerrit.display(PageLinks.MINE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable err) {
|
||||
if (SubmitFailureDialog.isConflict(err)) {
|
||||
new SubmitFailureDialog(err.getMessage()).center();
|
||||
@@ -545,6 +549,7 @@ class PatchSetComplexDisclosurePanel extends ComplexDisclosurePanel
|
||||
final Change.Id id = patchSet.getId().getParentKey();
|
||||
ChangeApi.rebase(id.get(), patchSet.getRevision().get(),
|
||||
new GerritCallback<ChangeInfo>() {
|
||||
@Override
|
||||
public void onSuccess(ChangeInfo result) {
|
||||
Gerrit.display(PageLinks.toChange(id));
|
||||
}
|
||||
@@ -691,6 +696,7 @@ class PatchSetComplexDisclosurePanel extends ComplexDisclosurePanel
|
||||
|
||||
Util.DETAIL_SVC.patchSetDetail2(diffBaseId, patchSet.getId(), diffPrefs,
|
||||
new GerritCallback<PatchSetDetail>() {
|
||||
@Override
|
||||
public void onSuccess(final PatchSetDetail result) {
|
||||
loadInfoTable(result);
|
||||
loadActionPanel(result);
|
||||
|
@@ -455,6 +455,7 @@ public class PatchTable extends Composite {
|
||||
int C_UNIFIED = C_SIDEBYSIDE - 2 + 1;
|
||||
Anchor unified = new Anchor(Util.C.diffAllUnified());
|
||||
unified.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
for (Patch p : detail.getPatches()) {
|
||||
openWindow(Dispatcher.toPatchUnified(base, p.getKey()));
|
||||
@@ -742,6 +743,7 @@ public class PatchTable extends Composite {
|
||||
/**
|
||||
* Add the files contained in the list of patches to the table, one per row.
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("fallthrough")
|
||||
public boolean execute() {
|
||||
final boolean attachedNow = isAttached();
|
||||
|
@@ -171,6 +171,7 @@ public class PublishCommentScreen extends AccountScreen implements
|
||||
submitTypeRecord = SubmitTypeRecord.OK(
|
||||
SubmitType.valueOf(result.asString()));
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}));
|
||||
ChangeApi.revision(patchSetId.getParentKey().get(), "" + patchSetId.get())
|
||||
@@ -180,6 +181,7 @@ public class PublishCommentScreen extends AccountScreen implements
|
||||
public void onSuccess(NativeMap<JsArray<CommentInfo>> result) {
|
||||
drafts = result;
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {}
|
||||
}));
|
||||
ChangeApi.revision(patchSetId).view("review")
|
||||
@@ -445,6 +447,7 @@ public class PublishCommentScreen extends AccountScreen implements
|
||||
patchSetId.getParentKey().get(),
|
||||
"" + patchSetId.get(),
|
||||
new GerritCallback<SubmitInfo>() {
|
||||
@Override
|
||||
public void onSuccess(SubmitInfo result) {
|
||||
saveStateOnUnload = false;
|
||||
goChange();
|
||||
|
@@ -65,7 +65,7 @@ class ChunkManager {
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static void focusOnClick(Element e, DisplaySide side) {
|
||||
onClick(e, side == A ? focusA : focusB);
|
||||
@@ -165,10 +165,10 @@ class ChunkManager {
|
||||
int endA = mapper.getLineA() - 1;
|
||||
int endB = mapper.getLineB() - 1;
|
||||
if (aLen > 0) {
|
||||
addDiffChunk(cmB, endB, endA, aLen, bLen > 0);
|
||||
addDiffChunk(cmB, endA, aLen, bLen > 0);
|
||||
}
|
||||
if (bLen > 0) {
|
||||
addDiffChunk(cmA, endA, endB, bLen, aLen > 0);
|
||||
addDiffChunk(cmA, endB, bLen, aLen > 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,8 +264,8 @@ class ChunkManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void addDiffChunk(CodeMirror cmToPad, int lineToPad,
|
||||
int lineOnOther, int chunkSize, boolean edit) {
|
||||
private void addDiffChunk(CodeMirror cmToPad, int lineOnOther,
|
||||
int chunkSize, boolean edit) {
|
||||
chunks.add(new DiffChunkInfo(host.otherCm(cmToPad).side(),
|
||||
lineOnOther - chunkSize + 1, lineOnOther, edit));
|
||||
}
|
||||
|
@@ -295,6 +295,7 @@ class CommentManager {
|
||||
|
||||
Runnable toggleOpenBox(final CodeMirror cm) {
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (cm.hasActiveLine()) {
|
||||
CommentGroup w = map(cm.side()).get(
|
||||
@@ -339,6 +340,7 @@ class CommentManager {
|
||||
}
|
||||
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (cm.hasActiveLine()) {
|
||||
newDraft(cm);
|
||||
|
@@ -281,6 +281,7 @@ class Header extends Composite {
|
||||
|
||||
Runnable toggleReviewed() {
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
reviewed.setValue(!reviewed.getValue(), true);
|
||||
}
|
||||
|
@@ -109,6 +109,7 @@ class PublishedBox extends CommentBox {
|
||||
return UIObject.isVisible(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
void setOpen(boolean open) {
|
||||
UIObject.setVisible(summary, !open);
|
||||
UIObject.setVisible(message, open);
|
||||
|
@@ -363,6 +363,7 @@ public class SideBySide2 extends Screen {
|
||||
.on("Shift-Left", moveCursorToSide(cm, DisplaySide.A))
|
||||
.on("Shift-Right", moveCursorToSide(cm, DisplaySide.B))
|
||||
.on("I", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
switch (getIntraLineStatus()) {
|
||||
case OFF:
|
||||
@@ -594,6 +595,7 @@ public class SideBySide2 extends Screen {
|
||||
}
|
||||
|
||||
operation(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Estimate initial CM3 height, fixed up in onShowView.
|
||||
int height = Window.getClientHeight()
|
||||
@@ -783,6 +785,7 @@ public class SideBySide2 extends Screen {
|
||||
private Runnable updateActiveLine(final CodeMirror cm) {
|
||||
final CodeMirror other = otherCm(cm);
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// The rendering of active lines has to be deferred. Reflow
|
||||
// caused by adding and removing styles chokes Firefox when arrow
|
||||
@@ -793,6 +796,7 @@ public class SideBySide2 extends Screen {
|
||||
@Override
|
||||
public void execute() {
|
||||
operation(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LineHandle handle = cm.getLineHandleVisualStart(
|
||||
cm.getCursor("end").getLine());
|
||||
@@ -848,6 +852,7 @@ public class SideBySide2 extends Screen {
|
||||
|
||||
private Runnable upToChange(final boolean openReplyBox) {
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallbackGroup group = new CallbackGroup();
|
||||
commentManager.saveAllDrafts(group);
|
||||
@@ -879,6 +884,7 @@ public class SideBySide2 extends Screen {
|
||||
|
||||
final DisplaySide sideSrc = cmSrc.side();
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (cmSrc.hasActiveLine()) {
|
||||
cmDst.setCursor(LineCharacter.create(lineOnOther(
|
||||
|
@@ -541,6 +541,11 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update cursor after selecting a comment.
|
||||
*
|
||||
* @param newComment comment that was selected.
|
||||
*/
|
||||
protected void updateCursor(final PatchLineComment newComment) {
|
||||
}
|
||||
|
||||
@@ -724,7 +729,7 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
|
||||
}
|
||||
|
||||
protected void bindComment(final int row, final int col,
|
||||
final PatchLineComment line, final boolean isLast, boolean expandComment) {
|
||||
final PatchLineComment line, boolean expandComment) {
|
||||
if (line.getStatus() == PatchLineComment.Status.DRAFT) {
|
||||
final CommentEditorPanel plc =
|
||||
new CommentEditorPanel(line, commentLinkProcessor);
|
||||
|
@@ -245,6 +245,7 @@ public class CommentEditorPanel extends CommentPanel implements ClickHandler,
|
||||
final PatchSet.Id psId = comment.getKey().getParentKey().getParentKey();
|
||||
final boolean wasNew = isNew();
|
||||
GerritCallback<CommentInfo> cb = new GerritCallback<CommentInfo>() {
|
||||
@Override
|
||||
public void onSuccess(CommentInfo result) {
|
||||
notifyDraftDelta(wasNew ? 1 : 0);
|
||||
comment = toComment(psId, comment.getKey().getParentKey().get(), result);
|
||||
@@ -300,6 +301,7 @@ public class CommentEditorPanel extends CommentPanel implements ClickHandler,
|
||||
comment.getKey().getParentKey().getParentKey(),
|
||||
comment.getKey().get(),
|
||||
new GerritCallback<JavaScriptObject>() {
|
||||
@Override
|
||||
public void onSuccess(JavaScriptObject result) {
|
||||
notifyDraftDelta(-1);
|
||||
removeUI();
|
||||
|
@@ -564,6 +564,7 @@ public abstract class PatchScreen extends Screen implements
|
||||
fileList.setSavePointerId("PatchTable " + psid);
|
||||
Util.DETAIL_SVC.patchSetDetail(psid,
|
||||
new GerritCallback<PatchSetDetail>() {
|
||||
@Override
|
||||
public void onSuccess(final PatchSetDetail result) {
|
||||
fileList.display(idSideA, result);
|
||||
}
|
||||
|
@@ -135,6 +135,7 @@ public class ReviewedPanels {
|
||||
private InlineHyperlink createReviewedLink(final int patchIndex,
|
||||
final PatchScreen.Type patchScreenType) {
|
||||
final PatchValidator unreviewedValidator = new PatchValidator() {
|
||||
@Override
|
||||
public boolean isValid(Patch patch) {
|
||||
return !patch.isReviewedByCurrentUser();
|
||||
}
|
||||
|
@@ -57,10 +57,12 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
||||
private boolean isHugeFile;
|
||||
protected boolean isFileCommentBorderRowExist;
|
||||
|
||||
@Override
|
||||
protected void createFileCommentEditorOnSideA() {
|
||||
createCommentEditor(R_HEAD + 1, A, R_HEAD, FILE_SIDE_A);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createFileCommentEditorOnSideB() {
|
||||
createCommentEditor(R_HEAD + 1, B, R_HEAD, FILE_SIDE_B);
|
||||
}
|
||||
@@ -96,7 +98,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
||||
final ArrayList<Object> lines = new ArrayList<>();
|
||||
final SafeHtmlBuilder nc = new SafeHtmlBuilder();
|
||||
isHugeFile = script.isHugeFile();
|
||||
allocateTableHeader(script, nc);
|
||||
allocateTableHeader(nc);
|
||||
lines.add(null);
|
||||
if (!isDisplayBinary) {
|
||||
if (script.getFileModeA() != FileMode.FILE
|
||||
@@ -119,7 +121,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
||||
&& script.hasIntralineDifference();
|
||||
for (final EditList.Hunk hunk : script.getHunks()) {
|
||||
if (!hunk.isStartOfFile()) {
|
||||
appendSkipLine(nc, hunk.getCurB() - lastB);
|
||||
appendSkipLine(nc);
|
||||
lines.add(new SkippedLine(lastA, lastB, hunk.getCurB() - lastB));
|
||||
}
|
||||
|
||||
@@ -185,7 +187,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
||||
lastB = hunk.getCurB();
|
||||
}
|
||||
if (lastB != b.size()) {
|
||||
appendSkipLine(nc, b.size() - lastB);
|
||||
appendSkipLine(nc);
|
||||
lines.add(new SkippedLine(lastA, lastB, b.size() - lastB));
|
||||
}
|
||||
}
|
||||
@@ -329,13 +331,13 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
||||
} else {
|
||||
insertRow(row);
|
||||
}
|
||||
bindComment(row, A, ac, !ai.hasNext(), expandComments);
|
||||
bindComment(row, B, bc, !bi.hasNext(), expandComments);
|
||||
bindComment(row, A, ac, !ai.hasNext());
|
||||
bindComment(row, B, bc, !bi.hasNext());
|
||||
row++;
|
||||
}
|
||||
|
||||
row = finish(ai, row, A, expandComments);
|
||||
row = finish(bi, row, B, expandComments);
|
||||
row = finish(ai, row, A);
|
||||
row = finish(bi, row, B);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,7 +392,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
||||
}
|
||||
}
|
||||
|
||||
private int finish(final Iterator<PatchLineComment> i, int row, final int col, boolean expandComment) {
|
||||
private int finish(final Iterator<PatchLineComment> i, int row, final int col) {
|
||||
while (i.hasNext()) {
|
||||
final PatchLineComment c = i.next();
|
||||
if (c.getLine() == R_HEAD) {
|
||||
@@ -398,13 +400,13 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
||||
} else {
|
||||
insertRow(row);
|
||||
}
|
||||
bindComment(row, col, c, !i.hasNext(), expandComment);
|
||||
bindComment(row, col, c, !i.hasNext());
|
||||
row++;
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
private void allocateTableHeader(PatchScript script, final SafeHtmlBuilder m) {
|
||||
private void allocateTableHeader(final SafeHtmlBuilder m) {
|
||||
m.openTr();
|
||||
|
||||
m.openTd();
|
||||
@@ -457,7 +459,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
||||
m.closeTr();
|
||||
}
|
||||
|
||||
private void appendSkipLine(final SafeHtmlBuilder m, final int skipCnt) {
|
||||
private void appendSkipLine(final SafeHtmlBuilder m) {
|
||||
m.openTr();
|
||||
|
||||
m.openTd();
|
||||
|
@@ -46,6 +46,7 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
||||
private static final int PC = 3;
|
||||
private static final Comparator<PatchLineComment> BY_DATE =
|
||||
new Comparator<PatchLineComment>() {
|
||||
@Override
|
||||
public int compare(final PatchLineComment o1, final PatchLineComment o2) {
|
||||
return o1.getWrittenOn().compareTo(o2.getWrittenOn());
|
||||
}
|
||||
@@ -164,10 +165,12 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
||||
nc.closeElement("img");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createFileCommentEditorOnSideA() {
|
||||
createCommentEditor(R_HEAD + 1, PC, R_HEAD, FILE_SIDE_A);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createFileCommentEditorOnSideB() {
|
||||
createCommentEditor(rowOfTableHeaderB + 1, PC, R_HEAD, FILE_SIDE_B);
|
||||
createFileCommentBorderRow();
|
||||
@@ -367,13 +370,13 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
||||
row++;
|
||||
|
||||
if (!fora.isEmpty()) {
|
||||
row = insert(fora, row, expandComments);
|
||||
row = insert(fora, row);
|
||||
}
|
||||
rowOfTableHeaderB = row;
|
||||
borderRowOfFileComment = row + 1;
|
||||
if (!forb.isEmpty()) {
|
||||
row++;// Skip the Header of sideB.
|
||||
row = insert(forb, row, expandComments);
|
||||
row = insert(forb, row);
|
||||
borderRowOfFileComment = row;
|
||||
createFileCommentBorderRow();
|
||||
}
|
||||
@@ -388,13 +391,13 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
||||
all.addAll(fora);
|
||||
all.addAll(forb);
|
||||
Collections.sort(all, BY_DATE);
|
||||
row = insert(all, row, expandComments);
|
||||
row = insert(all, row);
|
||||
|
||||
} else if (!fora.isEmpty()) {
|
||||
row = insert(fora, row, expandComments);
|
||||
row = insert(fora, row);
|
||||
|
||||
} else if (!forb.isEmpty()) {
|
||||
row = insert(forb, row, expandComments);
|
||||
row = insert(forb, row);
|
||||
}
|
||||
} else {
|
||||
row++;
|
||||
@@ -422,7 +425,7 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
||||
return PatchScreen.Type.UNIFIED;
|
||||
}
|
||||
|
||||
private int insert(final List<PatchLineComment> in, int row, boolean expandComment) {
|
||||
private int insert(final List<PatchLineComment> in, int row) {
|
||||
for (Iterator<PatchLineComment> ci = in.iterator(); ci.hasNext();) {
|
||||
final PatchLineComment c = ci.next();
|
||||
if (c.getLine() == R_HEAD) {
|
||||
@@ -430,7 +433,7 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
||||
} else {
|
||||
insertRow(row);
|
||||
}
|
||||
bindComment(row, PC, c, !ci.hasNext(), expandComment);
|
||||
bindComment(row, PC, c, !ci.hasNext());
|
||||
row++;
|
||||
}
|
||||
return row;
|
||||
|
@@ -33,6 +33,7 @@ import com.google.gwtjsonrpc.common.JsonConstants;
|
||||
public abstract class GerritCallback<T> implements
|
||||
com.google.gwtjsonrpc.common.AsyncCallback<T>,
|
||||
com.google.gwt.user.client.rpc.AsyncCallback<T> {
|
||||
@Override
|
||||
public void onFailure(final Throwable caught) {
|
||||
if (isNotSignedIn(caught) || isInvalidXSRF(caught)) {
|
||||
new NotSignedInDialog().center();
|
||||
|
@@ -28,6 +28,7 @@ public abstract class ScreenLoadCallback<T> extends GerritCallback<T> {
|
||||
screen = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onSuccess(final T result) {
|
||||
if (screen.isAttached()) {
|
||||
preDisplay(result);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user