Merge branch 'stable-3.8' into stable-3.9
* stable-3.8:
Update google-java-format to 1.24.0
Release-Notes: skip
Change-Id: Iae31159dbb6ec0f9b799709ef8227dd72bcab7ad
diff --git a/Documentation/dev-crafting-changes.txt b/Documentation/dev-crafting-changes.txt
index 6150c20..89ecbdb 100644
--- a/Documentation/dev-crafting-changes.txt
+++ b/Documentation/dev-crafting-changes.txt
@@ -147,7 +147,7 @@
To format Java source code, Gerrit uses the
link:https://github.com/google/google-java-format[`google-java-format`,role=external,window=_blank]
-tool (version 1.7), and to format Bazel BUILD, WORKSPACE and .bzl files the
+tool (version 1.24.0), and to format Bazel BUILD, WORKSPACE and .bzl files the
link:https://github.com/bazelbuild/buildtools/tree/master/buildifier[`buildifier`,role=external,window=_blank]
tool (version 4.0.0). Unused dependencies are found and removed using the
link:https://github.com/bazelbuild/buildtools/tree/master/unused_deps[`unused_deps`,role=external,window=_blank]
diff --git a/Documentation/dev-eclipse.txt b/Documentation/dev-eclipse.txt
index f4238d1..9aaa557 100644
--- a/Documentation/dev-eclipse.txt
+++ b/Documentation/dev-eclipse.txt
@@ -102,7 +102,7 @@
To format source code, Gerrit uses the
link:https://github.com/google/google-java-format[`google-java-format`,role=external,window=_blank]
-tool (version 1.7), which automatically formats code to follow the
+tool (version 1.24.0), which automatically formats code to follow the
style guide. See link:dev-crafting-changes.html#style[Code Style] for the
instruction how to set up command line tool that uses this formatter.
The Eclipse plugin is provided that allows to format with the same
diff --git a/java/com/google/gerrit/acceptance/GitObjectVisibilityChecker.java b/java/com/google/gerrit/acceptance/GitObjectVisibilityChecker.java
index afa1b1d..239d093 100644
--- a/java/com/google/gerrit/acceptance/GitObjectVisibilityChecker.java
+++ b/java/com/google/gerrit/acceptance/GitObjectVisibilityChecker.java
@@ -52,9 +52,9 @@
if (!reader.has(receiveEvent.commit)) {
throw new IllegalStateException(
String.format(
- "Commit %s was not visible using a new object reader in the repo. "
- + "This creates an illegal state for commit validators. You must flush any ObjectReaders "
- + "before performing the ref transaction.",
+ "Commit %s was not visible using a new object reader in the repo. This creates an"
+ + " illegal state for commit validators. You must flush any ObjectReaders"
+ + " before performing the ref transaction.",
receiveEvent.commit));
}
}
diff --git a/java/com/google/gerrit/acceptance/RestSession.java b/java/com/google/gerrit/acceptance/RestSession.java
index 3ff414e6..4264cd2 100644
--- a/java/com/google/gerrit/acceptance/RestSession.java
+++ b/java/com/google/gerrit/acceptance/RestSession.java
@@ -57,7 +57,7 @@
}
public RestResponse put(String endPoint) throws IOException {
- return put(endPoint, /* content = */ null);
+ return put(endPoint, /* content= */ null);
}
public RestResponse put(String endPoint, Object content) throws IOException {
@@ -91,7 +91,7 @@
}
public RestResponse post(String endPoint) throws IOException {
- return post(endPoint, /* content = */ null);
+ return post(endPoint, /* content= */ null);
}
public RestResponse post(String endPoint, Object content) throws IOException {
diff --git a/java/com/google/gerrit/acceptance/testsuite/change/FileBuilder.java b/java/com/google/gerrit/acceptance/testsuite/change/FileBuilder.java
index c8514a7..6b96ff9 100644
--- a/java/com/google/gerrit/acceptance/testsuite/change/FileBuilder.java
+++ b/java/com/google/gerrit/acceptance/testsuite/change/FileBuilder.java
@@ -26,6 +26,7 @@
public FileBuilder(Function<String, T> nextStepProvider) {
this.nextStepProvider = nextStepProvider;
}
+
/** File on which the comment should be added. */
public T ofFile(String file) {
return nextStepProvider.apply(file);
diff --git a/java/com/google/gerrit/auth/ldap/LdapAuthBackend.java b/java/com/google/gerrit/auth/ldap/LdapAuthBackend.java
index 017655f..43709b4 100644
--- a/java/com/google/gerrit/auth/ldap/LdapAuthBackend.java
+++ b/java/com/google/gerrit/auth/ldap/LdapAuthBackend.java
@@ -57,8 +57,11 @@
@Override
public AuthUser authenticate(AuthRequest req)
- throws MissingCredentialsException, InvalidCredentialsException, UnknownUserException,
- UserNotAllowedException, AuthException {
+ throws MissingCredentialsException,
+ InvalidCredentialsException,
+ UnknownUserException,
+ UserNotAllowedException,
+ AuthException {
if (!req.getUsername().isPresent() || !req.getPassword().isPresent()) {
throw new MissingCredentialsException();
}
diff --git a/java/com/google/gerrit/entities/AccessSection.java b/java/com/google/gerrit/entities/AccessSection.java
index 8ae0a5d..258a330 100644
--- a/java/com/google/gerrit/entities/AccessSection.java
+++ b/java/com/google/gerrit/entities/AccessSection.java
@@ -32,6 +32,7 @@
public abstract class AccessSection implements Comparable<AccessSection> {
/** Special name given to the global capabilities; not a valid reference. */
public static final String GLOBAL_CAPABILITIES = "GLOBAL_CAPABILITIES";
+
/** Pattern that matches all references in a project. */
public static final String ALL = "refs/*";
diff --git a/java/com/google/gerrit/entities/Change.java b/java/com/google/gerrit/entities/Change.java
index 3ad7e03..041fb06 100644
--- a/java/com/google/gerrit/entities/Change.java
+++ b/java/com/google/gerrit/entities/Change.java
@@ -311,8 +311,10 @@
/** Minimum database status constant for an open change. */
private static final char MIN_OPEN = 'a';
+
/** Database constant for {@link Status#NEW}. */
public static final char STATUS_NEW = 'n';
+
/** Maximum database status constant for an open change. */
private static final char MAX_OPEN = 'z';
diff --git a/java/com/google/gerrit/entities/ChangeMessage.java b/java/com/google/gerrit/entities/ChangeMessage.java
index dea070f..5a35af3 100644
--- a/java/com/google/gerrit/entities/ChangeMessage.java
+++ b/java/com/google/gerrit/entities/ChangeMessage.java
@@ -67,7 +67,8 @@
public static ChangeMessage create(
final ChangeMessage.Key k, @Nullable Account.Id a, Instant wo, @Nullable PatchSet.Id psid) {
- return create(k, a, wo, psid, /*messageTemplate=*/ null, /*realAuthor=*/ null, /*tag=*/ null);
+ return create(
+ k, a, wo, psid, /* messageTemplate= */ null, /* realAuthor= */ null, /* tag= */ null);
}
public static ChangeMessage create(
diff --git a/java/com/google/gerrit/entities/Comment.java b/java/com/google/gerrit/entities/Comment.java
index e1e143c..49d4169 100644
--- a/java/com/google/gerrit/entities/Comment.java
+++ b/java/com/google/gerrit/entities/Comment.java
@@ -212,6 +212,7 @@
}
public Key key;
+
/** The line number (1-based) to which the comment refers, or 0 for a file comment. */
public int lineNbr;
diff --git a/java/com/google/gerrit/extensions/api/changes/MoveInput.java b/java/com/google/gerrit/extensions/api/changes/MoveInput.java
index 3d82990..11e5a96 100644
--- a/java/com/google/gerrit/extensions/api/changes/MoveInput.java
+++ b/java/com/google/gerrit/extensions/api/changes/MoveInput.java
@@ -17,6 +17,7 @@
public class MoveInput {
public String message;
public String destinationBranch;
+
/**
* Whether or not to keep all votes in the destination branch. Keeping the votes can be confusing
* in the context of the destination branch, see
diff --git a/java/com/google/gerrit/extensions/api/projects/CommentLinkInput.java b/java/com/google/gerrit/extensions/api/projects/CommentLinkInput.java
index 1c964a4..491b6ac 100644
--- a/java/com/google/gerrit/extensions/api/projects/CommentLinkInput.java
+++ b/java/com/google/gerrit/extensions/api/projects/CommentLinkInput.java
@@ -22,14 +22,19 @@
public class CommentLinkInput {
/** A JavaScript regular expression to match positions to be replaced with a hyperlink. */
public String match;
+
/** The URL to direct the user to whenever the regular expression is matched. */
public String link;
+
/** Text inserted before the link if the regular expression is matched. */
public String prefix;
+
/** Text inserted after the link if the regular expression is matched. */
public String suffix;
+
/** Text of the link. */
public String text;
+
/** Whether the commentlink is enabled. */
public Boolean enabled;
}
diff --git a/java/com/google/gerrit/extensions/client/Comment.java b/java/com/google/gerrit/extensions/client/Comment.java
index b8843d3..8ef19ec 100644
--- a/java/com/google/gerrit/extensions/client/Comment.java
+++ b/java/com/google/gerrit/extensions/client/Comment.java
@@ -31,6 +31,7 @@
public String path;
public Side side;
public Integer parent;
+
/** Value 0 or null indicates a file comment, normal lines start at 1. */
public Integer line;
diff --git a/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java b/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java
index 5c48aaf..a9bde0c 100644
--- a/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java
+++ b/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java
@@ -119,6 +119,7 @@
/** Number of changes to show in a screen. */
public Integer changesPerPage;
+
/** Type of download URL the user prefers to use. */
public String downloadScheme;
@@ -142,6 +143,7 @@
public List<MenuItem> my;
public List<String> changeTable;
public Boolean allowBrowserNotifications;
+
/**
* The sidebar section that the user prefers to have open on the diff page, or "NONE" if all
* sidebars should be closed.
diff --git a/java/com/google/gerrit/extensions/common/ChangeInfo.java b/java/com/google/gerrit/extensions/common/ChangeInfo.java
index 90c3a92..d23a22c 100644
--- a/java/com/google/gerrit/extensions/common/ChangeInfo.java
+++ b/java/com/google/gerrit/extensions/common/ChangeInfo.java
@@ -42,6 +42,7 @@
public String project;
public String branch;
public String topic;
+
/**
* The <a href="https://www.gerritcodereview.com/design-docs/attention-set.html">attention set</a>
* for this change. Keyed by account ID. We don't use {@link
diff --git a/java/com/google/gerrit/extensions/common/InstallPluginInput.java b/java/com/google/gerrit/extensions/common/InstallPluginInput.java
index 9cefb0f..af9e5e4 100644
--- a/java/com/google/gerrit/extensions/common/InstallPluginInput.java
+++ b/java/com/google/gerrit/extensions/common/InstallPluginInput.java
@@ -17,7 +17,9 @@
import com.google.gerrit.extensions.restapi.DefaultInput;
import com.google.gerrit.extensions.restapi.RawInput;
-/** @deprecated use {@link com.google.gerrit.extensions.api.plugins.InstallPluginInput}. */
+/**
+ * @deprecated use {@link com.google.gerrit.extensions.api.plugins.InstallPluginInput}.
+ */
@Deprecated
public class InstallPluginInput {
public @DefaultInput String url;
diff --git a/java/com/google/gerrit/extensions/common/RebaseChainInfo.java b/java/com/google/gerrit/extensions/common/RebaseChainInfo.java
index b327007..2cae919 100644
--- a/java/com/google/gerrit/extensions/common/RebaseChainInfo.java
+++ b/java/com/google/gerrit/extensions/common/RebaseChainInfo.java
@@ -18,6 +18,7 @@
public class RebaseChainInfo {
public List<ChangeInfo> rebasedChanges;
+
/**
* Whether any of the changes contain conflicts.
*
diff --git a/java/com/google/gerrit/extensions/restapi/AuthException.java b/java/com/google/gerrit/extensions/restapi/AuthException.java
index fe1744b..49c62ce 100644
--- a/java/com/google/gerrit/extensions/restapi/AuthException.java
+++ b/java/com/google/gerrit/extensions/restapi/AuthException.java
@@ -25,7 +25,9 @@
private Optional<String> advice = Optional.empty();
- /** @param msg message to return to the client. */
+ /**
+ * @param msg message to return to the client.
+ */
public AuthException(String msg) {
super(msg);
}
diff --git a/java/com/google/gerrit/extensions/restapi/BadRequestException.java b/java/com/google/gerrit/extensions/restapi/BadRequestException.java
index 6e79c3a..97eb22e 100644
--- a/java/com/google/gerrit/extensions/restapi/BadRequestException.java
+++ b/java/com/google/gerrit/extensions/restapi/BadRequestException.java
@@ -18,7 +18,9 @@
public class BadRequestException extends RestApiException {
private static final long serialVersionUID = 1L;
- /** @param msg error text for client describing how request is bad. */
+ /**
+ * @param msg error text for client describing how request is bad.
+ */
public BadRequestException(String msg) {
super(msg);
}
diff --git a/java/com/google/gerrit/extensions/restapi/MethodNotAllowedException.java b/java/com/google/gerrit/extensions/restapi/MethodNotAllowedException.java
index 8422b61..7ba3b19 100644
--- a/java/com/google/gerrit/extensions/restapi/MethodNotAllowedException.java
+++ b/java/com/google/gerrit/extensions/restapi/MethodNotAllowedException.java
@@ -18,7 +18,9 @@
public class MethodNotAllowedException extends RestApiException {
private static final long serialVersionUID = 1L;
- /** @param msg error text for client describing why the method is not allowed. */
+ /**
+ * @param msg error text for client describing why the method is not allowed.
+ */
public MethodNotAllowedException(String msg) {
super(msg);
}
diff --git a/java/com/google/gerrit/extensions/restapi/PreconditionFailedException.java b/java/com/google/gerrit/extensions/restapi/PreconditionFailedException.java
index 1b88b1a..d06c284 100644
--- a/java/com/google/gerrit/extensions/restapi/PreconditionFailedException.java
+++ b/java/com/google/gerrit/extensions/restapi/PreconditionFailedException.java
@@ -18,7 +18,9 @@
public class PreconditionFailedException extends RestApiException {
private static final long serialVersionUID = 1L;
- /** @param msg message to return to the client describing the error. */
+ /**
+ * @param msg message to return to the client describing the error.
+ */
public PreconditionFailedException(String msg) {
super(msg);
}
diff --git a/java/com/google/gerrit/extensions/restapi/ResourceConflictException.java b/java/com/google/gerrit/extensions/restapi/ResourceConflictException.java
index a57accc..abd5dd4 100644
--- a/java/com/google/gerrit/extensions/restapi/ResourceConflictException.java
+++ b/java/com/google/gerrit/extensions/restapi/ResourceConflictException.java
@@ -25,12 +25,16 @@
public class ResourceConflictException extends RestApiException {
private static final long serialVersionUID = 1L;
- /** @param msg message to return to the client describing the error. */
+ /**
+ * @param msg message to return to the client describing the error.
+ */
public ResourceConflictException(String msg) {
super(msg);
}
- /** @param msg message to return to the client describing the error. */
+ /**
+ * @param msg message to return to the client describing the error.
+ */
public ResourceConflictException(String msg, Throwable cause) {
super(msg, cause);
}
diff --git a/java/com/google/gerrit/extensions/restapi/ResourceNotFoundException.java b/java/com/google/gerrit/extensions/restapi/ResourceNotFoundException.java
index 270a040..d7bef50 100644
--- a/java/com/google/gerrit/extensions/restapi/ResourceNotFoundException.java
+++ b/java/com/google/gerrit/extensions/restapi/ResourceNotFoundException.java
@@ -29,7 +29,9 @@
super(msg, cause);
}
- /** @param id portion of the resource URI that does not exist. */
+ /**
+ * @param id portion of the resource URI that does not exist.
+ */
public ResourceNotFoundException(IdString id) {
super("Not found: " + id.get());
}
diff --git a/java/com/google/gerrit/gpg/BouncyCastleUtil.java b/java/com/google/gerrit/gpg/BouncyCastleUtil.java
index 6dc74f2..f68d3cc 100644
--- a/java/com/google/gerrit/gpg/BouncyCastleUtil.java
+++ b/java/com/google/gerrit/gpg/BouncyCastleUtil.java
@@ -47,8 +47,12 @@
}
private static void addBouncyCastleProvider()
- throws ClassNotFoundException, SecurityException, NoSuchMethodException,
- InstantiationException, IllegalAccessException, InvocationTargetException {
+ throws ClassNotFoundException,
+ SecurityException,
+ NoSuchMethodException,
+ InstantiationException,
+ IllegalAccessException,
+ InvocationTargetException {
Class<?> clazz = Class.forName(BouncyCastleProvider.class.getName());
Constructor<?> constructor = clazz.getConstructor();
Security.addProvider((java.security.Provider) constructor.newInstance());
diff --git a/java/com/google/gerrit/gpg/PublicKeyStore.java b/java/com/google/gerrit/gpg/PublicKeyStore.java
index def35d6..7659943 100644
--- a/java/com/google/gerrit/gpg/PublicKeyStore.java
+++ b/java/com/google/gerrit/gpg/PublicKeyStore.java
@@ -151,7 +151,9 @@
private Map<Fingerprint, PGPPublicKeyRing> toAdd;
private Set<Fingerprint> toRemove;
- /** @param repo repository to read keys from. */
+ /**
+ * @param repo repository to read keys from.
+ */
public PublicKeyStore(Repository repo) {
this.repo = repo;
toAdd = new HashMap<>();
diff --git a/java/com/google/gerrit/httpd/GitOverHttpServlet.java b/java/com/google/gerrit/httpd/GitOverHttpServlet.java
index e513a72..1dca7e5 100644
--- a/java/com/google/gerrit/httpd/GitOverHttpServlet.java
+++ b/java/com/google/gerrit/httpd/GitOverHttpServlet.java
@@ -291,8 +291,10 @@
@Override
public Repository open(HttpServletRequest req, String projectName)
- throws RepositoryNotFoundException, ServiceNotAuthorizedException,
- ServiceNotEnabledException, ServiceMayNotContinueException {
+ throws RepositoryNotFoundException,
+ ServiceNotAuthorizedException,
+ ServiceNotEnabledException,
+ ServiceMayNotContinueException {
while (projectName.endsWith("/")) {
projectName = projectName.substring(0, projectName.length() - 1);
}
diff --git a/java/com/google/gerrit/httpd/GuiceRequestScopePropagator.java b/java/com/google/gerrit/httpd/GuiceRequestScopePropagator.java
index 998b313..4e95513 100644
--- a/java/com/google/gerrit/httpd/GuiceRequestScopePropagator.java
+++ b/java/com/google/gerrit/httpd/GuiceRequestScopePropagator.java
@@ -54,7 +54,9 @@
urlProvider.setHttpServletRequest(request);
}
- /** @see RequestScopePropagator#wrap(Callable) */
+ /**
+ * @see RequestScopePropagator#wrap(Callable)
+ */
// ServletScopes#continueRequest is deprecated, but it's not obvious their
// recommended replacement is an appropriate drop-in solution; see
// https://gerrit-review.googlesource.com/83971
diff --git a/java/com/google/gerrit/httpd/WebModule.java b/java/com/google/gerrit/httpd/WebModule.java
index 79dde85..e694f77 100644
--- a/java/com/google/gerrit/httpd/WebModule.java
+++ b/java/com/google/gerrit/httpd/WebModule.java
@@ -102,10 +102,10 @@
break;
case OAUTH:
- // OAuth support is bound in WebAppInitializer and Daemon.
+ // OAuth support is bound in WebAppInitializer and Daemon.
case OPENID:
case OPENID_SSO:
- // OpenID support is bound in WebAppInitializer and Daemon.
+ // OpenID support is bound in WebAppInitializer and Daemon.
case CUSTOM_EXTENSION:
break;
default:
diff --git a/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java b/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java
index 3edf5f2..641c8d8 100644
--- a/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java
+++ b/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java
@@ -111,7 +111,7 @@
break;
case PROFILE:
case DASHBOARD:
- // Dashboard is preloaded queries are added later when we check user is authenticated.
+ // Dashboard is preloaded queries are added later when we check user is authenticated.
case PAGE_WITHOUT_PRELOADING:
break;
}
diff --git a/java/com/google/gerrit/index/testing/AbstractFakeIndex.java b/java/com/google/gerrit/index/testing/AbstractFakeIndex.java
index 60402ba..41050b1 100644
--- a/java/com/google/gerrit/index/testing/AbstractFakeIndex.java
+++ b/java/com/google/gerrit/index/testing/AbstractFakeIndex.java
@@ -68,6 +68,7 @@
*/
public abstract class AbstractFakeIndex<K, V, D> implements Index<K, V> {
private final Schema<V> schema;
+
/**
* SitePaths (config files) are used to signal that an index is ready. This implementation is
* consistent with other index backends.
diff --git a/java/com/google/gerrit/index/testing/FakeStoredValue.java b/java/com/google/gerrit/index/testing/FakeStoredValue.java
index 133e0ab..618a9d7 100644
--- a/java/com/google/gerrit/index/testing/FakeStoredValue.java
+++ b/java/com/google/gerrit/index/testing/FakeStoredValue.java
@@ -22,6 +22,7 @@
/** Bridge to recover fields from the fake index. */
public class FakeStoredValue implements StoredValue {
private final Object field;
+
/**
* Some index implementations store protos, some convert them to bytes first.
*
diff --git a/java/com/google/gerrit/launcher/GerritLauncher.java b/java/com/google/gerrit/launcher/GerritLauncher.java
index 07a071a..f02f3a7 100644
--- a/java/com/google/gerrit/launcher/GerritLauncher.java
+++ b/java/com/google/gerrit/launcher/GerritLauncher.java
@@ -692,6 +692,7 @@
}
static final String SOURCE_ROOT_RESOURCE = "/com/google/gerrit/launcher/workspace-root.txt";
+
/**
* Locate a path in the source tree.
*
diff --git a/java/com/google/gerrit/mail/MailMessage.java b/java/com/google/gerrit/mail/MailMessage.java
index 2ce6cbb..8dd6653 100644
--- a/java/com/google/gerrit/mail/MailMessage.java
+++ b/java/com/google/gerrit/mail/MailMessage.java
@@ -33,16 +33,19 @@
public abstract class MailMessage {
// Unique Identifier
public abstract String id();
+
// Envelop Information
public abstract Address from();
public abstract ImmutableList<Address> to();
public abstract ImmutableList<Address> cc();
+
// Metadata
public abstract Instant dateReceived();
public abstract ImmutableList<String> additionalHeaders();
+
// Content
public abstract String subject();
@@ -51,6 +54,7 @@
@Nullable
public abstract String htmlContent();
+
// Raw content as received over the wire
@Nullable
public abstract ImmutableList<Integer> rawContent();
diff --git a/java/com/google/gerrit/metrics/proc/ProcMetricModule.java b/java/com/google/gerrit/metrics/proc/ProcMetricModule.java
index 301ec85..4800374 100644
--- a/java/com/google/gerrit/metrics/proc/ProcMetricModule.java
+++ b/java/com/google/gerrit/metrics/proc/ProcMetricModule.java
@@ -286,7 +286,8 @@
"proc/jvm/thread/num_total_started",
Long.class,
new Description(
- "Total number of threads created and also started since the Java virtual machine started")
+ "Total number of threads created and also started since the Java virtual machine"
+ + " started")
.setGauge()
.setUnit("threads"),
thread::getTotalStartedThreadCount);
@@ -295,7 +296,8 @@
"proc/jvm/thread/num_deadlocked_threads",
Integer.class,
new Description(
- "number of threads that are deadlocked waiting for object monitors or ownable synchronizers")
+ "number of threads that are deadlocked waiting for object monitors or ownable"
+ + " synchronizers")
.setGauge()
.setUnit("threads"),
() -> {
diff --git a/java/com/google/gerrit/pgm/util/ErrorLogJsonLayout.java b/java/com/google/gerrit/pgm/util/ErrorLogJsonLayout.java
index 7d4abfc..be5d11b 100644
--- a/java/com/google/gerrit/pgm/util/ErrorLogJsonLayout.java
+++ b/java/com/google/gerrit/pgm/util/ErrorLogJsonLayout.java
@@ -39,10 +39,13 @@
/** Hostname of the machine running Gerrit. */
public final String sourceHost;
+
/** Logged message. */
public final String message;
+
/** File containing the code creating the log entry. */
public final String file;
+
/** Line number of code creating the log entry. */
public final String lineNumber;
@@ -52,6 +55,7 @@
/** Method from which the log entry was created. */
public final String method;
+
/** Name of the logger creating the log entry. */
public final String loggerName;
@@ -61,8 +65,10 @@
/** Nested diagnostic context. */
public final String ndc;
+
/** Logging level/severity. */
public final String level;
+
/** Thread executing the code creating the log entry. */
public final String threadName;
diff --git a/java/com/google/gerrit/server/account/AccountDeactivator.java b/java/com/google/gerrit/server/account/AccountDeactivator.java
index a4d7608..99552b9 100644
--- a/java/com/google/gerrit/server/account/AccountDeactivator.java
+++ b/java/com/google/gerrit/server/account/AccountDeactivator.java
@@ -62,7 +62,8 @@
queue.scheduleAtFixedRate(deactivator, schedule.get());
} else {
logger.atWarning().log(
- "Not scheduling AccountDeactivator because auth.autoUpdateAccountActiveStatus is false");
+ "Not scheduling AccountDeactivator because auth.autoUpdateAccountActiveStatus is"
+ + " false");
}
}
}
diff --git a/java/com/google/gerrit/server/account/AccountDelta.java b/java/com/google/gerrit/server/account/AccountDelta.java
index f074522..89bd078 100644
--- a/java/com/google/gerrit/server/account/AccountDelta.java
+++ b/java/com/google/gerrit/server/account/AccountDelta.java
@@ -176,6 +176,7 @@
|| !this.getDeletedExternalIds().isEmpty()
|| !this.getUpdatedExternalIds().isEmpty();
}
+
/**
* Class to build an {@link AccountDelta}.
*
diff --git a/java/com/google/gerrit/server/account/AccountState.java b/java/com/google/gerrit/server/account/AccountState.java
index 8f2d66d..8f0cb2a 100644
--- a/java/com/google/gerrit/server/account/AccountState.java
+++ b/java/com/google/gerrit/server/account/AccountState.java
@@ -102,8 +102,10 @@
/** Get the cached account metadata. */
public abstract Account account();
+
/** The external identities that identify the account holder. */
public abstract ImmutableSet<ExternalId> externalIds();
+
/**
* Get the username, if one has been declared for this user.
*
@@ -113,8 +115,10 @@
* is empty
*/
public abstract Optional<String> userName();
+
/** The project watches of the account. */
public abstract ImmutableMap<ProjectWatchKey, ImmutableSet<NotifyType>> projectWatches();
+
/** The general preferences of the account. */
/** The general preferences of the account. */
diff --git a/java/com/google/gerrit/server/account/Emails.java b/java/com/google/gerrit/server/account/Emails.java
index 13385d0..7b04a40 100644
--- a/java/com/google/gerrit/server/account/Emails.java
+++ b/java/com/google/gerrit/server/account/Emails.java
@@ -73,7 +73,8 @@
}
return retryHelper
- .accountIndexQuery("queryAccountsByPreferredEmail", q -> q.byPreferredEmail(email)).call()
+ .accountIndexQuery("queryAccountsByPreferredEmail", q -> q.byPreferredEmail(email))
+ .call()
.stream()
.map(a -> a.account().id())
.collect(toImmutableSet());
@@ -96,7 +97,9 @@
retryHelper
.accountIndexQuery(
"queryAccountsByPreferredEmails", q -> q.byPreferredEmail(emailsToBackfill))
- .call().entries().stream()
+ .call()
+ .entries()
+ .stream()
.forEach(e -> result.put(e.getKey(), e.getValue().account().id()));
}
return ImmutableSetMultimap.copyOf(result);
diff --git a/java/com/google/gerrit/server/account/GroupIncludeCacheImpl.java b/java/com/google/gerrit/server/account/GroupIncludeCacheImpl.java
index 5134643..dc5f392 100644
--- a/java/com/google/gerrit/server/account/GroupIncludeCacheImpl.java
+++ b/java/com/google/gerrit/server/account/GroupIncludeCacheImpl.java
@@ -302,7 +302,8 @@
@Override
public ImmutableList<AccountGroup.UUID> deserialize(byte[] in) {
- return Protos.parseUnchecked(AllExternalGroupsProto.parser(), in).getExternalGroupList()
+ return Protos.parseUnchecked(AllExternalGroupsProto.parser(), in)
+ .getExternalGroupList()
.stream()
.map(groupProto -> AccountGroup.UUID.parse(groupProto.getGroupUuid()))
.collect(toImmutableList());
diff --git a/java/com/google/gerrit/server/account/ServiceUserClassifier.java b/java/com/google/gerrit/server/account/ServiceUserClassifier.java
index 2d2a646..383381a 100644
--- a/java/com/google/gerrit/server/account/ServiceUserClassifier.java
+++ b/java/com/google/gerrit/server/account/ServiceUserClassifier.java
@@ -22,6 +22,7 @@
* user; if an account is a part of this group, that account is considered a service user.
*/
public static final String SERVICE_USERS = "Service Users";
+
/** Returns {@code true} if the given user is considered a {@code Service User} user. */
boolean isServiceUser(Account.Id user);
diff --git a/java/com/google/gerrit/server/account/externalids/storage/notedb/ExternalIdCacheLoader.java b/java/com/google/gerrit/server/account/externalids/storage/notedb/ExternalIdCacheLoader.java
index db890fc..f2a5885 100644
--- a/java/com/google/gerrit/server/account/externalids/storage/notedb/ExternalIdCacheLoader.java
+++ b/java/com/google/gerrit/server/account/externalids/storage/notedb/ExternalIdCacheLoader.java
@@ -195,7 +195,8 @@
Set<String> additionKeys =
additions.keySet().stream().map(AnyObjectId::getName).collect(Collectors.toSet());
logger.atSevere().withCause(e).log(
- "Failed to load external ID cache. Repository ref is %s, cache ref is %s, additions are %s",
+ "Failed to load external ID cache. Repository ref is %s, cache ref is %s, additions are"
+ + " %s",
extIdRef.getObjectId().getName(), parentWithCacheValue.getId().getName(), additionKeys);
throw e;
}
diff --git a/java/com/google/gerrit/server/auth/AuthBackend.java b/java/com/google/gerrit/server/auth/AuthBackend.java
index 424ee43..a82b104 100644
--- a/java/com/google/gerrit/server/auth/AuthBackend.java
+++ b/java/com/google/gerrit/server/auth/AuthBackend.java
@@ -38,6 +38,9 @@
* @throws AuthException when any other error occurs.
*/
AuthUser authenticate(AuthRequest req)
- throws MissingCredentialsException, InvalidCredentialsException, UnknownUserException,
- UserNotAllowedException, AuthException;
+ throws MissingCredentialsException,
+ InvalidCredentialsException,
+ UnknownUserException,
+ UserNotAllowedException,
+ AuthException;
}
diff --git a/java/com/google/gerrit/server/auth/InternalAuthBackend.java b/java/com/google/gerrit/server/auth/InternalAuthBackend.java
index ce536f6..0618750 100644
--- a/java/com/google/gerrit/server/auth/InternalAuthBackend.java
+++ b/java/com/google/gerrit/server/auth/InternalAuthBackend.java
@@ -44,8 +44,11 @@
// TODO(gerritcodereview-team): This function has no coverage.
@Override
public AuthUser authenticate(AuthRequest req)
- throws MissingCredentialsException, InvalidCredentialsException, UnknownUserException,
- UserNotAllowedException, AuthException {
+ throws MissingCredentialsException,
+ InvalidCredentialsException,
+ UnknownUserException,
+ UserNotAllowedException,
+ AuthException {
if (!req.getUsername().isPresent() || !req.getPassword().isPresent()) {
throw new MissingCredentialsException();
}
diff --git a/java/com/google/gerrit/server/cache/PerThreadProjectCache.java b/java/com/google/gerrit/server/cache/PerThreadProjectCache.java
index 8394343..3a479e3 100644
--- a/java/com/google/gerrit/server/cache/PerThreadProjectCache.java
+++ b/java/com/google/gerrit/server/cache/PerThreadProjectCache.java
@@ -28,6 +28,7 @@
public class PerThreadProjectCache {
private static final PerThreadCache.Key<PerThreadProjectCache> PER_THREAD_PROJECT_CACHE_KEY =
PerThreadCache.Key.create(PerThreadProjectCache.class);
+
/**
* Cache at maximum 25 values per thread. This value was chosen arbitrarily. Some endpoints (like
* ListProjects) break the assumption that the data cached in a request is limited. To prevent
diff --git a/java/com/google/gerrit/server/change/RebaseUtil.java b/java/com/google/gerrit/server/change/RebaseUtil.java
index 47a1e11..ceb87e4 100644
--- a/java/com/google/gerrit/server/change/RebaseUtil.java
+++ b/java/com/google/gerrit/server/change/RebaseUtil.java
@@ -141,7 +141,9 @@
* @param rebaseInput the request input containing options for the rebase
*/
public void checkCanRebaseOnBehalfOf(RevisionResource rsrc, RebaseInput rebaseInput)
- throws IOException, PermissionBackendException, BadRequestException,
+ throws IOException,
+ PermissionBackendException,
+ BadRequestException,
ResourceConflictException {
if (rebaseInput.allowConflicts) {
throw new BadRequestException(
@@ -157,7 +159,7 @@
CurrentUser caller = rsrc.getUser();
Account.Id uploaderId = rsrc.getPatchSet().uploader();
- IdentifiedUser uploader = userFactory.runAs(/*remotePeer= */ null, uploaderId, caller);
+ IdentifiedUser uploader = userFactory.runAs(/* remotePeer= */ null, uploaderId, caller);
logger.atFine().log(
"%s is rebasing patch set %s of project %s on behalf of uploader %s",
caller.getLoggableName(),
@@ -189,7 +191,8 @@
rsrc.getNotes(),
RefPermission.FORGE_AUTHOR,
String.format(
- "change %s: author of patch set %d is forged and the uploader %s cannot forge author",
+ "change %s: author of patch set %d is forged and the uploader %s cannot forge"
+ + " author",
rsrc.getChange().getId(),
rsrc.getPatchSet().id().get(),
uploader.getLoggableName()));
@@ -200,8 +203,8 @@
rsrc.getNotes(),
RefPermission.FORGE_SERVER,
String.format(
- "change %s: author of patch set %d is the server identity and the uploader %s cannot forge"
- + " the server identity",
+ "change %s: author of patch set %d is the server identity and the uploader %s"
+ + " cannot forge the server identity",
rsrc.getChange().getId(),
rsrc.getPatchSet().id().get(),
uploader.getLoggableName()));
diff --git a/java/com/google/gerrit/server/events/EventFactory.java b/java/com/google/gerrit/server/events/EventFactory.java
index fad710a..fdef955 100644
--- a/java/com/google/gerrit/server/events/EventFactory.java
+++ b/java/com/google/gerrit/server/events/EventFactory.java
@@ -153,6 +153,7 @@
addCommitMessage(a, notes);
return a;
}
+
/**
* Create a {@link RefUpdateAttribute} for the given old ObjectId, new ObjectId, and branch that
* is suitable for serialization to JSON.
diff --git a/java/com/google/gerrit/server/fixes/FixCalculator.java b/java/com/google/gerrit/server/fixes/FixCalculator.java
index c471245..c969471 100644
--- a/java/com/google/gerrit/server/fixes/FixCalculator.java
+++ b/java/com/google/gerrit/server/fixes/FixCalculator.java
@@ -92,6 +92,7 @@
return String.format(
"(%s:%s - %s:%s)", range.startLine, range.startChar, range.endLine, range.endChar);
}
+
/*
Algorithm:
Input:
@@ -437,6 +438,7 @@
public static class FixResult {
/** List of edits to transform an original text to a final text (with all fixes applied) */
public final ImmutableList<Edit> edits;
+
/** Final text with all applied fixes */
public final Text text;
diff --git a/java/com/google/gerrit/server/fixes/FixReplacementInterpreter.java b/java/com/google/gerrit/server/fixes/FixReplacementInterpreter.java
index cce289a..a888f5d 100644
--- a/java/com/google/gerrit/server/fixes/FixReplacementInterpreter.java
+++ b/java/com/google/gerrit/server/fixes/FixReplacementInterpreter.java
@@ -72,7 +72,9 @@
ProjectState projectState,
ObjectId patchSetCommitId,
List<FixReplacement> fixReplacements)
- throws BadRequestException, ResourceNotFoundException, IOException,
+ throws BadRequestException,
+ ResourceNotFoundException,
+ IOException,
ResourceConflictException {
requireNonNull(fixReplacements, "Fix replacements must not be null");
@@ -144,7 +146,9 @@
ObjectId patchSetCommitId,
String filePath,
List<FixReplacement> fixReplacements)
- throws BadRequestException, ResourceNotFoundException, IOException,
+ throws BadRequestException,
+ ResourceNotFoundException,
+ IOException,
ResourceConflictException {
String fileContent = getFileContent(repository, projectState, patchSetCommitId, filePath);
String newFileContent = FixCalculator.getNewFileContent(fileContent, fixReplacements);
diff --git a/java/com/google/gerrit/server/git/DelegateRepository.java b/java/com/google/gerrit/server/git/DelegateRepository.java
index 9046d9d..d91a4ef 100644
--- a/java/com/google/gerrit/server/git/DelegateRepository.java
+++ b/java/com/google/gerrit/server/git/DelegateRepository.java
@@ -281,7 +281,9 @@
@Override
public ObjectId resolve(String revstr)
- throws AmbiguousObjectException, IncorrectObjectTypeException, RevisionSyntaxException,
+ throws AmbiguousObjectException,
+ IncorrectObjectTypeException,
+ RevisionSyntaxException,
IOException {
return delegate.resolve(revstr);
}
diff --git a/java/com/google/gerrit/server/git/LocalDiskRepositoryManager.java b/java/com/google/gerrit/server/git/LocalDiskRepositoryManager.java
index 5eb913d..3dcafa6 100644
--- a/java/com/google/gerrit/server/git/LocalDiskRepositoryManager.java
+++ b/java/com/google/gerrit/server/git/LocalDiskRepositoryManager.java
@@ -147,7 +147,7 @@
Repository repo;
try {
// Try to open with mustExist, so that it does not attempt to create a repository.
- repo = RepositoryCache.open(FileKey.lenient(dir, FS.DETECTED), /*mustExist=*/ true);
+ repo = RepositoryCache.open(FileKey.lenient(dir, FS.DETECTED), /* mustExist= */ true);
} catch (RepositoryNotFoundException e) {
return Status.NON_EXISTENT;
} catch (IOException e) {
diff --git a/java/com/google/gerrit/server/git/MultiProgressMonitor.java b/java/com/google/gerrit/server/git/MultiProgressMonitor.java
index ab5c988..ac6d46d 100644
--- a/java/com/google/gerrit/server/git/MultiProgressMonitor.java
+++ b/java/com/google/gerrit/server/git/MultiProgressMonitor.java
@@ -453,7 +453,8 @@
forcefulTermination = true;
if (workerFuture.isCancelled()) {
logger.atWarning().log(
- "MultiProgressMonitor worker killed after %sms, cancelled (timeout=%sms, task=%s(%s))",
+ "MultiProgressMonitor worker killed after %sms, cancelled (timeout=%sms,"
+ + " task=%s(%s))",
MILLISECONDS.convert(now - overallStart, NANOSECONDS),
MILLISECONDS.convert(now - deadline, NANOSECONDS),
taskKind,
diff --git a/java/com/google/gerrit/server/git/RepositoryCaseMismatchException.java b/java/com/google/gerrit/server/git/RepositoryCaseMismatchException.java
index 9e10c67..d4a8fdd 100644
--- a/java/com/google/gerrit/server/git/RepositoryCaseMismatchException.java
+++ b/java/com/google/gerrit/server/git/RepositoryCaseMismatchException.java
@@ -26,7 +26,9 @@
private static final long serialVersionUID = 1L;
- /** @param projectName name of the project that cannot be created */
+ /**
+ * @param projectName name of the project that cannot be created
+ */
public RepositoryCaseMismatchException(Project.NameKey projectName) {
super(projectName, "Name occupied in other case.");
}
diff --git a/java/com/google/gerrit/server/git/RepositoryExistsException.java b/java/com/google/gerrit/server/git/RepositoryExistsException.java
index 563b078..f3506c6 100644
--- a/java/com/google/gerrit/server/git/RepositoryExistsException.java
+++ b/java/com/google/gerrit/server/git/RepositoryExistsException.java
@@ -30,7 +30,9 @@
String.format("Repository %s exists and cannot be created. %s", projectName.get(), reason));
}
- /** @param projectName name of the project that cannot be created */
+ /**
+ * @param projectName name of the project that cannot be created
+ */
public RepositoryExistsException(Project.NameKey projectName) {
super(String.format("Repository %s exists and cannot be created.", projectName.get()));
}
diff --git a/java/com/google/gerrit/server/git/TagSet.java b/java/com/google/gerrit/server/git/TagSet.java
index bffc479..6888a79 100644
--- a/java/com/google/gerrit/server/git/TagSet.java
+++ b/java/com/google/gerrit/server/git/TagSet.java
@@ -454,6 +454,7 @@
return MoreObjects.toStringHelper(this).addValue(name()).add("refFlags", refFlags).toString();
}
}
+
/** A ref along with its index into RoaringBitmap. */
@VisibleForTesting
static final class CachedRef extends AtomicReference<ObjectId> {
diff --git a/java/com/google/gerrit/server/git/receive/ReceiveCommits.java b/java/com/google/gerrit/server/git/receive/ReceiveCommits.java
index f60a0c7..4d3c375 100644
--- a/java/com/google/gerrit/server/git/receive/ReceiveCommits.java
+++ b/java/com/google/gerrit/server/git/receive/ReceiveCommits.java
@@ -425,6 +425,7 @@
// Collections populated during processing.
private final Queue<ValidationMessage> messages;
+
/** Multimap of error text to refnames that produced that error. */
private final ListMultimap<String, String> errors;
@@ -1628,6 +1629,7 @@
final ReceiveCommand cmd;
final LabelTypes labelTypes;
+
/**
* Draft comments are published with the commit iff {@code --publish-comments} is set. All
* drafts are withheld (overriding the option) if at least one of the following conditions are
@@ -2812,7 +2814,10 @@
}
private void submit(Collection<CreateRequest> create, Collection<ReplaceRequest> replace)
- throws RestApiException, UpdateException, IOException, ConfigInvalidException,
+ throws RestApiException,
+ UpdateException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
try (TraceTimer traceTimer = newTimer("submit")) {
Map<ObjectId, Change> bySha = Maps.newHashMapWithExpectedSize(create.size() + replace.size());
diff --git a/java/com/google/gerrit/server/git/receive/ReceivePackRefCache.java b/java/com/google/gerrit/server/git/receive/ReceivePackRefCache.java
index 8568810..b5c0fef 100644
--- a/java/com/google/gerrit/server/git/receive/ReceivePackRefCache.java
+++ b/java/com/google/gerrit/server/git/receive/ReceivePackRefCache.java
@@ -105,8 +105,10 @@
// Collections lazily populated during processing.
private Map<String, Ref> allRefs;
+
/** Contains only patch set refs. */
private ListMultimap<Change.Id, Ref> refsByChange;
+
/** Contains all refs. */
private ListMultimap<ObjectId, Ref> refsByObjectId;
diff --git a/java/com/google/gerrit/server/git/validators/ValidationMessage.java b/java/com/google/gerrit/server/git/validators/ValidationMessage.java
index c743bbc..93cb682 100644
--- a/java/com/google/gerrit/server/git/validators/ValidationMessage.java
+++ b/java/com/google/gerrit/server/git/validators/ValidationMessage.java
@@ -42,7 +42,9 @@
private final String message;
private final Type type;
- /** @see ValidationMessage */
+ /**
+ * @see ValidationMessage
+ */
public ValidationMessage(String message, Type type) {
this.message = message;
this.type = type;
diff --git a/java/com/google/gerrit/server/index/account/AccountField.java b/java/com/google/gerrit/server/index/account/AccountField.java
index f87fbf5..abff3e9 100644
--- a/java/com/google/gerrit/server/index/account/AccountField.java
+++ b/java/com/google/gerrit/server/index/account/AccountField.java
@@ -128,6 +128,7 @@
public static final IndexedField<AccountState, String>.SearchSpec ACTIVE_FIELD_SPEC =
ACTIVE_FIELD.exact("inactive");
+
/**
* All emails (preferred email + secondary emails). Use this field only if the current user is
* allowed to see secondary emails (requires the 'Modify Account' capability).
diff --git a/java/com/google/gerrit/server/index/change/ChangeField.java b/java/com/google/gerrit/server/index/change/ChangeField.java
index 2b91d9a..54c864e 100644
--- a/java/com/google/gerrit/server/index/change/ChangeField.java
+++ b/java/com/google/gerrit/server/index/change/ChangeField.java
@@ -947,7 +947,8 @@
IndexedField.<ChangeData>iterableStringBuilder("AuthorParts")
.required()
.description(
- "The exact email address, or any part of the author name or email address, in the current patch set.")
+ "The exact email address, or any part of the author name or email address, in the"
+ + " current patch set.")
.build(ChangeField::getAuthorParts);
public static final IndexedField<ChangeData, Iterable<String>>.SearchSpec AUTHOR_PARTS_SPEC =
@@ -970,7 +971,8 @@
public static final IndexedField<ChangeData, Iterable<String>> COMMITTER_PARTS_FIELD =
IndexedField.<ChangeData>iterableStringBuilder("CommitterParts")
.description(
- "The exact email address, or any part of the committer name or email address, in the current patch set.")
+ "The exact email address, or any part of the committer name or email address, in the"
+ + " current patch set.")
.required()
.build(ChangeField::getCommitterParts);
@@ -1085,7 +1087,8 @@
IndexedField.<ChangeData>stringBuilder("CommitMessageExact")
.required()
.description(
- "Same as CommitMessage, but truncated, since supporting such large tokens may be problematic for indexes.")
+ "Same as CommitMessage, but truncated, since supporting such large tokens may be"
+ + " problematic for indexes.")
.build(cd -> truncateStringValueToMaxTermLength(cd.commitMessage()));
public static final IndexedField<ChangeData, String>.SearchSpec COMMIT_MESSAGE_EXACT =
diff --git a/java/com/google/gerrit/server/notedb/ChangeNotesParseApprovalUtil.java b/java/com/google/gerrit/server/notedb/ChangeNotesParseApprovalUtil.java
index 420f0c2..20b91c6 100644
--- a/java/com/google/gerrit/server/notedb/ChangeNotesParseApprovalUtil.java
+++ b/java/com/google/gerrit/server/notedb/ChangeNotesParseApprovalUtil.java
@@ -322,7 +322,7 @@
private static void checkFooter(boolean expr, FooterKey footer, String actual)
throws ConfigInvalidException {
if (!expr) {
- throw parseException(footer, actual, /*cause=*/ null);
+ throw parseException(footer, actual, /* cause= */ null);
}
}
diff --git a/java/com/google/gerrit/server/notedb/ChangeNotesParser.java b/java/com/google/gerrit/server/notedb/ChangeNotesParser.java
index ea26dbc..1c4f2d7 100644
--- a/java/com/google/gerrit/server/notedb/ChangeNotesParser.java
+++ b/java/com/google/gerrit/server/notedb/ChangeNotesParser.java
@@ -158,8 +158,10 @@
private final Table<Address, ReviewerStateInternal, Instant> reviewersByEmail;
private final List<Account.Id> allPastReviewers;
private final List<ReviewerStatusUpdate> reviewerUpdates;
+
/** Holds only the most recent update per user. Older updates are discarded. */
private final Map<Account.Id, AttentionSetUpdate> latestAttentionStatus;
+
/** Holds all updates to attention set. */
private final List<AttentionSetUpdate> allAttentionSetUpdates;
diff --git a/java/com/google/gerrit/server/notedb/CommitRewriter.java b/java/com/google/gerrit/server/notedb/CommitRewriter.java
index 270fc32..8a96717 100644
--- a/java/com/google/gerrit/server/notedb/CommitRewriter.java
+++ b/java/com/google/gerrit/server/notedb/CommitRewriter.java
@@ -122,16 +122,19 @@
/** Whether to rewrite the commit history or only find refs that need to be fixed. */
public boolean dryRun = true;
+
/**
* Whether to verify that resulting commits contain user data for the accounts that are linked
* to a change, see {@link #verifyCommit}, {@link #collectAccounts}.
*/
public boolean verifyCommits = true;
+
/** Whether to compute and output the diff of the commit history for the backfilled refs. */
public boolean outputDiff = true;
/** Max number of refs to update in a single {@link BatchRefUpdate}. */
public int maxRefsInBatch = 10000;
+
/**
* Max number of refs to fix by a single {@link RefsUpdate} run. Since the second run on the
* same set of refs is a no-op, running with this option in a loop will eventually fix all refs.
@@ -1283,6 +1286,7 @@
/** {@link com.google.gerrit.entities.Account.Id} parsed from PersonIdent string. */
Account.Id accountId;
+
/**
* Fixed ident string, that does not contain user data, or {@link Optional#empty} if fix was not
* required.
@@ -1317,6 +1321,7 @@
/** Id of the current commit in rewriter walk. */
ObjectId newTipId = null;
+
/** If any commits were rewritten by the rewriter. */
boolean anyFixesApplied = false;
diff --git a/java/com/google/gerrit/server/notedb/DeleteCommentRewriter.java b/java/com/google/gerrit/server/notedb/DeleteCommentRewriter.java
index 76871a8..6ee538a 100644
--- a/java/com/google/gerrit/server/notedb/DeleteCommentRewriter.java
+++ b/java/com/google/gerrit/server/notedb/DeleteCommentRewriter.java
@@ -133,7 +133,9 @@
ChangeNoteJson changeNoteJson, ObjectReader reader, NoteMap noteMap)
throws IOException, ConfigInvalidException {
return RevisionNoteMap.parse(changeNoteJson, reader, noteMap, HumanComment.Status.PUBLISHED)
- .revisionNotes.values().stream()
+ .revisionNotes
+ .values()
+ .stream()
.flatMap(n -> n.getEntities().stream())
.collect(toMap(c -> c.key.uuid, Function.identity()));
}
@@ -143,6 +145,7 @@
throws IOException, ConfigInvalidException {
return getPublishedComments(noteUtil.getChangeNoteJson(), reader, noteMap);
}
+
/**
* Gets the comments put in by the current commit. The message of the target comment will be
* replaced by the new message.
diff --git a/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java b/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
index 7b2148a..e7581b61 100644
--- a/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
+++ b/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
@@ -78,6 +78,7 @@
*/
public class NoteDbUpdateManager implements AutoCloseable {
private static final int MAX_UPDATES_DEFAULT = 1000;
+
/** Limits the number of patch sets that can be created. Can be overridden in the config. */
private static final int MAX_PATCH_SETS_DEFAULT = 1000;
diff --git a/java/com/google/gerrit/server/notedb/OpenRepo.java b/java/com/google/gerrit/server/notedb/OpenRepo.java
index d02ec87..bf8421f 100644
--- a/java/com/google/gerrit/server/notedb/OpenRepo.java
+++ b/java/com/google/gerrit/server/notedb/OpenRepo.java
@@ -178,9 +178,10 @@
&& !update.bypassMaxUpdates()) {
throw new LimitExceededException(
String.format(
- "Change %s may not exceed %d updates. It may still be abandoned, submitted and you can add/remove"
- + " reviewers to/from the attention-set. To continue working on this change, recreate it with a new"
- + " Change-Id, then abandon this one.",
+ "Change %s may not exceed %d updates. It may still be abandoned, submitted and"
+ + " you can add/remove reviewers to/from the attention-set. To continue"
+ + " working on this change, recreate it with a new Change-Id, then abandon"
+ + " this one.",
update.getId(), maxUpdates.get()));
}
curr = next;
diff --git a/java/com/google/gerrit/server/patch/BaseCommitUtil.java b/java/com/google/gerrit/server/patch/BaseCommitUtil.java
index a264793..0fa6560 100644
--- a/java/com/google/gerrit/server/patch/BaseCommitUtil.java
+++ b/java/com/google/gerrit/server/patch/BaseCommitUtil.java
@@ -116,7 +116,8 @@
if (current.getParentCount() == 2) {
if (!saveAutomerge) {
throw new IOException(
- "diff against auto-merge commits is only supported if 'change.cacheAutomerge' config is set to true.");
+ "diff against auto-merge commits is only supported if 'change.cacheAutomerge'"
+ + " config is set to true.");
}
// TODO(ghareeb): Avoid persisting auto-merge commits.
return getAutoMergeFromGitOrCreate(repo, ins, rw, current);
diff --git a/java/com/google/gerrit/server/patch/DiffContentCalculator.java b/java/com/google/gerrit/server/patch/DiffContentCalculator.java
index a387da6..bed3fdb 100644
--- a/java/com/google/gerrit/server/patch/DiffContentCalculator.java
+++ b/java/com/google/gerrit/server/patch/DiffContentCalculator.java
@@ -208,6 +208,7 @@
/** Lines to be displayed */
final DiffContent diffContent;
+
/** List of edits including "fake" edits for unchanged lines with comments. */
final ImmutableList<Edit> edits;
@@ -221,6 +222,7 @@
static class DiffContent {
/* All lines from the original text (i.e. srcA) to be displayed. */
final SparseFileContent a;
+
/**
* All lines from the new text (i.e. srcB) which are different than in original text. Lines are:
* a) All changed lines (i.e. if the content of the line was replaced with the new line) b) All
diff --git a/java/com/google/gerrit/server/patch/DiffOperationsImpl.java b/java/com/google/gerrit/server/patch/DiffOperationsImpl.java
index 4d0bcc8..6feaeff 100644
--- a/java/com/google/gerrit/server/patch/DiffOperationsImpl.java
+++ b/java/com/google/gerrit/server/patch/DiffOperationsImpl.java
@@ -256,7 +256,7 @@
MERGE_LIST,
DEFAULT_DIFF_ALGORITHM,
/* useTimeout= */ true,
- /*whitespace = */ null));
+ /* whitespace= */ null));
}
if (diffParams.skipFiles() == null) {
diff --git a/java/com/google/gerrit/server/patch/PatchFile.java b/java/com/google/gerrit/server/patch/PatchFile.java
index c3a6807..da59148 100644
--- a/java/com/google/gerrit/server/patch/PatchFile.java
+++ b/java/com/google/gerrit/server/patch/PatchFile.java
@@ -153,7 +153,9 @@
}
private Text load(ObjectId tree, String path)
- throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException,
+ throws MissingObjectException,
+ IncorrectObjectTypeException,
+ CorruptObjectException,
IOException {
if (path == null || Patch.PATCHSET_LEVEL.equals(path)) {
return Text.EMPTY;
diff --git a/java/com/google/gerrit/server/patch/PatchListEntry.java b/java/com/google/gerrit/server/patch/PatchListEntry.java
index de292c3..712016a 100644
--- a/java/com/google/gerrit/server/patch/PatchListEntry.java
+++ b/java/com/google/gerrit/server/patch/PatchListEntry.java
@@ -78,6 +78,7 @@
private final int deletions;
private final long size;
private final long sizeDelta;
+
// Note: When adding new fields, the serialVersionUID in PatchListKey must be
// incremented so that entries from the cache are automatically invalidated.
diff --git a/java/com/google/gerrit/server/patch/PatchScriptFactoryForAutoFix.java b/java/com/google/gerrit/server/patch/PatchScriptFactoryForAutoFix.java
index 348e244..0abb77b 100644
--- a/java/com/google/gerrit/server/patch/PatchScriptFactoryForAutoFix.java
+++ b/java/com/google/gerrit/server/patch/PatchScriptFactoryForAutoFix.java
@@ -94,8 +94,12 @@
@Override
public PatchScript call()
- throws LargeObjectException, AuthException, InvalidChangeOperationException, IOException,
- PermissionBackendException, ResourceNotFoundException {
+ throws LargeObjectException,
+ AuthException,
+ InvalidChangeOperationException,
+ IOException,
+ PermissionBackendException,
+ ResourceNotFoundException {
if (!permissionBackend.currentUser().change(notes).test(ChangePermission.READ)) {
throw new NoSuchChangeException(changeId);
diff --git a/java/com/google/gerrit/server/project/CreateRefControl.java b/java/com/google/gerrit/server/project/CreateRefControl.java
index ab134b5..c1658f9 100644
--- a/java/com/google/gerrit/server/project/CreateRefControl.java
+++ b/java/com/google/gerrit/server/project/CreateRefControl.java
@@ -83,7 +83,10 @@
RevObject object,
boolean forPush,
BranchNameKey... sourceBranches)
- throws AuthException, PermissionBackendException, NoSuchProjectException, IOException,
+ throws AuthException,
+ PermissionBackendException,
+ NoSuchProjectException,
+ IOException,
ResourceConflictException {
ProjectState ps =
projectCache.get(destBranch.project()).orElseThrow(noSuchProject(destBranch.project()));
diff --git a/java/com/google/gerrit/server/project/LabelConfigValidator.java b/java/com/google/gerrit/server/project/LabelConfigValidator.java
index 3e5ff6b..89e3caa 100644
--- a/java/com/google/gerrit/server/project/LabelConfigValidator.java
+++ b/java/com/google/gerrit/server/project/LabelConfigValidator.java
@@ -268,7 +268,7 @@
diffOperations.listModifiedFilesAgainstParent(
receiveEvent.getProjectNameKey(),
receiveEvent.commit,
- /* parentNum=*/ 0,
+ /* parentNum= */ 0,
DiffOptions.DEFAULTS);
}
return fileDiffOutputs.keySet().contains(fileName);
diff --git a/java/com/google/gerrit/server/project/PrologRulesWarningValidator.java b/java/com/google/gerrit/server/project/PrologRulesWarningValidator.java
index 5683fe7..43862dd 100644
--- a/java/com/google/gerrit/server/project/PrologRulesWarningValidator.java
+++ b/java/com/google/gerrit/server/project/PrologRulesWarningValidator.java
@@ -75,9 +75,10 @@
.listModifiedFilesAgainstParent(
receiveEvent.project.getNameKey(),
receiveEvent.commit,
- /* parentNum=*/ 0,
+ /* parentNum= */ 0,
DiffOptions.DEFAULTS)
- .entrySet().stream()
+ .entrySet()
+ .stream()
.filter(e -> fileName.equals(e.getKey()))
.collect(Collectors.toList());
if (matchingEntries.size() != 1) {
diff --git a/java/com/google/gerrit/server/project/SubmitRequirementConfigValidator.java b/java/com/google/gerrit/server/project/SubmitRequirementConfigValidator.java
index 6366a14..388b2a7 100644
--- a/java/com/google/gerrit/server/project/SubmitRequirementConfigValidator.java
+++ b/java/com/google/gerrit/server/project/SubmitRequirementConfigValidator.java
@@ -120,9 +120,10 @@
.listModifiedFilesAgainstParent(
receiveEvent.project.getNameKey(),
receiveEvent.commit,
- /* parentNum=*/ 0,
+ /* parentNum= */ 0,
DiffOptions.DEFAULTS)
- .keySet().stream()
+ .keySet()
+ .stream()
.anyMatch(fileName::equals);
}
diff --git a/java/com/google/gerrit/server/project/SuggestParentCandidates.java b/java/com/google/gerrit/server/project/SuggestParentCandidates.java
index 07addb4..d15c93b 100644
--- a/java/com/google/gerrit/server/project/SuggestParentCandidates.java
+++ b/java/com/google/gerrit/server/project/SuggestParentCandidates.java
@@ -43,7 +43,9 @@
}
public List<Project.NameKey> getNameKeys() throws PermissionBackendException {
- return permissionBackend.currentUser().filter(ProjectPermission.ACCESS, readableParents())
+ return permissionBackend
+ .currentUser()
+ .filter(ProjectPermission.ACCESS, readableParents())
.stream()
.sorted()
.collect(toList());
diff --git a/java/com/google/gerrit/server/query/change/ChangeData.java b/java/com/google/gerrit/server/query/change/ChangeData.java
index 4718a69..6a14042 100644
--- a/java/com/google/gerrit/server/query/change/ChangeData.java
+++ b/java/com/google/gerrit/server/query/change/ChangeData.java
@@ -422,6 +422,7 @@
private ObjectId metaRevision;
private Set<String> hashtags;
private ImmutableMap<String, String> customKeyedValues;
+
/**
* Map from {@link com.google.gerrit.entities.Account.Id} to the tip of the edit ref for this
* change and a given user.
@@ -429,6 +430,7 @@
private Table<Account.Id, PatchSet.Id, Ref> editRefsByUser;
private Set<Account.Id> reviewedBy;
+
/**
* Map from {@link com.google.gerrit.entities.Account.Id} to the tip of the draft comments ref for
* this change and the user.
@@ -1236,8 +1238,7 @@
if (!change().isClosed() && submitRecords.size() == 1) {
// Cache the SubmitRecord with allowClosed = !allowClosed as the SubmitRecord are the same.
submitRecords.put(
- options
- .toBuilder()
+ options.toBuilder()
.recomputeOnClosedChanges(!options.recomputeOnClosedChanges())
.build(),
records);
diff --git a/java/com/google/gerrit/server/query/change/EqualsLabelPredicates.java b/java/com/google/gerrit/server/query/change/EqualsLabelPredicates.java
index 0d6dc3c..bf37b65 100644
--- a/java/com/google/gerrit/server/query/change/EqualsLabelPredicates.java
+++ b/java/com/google/gerrit/server/query/change/EqualsLabelPredicates.java
@@ -96,8 +96,10 @@
protected final ProjectCache projectCache;
protected final PermissionBackend permissionBackend;
protected final IdentifiedUser.GenericFactory userFactory;
+
/** label name to be matched. */
protected final String label;
+
/** Expected vote value for the label. */
protected final int expVal;
diff --git a/java/com/google/gerrit/server/query/project/ProjectQueryBuilder.java b/java/com/google/gerrit/server/query/project/ProjectQueryBuilder.java
index ade6606..f83be1a 100644
--- a/java/com/google/gerrit/server/query/project/ProjectQueryBuilder.java
+++ b/java/com/google/gerrit/server/query/project/ProjectQueryBuilder.java
@@ -30,6 +30,7 @@
/** See {@link com.google.gerrit.index.query.QueryBuilder#parse(String)}. */
Predicate<ProjectData> parse(String query) throws QueryParseException;
+
/** See {@link com.google.gerrit.index.query.QueryBuilder#parse(List)}. */
List<Predicate<ProjectData>> parse(List<String> queries) throws QueryParseException;
}
diff --git a/java/com/google/gerrit/server/restapi/account/DeleteEmail.java b/java/com/google/gerrit/server/restapi/account/DeleteEmail.java
index 5cdf4ae..71a62d3 100644
--- a/java/com/google/gerrit/server/restapi/account/DeleteEmail.java
+++ b/java/com/google/gerrit/server/restapi/account/DeleteEmail.java
@@ -73,8 +73,12 @@
@Override
public Response<?> apply(AccountResource.Email rsrc, Input input)
- throws AuthException, ResourceNotFoundException, ResourceConflictException,
- MethodNotAllowedException, IOException, ConfigInvalidException,
+ throws AuthException,
+ ResourceNotFoundException,
+ ResourceConflictException,
+ MethodNotAllowedException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
if (!self.get().hasSameAccountId(rsrc.getUser())) {
permissionBackend.currentUser().check(GlobalPermission.MODIFY_ACCOUNT);
@@ -83,8 +87,11 @@
}
public Response<?> apply(IdentifiedUser user, String email)
- throws ResourceNotFoundException, ResourceConflictException, MethodNotAllowedException,
- IOException, ConfigInvalidException {
+ throws ResourceNotFoundException,
+ ResourceConflictException,
+ MethodNotAllowedException,
+ IOException,
+ ConfigInvalidException {
Account.Id accountId = user.getAccountId();
if (realm.accountBelongsToRealm(externalIds.byAccount(accountId))
&& !realm.allowsEdit(AccountFieldName.REGISTER_NEW_EMAIL)) {
diff --git a/java/com/google/gerrit/server/restapi/account/DeleteWatchedProjects.java b/java/com/google/gerrit/server/restapi/account/DeleteWatchedProjects.java
index e070522..2ecb02f 100644
--- a/java/com/google/gerrit/server/restapi/account/DeleteWatchedProjects.java
+++ b/java/com/google/gerrit/server/restapi/account/DeleteWatchedProjects.java
@@ -64,7 +64,10 @@
@Override
public Response<?> apply(AccountResource rsrc, List<ProjectWatchInfo> input)
- throws AuthException, UnprocessableEntityException, IOException, ConfigInvalidException,
+ throws AuthException,
+ UnprocessableEntityException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
if (!self.get().hasSameAccountId(rsrc.getUser())) {
permissionBackend.currentUser().check(GlobalPermission.ADMINISTRATE_SERVER);
diff --git a/java/com/google/gerrit/server/restapi/account/GetWatchedProjects.java b/java/com/google/gerrit/server/restapi/account/GetWatchedProjects.java
index d8ad3cf..00c70d0 100644
--- a/java/com/google/gerrit/server/restapi/account/GetWatchedProjects.java
+++ b/java/com/google/gerrit/server/restapi/account/GetWatchedProjects.java
@@ -64,7 +64,10 @@
@Override
public Response<List<ProjectWatchInfo>> apply(AccountResource rsrc)
- throws AuthException, IOException, ConfigInvalidException, PermissionBackendException,
+ throws AuthException,
+ IOException,
+ ConfigInvalidException,
+ PermissionBackendException,
ResourceNotFoundException {
if (!self.get().hasSameAccountId(rsrc.getUser())) {
permissionBackend.currentUser().check(GlobalPermission.ADMINISTRATE_SERVER);
diff --git a/java/com/google/gerrit/server/restapi/account/PutDisplayName.java b/java/com/google/gerrit/server/restapi/account/PutDisplayName.java
index 557e660..05b89d5 100644
--- a/java/com/google/gerrit/server/restapi/account/PutDisplayName.java
+++ b/java/com/google/gerrit/server/restapi/account/PutDisplayName.java
@@ -63,7 +63,10 @@
@Override
public Response<String> apply(AccountResource rsrc, @Nullable DisplayNameInput input)
- throws AuthException, ResourceNotFoundException, IOException, PermissionBackendException,
+ throws AuthException,
+ ResourceNotFoundException,
+ IOException,
+ PermissionBackendException,
ConfigInvalidException {
IdentifiedUser user = rsrc.getUser();
if (!self.get().hasSameAccountId(user)) {
diff --git a/java/com/google/gerrit/server/restapi/account/PutName.java b/java/com/google/gerrit/server/restapi/account/PutName.java
index 78430c3..a70db16 100644
--- a/java/com/google/gerrit/server/restapi/account/PutName.java
+++ b/java/com/google/gerrit/server/restapi/account/PutName.java
@@ -71,8 +71,12 @@
@Override
public Response<String> apply(AccountResource rsrc, NameInput input)
- throws AuthException, MethodNotAllowedException, ResourceNotFoundException, IOException,
- PermissionBackendException, ConfigInvalidException {
+ throws AuthException,
+ MethodNotAllowedException,
+ ResourceNotFoundException,
+ IOException,
+ PermissionBackendException,
+ ConfigInvalidException {
if (!self.get().hasSameAccountId(rsrc.getUser())) {
permissionBackend.currentUser().check(GlobalPermission.MODIFY_ACCOUNT);
}
@@ -80,7 +84,9 @@
}
public Response<String> apply(IdentifiedUser user, NameInput input)
- throws MethodNotAllowedException, ResourceNotFoundException, IOException,
+ throws MethodNotAllowedException,
+ ResourceNotFoundException,
+ IOException,
ConfigInvalidException {
if (input == null) {
input = new NameInput();
diff --git a/java/com/google/gerrit/server/restapi/account/PutStatus.java b/java/com/google/gerrit/server/restapi/account/PutStatus.java
index 106f39e..3175a76 100644
--- a/java/com/google/gerrit/server/restapi/account/PutStatus.java
+++ b/java/com/google/gerrit/server/restapi/account/PutStatus.java
@@ -61,7 +61,10 @@
@Override
public Response<String> apply(AccountResource rsrc, StatusInput input)
- throws AuthException, ResourceNotFoundException, IOException, PermissionBackendException,
+ throws AuthException,
+ ResourceNotFoundException,
+ IOException,
+ PermissionBackendException,
ConfigInvalidException {
if (!self.get().hasSameAccountId(rsrc.getUser())) {
permissionBackend.currentUser().check(GlobalPermission.MODIFY_ACCOUNT);
diff --git a/java/com/google/gerrit/server/restapi/account/SetDiffPreferences.java b/java/com/google/gerrit/server/restapi/account/SetDiffPreferences.java
index 3f25b3b..6df6538 100644
--- a/java/com/google/gerrit/server/restapi/account/SetDiffPreferences.java
+++ b/java/com/google/gerrit/server/restapi/account/SetDiffPreferences.java
@@ -67,7 +67,10 @@
@Override
public Response<DiffPreferencesInfo> apply(AccountResource rsrc, DiffPreferencesInfo input)
- throws RestApiException, ConfigInvalidException, RepositoryNotFoundException, IOException,
+ throws RestApiException,
+ ConfigInvalidException,
+ RepositoryNotFoundException,
+ IOException,
PermissionBackendException {
if (!self.get().hasSameAccountId(rsrc.getUser())) {
permissionBackend.currentUser().check(GlobalPermission.MODIFY_ACCOUNT);
diff --git a/java/com/google/gerrit/server/restapi/account/SetEditPreferences.java b/java/com/google/gerrit/server/restapi/account/SetEditPreferences.java
index a15a751..942e088 100644
--- a/java/com/google/gerrit/server/restapi/account/SetEditPreferences.java
+++ b/java/com/google/gerrit/server/restapi/account/SetEditPreferences.java
@@ -68,7 +68,10 @@
@Override
public Response<EditPreferencesInfo> apply(AccountResource rsrc, EditPreferencesInfo input)
- throws RestApiException, RepositoryNotFoundException, IOException, ConfigInvalidException,
+ throws RestApiException,
+ RepositoryNotFoundException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
if (!self.get().hasSameAccountId(rsrc.getUser())) {
permissionBackend.currentUser().check(GlobalPermission.MODIFY_ACCOUNT);
diff --git a/java/com/google/gerrit/server/restapi/account/SshKeys.java b/java/com/google/gerrit/server/restapi/account/SshKeys.java
index a6c4d80..ab7b3be 100644
--- a/java/com/google/gerrit/server/restapi/account/SshKeys.java
+++ b/java/com/google/gerrit/server/restapi/account/SshKeys.java
@@ -63,7 +63,9 @@
@Override
public AccountResource.SshKey parse(AccountResource rsrc, IdString id)
- throws ResourceNotFoundException, IOException, ConfigInvalidException,
+ throws ResourceNotFoundException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
if (!self.get().hasSameAccountId(rsrc.getUser())) {
try {
diff --git a/java/com/google/gerrit/server/restapi/change/Abandon.java b/java/com/google/gerrit/server/restapi/change/Abandon.java
index 36080a4..0ea9e99 100644
--- a/java/com/google/gerrit/server/restapi/change/Abandon.java
+++ b/java/com/google/gerrit/server/restapi/change/Abandon.java
@@ -76,7 +76,10 @@
@Override
public Response<ChangeInfo> apply(ChangeResource rsrc, AbandonInput input)
- throws RestApiException, UpdateException, PermissionBackendException, IOException,
+ throws RestApiException,
+ UpdateException,
+ PermissionBackendException,
+ IOException,
ConfigInvalidException {
// Not allowed to abandon if the current patch set is locked.
patchSetUtil.checkPatchSetNotLocked(rsrc.getNotes());
diff --git a/java/com/google/gerrit/server/restapi/change/ApplyPatch.java b/java/com/google/gerrit/server/restapi/change/ApplyPatch.java
index 6adde99..672217e 100644
--- a/java/com/google/gerrit/server/restapi/change/ApplyPatch.java
+++ b/java/com/google/gerrit/server/restapi/change/ApplyPatch.java
@@ -117,8 +117,13 @@
@Override
public Response<ChangeInfo> apply(ChangeResource rsrc, ApplyPatchPatchSetInput input)
- throws IOException, UpdateException, RestApiException, PermissionBackendException,
- ConfigInvalidException, NoSuchProjectException, InvalidChangeOperationException {
+ throws IOException,
+ UpdateException,
+ RestApiException,
+ PermissionBackendException,
+ ConfigInvalidException,
+ NoSuchProjectException,
+ InvalidChangeOperationException {
NameKey project = rsrc.getProject();
contributorAgreements.check(project, rsrc.getUser());
BranchNameKey destBranch = rsrc.getChange().getDest();
@@ -173,7 +178,8 @@
if (latestPatchset.getParentCount() != 1) {
throw new BadRequestException(
String.format(
- "Cannot parse base commit for a change with none or multiple parents. Change ID: %s.",
+ "Cannot parse base commit for a change with none or multiple parents. Change ID:"
+ + " %s.",
destChange.getId()));
}
if (Boolean.TRUE.equals(input.amend)) {
diff --git a/java/com/google/gerrit/server/restapi/change/ApplyProvidedFix.java b/java/com/google/gerrit/server/restapi/change/ApplyProvidedFix.java
index a55ef84b..048677a 100644
--- a/java/com/google/gerrit/server/restapi/change/ApplyProvidedFix.java
+++ b/java/com/google/gerrit/server/restapi/change/ApplyProvidedFix.java
@@ -73,8 +73,12 @@
@Override
public Response<EditInfo> apply(
RevisionResource revisionResource, ApplyProvidedFixInput applyProvidedFixInput)
- throws AuthException, BadRequestException, ResourceConflictException, IOException,
- ResourceNotFoundException, PermissionBackendException {
+ throws AuthException,
+ BadRequestException,
+ ResourceConflictException,
+ IOException,
+ ResourceNotFoundException,
+ PermissionBackendException {
if (applyProvidedFixInput == null) {
throw new BadRequestException("applyProvidedFixInput is required");
}
diff --git a/java/com/google/gerrit/server/restapi/change/ApplyStoredFix.java b/java/com/google/gerrit/server/restapi/change/ApplyStoredFix.java
index 2d87dcf..af83000 100644
--- a/java/com/google/gerrit/server/restapi/change/ApplyStoredFix.java
+++ b/java/com/google/gerrit/server/restapi/change/ApplyStoredFix.java
@@ -68,8 +68,12 @@
@Override
public Response<EditInfo> apply(FixResource fixResource, Input nothing)
- throws AuthException, BadRequestException, ResourceConflictException, IOException,
- ResourceNotFoundException, PermissionBackendException {
+ throws AuthException,
+ BadRequestException,
+ ResourceConflictException,
+ IOException,
+ ResourceNotFoundException,
+ PermissionBackendException {
RevisionResource revisionResource = fixResource.getRevisionResource();
Project.NameKey project = revisionResource.getProject();
ProjectState projectState = projectCache.get(project).orElseThrow(illegalState(project));
diff --git a/java/com/google/gerrit/server/restapi/change/AttentionSet.java b/java/com/google/gerrit/server/restapi/change/AttentionSet.java
index f72fe64ec..25a1296 100644
--- a/java/com/google/gerrit/server/restapi/change/AttentionSet.java
+++ b/java/com/google/gerrit/server/restapi/change/AttentionSet.java
@@ -59,7 +59,10 @@
@Override
public AttentionSetEntryResource parse(ChangeResource changeResource, IdString idString)
- throws ResourceNotFoundException, AuthException, IOException, ConfigInvalidException,
+ throws ResourceNotFoundException,
+ AuthException,
+ IOException,
+ ConfigInvalidException,
BadRequestException {
Account.Id accountId =
AttentionSetUtil.resolveAccount(accountResolver, changeResource.getNotes(), idString.get());
diff --git a/java/com/google/gerrit/server/restapi/change/CherryPick.java b/java/com/google/gerrit/server/restapi/change/CherryPick.java
index f74940e..5004073 100644
--- a/java/com/google/gerrit/server/restapi/change/CherryPick.java
+++ b/java/com/google/gerrit/server/restapi/change/CherryPick.java
@@ -70,8 +70,12 @@
@Override
public Response<ChangeInfo> apply(RevisionResource rsrc, CherryPickInput input)
- throws IOException, UpdateException, RestApiException, PermissionBackendException,
- ConfigInvalidException, NoSuchProjectException {
+ throws IOException,
+ UpdateException,
+ RestApiException,
+ PermissionBackendException,
+ ConfigInvalidException,
+ NoSuchProjectException {
input.parent = input.parent == null ? 1 : input.parent;
if (input.destination == null || input.destination.trim().isEmpty()) {
throw new BadRequestException("destination must be non-empty");
diff --git a/java/com/google/gerrit/server/restapi/change/CherryPickCommit.java b/java/com/google/gerrit/server/restapi/change/CherryPickCommit.java
index f51257f..6c2f582 100644
--- a/java/com/google/gerrit/server/restapi/change/CherryPickCommit.java
+++ b/java/com/google/gerrit/server/restapi/change/CherryPickCommit.java
@@ -64,8 +64,12 @@
@Override
public Response<ChangeInfo> apply(CommitResource rsrc, CherryPickInput input)
- throws IOException, UpdateException, RestApiException, PermissionBackendException,
- ConfigInvalidException, NoSuchProjectException {
+ throws IOException,
+ UpdateException,
+ RestApiException,
+ PermissionBackendException,
+ ConfigInvalidException,
+ NoSuchProjectException {
String destination = Strings.nullToEmpty(input.destination).trim();
input.parent = input.parent == null ? 1 : input.parent;
Project.NameKey projectName = rsrc.getProjectState().getNameKey();
diff --git a/java/com/google/gerrit/server/restapi/change/DeleteComment.java b/java/com/google/gerrit/server/restapi/change/DeleteComment.java
index 1397582..d72f077 100644
--- a/java/com/google/gerrit/server/restapi/change/DeleteComment.java
+++ b/java/com/google/gerrit/server/restapi/change/DeleteComment.java
@@ -75,7 +75,10 @@
@Override
public Response<CommentInfo> apply(HumanCommentResource rsrc, DeleteCommentInput input)
- throws RestApiException, IOException, ConfigInvalidException, PermissionBackendException,
+ throws RestApiException,
+ IOException,
+ ConfigInvalidException,
+ PermissionBackendException,
UpdateException {
CurrentUser user = userProvider.get();
permissionBackend.user(user).check(GlobalPermission.ADMINISTRATE_SERVER);
diff --git a/java/com/google/gerrit/server/restapi/change/Files.java b/java/com/google/gerrit/server/restapi/change/Files.java
index 96e5645..59220257 100644
--- a/java/com/google/gerrit/server/restapi/change/Files.java
+++ b/java/com/google/gerrit/server/restapi/change/Files.java
@@ -151,8 +151,11 @@
@Override
public Response<?> apply(RevisionResource resource)
- throws RestApiException, RepositoryNotFoundException, IOException,
- PatchListNotAvailableException, PermissionBackendException {
+ throws RestApiException,
+ RepositoryNotFoundException,
+ IOException,
+ PatchListNotAvailableException,
+ PermissionBackendException {
checkOptions();
if (reviewed) {
return Response.ok(reviewed(resource));
diff --git a/java/com/google/gerrit/server/restapi/change/GetDiff.java b/java/com/google/gerrit/server/restapi/change/GetDiff.java
index 9424198..0b874ca 100644
--- a/java/com/google/gerrit/server/restapi/change/GetDiff.java
+++ b/java/com/google/gerrit/server/restapi/change/GetDiff.java
@@ -108,8 +108,13 @@
@Override
public Response<DiffInfo> apply(FileResource resource)
- throws BadRequestException, ResourceConflictException, ResourceNotFoundException,
- AuthException, InvalidChangeOperationException, IOException, PermissionBackendException {
+ throws BadRequestException,
+ ResourceConflictException,
+ ResourceNotFoundException,
+ AuthException,
+ InvalidChangeOperationException,
+ IOException,
+ PermissionBackendException {
DiffPreferencesInfo prefs = new DiffPreferencesInfo();
if (whitespace != null) {
prefs.ignoreWhitespace = whitespace;
diff --git a/java/com/google/gerrit/server/restapi/change/PreviewFix.java b/java/com/google/gerrit/server/restapi/change/PreviewFix.java
index e771898..c2e23b7 100644
--- a/java/com/google/gerrit/server/restapi/change/PreviewFix.java
+++ b/java/com/google/gerrit/server/restapi/change/PreviewFix.java
@@ -95,8 +95,12 @@
@Override
public Response<Map<String, DiffInfo>> apply(FixResource fixResource)
- throws PermissionBackendException, ResourceNotFoundException, ResourceConflictException,
- AuthException, IOException, InvalidChangeOperationException {
+ throws PermissionBackendException,
+ ResourceNotFoundException,
+ ResourceConflictException,
+ AuthException,
+ IOException,
+ InvalidChangeOperationException {
PreviewFix previewFix = previewFixFactory.create(fixResource.getRevisionResource());
@@ -120,8 +124,13 @@
@Override
public Response<Map<String, DiffInfo>> apply(
RevisionResource revisionResource, ApplyProvidedFixInput applyProvidedFixInput)
- throws BadRequestException, PermissionBackendException, ResourceNotFoundException,
- ResourceConflictException, AuthException, IOException, InvalidChangeOperationException {
+ throws BadRequestException,
+ PermissionBackendException,
+ ResourceNotFoundException,
+ ResourceConflictException,
+ AuthException,
+ IOException,
+ InvalidChangeOperationException {
if (applyProvidedFixInput == null) {
throw new BadRequestException("applyProvidedFixInput is required");
}
@@ -142,8 +151,12 @@
private Map<String, DiffInfo> previewAllFiles(
Map<String, List<FixReplacement>> fixReplacementsPerFilePath)
- throws PermissionBackendException, ResourceNotFoundException, ResourceConflictException,
- AuthException, IOException, InvalidChangeOperationException {
+ throws PermissionBackendException,
+ ResourceNotFoundException,
+ ResourceConflictException,
+ AuthException,
+ IOException,
+ InvalidChangeOperationException {
Map<String, DiffInfo> result = new HashMap<>();
try (Repository git = repoManager.openRepository(notes.getProjectName())) {
for (Map.Entry<String, List<FixReplacement>> entry : fixReplacementsPerFilePath.entrySet()) {
@@ -162,8 +175,12 @@
private DiffInfo previewSingleFile(
Repository git, String fileName, ImmutableList<FixReplacement> fixReplacements)
- throws PermissionBackendException, AuthException, LargeObjectException,
- InvalidChangeOperationException, IOException, ResourceNotFoundException {
+ throws PermissionBackendException,
+ AuthException,
+ LargeObjectException,
+ InvalidChangeOperationException,
+ IOException,
+ ResourceNotFoundException {
PatchScriptFactoryForAutoFix psf =
patchScriptFactoryFactory.create(
git, notes, fileName, patchSet, fixReplacements, DiffPreferencesInfo.defaults());
diff --git a/java/com/google/gerrit/server/restapi/change/PublishChangeEdit.java b/java/com/google/gerrit/server/restapi/change/PublishChangeEdit.java
index d76e53a..7347426 100644
--- a/java/com/google/gerrit/server/restapi/change/PublishChangeEdit.java
+++ b/java/com/google/gerrit/server/restapi/change/PublishChangeEdit.java
@@ -57,7 +57,10 @@
@Override
public Response<Object> apply(ChangeResource rsrc, PublishChangeEditInput in)
- throws IOException, RestApiException, UpdateException, ConfigInvalidException,
+ throws IOException,
+ RestApiException,
+ UpdateException,
+ ConfigInvalidException,
NoSuchProjectException {
contributorAgreementsChecker.check(rsrc.getProject(), rsrc.getUser());
Optional<ChangeEdit> edit = editUtil.byChange(rsrc.getNotes(), rsrc.getUser());
diff --git a/java/com/google/gerrit/server/restapi/change/RemoveFromAttentionSet.java b/java/com/google/gerrit/server/restapi/change/RemoveFromAttentionSet.java
index d761fa7..d996750 100644
--- a/java/com/google/gerrit/server/restapi/change/RemoveFromAttentionSet.java
+++ b/java/com/google/gerrit/server/restapi/change/RemoveFromAttentionSet.java
@@ -62,7 +62,10 @@
@Override
public Response<Object> apply(
AttentionSetEntryResource attentionResource, AttentionSetInput input)
- throws RestApiException, PermissionBackendException, IOException, ConfigInvalidException,
+ throws RestApiException,
+ PermissionBackendException,
+ IOException,
+ ConfigInvalidException,
UpdateException {
if (input == null) {
throw new BadRequestException("input may not be null");
diff --git a/java/com/google/gerrit/server/restapi/change/Revert.java b/java/com/google/gerrit/server/restapi/change/Revert.java
index 7dd3e7a..f9ac958 100644
--- a/java/com/google/gerrit/server/restapi/change/Revert.java
+++ b/java/com/google/gerrit/server/restapi/change/Revert.java
@@ -77,8 +77,13 @@
@Override
public Response<ChangeInfo> apply(ChangeResource rsrc, RevertInput input)
- throws IOException, RestApiException, UpdateException, NoSuchChangeException,
- PermissionBackendException, NoSuchProjectException, ConfigInvalidException {
+ throws IOException,
+ RestApiException,
+ UpdateException,
+ NoSuchChangeException,
+ PermissionBackendException,
+ NoSuchProjectException,
+ ConfigInvalidException {
Change change = rsrc.getChange();
if (!change.isMerged()) {
throw new ResourceConflictException("change is " + ChangeUtil.status(change));
diff --git a/java/com/google/gerrit/server/restapi/change/ReviewersUtil.java b/java/com/google/gerrit/server/restapi/change/ReviewersUtil.java
index 8dd20c9..6b6e5fc 100644
--- a/java/com/google/gerrit/server/restapi/change/ReviewersUtil.java
+++ b/java/com/google/gerrit/server/restapi/change/ReviewersUtil.java
@@ -201,7 +201,8 @@
if (accountVisibility == AccountVisibility.NONE && !accountControl.canViewAll()) {
logger.atFine().log(
- "Not suggesting reviewers: accountVisibility = %s and the user does not have %s capability",
+ "Not suggesting reviewers: accountVisibility = %s and the user does not have %s"
+ + " capability",
AccountVisibility.NONE, GlobalPermission.VIEW_ALL_ACCOUNTS);
return Collections.emptyList();
}
diff --git a/java/com/google/gerrit/server/restapi/change/RevisionReviewers.java b/java/com/google/gerrit/server/restapi/change/RevisionReviewers.java
index 97383cda..a4a70af 100644
--- a/java/com/google/gerrit/server/restapi/change/RevisionReviewers.java
+++ b/java/com/google/gerrit/server/restapi/change/RevisionReviewers.java
@@ -68,7 +68,10 @@
@Override
public ReviewerResource parse(RevisionResource rsrc, IdString id)
- throws ResourceNotFoundException, AuthException, MethodNotAllowedException, IOException,
+ throws ResourceNotFoundException,
+ AuthException,
+ MethodNotAllowedException,
+ IOException,
ConfigInvalidException {
if (!rsrc.isCurrent()) {
throw new MethodNotAllowedException("Cannot access on non-current patch set");
diff --git a/java/com/google/gerrit/server/restapi/change/Submit.java b/java/com/google/gerrit/server/restapi/change/Submit.java
index be2fae3..fddcfa4 100644
--- a/java/com/google/gerrit/server/restapi/change/Submit.java
+++ b/java/com/google/gerrit/server/restapi/change/Submit.java
@@ -170,8 +170,12 @@
@Override
public Response<ChangeInfo> apply(RevisionResource rsrc, @Nullable SubmitInput input)
- throws RestApiException, RepositoryNotFoundException, IOException, PermissionBackendException,
- UpdateException, ConfigInvalidException {
+ throws RestApiException,
+ RepositoryNotFoundException,
+ IOException,
+ PermissionBackendException,
+ UpdateException,
+ ConfigInvalidException {
if (input == null) {
input = new SubmitInput();
}
@@ -193,7 +197,10 @@
@UsedAt(UsedAt.Project.GOOGLE)
public Change mergeChange(RevisionResource rsrc, IdentifiedUser submitter, SubmitInput input)
- throws RestApiException, IOException, UpdateException, ConfigInvalidException,
+ throws RestApiException,
+ IOException,
+ UpdateException,
+ ConfigInvalidException,
PermissionBackendException {
Change change = rsrc.getChange();
if (!change.isNew()) {
@@ -251,7 +258,8 @@
.test(EnumSet.of(ChangePermission.READ, ChangePermission.SUBMIT));
if (!can.contains(ChangePermission.READ)) {
logger.atFine().log(
- "Change %d cannot be submitted by user %s because it depends on change %d which the user cannot read",
+ "Change %d cannot be submitted by user %s because it depends on change %d which the"
+ + " user cannot read",
cd.getId().get(), user.getLoggableName(), c.getId().get());
return BLOCKED_HIDDEN_SUBMIT_TOOLTIP;
}
@@ -323,7 +331,7 @@
ChangeSet cs =
mergeSuperSet
.get()
- .completeChangeSet(cd.change(), resource.getUser(), /*includingTopicClosure= */ false);
+ .completeChangeSet(cd.change(), resource.getUser(), /* includingTopicClosure= */ false);
String topic = change.getTopic();
int topicSize = 0;
if (!Strings.isNullOrEmpty(topic)) {
@@ -454,7 +462,10 @@
}
private IdentifiedUser onBehalfOf(RevisionResource rsrc, SubmitInput in)
- throws AuthException, UnprocessableEntityException, PermissionBackendException, IOException,
+ throws AuthException,
+ UnprocessableEntityException,
+ PermissionBackendException,
+ IOException,
ConfigInvalidException {
PermissionBackend.ForChange perm = rsrc.permissions();
perm.check(ChangePermission.SUBMIT);
diff --git a/java/com/google/gerrit/server/restapi/change/SubmittedTogether.java b/java/com/google/gerrit/server/restapi/change/SubmittedTogether.java
index 2ce82ab..e31598b 100644
--- a/java/com/google/gerrit/server/restapi/change/SubmittedTogether.java
+++ b/java/com/google/gerrit/server/restapi/change/SubmittedTogether.java
@@ -111,7 +111,10 @@
@Override
public Response<Object> apply(ChangeResource resource)
- throws AuthException, BadRequestException, ResourceConflictException, IOException,
+ throws AuthException,
+ BadRequestException,
+ ResourceConflictException,
+ IOException,
PermissionBackendException {
SubmittedTogetherInfo info = applyInfo(resource);
if (options.isEmpty()) {
diff --git a/java/com/google/gerrit/server/restapi/change/SuggestChangeReviewers.java b/java/com/google/gerrit/server/restapi/change/SuggestChangeReviewers.java
index 26a0415..9e5b909 100644
--- a/java/com/google/gerrit/server/restapi/change/SuggestChangeReviewers.java
+++ b/java/com/google/gerrit/server/restapi/change/SuggestChangeReviewers.java
@@ -84,7 +84,10 @@
@Override
public Response<List<SuggestedReviewerInfo>> apply(ChangeResource rsrc)
- throws AuthException, BadRequestException, IOException, ConfigInvalidException,
+ throws AuthException,
+ BadRequestException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
if (!self.get().isIdentifiedUser()) {
throw new AuthException("Authentication required");
diff --git a/java/com/google/gerrit/server/restapi/config/PostCaches.java b/java/com/google/gerrit/server/restapi/config/PostCaches.java
index c9480c5..641d752 100644
--- a/java/com/google/gerrit/server/restapi/config/PostCaches.java
+++ b/java/com/google/gerrit/server/restapi/config/PostCaches.java
@@ -71,7 +71,9 @@
@Override
public Response<String> apply(ConfigResource rsrc, Input input)
- throws AuthException, BadRequestException, UnprocessableEntityException,
+ throws AuthException,
+ BadRequestException,
+ UnprocessableEntityException,
PermissionBackendException {
if (input == null || input.operation == null) {
throw new BadRequestException("operation must be specified");
diff --git a/java/com/google/gerrit/server/restapi/config/TasksCollection.java b/java/com/google/gerrit/server/restapi/config/TasksCollection.java
index 29a0033..2694cce 100644
--- a/java/com/google/gerrit/server/restapi/config/TasksCollection.java
+++ b/java/com/google/gerrit/server/restapi/config/TasksCollection.java
@@ -71,7 +71,9 @@
@Override
public TaskResource parse(ConfigResource parent, IdString id)
- throws ResourceNotFoundException, AuthException, PermissionBackendException,
+ throws ResourceNotFoundException,
+ AuthException,
+ PermissionBackendException,
ResourceConflictException {
CurrentUser user = self.get();
if (!user.isIdentifiedUser()) {
diff --git a/java/com/google/gerrit/server/restapi/group/AddMembers.java b/java/com/google/gerrit/server/restapi/group/AddMembers.java
index 4cb2f47..d744e7a 100644
--- a/java/com/google/gerrit/server/restapi/group/AddMembers.java
+++ b/java/com/google/gerrit/server/restapi/group/AddMembers.java
@@ -116,8 +116,13 @@
@Override
public Response<List<AccountInfo>> apply(GroupResource resource, Input input)
- throws AuthException, NotInternalGroupException, UnprocessableEntityException, IOException,
- ConfigInvalidException, ResourceNotFoundException, PermissionBackendException {
+ throws AuthException,
+ NotInternalGroupException,
+ UnprocessableEntityException,
+ IOException,
+ ConfigInvalidException,
+ ResourceNotFoundException,
+ PermissionBackendException {
GroupDescription.Internal internalGroup =
resource.asInternalGroup().orElseThrow(NotInternalGroupException::new);
input = Input.init(input);
@@ -226,7 +231,10 @@
@Override
public Response<AccountInfo> apply(GroupResource resource, IdString id, Input input)
- throws RestApiException, NotInternalGroupException, IOException, ConfigInvalidException,
+ throws RestApiException,
+ NotInternalGroupException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
AddMembers.Input in = new AddMembers.Input();
in._oneMember = id.get();
diff --git a/java/com/google/gerrit/server/restapi/group/AddSubgroups.java b/java/com/google/gerrit/server/restapi/group/AddSubgroups.java
index df854ecd2c..1fcd5a8 100644
--- a/java/com/google/gerrit/server/restapi/group/AddSubgroups.java
+++ b/java/com/google/gerrit/server/restapi/group/AddSubgroups.java
@@ -92,8 +92,12 @@
@Override
public Response<List<GroupInfo>> apply(GroupResource resource, Input input)
- throws NotInternalGroupException, AuthException, UnprocessableEntityException,
- ResourceNotFoundException, IOException, ConfigInvalidException,
+ throws NotInternalGroupException,
+ AuthException,
+ UnprocessableEntityException,
+ ResourceNotFoundException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
GroupDescription.Internal group =
resource.asInternalGroup().orElseThrow(NotInternalGroupException::new);
diff --git a/java/com/google/gerrit/server/restapi/group/DeleteMembers.java b/java/com/google/gerrit/server/restapi/group/DeleteMembers.java
index 2386fce..a4d28c2 100644
--- a/java/com/google/gerrit/server/restapi/group/DeleteMembers.java
+++ b/java/com/google/gerrit/server/restapi/group/DeleteMembers.java
@@ -56,8 +56,12 @@
@Override
public Response<?> apply(GroupResource resource, Input input)
- throws AuthException, NotInternalGroupException, UnprocessableEntityException, IOException,
- ConfigInvalidException, ResourceNotFoundException {
+ throws AuthException,
+ NotInternalGroupException,
+ UnprocessableEntityException,
+ IOException,
+ ConfigInvalidException,
+ ResourceNotFoundException {
GroupDescription.Internal internalGroup =
resource.asInternalGroup().orElseThrow(NotInternalGroupException::new);
input = Input.init(input);
@@ -105,8 +109,12 @@
@Override
public Response<?> apply(MemberResource resource, Input input)
- throws AuthException, MethodNotAllowedException, UnprocessableEntityException, IOException,
- ConfigInvalidException, ResourceNotFoundException {
+ throws AuthException,
+ MethodNotAllowedException,
+ UnprocessableEntityException,
+ IOException,
+ ConfigInvalidException,
+ ResourceNotFoundException {
AddMembers.Input in = new AddMembers.Input();
in._oneMember = resource.getMember().getAccountId().toString();
return delete.get().apply(resource, in);
diff --git a/java/com/google/gerrit/server/restapi/group/DeleteSubgroups.java b/java/com/google/gerrit/server/restapi/group/DeleteSubgroups.java
index bc63035..08599bd 100644
--- a/java/com/google/gerrit/server/restapi/group/DeleteSubgroups.java
+++ b/java/com/google/gerrit/server/restapi/group/DeleteSubgroups.java
@@ -55,8 +55,12 @@
@Override
public Response<?> apply(GroupResource resource, Input input)
- throws AuthException, NotInternalGroupException, UnprocessableEntityException,
- ResourceNotFoundException, IOException, ConfigInvalidException {
+ throws AuthException,
+ NotInternalGroupException,
+ UnprocessableEntityException,
+ ResourceNotFoundException,
+ IOException,
+ ConfigInvalidException {
GroupDescription.Internal internalGroup =
resource.asInternalGroup().orElseThrow(NotInternalGroupException::new);
input = Input.init(input);
@@ -106,8 +110,12 @@
@Override
public Response<?> apply(SubgroupResource resource, Input input)
- throws AuthException, MethodNotAllowedException, UnprocessableEntityException,
- ResourceNotFoundException, IOException, ConfigInvalidException {
+ throws AuthException,
+ MethodNotAllowedException,
+ UnprocessableEntityException,
+ ResourceNotFoundException,
+ IOException,
+ ConfigInvalidException {
AddSubgroups.Input in = new AddSubgroups.Input();
in.groups = ImmutableList.of(resource.getMember().get());
return delete.get().apply(resource, in);
diff --git a/java/com/google/gerrit/server/restapi/group/GetAuditLog.java b/java/com/google/gerrit/server/restapi/group/GetAuditLog.java
index 1b0fcd4..60411ea 100644
--- a/java/com/google/gerrit/server/restapi/group/GetAuditLog.java
+++ b/java/com/google/gerrit/server/restapi/group/GetAuditLog.java
@@ -77,7 +77,10 @@
@Override
public Response<List<? extends GroupAuditEventInfo>> apply(GroupResource rsrc)
- throws AuthException, NotInternalGroupException, IOException, ConfigInvalidException,
+ throws AuthException,
+ NotInternalGroupException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
GroupDescription.Internal group =
rsrc.asInternalGroup().orElseThrow(NotInternalGroupException::new);
diff --git a/java/com/google/gerrit/server/restapi/group/MembersCollection.java b/java/com/google/gerrit/server/restapi/group/MembersCollection.java
index 79f3d6a..ff61dff 100644
--- a/java/com/google/gerrit/server/restapi/group/MembersCollection.java
+++ b/java/com/google/gerrit/server/restapi/group/MembersCollection.java
@@ -55,7 +55,10 @@
@Override
public MemberResource parse(GroupResource parent, IdString id)
- throws NotInternalGroupException, AuthException, ResourceNotFoundException, IOException,
+ throws NotInternalGroupException,
+ AuthException,
+ ResourceNotFoundException,
+ IOException,
ConfigInvalidException {
GroupDescription.Internal group =
parent.asInternalGroup().orElseThrow(NotInternalGroupException::new);
diff --git a/java/com/google/gerrit/server/restapi/group/PutDescription.java b/java/com/google/gerrit/server/restapi/group/PutDescription.java
index 0c3ff06..7d76c97 100644
--- a/java/com/google/gerrit/server/restapi/group/PutDescription.java
+++ b/java/com/google/gerrit/server/restapi/group/PutDescription.java
@@ -45,7 +45,10 @@
@Override
public Response<String> apply(GroupResource resource, DescriptionInput input)
- throws AuthException, NotInternalGroupException, ResourceNotFoundException, IOException,
+ throws AuthException,
+ NotInternalGroupException,
+ ResourceNotFoundException,
+ IOException,
ConfigInvalidException {
if (input == null) {
input = new DescriptionInput(); // Delete would set description to null.
diff --git a/java/com/google/gerrit/server/restapi/group/PutName.java b/java/com/google/gerrit/server/restapi/group/PutName.java
index 5246ade..9c70833 100644
--- a/java/com/google/gerrit/server/restapi/group/PutName.java
+++ b/java/com/google/gerrit/server/restapi/group/PutName.java
@@ -47,8 +47,12 @@
@Override
public Response<String> apply(GroupResource rsrc, NameInput input)
- throws NotInternalGroupException, AuthException, BadRequestException,
- ResourceConflictException, ResourceNotFoundException, IOException,
+ throws NotInternalGroupException,
+ AuthException,
+ BadRequestException,
+ ResourceConflictException,
+ ResourceNotFoundException,
+ IOException,
ConfigInvalidException {
GroupDescription.Internal internalGroup =
rsrc.asInternalGroup().orElseThrow(NotInternalGroupException::new);
@@ -71,7 +75,9 @@
}
private void renameGroup(GroupDescription.Internal group, String newName)
- throws ResourceConflictException, ResourceNotFoundException, IOException,
+ throws ResourceConflictException,
+ ResourceNotFoundException,
+ IOException,
ConfigInvalidException {
AccountGroup.UUID groupUuid = group.getGroupUUID();
GroupDelta groupDelta = GroupDelta.builder().setName(AccountGroup.nameKey(newName)).build();
diff --git a/java/com/google/gerrit/server/restapi/group/PutOptions.java b/java/com/google/gerrit/server/restapi/group/PutOptions.java
index 926203f..753cde1 100644
--- a/java/com/google/gerrit/server/restapi/group/PutOptions.java
+++ b/java/com/google/gerrit/server/restapi/group/PutOptions.java
@@ -44,8 +44,12 @@
@Override
public Response<GroupOptionsInfo> apply(GroupResource resource, GroupOptionsInfo input)
- throws NotInternalGroupException, AuthException, BadRequestException,
- ResourceNotFoundException, IOException, ConfigInvalidException {
+ throws NotInternalGroupException,
+ AuthException,
+ BadRequestException,
+ ResourceNotFoundException,
+ IOException,
+ ConfigInvalidException {
GroupDescription.Internal internalGroup =
resource.asInternalGroup().orElseThrow(NotInternalGroupException::new);
if (!resource.getControl().isOwner()) {
diff --git a/java/com/google/gerrit/server/restapi/group/PutOwner.java b/java/com/google/gerrit/server/restapi/group/PutOwner.java
index 45acd68..e5d8d54 100644
--- a/java/com/google/gerrit/server/restapi/group/PutOwner.java
+++ b/java/com/google/gerrit/server/restapi/group/PutOwner.java
@@ -56,8 +56,13 @@
@Override
public Response<GroupInfo> apply(GroupResource resource, OwnerInput input)
- throws ResourceNotFoundException, NotInternalGroupException, AuthException,
- BadRequestException, UnprocessableEntityException, IOException, ConfigInvalidException,
+ throws ResourceNotFoundException,
+ NotInternalGroupException,
+ AuthException,
+ BadRequestException,
+ UnprocessableEntityException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
GroupDescription.Internal internalGroup =
resource.asInternalGroup().orElseThrow(NotInternalGroupException::new);
diff --git a/java/com/google/gerrit/server/restapi/project/CheckMergeability.java b/java/com/google/gerrit/server/restapi/project/CheckMergeability.java
index 4730318..dc4e6df 100644
--- a/java/com/google/gerrit/server/restapi/project/CheckMergeability.java
+++ b/java/com/google/gerrit/server/restapi/project/CheckMergeability.java
@@ -80,7 +80,9 @@
@Override
public Response<MergeableInfo> apply(BranchResource resource)
- throws IOException, BadRequestException, ResourceNotFoundException,
+ throws IOException,
+ BadRequestException,
+ ResourceNotFoundException,
ResourceConflictException {
if (!(submitType.equals(SubmitType.MERGE_ALWAYS)
|| submitType.equals(SubmitType.MERGE_IF_NECESSARY))) {
diff --git a/java/com/google/gerrit/server/restapi/project/CommitsIncludedInRefs.java b/java/com/google/gerrit/server/restapi/project/CommitsIncludedInRefs.java
index 05ec28e..8327412 100644
--- a/java/com/google/gerrit/server/restapi/project/CommitsIncludedInRefs.java
+++ b/java/com/google/gerrit/server/restapi/project/CommitsIncludedInRefs.java
@@ -72,8 +72,12 @@
@Override
public Response<Map<String, Set<String>>> apply(ProjectResource resource)
- throws ResourceConflictException, BadRequestException, IOException,
- PermissionBackendException, ResourceNotFoundException, AuthException {
+ throws ResourceConflictException,
+ BadRequestException,
+ IOException,
+ PermissionBackendException,
+ ResourceNotFoundException,
+ AuthException {
if (commits.isEmpty()) {
throw new BadRequestException("commit is required");
}
diff --git a/java/com/google/gerrit/server/restapi/project/CreateChange.java b/java/com/google/gerrit/server/restapi/project/CreateChange.java
index e30759d..d4b4dc2 100644
--- a/java/com/google/gerrit/server/restapi/project/CreateChange.java
+++ b/java/com/google/gerrit/server/restapi/project/CreateChange.java
@@ -54,8 +54,13 @@
@Override
public Response<ChangeInfo> apply(ProjectResource rsrc, ChangeInput input)
- throws PermissionBackendException, IOException, ConfigInvalidException,
- InvalidChangeOperationException, InvalidNameException, UpdateException, RestApiException {
+ throws PermissionBackendException,
+ IOException,
+ ConfigInvalidException,
+ InvalidChangeOperationException,
+ InvalidNameException,
+ UpdateException,
+ RestApiException {
if (!user.get().isIdentifiedUser()) {
throw new AuthException("Authentication required");
}
diff --git a/java/com/google/gerrit/server/restapi/project/CreateLabel.java b/java/com/google/gerrit/server/restapi/project/CreateLabel.java
index ad79a14..19d1ec0 100644
--- a/java/com/google/gerrit/server/restapi/project/CreateLabel.java
+++ b/java/com/google/gerrit/server/restapi/project/CreateLabel.java
@@ -75,8 +75,12 @@
@Override
public Response<LabelDefinitionInfo> apply(
ProjectResource rsrc, IdString id, LabelDefinitionInput input)
- throws AuthException, BadRequestException, ResourceConflictException,
- PermissionBackendException, IOException, ConfigInvalidException {
+ throws AuthException,
+ BadRequestException,
+ ResourceConflictException,
+ PermissionBackendException,
+ IOException,
+ ConfigInvalidException {
if (!user.get().isIdentifiedUser()) {
throw new AuthException("Authentication required");
}
diff --git a/java/com/google/gerrit/server/restapi/project/CreateProject.java b/java/com/google/gerrit/server/restapi/project/CreateProject.java
index 04819d8..24529fb 100644
--- a/java/com/google/gerrit/server/restapi/project/CreateProject.java
+++ b/java/com/google/gerrit/server/restapi/project/CreateProject.java
@@ -234,7 +234,8 @@
if (RefNames.isGerritRef(branch)) {
throw new ValidationException(
String.format(
- "Cannot create a project with branch %s. Branches in the Gerrit internal refs namespace are not allowed",
+ "Cannot create a project with branch %s. Branches in the Gerrit internal refs"
+ + " namespace are not allowed",
branch));
}
}
diff --git a/java/com/google/gerrit/server/restapi/project/DashboardsCollection.java b/java/com/google/gerrit/server/restapi/project/DashboardsCollection.java
index 455358a..fbcabac 100644
--- a/java/com/google/gerrit/server/restapi/project/DashboardsCollection.java
+++ b/java/com/google/gerrit/server/restapi/project/DashboardsCollection.java
@@ -127,8 +127,12 @@
private DashboardResource parse(
ProjectState parent, ProjectState current, CurrentUser user, DashboardInfo info)
- throws ResourceNotFoundException, IOException, AmbiguousObjectException,
- IncorrectObjectTypeException, ConfigInvalidException, PermissionBackendException,
+ throws ResourceNotFoundException,
+ IOException,
+ AmbiguousObjectException,
+ IncorrectObjectTypeException,
+ ConfigInvalidException,
+ PermissionBackendException,
ResourceConflictException {
String ref = normalizeDashboardRef(info.ref);
try {
diff --git a/java/com/google/gerrit/server/restapi/project/DeleteLabel.java b/java/com/google/gerrit/server/restapi/project/DeleteLabel.java
index 8a1927a..498b09a 100644
--- a/java/com/google/gerrit/server/restapi/project/DeleteLabel.java
+++ b/java/com/google/gerrit/server/restapi/project/DeleteLabel.java
@@ -59,7 +59,10 @@
@Override
public Response<?> apply(LabelResource rsrc, InputWithCommitMessage input)
- throws AuthException, ResourceNotFoundException, PermissionBackendException, IOException,
+ throws AuthException,
+ ResourceNotFoundException,
+ PermissionBackendException,
+ IOException,
ConfigInvalidException {
if (!user.get().isIdentifiedUser()) {
throw new AuthException("Authentication required");
diff --git a/java/com/google/gerrit/server/restapi/project/GetAccess.java b/java/com/google/gerrit/server/restapi/project/GetAccess.java
index e1a3c0c..6bae8f71 100644
--- a/java/com/google/gerrit/server/restapi/project/GetAccess.java
+++ b/java/com/google/gerrit/server/restapi/project/GetAccess.java
@@ -127,7 +127,9 @@
@Override
public Response<ProjectAccessInfo> apply(ProjectResource rsrc)
- throws ResourceNotFoundException, ResourceConflictException, IOException,
+ throws ResourceNotFoundException,
+ ResourceConflictException,
+ IOException,
PermissionBackendException {
// Load the current configuration from the repository, ensuring it's the most
// recent version available. If it differs from what was in the project
diff --git a/java/com/google/gerrit/server/restapi/project/PostLabels.java b/java/com/google/gerrit/server/restapi/project/PostLabels.java
index 6cb912e..d20b14b 100644
--- a/java/com/google/gerrit/server/restapi/project/PostLabels.java
+++ b/java/com/google/gerrit/server/restapi/project/PostLabels.java
@@ -75,8 +75,13 @@
@Override
public Response<?> apply(ProjectResource rsrc, BatchLabelInput input)
- throws AuthException, UnprocessableEntityException, PermissionBackendException, IOException,
- ConfigInvalidException, BadRequestException, ResourceConflictException {
+ throws AuthException,
+ UnprocessableEntityException,
+ PermissionBackendException,
+ IOException,
+ ConfigInvalidException,
+ BadRequestException,
+ ResourceConflictException {
if (!user.get().isIdentifiedUser()) {
throw new AuthException("Authentication required");
}
diff --git a/java/com/google/gerrit/server/restapi/project/PutConfig.java b/java/com/google/gerrit/server/restapi/project/PutConfig.java
index d4b30c2..fd5d1e1 100644
--- a/java/com/google/gerrit/server/restapi/project/PutConfig.java
+++ b/java/com/google/gerrit/server/restapi/project/PutConfig.java
@@ -254,7 +254,7 @@
value,
v.getKey()));
}
- // $FALL-THROUGH$
+ // $FALL-THROUGH$
case STRING:
String valueToSet = value;
projectConfig.updatePluginConfig(
diff --git a/java/com/google/gerrit/server/restapi/project/PutDescription.java b/java/com/google/gerrit/server/restapi/project/PutDescription.java
index ec42035..761c2c8 100644
--- a/java/com/google/gerrit/server/restapi/project/PutDescription.java
+++ b/java/com/google/gerrit/server/restapi/project/PutDescription.java
@@ -58,7 +58,10 @@
@Override
public Response<String> apply(ProjectResource resource, DescriptionInput input)
- throws AuthException, ResourceConflictException, ResourceNotFoundException, IOException,
+ throws AuthException,
+ ResourceConflictException,
+ ResourceNotFoundException,
+ IOException,
PermissionBackendException {
if (input == null) {
input = new DescriptionInput(); // Delete would set description to null.
diff --git a/java/com/google/gerrit/server/restapi/project/SetAccessUtil.java b/java/com/google/gerrit/server/restapi/project/SetAccessUtil.java
index 547a214..418139f 100644
--- a/java/com/google/gerrit/server/restapi/project/SetAccessUtil.java
+++ b/java/com/google/gerrit/server/restapi/project/SetAccessUtil.java
@@ -237,7 +237,9 @@
Project.NameKey projectName,
Project.NameKey newParentProjectName,
boolean checkAdmin)
- throws ResourceConflictException, AuthException, PermissionBackendException,
+ throws ResourceConflictException,
+ AuthException,
+ PermissionBackendException,
BadRequestException {
if (newParentProjectName != null
&& !config.getProject().getNameKey().equals(allProjects)
diff --git a/java/com/google/gerrit/server/restapi/project/SetHead.java b/java/com/google/gerrit/server/restapi/project/SetHead.java
index ae70e46..23a819d 100644
--- a/java/com/google/gerrit/server/restapi/project/SetHead.java
+++ b/java/com/google/gerrit/server/restapi/project/SetHead.java
@@ -66,8 +66,12 @@
@Override
public Response<String> apply(ProjectResource rsrc, HeadInput input)
- throws AuthException, ResourceNotFoundException, BadRequestException,
- UnprocessableEntityException, IOException, PermissionBackendException {
+ throws AuthException,
+ ResourceNotFoundException,
+ BadRequestException,
+ UnprocessableEntityException,
+ IOException,
+ PermissionBackendException {
if (input == null || Strings.isNullOrEmpty(input.ref)) {
throw new BadRequestException("ref required");
}
diff --git a/java/com/google/gerrit/server/restapi/project/SetLabel.java b/java/com/google/gerrit/server/restapi/project/SetLabel.java
index 6c4976d..37e2d40 100644
--- a/java/com/google/gerrit/server/restapi/project/SetLabel.java
+++ b/java/com/google/gerrit/server/restapi/project/SetLabel.java
@@ -68,8 +68,12 @@
@Override
public Response<LabelDefinitionInfo> apply(LabelResource rsrc, LabelDefinitionInput input)
- throws AuthException, BadRequestException, ResourceConflictException,
- PermissionBackendException, IOException, ConfigInvalidException {
+ throws AuthException,
+ BadRequestException,
+ ResourceConflictException,
+ PermissionBackendException,
+ IOException,
+ ConfigInvalidException {
if (!user.get().isIdentifiedUser()) {
throw new AuthException("Authentication required");
}
diff --git a/java/com/google/gerrit/server/restapi/project/SetParent.java b/java/com/google/gerrit/server/restapi/project/SetParent.java
index ef31dc5..599dfb1 100644
--- a/java/com/google/gerrit/server/restapi/project/SetParent.java
+++ b/java/com/google/gerrit/server/restapi/project/SetParent.java
@@ -87,15 +87,23 @@
@Override
public Response<String> apply(ProjectResource rsrc, ParentInput input)
- throws AuthException, ResourceConflictException, ResourceNotFoundException,
- UnprocessableEntityException, IOException, PermissionBackendException,
+ throws AuthException,
+ ResourceConflictException,
+ ResourceNotFoundException,
+ UnprocessableEntityException,
+ IOException,
+ PermissionBackendException,
BadRequestException {
return Response.ok(apply(rsrc, input, true));
}
public String apply(ProjectResource rsrc, ParentInput input, boolean checkIfAdmin)
- throws AuthException, ResourceConflictException, ResourceNotFoundException,
- UnprocessableEntityException, IOException, PermissionBackendException,
+ throws AuthException,
+ ResourceConflictException,
+ ResourceNotFoundException,
+ UnprocessableEntityException,
+ IOException,
+ PermissionBackendException,
BadRequestException {
IdentifiedUser user = rsrc.getUser().asIdentifiedUser();
String parentName =
@@ -129,8 +137,11 @@
public void validateParentUpdate(
Project.NameKey project, IdentifiedUser user, String newParent, boolean checkIfAdmin)
- throws AuthException, ResourceConflictException, UnprocessableEntityException,
- PermissionBackendException, BadRequestException {
+ throws AuthException,
+ ResourceConflictException,
+ UnprocessableEntityException,
+ PermissionBackendException,
+ BadRequestException {
if (checkIfAdmin) {
if (allowProjectOwnersToChangeParent) {
permissionBackend.user(user).project(project).check(ProjectPermission.WRITE_CONFIG);
diff --git a/java/com/google/gerrit/server/rules/prolog/StoredValue.java b/java/com/google/gerrit/server/rules/prolog/StoredValue.java
index e06ddde..d70885c 100644
--- a/java/com/google/gerrit/server/rules/prolog/StoredValue.java
+++ b/java/com/google/gerrit/server/rules/prolog/StoredValue.java
@@ -54,6 +54,7 @@
public T getOrNull(Prolog engine) {
return get((PrologEnvironment) engine.control);
}
+
/** Get the value from the engine, or throw SystemException. */
public T get(Prolog engine) {
T obj = getOrNull(engine);
diff --git a/java/com/google/gerrit/server/schema/NoteDbSchemaVersionCheck.java b/java/com/google/gerrit/server/schema/NoteDbSchemaVersionCheck.java
index 0360ec0..d62341a 100644
--- a/java/com/google/gerrit/server/schema/NoteDbSchemaVersionCheck.java
+++ b/java/com/google/gerrit/server/schema/NoteDbSchemaVersionCheck.java
@@ -67,12 +67,13 @@
if (current > expected
&& gerritConfig.getBoolean("gerrit", "experimentalRollingUpgrade", false)) {
logger.atWarning().log(
- "Gerrit has detected refs/meta/version %d different than the expected %d."
- + "Bear in mind that this is supported ONLY for rolling upgrades to immediate next "
- + "Gerrit version (e.g. v3.1 to v3.2). If this is not expected, remove gerrit.experimentalRollingUpgrade "
- + "from $GERRIT_SITE/etc/gerrit.config and restart Gerrit."
- + "Please note that gerrit.experimentalRollingUpgrade is intended to be used "
- + "for the rolling upgrade phase only and should be disabled afterwards.",
+ "Gerrit has detected refs/meta/version %d different than the expected %d.Bear in mind"
+ + " that this is supported ONLY for rolling upgrades to immediate next Gerrit"
+ + " version (e.g. v3.1 to v3.2). If this is not expected, remove"
+ + " gerrit.experimentalRollingUpgrade from $GERRIT_SITE/etc/gerrit.config and"
+ + " restart Gerrit.Please note that gerrit.experimentalRollingUpgrade is intended"
+ + " to be used for the rolling upgrade phase only and should be disabled"
+ + " afterwards.",
current, expected);
} else if (current != expected) {
String advice =
diff --git a/java/com/google/gerrit/server/submit/ChangeAlreadyMergedException.java b/java/com/google/gerrit/server/submit/ChangeAlreadyMergedException.java
index b4d3a4d..3e7a498 100644
--- a/java/com/google/gerrit/server/submit/ChangeAlreadyMergedException.java
+++ b/java/com/google/gerrit/server/submit/ChangeAlreadyMergedException.java
@@ -18,7 +18,9 @@
public class ChangeAlreadyMergedException extends MergeIdenticalTreeException {
private static final long serialVersionUID = 1L;
- /** @param msg message to return to the client describing the error. */
+ /**
+ * @param msg message to return to the client describing the error.
+ */
public ChangeAlreadyMergedException(String msg) {
super(msg);
}
diff --git a/java/com/google/gerrit/server/submit/MergeIdenticalTreeException.java b/java/com/google/gerrit/server/submit/MergeIdenticalTreeException.java
index d063046..3e78e8d 100644
--- a/java/com/google/gerrit/server/submit/MergeIdenticalTreeException.java
+++ b/java/com/google/gerrit/server/submit/MergeIdenticalTreeException.java
@@ -23,7 +23,9 @@
public class MergeIdenticalTreeException extends ResourceConflictException {
private static final long serialVersionUID = 1L;
- /** @param msg message to return to the client describing the error. */
+ /**
+ * @param msg message to return to the client describing the error.
+ */
public MergeIdenticalTreeException(String msg) {
super(msg);
}
diff --git a/java/com/google/gerrit/server/submit/RebaseSubmitStrategy.java b/java/com/google/gerrit/server/submit/RebaseSubmitStrategy.java
index 87de810..d8f8032 100644
--- a/java/com/google/gerrit/server/submit/RebaseSubmitStrategy.java
+++ b/java/com/google/gerrit/server/submit/RebaseSubmitStrategy.java
@@ -143,7 +143,9 @@
@Override
public void updateRepoImpl(RepoContext ctx)
- throws InvalidChangeOperationException, RestApiException, IOException,
+ throws InvalidChangeOperationException,
+ RestApiException,
+ IOException,
PermissionBackendException {
if (args.mergeUtil.canFastForward(
args.mergeSorter, args.mergeTip.getCurrentTip(), args.rw, toMerge)) {
@@ -218,7 +220,7 @@
args.project.is(BooleanProjectConfig.MATCH_AUTHOR_TO_COMMITTER_DATE))
// The votes are automatically copied and they don't count as copied votes. See
// method's javadoc.
- .setStoreCopiedVotes(/* storeCopiedVotes = */ false);
+ .setStoreCopiedVotes(/* storeCopiedVotes= */ false);
try {
rebaseOp.updateRepo(ctx);
} catch (MergeConflictException | NoSuchChangeException e) {
diff --git a/java/com/google/gerrit/server/submit/SubmitStrategyOp.java b/java/com/google/gerrit/server/submit/SubmitStrategyOp.java
index 96dc326..2a36bac 100644
--- a/java/com/google/gerrit/server/submit/SubmitStrategyOp.java
+++ b/java/com/google/gerrit/server/submit/SubmitStrategyOp.java
@@ -396,7 +396,9 @@
}
private String message(ChangeContext ctx, CodeReviewCommit commit, CommitMergeStatus s)
- throws AuthException, IOException, PermissionBackendException,
+ throws AuthException,
+ IOException,
+ PermissionBackendException,
InvalidChangeOperationException {
requireNonNull(s, "CommitMergeStatus may not be null");
String txt = s.getDescription();
@@ -438,7 +440,9 @@
}
private String message(ChangeContext ctx, String body)
- throws AuthException, IOException, PermissionBackendException,
+ throws AuthException,
+ IOException,
+ PermissionBackendException,
InvalidChangeOperationException {
stickyApprovalDiff = args.submitWithStickyApprovalDiff.apply(ctx.getNotes(), ctx.getUser());
return body + stickyApprovalDiff;
diff --git a/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java b/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java
index 92f5488..635e088 100644
--- a/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java
+++ b/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java
@@ -34,7 +34,9 @@
this.threadLocal = threadLocal;
}
- /** @see RequestScopePropagator#wrap(Callable) */
+ /**
+ * @see RequestScopePropagator#wrap(Callable)
+ */
@Override
protected final <T> Callable<T> wrapImpl(Callable<T> callable) {
C ctx = continuingContext(requireContext());
diff --git a/java/com/google/gerrit/sshd/ChannelIdTrackingUnknownChannelReferenceHandler.java b/java/com/google/gerrit/sshd/ChannelIdTrackingUnknownChannelReferenceHandler.java
index b9ca79c..9bd8e32 100644
--- a/java/com/google/gerrit/sshd/ChannelIdTrackingUnknownChannelReferenceHandler.java
+++ b/java/com/google/gerrit/sshd/ChannelIdTrackingUnknownChannelReferenceHandler.java
@@ -72,7 +72,8 @@
if ((lastTracked != null) && (channelId <= lastTracked.intValue())) {
// Use TRACE level in order to avoid messages flooding
logger.atFinest().log(
- "handleUnknownChannelCommand(%s) apply default handling for %s on channel=%s (lastTracked=%s)",
+ "handleUnknownChannelCommand(%s) apply default handling for %s on channel=%s"
+ + " (lastTracked=%s)",
session, SshConstants.getCommandMessageName(cmd), channelId, lastTracked);
return super.handleUnknownChannelCommand(service, cmd, channelId, buffer);
}
diff --git a/java/com/google/gerrit/sshd/HostKeyProvider.java b/java/com/google/gerrit/sshd/HostKeyProvider.java
index 0e9b46b..73c7356 100644
--- a/java/com/google/gerrit/sshd/HostKeyProvider.java
+++ b/java/com/google/gerrit/sshd/HostKeyProvider.java
@@ -69,8 +69,8 @@
p.setAlgorithm(KeyUtils.RSA_ALGORITHM);
p.setPath(objKey.toAbsolutePath());
logger.atWarning().log(
- "Defaulting to RSA algorithm for SSH key exchange."
- + "This is a weak security setting, consider changing it (see 'sshd.kex' documentation section).");
+ "Defaulting to RSA algorithm for SSH key exchange.This is a weak security setting,"
+ + " consider changing it (see 'sshd.kex' documentation section).");
return p;
}
// Both formats of host key exist, we don't know which format
diff --git a/java/com/google/gerrit/sshd/SshPluginStarterCallback.java b/java/com/google/gerrit/sshd/SshPluginStarterCallback.java
index f807b19..1a167fc 100644
--- a/java/com/google/gerrit/sshd/SshPluginStarterCallback.java
+++ b/java/com/google/gerrit/sshd/SshPluginStarterCallback.java
@@ -71,7 +71,8 @@
} catch (RuntimeException err) {
if (!providesDynamicOptions(plugin) && !providesCommandInterceptor(plugin)) {
logger.atWarning().withCause(err).log(
- "Plugin %s did not define its top-level command, any DynamicOptions, nor any Ssh*CommandInterceptors",
+ "Plugin %s did not define its top-level command, any DynamicOptions, nor any"
+ + " Ssh*CommandInterceptors",
plugin.getName());
}
}
diff --git a/java/com/google/gerrit/sshd/commands/BaseTestPrologCommand.java b/java/com/google/gerrit/sshd/commands/BaseTestPrologCommand.java
index ad8e20d..bf3028d 100644
--- a/java/com/google/gerrit/sshd/commands/BaseTestPrologCommand.java
+++ b/java/com/google/gerrit/sshd/commands/BaseTestPrologCommand.java
@@ -44,7 +44,8 @@
@Option(
name = "-s",
usage =
- "Read prolog script from stdin instead of reading rules.pl from the refs/meta/config branch")
+ "Read prolog script from stdin instead of reading rules.pl from the refs/meta/config"
+ + " branch")
protected boolean useStdin;
@Option(
diff --git a/java/com/google/gerrit/sshd/commands/SetAccountCommand.java b/java/com/google/gerrit/sshd/commands/SetAccountCommand.java
index 0c286ca..6d1f076 100644
--- a/java/com/google/gerrit/sshd/commands/SetAccountCommand.java
+++ b/java/com/google/gerrit/sshd/commands/SetAccountCommand.java
@@ -183,12 +183,14 @@
if (!user.hasSameAccountId(userProvider.get()) && !canModifyAccount) {
throw die(
- "Setting another user's account information requries 'modify account' or 'administrate server' capabilities.");
+ "Setting another user's account information requries 'modify account' or 'administrate"
+ + " server' capabilities.");
}
if (active || inactive) {
if (!canModifyAccount) {
throw die(
- "--active and --inactive require 'modify account' or 'administrate server' capabilities.");
+ "--active and --inactive require 'modify account' or 'administrate server'"
+ + " capabilities.");
}
if (active && inactive) {
throw die("--active and --inactive options are mutually exclusive.");
@@ -319,14 +321,20 @@
}
private void deleteSshKey(SshKeyInfo i)
- throws AuthException, RepositoryNotFoundException, IOException, ConfigInvalidException,
+ throws AuthException,
+ RepositoryNotFoundException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
AccountSshKey sshKey = AccountSshKey.create(user.getAccountId(), i.seq, i.sshPublicKey);
deleteSshKey.apply(new AccountResource.SshKey(user.asIdentifiedUser(), sshKey), null);
}
private void addEmail(String email)
- throws UnloggedFailure, RestApiException, IOException, ConfigInvalidException,
+ throws UnloggedFailure,
+ RestApiException,
+ IOException,
+ ConfigInvalidException,
PermissionBackendException {
EmailInput in = new EmailInput();
in.email = email;
diff --git a/java/com/google/gerrit/sshd/commands/UploadArchive.java b/java/com/google/gerrit/sshd/commands/UploadArchive.java
index c1f4a7b..8bcda6f 100644
--- a/java/com/google/gerrit/sshd/commands/UploadArchive.java
+++ b/java/com/google/gerrit/sshd/commands/UploadArchive.java
@@ -76,9 +76,9 @@
@Option(
name = "--compression-level",
usage =
- "Controls compression for different formats. The value is in [0-9] with 0 for fast levels"
- + " with medium compressions, and 9 for the highest compression. Note that higher"
- + " compressions require more memory.")
+ "Controls compression for different formats. The value is in [0-9] with 0 for fast"
+ + " levels with medium compressions, and 9 for the highest compression. Note that"
+ + " higher compressions require more memory.")
private int compressionLevel = -1;
@Option(name = "-0", usage = "Store the files instead of deflating them.")
diff --git a/java/com/google/gerrit/testing/InMemoryRepositoryManager.java b/java/com/google/gerrit/testing/InMemoryRepositoryManager.java
index 8c87405..b227d31 100644
--- a/java/com/google/gerrit/testing/InMemoryRepositoryManager.java
+++ b/java/com/google/gerrit/testing/InMemoryRepositoryManager.java
@@ -156,7 +156,8 @@
checkState(
allowedRefUpdateTypes.get().stream().anyMatch(RefUpdateContext::hasOpen)
|| isTestRepoCall(),
- "Special ref '%s' is updated outside of the expected operation. Wrap code in the correct RefUpdateContext or fix allowed update types",
+ "Special ref '%s' is updated outside of the expected operation. Wrap code in the"
+ + " correct RefUpdateContext or fix allowed update types",
refName);
return;
}
@@ -168,7 +169,8 @@
// Plugin can update any ref
|| RefUpdateContext.hasOpen(PLUGIN)
|| isTestRepoCall(),
- "Ordinary ref '%s' is updated outside of the expected operation. Wrap code in the correct RefUpdateContext or add the ref as a special ref.",
+ "Ordinary ref '%s' is updated outside of the expected operation. Wrap code in the"
+ + " correct RefUpdateContext or add the ref as a special ref.",
refName);
}
@@ -188,7 +190,8 @@
.collect(toList());
checkState(
allowedTypes.size() <= 1,
- "refName matches more than 1 predicate. Please fix the specialRefs list, so each reference has no more than one match.");
+ "refName matches more than 1 predicate. Please fix the specialRefs list, so each"
+ + " reference has no more than one match.");
if (allowedTypes.size() == 0) {
return Optional.empty();
}
diff --git a/javatests/com/google/gerrit/acceptance/api/change/RebaseChainOnBehalfOfUploaderIT.java b/javatests/com/google/gerrit/acceptance/api/change/RebaseChainOnBehalfOfUploaderIT.java
index 297579c..065e1bf 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/RebaseChainOnBehalfOfUploaderIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/RebaseChainOnBehalfOfUploaderIT.java
@@ -751,7 +751,8 @@
.hasMessageThat()
.isEqualTo(
String.format(
- "change %s: author of patch set 1 is forged and the uploader %s cannot forge author",
+ "change %s: author of patch set 1 is forged and the uploader %s cannot forge"
+ + " author",
changeToBeRebased1, uploaderEmail));
}
@@ -930,8 +931,8 @@
.hasMessageThat()
.isEqualTo(
String.format(
- "change %s: author of patch set 1 is the server identity and the uploader %s cannot forge"
- + " the server identity",
+ "change %s: author of patch set 1 is the server identity and the uploader %s cannot"
+ + " forge the server identity",
changeToBeRebased1, uploaderEmail));
}
@@ -1416,8 +1417,11 @@
private void assertRealUserForChangeUpdate(
Change.Id changeId, @Nullable Account.Id expectedRealUser) {
Optional<FooterLine> realUserFooter =
- projectOperations.project(project).getHead(RefNames.changeMetaRef(changeId))
- .getFooterLines().stream()
+ projectOperations
+ .project(project)
+ .getHead(RefNames.changeMetaRef(changeId))
+ .getFooterLines()
+ .stream()
.filter(footerLine -> footerLine.matches(FOOTER_REAL_USER))
.findFirst();
diff --git a/javatests/com/google/gerrit/acceptance/api/change/RebaseOnBehalfOfUploaderIT.java b/javatests/com/google/gerrit/acceptance/api/change/RebaseOnBehalfOfUploaderIT.java
index 319c0cd..7ce3368 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/RebaseOnBehalfOfUploaderIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/RebaseOnBehalfOfUploaderIT.java
@@ -324,8 +324,11 @@
// Verify that the rebaser was recorded as realUser in NoteDb.
Optional<FooterLine> realUserFooter =
- projectOperations.project(project).getHead(RefNames.changeMetaRef(changeToBeRebased))
- .getFooterLines().stream()
+ projectOperations
+ .project(project)
+ .getHead(RefNames.changeMetaRef(changeToBeRebased))
+ .getFooterLines()
+ .stream()
.filter(footerLine -> footerLine.matches(FOOTER_REAL_USER))
.findFirst();
assertThat(realUserFooter.map(FooterLine::getValue))
@@ -822,7 +825,8 @@
.hasMessageThat()
.isEqualTo(
String.format(
- "change %s: author of patch set 1 is forged and the uploader %s cannot forge author",
+ "change %s: author of patch set 1 is forged and the uploader %s cannot forge"
+ + " author",
changeToBeRebased, uploaderEmail));
}
@@ -968,8 +972,8 @@
.hasMessageThat()
.isEqualTo(
String.format(
- "change %s: author of patch set 1 is the server identity and the uploader %s cannot forge"
- + " the server identity",
+ "change %s: author of patch set 1 is the server identity and the uploader %s cannot"
+ + " forge the server identity",
changeToBeRebased, uploaderEmail));
}
diff --git a/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java b/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
index c8f361e..4a8dbf3 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
@@ -1874,7 +1874,8 @@
"build-cop-override",
Status.SATISFIED,
/* isLegacy= */ false,
- /* submittabilityCondition= */ "label:build-cop-override=MAX -label:build-cop-override=MIN");
+ /* submittabilityCondition= */ "label:build-cop-override=MAX"
+ + " -label:build-cop-override=MIN");
assertThat(change.submittable).isTrue();
// Merge the change. Submit requirements are still the same.
@@ -1888,7 +1889,8 @@
"build-cop-override",
Status.SATISFIED,
/* isLegacy= */ false,
- /* submittabilityCondition= */ "label:build-cop-override=MAX -label:build-cop-override=MIN");
+ /* submittabilityCondition= */ "label:build-cop-override=MAX"
+ + " -label:build-cop-override=MIN");
}
@Test
@@ -1935,7 +1937,8 @@
Status.SATISFIED,
/* isLegacy= */ true,
// MAX_WITH_BLOCK function was translated to a submittability expression.
- /* submittabilityCondition= */ "label:build-cop-override=MAX -label:build-cop-override=MIN");
+ /* submittabilityCondition= */ "label:build-cop-override=MAX"
+ + " -label:build-cop-override=MIN");
assertSubmitRequirementStatus(
change.submitRequirements,
"build-cop-override",
@@ -2645,9 +2648,10 @@
public void legacySubmitRequirementDuplicatesGlobal_statusMatches_globalReturned()
throws Exception {
// The behaviour does not depend on AllowOverrideInChildProject in global submit requirement.
- testLegacySubmitRequirementDuplicatesGlobalStatusMatches(/*allowOverrideInChildProject=*/ true);
testLegacySubmitRequirementDuplicatesGlobalStatusMatches(
- /*allowOverrideInChildProject=*/ false);
+ /* allowOverrideInChildProject= */ true);
+ testLegacySubmitRequirementDuplicatesGlobalStatusMatches(
+ /* allowOverrideInChildProject= */ false);
}
private void testLegacySubmitRequirementDuplicatesGlobalStatusMatches(
@@ -2718,9 +2722,9 @@
throws Exception {
// The behaviour does not depend on AllowOverrideInChildProject in global submit requirement.
testLegacySubmitRequirementDuplicatesGlobalStatusDoesNotMatch(
- /*allowOverrideInChildProject=*/ true);
+ /* allowOverrideInChildProject= */ true);
testLegacySubmitRequirementDuplicatesGlobalStatusDoesNotMatch(
- /*allowOverrideInChildProject=*/ false);
+ /* allowOverrideInChildProject= */ false);
}
private void testLegacySubmitRequirementDuplicatesGlobalStatusDoesNotMatch(
@@ -2943,9 +2947,9 @@
ChangeInfo changeInfo = gApi.changes().id(r1.getChangeId()).get();
assertThat(changeInfo.submitRequirements).hasSize(2);
assertSubmitRequirementStatus(
- changeInfo.submitRequirements, "Code-Review", Status.UNSATISFIED, /* isLegacy = */ false);
+ changeInfo.submitRequirements, "Code-Review", Status.UNSATISFIED, /* isLegacy= */ false);
assertSubmitRequirementStatus(
- changeInfo.submitRequirements, "Code-Review", Status.SATISFIED, /* isLegacy = */ true);
+ changeInfo.submitRequirements, "Code-Review", Status.SATISFIED, /* isLegacy= */ true);
requestScopeOperations.setApiUser(user.id());
try (AutoCloseable ignored = disableNoteDb()) {
@@ -2964,12 +2968,12 @@
changeInfos.get(0).submitRequirements,
"Code-Review",
Status.UNSATISFIED,
- /* isLegacy = */ false);
+ /* isLegacy= */ false);
assertSubmitRequirementStatus(
changeInfos.get(0).submitRequirements,
"Code-Review",
Status.SATISFIED,
- /* isLegacy = */ true);
+ /* isLegacy= */ true);
}
}
diff --git a/javatests/com/google/gerrit/acceptance/api/change/SubmitWithStickyApprovalDiffIT.java b/javatests/com/google/gerrit/acceptance/api/change/SubmitWithStickyApprovalDiffIT.java
index b0d39d5..34e521c 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/SubmitWithStickyApprovalDiffIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/SubmitWithStickyApprovalDiffIT.java
@@ -652,8 +652,7 @@
oldFileName,
/* file2= */ null,
/* insertions2= */ 0,
- /* deletions2 =
- */ 0,
+ /* deletions2= */ 0,
/* expectedFileDiff2= */ null,
/* oldFileName2= */ null);
}
diff --git a/javatests/com/google/gerrit/acceptance/api/project/CheckAccessIT.java b/javatests/com/google/gerrit/acceptance/api/project/CheckAccessIT.java
index 27193dd..f02c900 100644
--- a/javatests/com/google/gerrit/acceptance/api/project/CheckAccessIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/project/CheckAccessIT.java
@@ -286,7 +286,8 @@
+ "')",
"'user1' cannot perform 'read' with force=false on project '"
+ secretRefProject.get()
- + "' for ref 'refs/heads/secret/master' because this permission is blocked")),
+ + "' for ref 'refs/heads/secret/master' because this permission is"
+ + " blocked")),
// Test 5
TestCase.projectRef(
privilegedUser.email(),
@@ -353,7 +354,8 @@
+ "' for ref 'refs/heads/*' (allowed for group '"
+ SystemGroupBackend.ANONYMOUS_USERS.get()
+ "' by rule 'group Anonymous Users')",
- "'privilegedUser' can perform 'viewPrivateChanges' with force=false on project '"
+ "'privilegedUser' can perform 'viewPrivateChanges' with force=false on project"
+ + " '"
+ normalProject.get()
+ "' for ref 'refs/heads/master' (allowed for group '"
+ privilegedGroupUuid.get()
@@ -375,7 +377,8 @@
+ "' for ref 'refs/heads/*' (allowed for group '"
+ SystemGroupBackend.ANONYMOUS_USERS.get()
+ "' by rule 'group Anonymous Users')",
- "'privilegedUser' can perform 'forgeServerAsCommitter' with force=false on project '"
+ "'privilegedUser' can perform 'forgeServerAsCommitter' with force=false on"
+ + " project '"
+ normalProject.get()
+ "' for ref 'refs/heads/master' (allowed for group '"
+ privilegedGroupUuid.get()
diff --git a/javatests/com/google/gerrit/acceptance/api/project/CommitIT.java b/javatests/com/google/gerrit/acceptance/api/project/CommitIT.java
index 41d50a6..0919086 100644
--- a/javatests/com/google/gerrit/acceptance/api/project/CommitIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/project/CommitIT.java
@@ -314,7 +314,9 @@
input.destination = destBranch;
input.message =
String.format(
- "it goes to foo branch\n\nChange-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef\n\nChange-Id: %s\n",
+ "it goes to foo branch\n\n"
+ + "Change-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef\n\n"
+ + "Change-Id: %s\n",
changeId);
ChangeInfo cherryPickResult =
@@ -356,7 +358,9 @@
input.destination = destBranch;
input.message =
String.format(
- "it goes to foo branch\n\nChange-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef\n\nChange-Id: %s\n",
+ "it goes to foo branch\n\n"
+ + "Change-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef\n\n"
+ + "Change-Id: %s\n",
existingDestChange.changeId);
input.allowConflicts = true;
input.allowEmpty = true;
diff --git a/javatests/com/google/gerrit/acceptance/git/PushPermissionsIT.java b/javatests/com/google/gerrit/acceptance/git/PushPermissionsIT.java
index f94aa12..fb7a43f 100644
--- a/javatests/com/google/gerrit/acceptance/git/PushPermissionsIT.java
+++ b/javatests/com/google/gerrit/acceptance/git/PushPermissionsIT.java
@@ -130,7 +130,8 @@
assertThat(r)
.hasMessages(
"error: branch refs/heads/master:",
- "Push to refs/for/master to create a review, or get 'Push' rights to update the branch.",
+ "Push to refs/for/master to create a review, or get 'Push' rights to update the"
+ + " branch.",
"User: admin",
"Contact an administrator to fix the permissions");
assertThat(r).hasProcessed(ImmutableMap.of("refs", 1));
@@ -210,7 +211,8 @@
"You need 'Delete Reference' rights or 'Push' rights with the ",
"'Force Push' flag set to delete references.",
"error: branch refs/heads/master:",
- "Push to refs/for/master to create a review, or get 'Push' rights to update the branch.",
+ "Push to refs/for/master to create a review, or get 'Push' rights to update the"
+ + " branch.",
"User: admin",
"Contact an administrator to fix the permissions");
}
diff --git a/javatests/com/google/gerrit/acceptance/pgm/MigrateLabelConfigToCopyConditionIT.java b/javatests/com/google/gerrit/acceptance/pgm/MigrateLabelConfigToCopyConditionIT.java
index eec2811..eaacf6a 100644
--- a/javatests/com/google/gerrit/acceptance/pgm/MigrateLabelConfigToCopyConditionIT.java
+++ b/javatests/com/google/gerrit/acceptance/pgm/MigrateLabelConfigToCopyConditionIT.java
@@ -429,7 +429,8 @@
assertDeprecatedFieldsUnset(LabelId.CODE_REVIEW);
assertThat(getCopyConditionOfCodeReviewLabel())
.isEqualTo(
- "(is:ANY AND (changekind:TRIVIAL_REBASE OR changekind:NO_CODE_CHANGE)) OR changekind:TRIVIAL_REBASE OR is:ANY");
+ "(is:ANY AND (changekind:TRIVIAL_REBASE OR changekind:NO_CODE_CHANGE)) OR"
+ + " changekind:TRIVIAL_REBASE OR is:ANY");
}
@Test
diff --git a/javatests/com/google/gerrit/acceptance/pgm/MigrateLabelFunctionsToSubmitRequirementIT.java b/javatests/com/google/gerrit/acceptance/pgm/MigrateLabelFunctionsToSubmitRequirementIT.java
index 9d37497..6df7b83 100644
--- a/javatests/com/google/gerrit/acceptance/pgm/MigrateLabelFunctionsToSubmitRequirementIT.java
+++ b/javatests/com/google/gerrit/acceptance/pgm/MigrateLabelFunctionsToSubmitRequirementIT.java
@@ -50,7 +50,7 @@
@Test
public void migrateBlockingLabel_maxWithBlock() throws Exception {
createLabel("Foo", "MaxWithBlock", /* ignoreSelfApproval= */ false);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -67,7 +67,7 @@
@Test
public void migrateBlockingLabel_maxNoBlock() throws Exception {
createLabel("Foo", "MaxNoBlock", /* ignoreSelfApproval= */ false);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -84,7 +84,7 @@
@Test
public void migrateBlockingLabel_anyWithBlock() throws Exception {
createLabel("Foo", "AnyWithBlock", /* ignoreSelfApproval= */ false);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -101,7 +101,7 @@
@Test
public void migrateBlockingLabel_maxWithBlock_withIgnoreSelfApproval() throws Exception {
createLabel("Foo", "MaxWithBlock", /* ignoreSelfApproval= */ true);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -118,7 +118,7 @@
@Test
public void migrateBlockingLabel_maxNoBlock_withIgnoreSelfApproval() throws Exception {
createLabel("Foo", "MaxNoBlock", /* ignoreSelfApproval= */ true);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -137,7 +137,7 @@
// NoBlock labels are left as is, i.e. we don't create a "submit requirement" for them. Those
// labels will then be treated as trigger votes in the change page.
createLabel("Foo", "NoBlock", /* ignoreSelfApproval= */ false);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.NO_CHANGE);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(0);
@@ -154,7 +154,7 @@
// NoOp labels are left as is, i.e. we don't create a "submit requirement" for them. Those
// labels will then be treated as trigger votes in the change page.
createLabel("Foo", "NoOp", /* ignoreSelfApproval= */ false);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(0);
@@ -171,7 +171,7 @@
// Labels that have a single "zero" value are skipped in the project. The migrator creates
// non-applicable SR for these labels.
createLabel("Foo", "NoBlock", /* ignoreSelfApproval= */ false, ImmutableMap.of("0", "No vote"));
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -193,7 +193,7 @@
// non-applicable SRs for these labels.
createLabel(
"Foo", "MaxWithBlock", /* ignoreSelfApproval= */ false, ImmutableMap.of("0", "No vote"));
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -226,14 +226,14 @@
@Test
public void migrateNonBlockingLabel_patchSetLock_doesNothing() throws Exception {
createLabel("Foo", "PatchSetLock", /* ignoreSelfApproval= */ false);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.NO_CHANGE);
// No submit requirement created for the patchset lock label function
assertThat(updateUI.newlyCreatedSrs).isEqualTo(0);
assertThat(updateUI.existingSrsMismatchingWithMigration).isEqualTo(0);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
assertLabelFunction("Foo", "PatchSetLock");
}
@@ -241,7 +241,7 @@
public void migrationIsCommittedWithServerIdent() throws Exception {
RevCommit oldMetaCommit = projectOperations.project(project).getHead(RefNames.REFS_CONFIG);
createLabel("Foo", "MaxWithBlock", /* ignoreSelfApproval= */ false);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -268,7 +268,7 @@
/* ignoreSelfApproval= */ false,
ImmutableList.of("refs/heads/master"));
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -290,7 +290,7 @@
/* ignoreSelfApproval= */ false,
ImmutableList.of("refs/heads/master", "refs/heads/develop"));
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -313,7 +313,7 @@
/* ignoreSelfApproval= */ false,
ImmutableList.of("^refs/heads/main-.*"));
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -335,7 +335,7 @@
/* ignoreSelfApproval= */ false,
ImmutableList.of("refs/heads/master", "^refs/heads/main-.*"));
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
assertThat(updateUI.newlyCreatedSrs).isEqualTo(1);
@@ -357,7 +357,7 @@
oldRefsConfigId = repo.exactRef(RefNames.REFS_CONFIG).getObjectId().toString();
}
createLabel("Foo", "MaxWithBlock", /* ignoreSelfApproval= */ false);
- assertNonExistentSr(/* srName = */ "Foo");
+ assertNonExistentSr(/* srName= */ "Foo");
// Running the migration causes REFS_CONFIG to change.
TestUpdateUI updateUI = runMigration(/* expectedResult= */ Status.MIGRATED);
diff --git a/javatests/com/google/gerrit/acceptance/rest/RestApiServletIT.java b/javatests/com/google/gerrit/acceptance/rest/RestApiServletIT.java
index be139c7..c5e6507 100644
--- a/javatests/com/google/gerrit/acceptance/rest/RestApiServletIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/RestApiServletIT.java
@@ -280,7 +280,7 @@
RestResponse response =
adminRestSession.postWithHeaders(
"/changes/" + change2.getChangeId() + "/submit",
- /* content = */ null,
+ /* content= */ null,
X_GERRIT_UPDATED_REF_ENABLED_HEADER);
response.assertOK();
@@ -355,7 +355,7 @@
RestResponse response =
adminRestSession.postWithHeaders(
"/changes/" + change2.getChangeId() + "/submit",
- /* content = */ null,
+ /* content= */ null,
X_GERRIT_UPDATED_REF_ENABLED_HEADER);
response.assertOK();
assertThat(gApi.changes().id(change1.getChangeId()).get().status)
diff --git a/javatests/com/google/gerrit/acceptance/rest/change/ChangeNoLongerSubmittableIT.java b/javatests/com/google/gerrit/acceptance/rest/change/ChangeNoLongerSubmittableIT.java
index 5bb6dc4..00e588e 100644
--- a/javatests/com/google/gerrit/acceptance/rest/change/ChangeNoLongerSubmittableIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/change/ChangeNoLongerSubmittableIT.java
@@ -482,7 +482,8 @@
String.format(
"Attention is currently required from: %s, %s, %s.\n"
+ "\n"
- + "%s has uploaded a new patch set (#3) to the change originally created by %s.",
+ + "%s has uploaded a new patch set (#3) to the change originally created by"
+ + " %s.",
admin.fullName(),
user.fullName(),
approver.fullName(),
@@ -557,7 +558,8 @@
String.format(
"Attention is currently required from: %s, %s.\n"
+ "\n"
- + "%s has uploaded a new patch set (#3) to the change originally created by %s.",
+ + "%s has uploaded a new patch set (#3) to the change originally created by"
+ + " %s.",
admin.fullName(), user.fullName(), approver.fullName(), admin.fullName()));
assertThat(message.body())
.contains("The change is no longer submittable: Code-Review is unsatisfied now.\n");
@@ -628,7 +630,8 @@
String.format(
"Attention is currently required from: %s, %s.\n"
+ "\n"
- + "%s has uploaded a new patch set (#3) to the change originally created by %s.",
+ + "%s has uploaded a new patch set (#3) to the change originally created by"
+ + " %s.",
admin.fullName(), user.fullName(), approver.fullName(), admin.fullName()));
assertThat(message.body())
.contains("The change is no longer submittable: Code-Review is unsatisfied now.\n");
@@ -701,7 +704,8 @@
String.format(
"Attention is currently required from: %s, %s, %s.\n"
+ "\n"
- + "%s has uploaded a new patch set (#3) to the change originally created by %s.",
+ + "%s has uploaded a new patch set (#3) to the change originally created by"
+ + " %s.",
admin.fullName(),
user.fullName(),
uploaderPs3.fullName(),
@@ -766,7 +770,8 @@
String.format(
"Attention is currently required from: %s, %s.\n"
+ "\n"
- + "%s has uploaded a new patch set (#3) to the change originally created by %s.",
+ + "%s has uploaded a new patch set (#3) to the change originally created by"
+ + " %s.",
admin.fullName(), user.fullName(), uploaderPs3.fullName(), admin.fullName()));
assertThat(message.body()).doesNotContain("The change is no longer submittable");
assertThat(message.htmlBody()).doesNotContain("The change is no longer submittable");
@@ -822,7 +827,8 @@
String.format(
"Attention is currently required from: %s, %s, %s, %s.\n"
+ "\n"
- + "%s has uploaded a new patch set (#3) to the change originally created by %s.",
+ + "%s has uploaded a new patch set (#3) to the change originally created by"
+ + " %s.",
admin.fullName(),
user.fullName(),
approver.fullName(),
@@ -902,7 +908,8 @@
String.format(
"Attention is currently required from: %s.\n"
+ "\n"
- + "%s has uploaded a new patch set (#3) to the change originally created by %s.",
+ + "%s has uploaded a new patch set (#3) to the change originally created by"
+ + " %s.",
uploaderPs3.fullName(), uploaderPs3.fullName(), admin.fullName()));
assertThat(message.body()).doesNotContain("The change is no longer submittable");
assertThat(message.htmlBody()).doesNotContain("The change is no longer submittable");
diff --git a/javatests/com/google/gerrit/acceptance/rest/change/CorsIT.java b/javatests/com/google/gerrit/acceptance/rest/change/CorsIT.java
index ae872b2b..32bf5fe 100644
--- a/javatests/com/google/gerrit/acceptance/rest/change/CorsIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/change/CorsIT.java
@@ -134,7 +134,7 @@
RestResponse r =
adminRestSession.putWithHeaders(
"/changes/" + change.getChangeId() + "/topic",
- /* content = */ "A",
+ /* content= */ "A",
new BasicHeader(ORIGIN, origin));
r.assertOK();
checkCors(r, false, origin);
@@ -148,7 +148,7 @@
RestResponse r =
adminRestSession.putWithHeaders(
"/changes/" + change.getChangeId() + "/topic",
- /* content = */ "A",
+ /* content= */ "A",
new BasicHeader(ORIGIN, origin));
r.assertOK();
checkCors(r, true, origin);
diff --git a/javatests/com/google/gerrit/acceptance/rest/change/SubmitByFastForwardIT.java b/javatests/com/google/gerrit/acceptance/rest/change/SubmitByFastForwardIT.java
index a60f757..b8e5841 100644
--- a/javatests/com/google/gerrit/acceptance/rest/change/SubmitByFastForwardIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/change/SubmitByFastForwardIT.java
@@ -120,9 +120,9 @@
approve(change2.getChangeId());
String fastForwardIndependentChangesError =
- "Change could not be merged because the submission"
- + " has two independent changes with the same destination branch. Independent changes can't "
- + "be submitted to the same destination branch with FAST_FORWARD_ONLY submit strategy";
+ "Change could not be merged because the submission has two independent changes with the"
+ + " same destination branch. Independent changes can't be submitted to the same"
+ + " destination branch with FAST_FORWARD_ONLY submit strategy";
submitWithConflict(
change2.getChangeId(),
diff --git a/javatests/com/google/gerrit/acceptance/rest/change/SuggestReviewersIT.java b/javatests/com/google/gerrit/acceptance/rest/change/SuggestReviewersIT.java
index 6dfa82b..b6c02e9 100644
--- a/javatests/com/google/gerrit/acceptance/rest/change/SuggestReviewersIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/change/SuggestReviewersIT.java
@@ -490,7 +490,7 @@
assertThat(gApi.accounts().id(foo2.id().get()).getActive()).isFalse();
assertReviewers(suggestReviewers(changeId, name), ImmutableList.of(foo1), ImmutableList.of());
assertReviewers(
- suggestReviewers(changeId, /*query=*/ ""), ImmutableList.of(foo1), ImmutableList.of());
+ suggestReviewers(changeId, /* query= */ ""), ImmutableList.of(foo1), ImmutableList.of());
}
@Test
diff --git a/javatests/com/google/gerrit/acceptance/rest/project/CheckMergeabilityIT.java b/javatests/com/google/gerrit/acceptance/rest/project/CheckMergeabilityIT.java
index b0320f6..70a8785 100644
--- a/javatests/com/google/gerrit/acceptance/rest/project/CheckMergeabilityIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/project/CheckMergeabilityIT.java
@@ -237,7 +237,8 @@
"master",
"fdsafsdf",
"recursive",
- "Error resolving: 'fdsafsdf'. Do not have read permission, or failed to resolve to a commit.");
+ "Error resolving: 'fdsafsdf'. Do not have read permission, or failed to resolve to a"
+ + " commit.");
}
@Test
diff --git a/javatests/com/google/gerrit/acceptance/server/change/CommentsIT.java b/javatests/com/google/gerrit/acceptance/server/change/CommentsIT.java
index 7938ab9..92a786a 100644
--- a/javatests/com/google/gerrit/acceptance/server/change/CommentsIT.java
+++ b/javatests/com/google/gerrit/acceptance/server/change/CommentsIT.java
@@ -313,7 +313,7 @@
String commentMessage = "to be deleted";
CommentInput comment =
CommentsUtil.newComment(
- COMMIT_MSG, Side.REVISION, /*line= */ 0, commentMessage, /*unresolved= */ true);
+ COMMIT_MSG, Side.REVISION, /* line= */ 0, commentMessage, /* unresolved= */ true);
CommentsUtil.addComments(gApi, changeId, revId, comment);
Map<String, List<CommentInfo>> results = getPublishedComments(changeId, revId);
@@ -1570,8 +1570,8 @@
.hasMessageThat()
.isEqualTo(
String.format(
- "Draft comments for other revisions cannot be published when DraftHandling = PUBLISH."
- + " (draft IDs: [%s])",
+ "Draft comments for other revisions cannot be published when DraftHandling ="
+ + " PUBLISH. (draft IDs: [%s])",
draftPs1.id));
}
diff --git a/javatests/com/google/gerrit/acceptance/server/permissions/ExternalUserPermissionIT.java b/javatests/com/google/gerrit/acceptance/server/permissions/ExternalUserPermissionIT.java
index 7a55ecb..98e3e13 100644
--- a/javatests/com/google/gerrit/acceptance/server/permissions/ExternalUserPermissionIT.java
+++ b/javatests/com/google/gerrit/acceptance/server/permissions/ExternalUserPermissionIT.java
@@ -288,7 +288,9 @@
private ImmutableList<String> getVisibleRefNames(CurrentUser user) throws Exception {
try (Repository repo = repoManager.openRepository(project)) {
- return permissionBackend.user(user).project(project)
+ return permissionBackend
+ .user(user)
+ .project(project)
.filter(
repo.getRefDatabase().getRefs(), repo, PermissionBackend.RefFilterOptions.defaults())
.stream()
diff --git a/javatests/com/google/gerrit/acceptance/server/permissions/GroupBackedUserPermissionIT.java b/javatests/com/google/gerrit/acceptance/server/permissions/GroupBackedUserPermissionIT.java
index d68d681..55c6464 100644
--- a/javatests/com/google/gerrit/acceptance/server/permissions/GroupBackedUserPermissionIT.java
+++ b/javatests/com/google/gerrit/acceptance/server/permissions/GroupBackedUserPermissionIT.java
@@ -173,7 +173,9 @@
private ImmutableList<String> getVisibleRefNames(CurrentUser user) throws Exception {
try (Repository repo = repoManager.openRepository(project)) {
- return permissionBackend.user(user).project(project)
+ return permissionBackend
+ .user(user)
+ .project(project)
.filter(
repo.getRefDatabase().getRefs(), repo, PermissionBackend.RefFilterOptions.defaults())
.stream()
diff --git a/javatests/com/google/gerrit/acceptance/server/project/SubmitRequirementsEvaluatorIT.java b/javatests/com/google/gerrit/acceptance/server/project/SubmitRequirementsEvaluatorIT.java
index 15cd1a9..37e323a 100644
--- a/javatests/com/google/gerrit/acceptance/server/project/SubmitRequirementsEvaluatorIT.java
+++ b/javatests/com/google/gerrit/acceptance/server/project/SubmitRequirementsEvaluatorIT.java
@@ -152,18 +152,18 @@
public void globalSubmitRequirementEvaluated() throws Exception {
SubmitRequirement globalSubmitRequirement =
createSubmitRequirement(
- /*name=*/ "global-config-requirement",
+ /* name= */ "global-config-requirement",
/* applicabilityExpr= */ "project:" + project.get(),
- /*submittabilityExpr= */ "is:true",
+ /* submittabilityExpr= */ "is:true",
/* overrideExpr= */ "", /*allowOverrideInChildProjects*/
false);
try (Registration registration =
extensionRegistry.newRegistration().add(globalSubmitRequirement)) {
SubmitRequirement projectSubmitRequirement =
createSubmitRequirement(
- /*name=*/ "project-config-requirement",
+ /* name= */ "project-config-requirement",
/* applicabilityExpr= */ "project:" + project.get(),
- /*submittabilityExpr= */ "is:true",
+ /* submittabilityExpr= */ "is:true",
/* overrideExpr= */ "", /*allowOverrideInChildProjects*/
false);
configSubmitRequirement(project, projectSubmitRequirement);
@@ -183,18 +183,18 @@
throws Exception {
SubmitRequirement globalSubmitRequirement =
createSubmitRequirement(
- /*name=*/ "config-requirement",
+ /* name= */ "config-requirement",
/* applicabilityExpr= */ "project:" + project.get(),
- /*submittabilityExpr= */ "is:true",
+ /* submittabilityExpr= */ "is:true",
/* overrideExpr= */ "", /*allowOverrideInChildProjects*/
true);
try (Registration registration =
extensionRegistry.newRegistration().add(globalSubmitRequirement)) {
SubmitRequirement projectSubmitRequirement =
createSubmitRequirement(
- /*name=*/ "config-requirement",
+ /* name= */ "config-requirement",
/* applicabilityExpr= */ "project:" + project.get(),
- /*submittabilityExpr= */ "is:true",
+ /* submittabilityExpr= */ "is:true",
/* overrideExpr= */ "", /*allowOverrideInChildProjects*/
false);
configSubmitRequirement(project, projectSubmitRequirement);
@@ -212,18 +212,18 @@
throws Exception {
SubmitRequirement globalSubmitRequirement =
createSubmitRequirement(
- /*name=*/ "config-requirement",
+ /* name= */ "config-requirement",
/* applicabilityExpr= */ "project:" + project.get(),
- /*submittabilityExpr= */ "is:true",
+ /* submittabilityExpr= */ "is:true",
/* overrideExpr= */ "", /*allowOverrideInChildProjects*/
false);
try (Registration registration =
extensionRegistry.newRegistration().add(globalSubmitRequirement)) {
SubmitRequirement projectSubmitRequirement =
createSubmitRequirement(
- /*name=*/ "config-requirement",
+ /* name= */ "config-requirement",
/* applicabilityExpr= */ "project:" + project.get(),
- /*submittabilityExpr= */ "is:true",
+ /* submittabilityExpr= */ "is:true",
/* overrideExpr= */ "", /*allowOverrideInChildProjects*/
false);
configSubmitRequirement(project, projectSubmitRequirement);
@@ -462,7 +462,7 @@
@Test
public void byAuthorEmail() throws Exception {
TestAccount user2 =
- accountCreator.create("Foo", "user@example.com", "User", /* displayName = */ null);
+ accountCreator.create("Foo", "user@example.com", "User", /* displayName= */ null);
requestScopeOperations.setApiUser(user2.id());
ChangeInfo info =
gApi.changes().create(new ChangeInput(project.get(), "master", "Test Change")).get();
@@ -496,7 +496,7 @@
@Test
public void byCommitterEmail() throws Exception {
TestAccount user2 =
- accountCreator.create("Foo", "user@example.com", "User", /* displayName = */ null);
+ accountCreator.create("Foo", "user@example.com", "User", /* displayName= */ null);
requestScopeOperations.setApiUser(user2.id());
ChangeInfo info =
gApi.changes().create(new ChangeInput(project.get(), "master", "Test Change")).get();
@@ -530,7 +530,7 @@
@Test
public void byUploaderEmail() throws Exception {
TestAccount user2 =
- accountCreator.create("Foo", "user@example.com", "User", /* displayName = */ null);
+ accountCreator.create("Foo", "user@example.com", "User", /* displayName= */ null);
requestScopeOperations.setApiUser(user2.id());
ChangeInfo info =
gApi.changes().create(new ChangeInput(project.get(), "master", "Test Change")).get();
@@ -953,11 +953,11 @@
String submittabilityExpr,
@Nullable String overrideExpr) {
return createSubmitRequirement(
- /*name= */ "sr-name",
+ /* name= */ "sr-name",
applicabilityExpr,
submittabilityExpr,
overrideExpr,
- /*allowOverrideInChildProjects=*/ false);
+ /* allowOverrideInChildProjects= */ false);
}
private SubmitRequirement createSubmitRequirement(
diff --git a/javatests/com/google/gerrit/acceptance/ssh/SetAccountIT.java b/javatests/com/google/gerrit/acceptance/ssh/SetAccountIT.java
index a82876e..7e30b1b 100644
--- a/javatests/com/google/gerrit/acceptance/ssh/SetAccountIT.java
+++ b/javatests/com/google/gerrit/acceptance/ssh/SetAccountIT.java
@@ -64,7 +64,8 @@
assertThat(extIdKeys.contains("username:user3")).isTrue();
assertThat(extIdKeys.contains("mailto:user3@example.com")).isTrue();
adminSshSession.exec(
- "gerrit set-account --delete-external-id username:user3 --delete-external-id mailto:user3@example.com user3");
+ "gerrit set-account --delete-external-id username:user3 --delete-external-id"
+ + " mailto:user3@example.com user3");
adminSshSession.assertSuccess();
extIdKeys = getExternalIdKeys(testAccount);
assertThat(extIdKeys.contains("username:user3")).isFalse();
diff --git a/javatests/com/google/gerrit/acceptance/testsuite/change/PatchsetOperationsImplTest.java b/javatests/com/google/gerrit/acceptance/testsuite/change/PatchsetOperationsImplTest.java
index 080c22c..0406683 100644
--- a/javatests/com/google/gerrit/acceptance/testsuite/change/PatchsetOperationsImplTest.java
+++ b/javatests/com/google/gerrit/acceptance/testsuite/change/PatchsetOperationsImplTest.java
@@ -1215,8 +1215,12 @@
private RobotCommentInfo getRobotCommentFromServer(PatchSet.Id patchsetId, String uuid)
throws RestApiException {
- return gApi.changes().id(patchsetId.changeId().toString())
- .revision(patchsetId.getId().toString()).robotCommentsAsList().stream()
+ return gApi
+ .changes()
+ .id(patchsetId.changeId().toString())
+ .revision(patchsetId.getId().toString())
+ .robotCommentsAsList()
+ .stream()
.filter(comment -> comment.id.equals(uuid))
.findAny()
.orElseThrow(
diff --git a/javatests/com/google/gerrit/common/data/ParameterizedStringTest.java b/javatests/com/google/gerrit/common/data/ParameterizedStringTest.java
index b646d2b..82922b6 100644
--- a/javatests/com/google/gerrit/common/data/ParameterizedStringTest.java
+++ b/javatests/com/google/gerrit/common/data/ParameterizedStringTest.java
@@ -172,7 +172,8 @@
public void undefinedFunctionName() {
ParameterizedString p =
new ParameterizedString(
- "hi, ${userName.toUpperCase},your eamil address is '${email.toLowerCase.localPart}'.right?");
+ "hi, ${userName.toUpperCase},your eamil address is"
+ + " '${email.toLowerCase.localPart}'.right?");
assertThat(p.getParameterNames()).containsExactly("userName", "email");
Map<String, String> a = new HashMap<>();
diff --git a/javatests/com/google/gerrit/index/query/LazyDataSourceTest.java b/javatests/com/google/gerrit/index/query/LazyDataSourceTest.java
index 4105a1d..681dcbb 100644
--- a/javatests/com/google/gerrit/index/query/LazyDataSourceTest.java
+++ b/javatests/com/google/gerrit/index/query/LazyDataSourceTest.java
@@ -76,13 +76,15 @@
@Override
public Iterator<T> iterator() {
throw new AssertionError(
- "called iterator() on the result set, but shouldn't have because the data source must be lazy");
+ "called iterator() on the result set, but shouldn't have because the data source must be"
+ + " lazy");
}
@Override
public ImmutableList<T> toList() {
throw new AssertionError(
- "called toList() on the result set, but shouldn't have because the data source must be lazy");
+ "called toList() on the result set, but shouldn't have because the data source must be"
+ + " lazy");
}
@Override
diff --git a/javatests/com/google/gerrit/mail/HtmlParserTest.java b/javatests/com/google/gerrit/mail/HtmlParserTest.java
index bb60fd8..faf068a 100644
--- a/javatests/com/google/gerrit/mail/HtmlParserTest.java
+++ b/javatests/com/google/gerrit/mail/HtmlParserTest.java
@@ -159,7 +159,8 @@
@Test
public void commentsSpanningMultipleBlocks() {
String htmlMessage =
- "This is a very long test comment. <div><br></div><div>Now this is a new paragraph yay.</div>";
+ "This is a very long test comment. <div><br></div><div>Now this is a new paragraph"
+ + " yay.</div>";
String txtMessage = "This is a very long test comment.\n\nNow this is a new paragraph yay.";
MailMessage.Builder b = newMailMessageBuilder();
b.htmlContent(newHtmlBody(htmlMessage, null, null, htmlMessage, htmlMessage, null, null));
diff --git a/javatests/com/google/gerrit/mail/data/RawMailMessage.java b/javatests/com/google/gerrit/mail/data/RawMailMessage.java
index 53c782c..b52e201 100644
--- a/javatests/com/google/gerrit/mail/data/RawMailMessage.java
+++ b/javatests/com/google/gerrit/mail/data/RawMailMessage.java
@@ -24,6 +24,7 @@
public abstract String raw();
public abstract int[] rawChars();
+
// Parsed representation for asserting the expected parser output
public abstract MailMessage expectedMailMessage();
}
diff --git a/javatests/com/google/gerrit/server/account/AccountResolverTest.java b/javatests/com/google/gerrit/server/account/AccountResolverTest.java
index 34f746a..7a67442 100644
--- a/javatests/com/google/gerrit/server/account/AccountResolverTest.java
+++ b/javatests/com/google/gerrit/server/account/AccountResolverTest.java
@@ -257,7 +257,9 @@
assertThat(thrown)
.hasMessageThat()
.isEqualTo(
- "Account 'foo' is ambiguous (at most 3 shown):\n1: Anonymous Name (1)\n2: Anonymous Name (2)");
+ "Account 'foo' is ambiguous (at most 3 shown):\n"
+ + "1: Anonymous Name (1)\n"
+ + "2: Anonymous Name (2)");
}
@Test
@@ -303,7 +305,9 @@
user)))
.hasMessageThat()
.isEqualTo(
- "Account 'foo' is ambiguous (at most 3 shown):\n1: Anonymous Name (1)\n3: Anonymous Name (3)");
+ "Account 'foo' is ambiguous (at most 3 shown):\n"
+ + "1: Anonymous Name (1)\n"
+ + "3: Anonymous Name (3)");
}
@Test
@@ -368,7 +372,9 @@
return AccountResolverTest::allVisible;
}
- /** @param accountState account state for which the visibility should be checked */
+ /**
+ * @param accountState account state for which the visibility should be checked
+ */
private static boolean allVisible(AccountState accountState) {
return true;
}
diff --git a/javatests/com/google/gerrit/server/cache/serialize/entities/CachedProjectConfigSerializerTest.java b/javatests/com/google/gerrit/server/cache/serialize/entities/CachedProjectConfigSerializerTest.java
index bf8a071..a6c577d 100644
--- a/javatests/com/google/gerrit/server/cache/serialize/entities/CachedProjectConfigSerializerTest.java
+++ b/javatests/com/google/gerrit/server/cache/serialize/entities/CachedProjectConfigSerializerTest.java
@@ -44,8 +44,7 @@
.build();
static final CachedProjectConfig ALL_VALUES_SET =
- MINIMAL_VALUES_SET
- .toBuilder()
+ MINIMAL_VALUES_SET.toBuilder()
.addGroup(GroupReferenceSerializerTest.ALL_VALUES_SET)
.addAccessSection(AccessSectionSerializerTest.ALL_VALUES_SET)
.setBranchOrderSection(Optional.of(BranchOrderSectionSerializerTest.ALL_VALUES_SET))
diff --git a/javatests/com/google/gerrit/server/cache/serialize/entities/InternalGroupSerializerTest.java b/javatests/com/google/gerrit/server/cache/serialize/entities/InternalGroupSerializerTest.java
index 78947a2..15d768f 100644
--- a/javatests/com/google/gerrit/server/cache/serialize/entities/InternalGroupSerializerTest.java
+++ b/javatests/com/google/gerrit/server/cache/serialize/entities/InternalGroupSerializerTest.java
@@ -43,8 +43,7 @@
.build();
static final InternalGroup ALL_VALUES_SET =
- MINIMAL_VALUES_SET
- .toBuilder()
+ MINIMAL_VALUES_SET.toBuilder()
.setDescription("description")
.setRefState(ObjectId.fromString("12345678deadbeefdeadbeefdeadbeefdeadbeef"))
.build();
diff --git a/javatests/com/google/gerrit/server/cache/serialize/entities/SubmitRequirementJsonSerializerTest.java b/javatests/com/google/gerrit/server/cache/serialize/entities/SubmitRequirementJsonSerializerTest.java
index 7e71a3e..b669755 100644
--- a/javatests/com/google/gerrit/server/cache/serialize/entities/SubmitRequirementJsonSerializerTest.java
+++ b/javatests/com/google/gerrit/server/cache/serialize/entities/SubmitRequirementJsonSerializerTest.java
@@ -275,8 +275,7 @@
public void submitRequirementResult_emptySubmittabilityExpressionResultField_roundTrip()
throws Exception {
SubmitRequirementResult srResult =
- srReqResult
- .toBuilder()
+ srReqResult.toBuilder()
.submittabilityExpressionResult(Optional.empty())
.applicabilityExpressionResult(Optional.empty())
.overrideExpressionResult(Optional.empty())
diff --git a/javatests/com/google/gerrit/server/index/IndexedFieldTest.java b/javatests/com/google/gerrit/server/index/IndexedFieldTest.java
index 5029334..42c4c09 100644
--- a/javatests/com/google/gerrit/server/index/IndexedFieldTest.java
+++ b/javatests/com/google/gerrit/server/index/IndexedFieldTest.java
@@ -148,7 +148,8 @@
fieldToStoredValue) {
Object docValue = fieldToStoredValue.getValue();
IndexedField<TestIndexedData, StoredValue>.SearchSpec searchSpec = fieldToStoredValue.getKey();
- StoredValue storedValue = new FakeStoredValue(fieldToStoredValue.getValue(), /*isProto=*/ true);
+ StoredValue storedValue =
+ new FakeStoredValue(fieldToStoredValue.getValue(), /* isProto= */ true);
TestIndexedData testIndexedData = new TestIndexedData();
searchSpec.setIfPossible(testIndexedData, storedValue);
assertThat(testIndexedData.getTestField()).isEqualTo(docValue);
diff --git a/javatests/com/google/gerrit/server/notedb/ChangeNotesCommitTest.java b/javatests/com/google/gerrit/server/notedb/ChangeNotesCommitTest.java
index 84d2d5d..5650380 100644
--- a/javatests/com/google/gerrit/server/notedb/ChangeNotesCommitTest.java
+++ b/javatests/com/google/gerrit/server/notedb/ChangeNotesCommitTest.java
@@ -54,7 +54,8 @@
+ "Patch-set: 1\n"
+ "Attention: {\"person_ident\":\""
+ FQ_USER_IDENT
- + "\\u003e\",\"operation\":\"ADD\",\"reason\":\"Added by Administrator using the hovercard menu\"}");
+ + "\\u003e\",\"operation\":\"ADD\",\"reason\":\"Added by Administrator using the"
+ + " hovercard menu\"}");
newParser(commit).parseAll();
assertThat(((ChangeNotesCommit) commit).isAttentionSetCommitOnly(false)).isEqualTo(true);
@@ -71,7 +72,8 @@
+ "Subject: Change subject\n"
+ "Attention: {\"person_ident\":\""
+ FQ_USER_IDENT
- + "\\u003e\",\"operation\":\"ADD\",\"reason\":\"Added by Administrator using the hovercard menu\"}");
+ + "\\u003e\",\"operation\":\"ADD\",\"reason\":\"Added by Administrator using the"
+ + " hovercard menu\"}");
newParser(commit).parseAll();
assertThat(((ChangeNotesCommit) commit).isAttentionSetCommitOnly(false)).isEqualTo(false);
@@ -95,7 +97,8 @@
+ "Patch-set: 1\n"
+ "Attention: {\"person_ident\":\""
+ FQ_USER_IDENT
- + "\\u003e\",\"operation\":\"ADD\",\"reason\":\"Added by Administrator using the hovercard menu\"}");
+ + "\\u003e\",\"operation\":\"ADD\",\"reason\":\"Added by Administrator using the"
+ + " hovercard menu\"}");
newParser(commit).parseAll();
assertThat(((ChangeNotesCommit) commit).isAttentionSetCommitOnly(true)).isEqualTo(false);
diff --git a/javatests/com/google/gerrit/server/patch/DiffOperationsTest.java b/javatests/com/google/gerrit/server/patch/DiffOperationsTest.java
index 1c28690..e7e03ee 100644
--- a/javatests/com/google/gerrit/server/patch/DiffOperationsTest.java
+++ b/javatests/com/google/gerrit/server/patch/DiffOperationsTest.java
@@ -83,7 +83,7 @@
FileDiffOutput diffOutput =
diffOperations.getModifiedFileAgainstParent(
- testProjectName, newCommitId, /* parentNum=*/ 0, fileName2, /* whitespace=*/ null);
+ testProjectName, newCommitId, /* parentNum= */ 0, fileName2, /* whitespace= */ null);
assertThat(diffOutput.oldCommitId()).isEqualTo(oldCommitId);
assertThat(diffOutput.newCommitId()).isEqualTo(newCommitId);
@@ -113,7 +113,7 @@
Map<String, FileDiffOutput> changedFiles =
diffOperations.listModifiedFilesAgainstParent(
- testProjectName, merge, /* parentNum=*/ 0, DiffOptions.DEFAULTS);
+ testProjectName, merge, /* parentNum= */ 0, DiffOptions.DEFAULTS);
assertThat(changedFiles.keySet()).containsExactly("/COMMIT_MSG", "/MERGE_LIST", "file_3.txt");
assertThat(repo.getRefDatabase().exactRef(autoMergeRef)).isNull();
@@ -206,7 +206,7 @@
// This call loads modified files directly without going through the diff cache.
Map<String, ModifiedFile> modifiedFiles =
diffOperations.loadModifiedFilesAgainstParent(
- testProjectName, newCommitId, /* parentNum=*/ 0, DiffOptions.DEFAULTS, rw, repoConfig);
+ testProjectName, newCommitId, /* parentNum= */ 0, DiffOptions.DEFAULTS, rw, repoConfig);
assertThat(modifiedFiles)
.containsExactly(
diff --git a/javatests/com/google/gerrit/server/query/account/AbstractQueryAccountsTest.java b/javatests/com/google/gerrit/server/query/account/AbstractQueryAccountsTest.java
index c530c79..2f9a428 100644
--- a/javatests/com/google/gerrit/server/query/account/AbstractQueryAccountsTest.java
+++ b/javatests/com/google/gerrit/server/query/account/AbstractQueryAccountsTest.java
@@ -638,7 +638,7 @@
@Test
public void asAnonymous() throws Exception {
- AccountInfo user1 = newAccount("user1", "user1@gerrit.com", /*active=*/ true);
+ AccountInfo user1 = newAccount("user1", "user1@gerrit.com", /* active= */ true);
setAnonymous();
assertQuery("9999999");
diff --git a/javatests/com/google/gerrit/server/schema/NoteDbSchemaVersionsTest.java b/javatests/com/google/gerrit/server/schema/NoteDbSchemaVersionsTest.java
index 31697fd..4bc1922 100644
--- a/javatests/com/google/gerrit/server/schema/NoteDbSchemaVersionsTest.java
+++ b/javatests/com/google/gerrit/server/schema/NoteDbSchemaVersionsTest.java
@@ -52,7 +52,8 @@
int minNoteDbVersion = 180;
ImmutableList<Integer> allSchemaVersions =
ClassPath.from(getClass().getClassLoader())
- .getTopLevelClasses(getClass().getPackage().getName()).stream()
+ .getTopLevelClasses(getClass().getPackage().getName())
+ .stream()
.map(ClassInfo::load)
.map(NoteDbSchemaVersions::guessVersion)
.flatMap(Streams::stream)
diff --git a/javatests/com/google/gerrit/server/update/BatchUpdateTest.java b/javatests/com/google/gerrit/server/update/BatchUpdateTest.java
index f7a2afa..99ac425 100644
--- a/javatests/com/google/gerrit/server/update/BatchUpdateTest.java
+++ b/javatests/com/google/gerrit/server/update/BatchUpdateTest.java
@@ -317,6 +317,7 @@
assertThat(getUpdateCount(id)).isEqualTo(MAX_UPDATES + 1);
assertThat(getMetaId(id)).isNotEqualTo(oldMetaId);
}
+
// Not possible to write a variant of this test that submits first and adds a message second in
// the same batch, since submit always comes last.
diff --git a/tools/setup_gjf.sh b/tools/setup_gjf.sh
index 119f9af..08c51c2 100755
--- a/tools/setup_gjf.sh
+++ b/tools/setup_gjf.sh
@@ -16,21 +16,20 @@
set -eu
-# Keep this version in sync with dev-contributing.txt.
-VERSION=${1:-1.7}
+# Keep this version in sync with
+# - Documentation/dev-crafting-changes.txt
+# - Documentation/dev-eclipse.txt
+VERSION=${1:-1.24.0}
+
case "$VERSION" in
-1.3)
- SHA1="a73cfe6f9af01bd6ff150c0b50c9d620400f784c"
- ;;
-1.5)
- SHA1="b1f79e4d39a3c501f07c0ce7e8b03ac6964ed1f1"
- ;;
-1.6)
- SHA1="02b3e84e52d2473e2c4868189709905a51647d03"
- ;;
1.7)
SHA1="b6d34a51e579b08db7c624505bdf9af4397f1702"
+ TAG_PREFIX=google-java-format-
+ ;;
+1.24.0)
+ SHA1="3b55f08a70d53984ac4b3e7796dc992858d6bdd8"
+ TAG_PREFIX=v
;;
*)
echo "unknown google-java-format version: $VERSION"
@@ -48,7 +47,7 @@
mkdir -p "$dir"
name="google-java-format-$VERSION-all-deps.jar"
-url="https://github.com/google/google-java-format/releases/download/google-java-format-$VERSION/$name"
+url="https://github.com/google/google-java-format/releases/download/$TAG_PREFIX$VERSION/$name"
"$root/tools/download_file.py" -o "$dir/$name" -u "$url" -v "$SHA1"
launcher="$dir/google-java-format-$VERSION"