From 54c04f59b9005cd1c7d9544bad8962bc144cb8e5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 6 Jun 2018 09:10:11 +0900 Subject: [PATCH] Reformat all Java files with google-java-format 1.6 Reformat all files with the exception of: - lib/asciidoctor/java/AsciiDoctor.java to avoid requiring the Library-Compliance label. Change-Id: Iedba3f24ac00e2186e3e0688fabea817ddf43739 --- .../UseGerritConfigAnnotationTest.java | 17 ++-- .../UseGlobalPluginConfigAnnotationTest.java | 23 ++--- .../acceptance/api/accounts/AccountIT.java | 5 +- .../acceptance/rest/config/ServerInfoIT.java | 5 +- .../server/mail/ListMailFilterIT.java | 20 ++-- .../acceptance/ssh/UploadArchiveIT.java | 5 +- .../java/com/google/gerrit/pgm/Daemon.java | 14 ++- .../main/java/com/google/gerrit/pgm/Init.java | 12 +-- .../pgm/MigrateAccountPatchReviewDb.java | 5 +- .../google/gerrit/pgm/MigrateToNoteDb.java | 46 ++++----- .../java/com/google/gerrit/pgm/Passwd.java | 9 +- .../java/com/google/gerrit/pgm/ProtoGen.java | 11 +-- .../com/google/gerrit/pgm/ProtobufImport.java | 11 +-- .../java/com/google/gerrit/pgm/Reindex.java | 5 +- .../java/com/google/gerrit/pgm/Rulec.java | 9 +- .../google/gerrit/pgm/SwitchSecureStore.java | 7 +- .../google/gerrit/pgm/util/SiteProgram.java | 7 +- .../metrics/dropwizard/ListMetrics.java | 9 +- .../gerrit/server/access/ListAccess.java | 9 +- .../gerrit/server/account/GetAvatar.java | 7 +- .../gerrit/server/account/QueryAccounts.java | 27 +++--- .../gerrit/server/change/ChangeEdits.java | 14 ++- .../google/gerrit/server/change/GetBlame.java | 11 +-- .../gerrit/server/change/GetPureRevert.java | 7 +- .../gerrit/server/change/Mergeable.java | 7 +- .../server/change/SuggestChangeReviewers.java | 7 +- .../server/change/SuggestReviewers.java | 18 ++-- .../server/git/receive/ReceiveCommits.java | 77 +++++++-------- .../gerrit/server/group/ListGroups.java | 85 ++++++++--------- .../gerrit/server/group/QueryGroups.java | 25 +++-- .../gerrit/server/plugins/ListPlugins.java | 43 ++++----- .../server/project/CheckMergeability.java | 22 ++--- .../gerrit/server/project/GetReflog.java | 35 ++++--- .../gerrit/server/project/ListBranches.java | 36 ++++--- .../gerrit/server/project/ListProjects.java | 68 ++++++------- .../gerrit/server/project/ListTags.java | 36 ++++--- .../server/query/change/QueryChanges.java | 27 +++--- .../gerrit/sshd/commands/AdminSetParent.java | 39 ++++---- .../gerrit/sshd/commands/AproposCommand.java | 7 +- .../sshd/commands/BanCommitCommand.java | 36 ++++--- .../sshd/commands/BaseTestPrologCommand.java | 14 ++- .../gerrit/sshd/commands/CloseConnection.java | 18 ++-- .../sshd/commands/CreateAccountCommand.java | 16 ++-- .../sshd/commands/CreateBranchCommand.java | 9 +- .../sshd/commands/CreateGroupCommand.java | 36 ++++--- .../sshd/commands/CreateProjectCommand.java | 95 ++++++++----------- .../gerrit/sshd/commands/FlushCaches.java | 7 +- .../commands/GarbageCollectionCommand.java | 11 +-- .../sshd/commands/IndexChangesCommand.java | 11 +-- .../sshd/commands/IndexProjectCommand.java | 11 +-- .../sshd/commands/ListGroupsCommand.java | 20 ++-- .../commands/ListLoggingLevelCommand.java | 7 +- .../sshd/commands/ListMembersCommand.java | 7 +- .../sshd/commands/ListProjectsCommand.java | 7 +- .../gerrit/sshd/commands/LsUserRefs.java | 29 +++--- .../sshd/commands/PluginInstallCommand.java | 7 +- .../google/gerrit/sshd/commands/Query.java | 23 ++--- .../google/gerrit/sshd/commands/Receive.java | 23 ++--- .../sshd/commands/RenameGroupCommand.java | 9 +- .../gerrit/sshd/commands/ReviewCommand.java | 54 +++++------ .../sshd/commands/SetAccountCommand.java | 37 ++++---- .../sshd/commands/SetLoggingLevelCommand.java | 7 +- .../sshd/commands/SetMembersCommand.java | 52 +++++----- .../sshd/commands/SetProjectCommand.java | 70 ++++++-------- .../sshd/commands/SetReviewersCommand.java | 29 +++--- .../gerrit/sshd/commands/ShowCaches.java | 16 ++-- .../gerrit/sshd/commands/ShowConnections.java | 21 ++-- .../gerrit/sshd/commands/ShowQueue.java | 21 ++-- .../gerrit/sshd/commands/StreamEvents.java | 9 +- .../gerrit/sshd/commands/UploadArchive.java | 41 ++++---- 70 files changed, 694 insertions(+), 886 deletions(-) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/annotation/UseGerritConfigAnnotationTest.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/annotation/UseGerritConfigAnnotationTest.java index 53f1839b17..d5ac2f7845 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/annotation/UseGerritConfigAnnotationTest.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/annotation/UseGerritConfigAnnotationTest.java @@ -47,9 +47,8 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest { @Test @GerritConfig( - name = "section.name", - values = {"value-1", "value-2"} - ) + name = "section.name", + values = {"value-1", "value-2"}) public void testList() { assertThat(cfg.getStringList("section", null, "name")) .asList() @@ -58,9 +57,8 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest { @Test @GerritConfig( - name = "section.subsection.name", - values = {"value-1", "value-2"} - ) + name = "section.subsection.name", + values = {"value-1", "value-2"}) public void testListWithSubsection() { assertThat(cfg.getStringList("section", "subsection", "name")) .asList() @@ -69,10 +67,9 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest { @Test @GerritConfig( - name = "section.name", - value = "value-1", - values = {"value-2", "value-3"} - ) + name = "section.name", + value = "value-1", + values = {"value-2", "value-3"}) public void valueHasPrecedenceOverValues() { assertThat(cfg.getStringList("section", null, "name")).asList().containsExactly("value-1"); } diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/annotation/UseGlobalPluginConfigAnnotationTest.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/annotation/UseGlobalPluginConfigAnnotationTest.java index eaa0a95d8b..44d9e4619e 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/annotation/UseGlobalPluginConfigAnnotationTest.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/annotation/UseGlobalPluginConfigAnnotationTest.java @@ -57,10 +57,9 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest { @Test @UseLocalDisk @GlobalPluginConfig( - pluginName = "test", - name = "section.name", - values = {"value-1", "value-2"} - ) + pluginName = "test", + name = "section.name", + values = {"value-1", "value-2"}) public void testList() { assertThat(cfg().getStringList("section", null, "name")) .asList() @@ -70,10 +69,9 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest { @Test @UseLocalDisk @GlobalPluginConfig( - pluginName = "test", - name = "section.subsection.name", - values = {"value-1", "value-2"} - ) + pluginName = "test", + name = "section.subsection.name", + values = {"value-1", "value-2"}) public void testListWithSubsection() { assertThat(cfg().getStringList("section", "subsection", "name")) .asList() @@ -83,11 +81,10 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest { @Test @UseLocalDisk @GlobalPluginConfig( - pluginName = "test", - name = "section.name", - value = "value-1", - values = {"value-2", "value-3"} - ) + pluginName = "test", + name = "section.name", + value = "value-1", + values = {"value-2", "value-3"}) public void valueHasPrecedenceOverValues() { assertThat(cfg().getStringList("section", null, "name")).asList().containsExactly("value-1"); } diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/AccountIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/AccountIT.java index 15987622e5..a20e62b994 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/AccountIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/AccountIT.java @@ -647,9 +647,8 @@ public class AccountIT extends AbstractDaemonTest { @Test @GerritConfig( - name = "auth.registerEmailPrivateKey", - value = "HsOc6l+2lhS9G7sE/RsnS7Z6GJjdRDX14co=" - ) + name = "auth.registerEmailPrivateKey", + value = "HsOc6l+2lhS9G7sE/RsnS7Z6GJjdRDX14co=") public void addEmailSendsConfirmationEmail() throws Exception { String email = "new.email@example.com"; EmailInput input = newEmailInput(email, false); diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java index 5fdf8bc35c..22f1602684 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java @@ -62,9 +62,8 @@ public class ServerInfoIT extends AbstractDaemonTest { // download @GerritConfig( - name = "download.archive", - values = {"tar", "tbz2", "tgz", "txz"} - ) + name = "download.archive", + values = {"tar", "tbz2", "tgz", "txz"}) // gerrit @GerritConfig(name = "gerrit.allProjects", value = "Root") diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/mail/ListMailFilterIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/mail/ListMailFilterIT.java index a96c6ece73..ea4f5017ba 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/mail/ListMailFilterIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/mail/ListMailFilterIT.java @@ -47,9 +47,8 @@ public class ListMailFilterIT extends AbstractMailIT { @Test @GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST") @GerritConfig( - name = "receiveemail.filter.patterns", - values = {".+ser@example\\.com", "a@b\\.com"} - ) + name = "receiveemail.filter.patterns", + values = {".+ser@example\\.com", "a@b\\.com"}) public void listFilterWhitelistDoesNotFilterListedUser() throws Exception { ChangeInfo changeInfo = createChangeAndReplyByEmail(); // Check that the comments from the email have been persisted @@ -60,9 +59,8 @@ public class ListMailFilterIT extends AbstractMailIT { @Test @GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST") @GerritConfig( - name = "receiveemail.filter.patterns", - values = {".+@gerritcodereview\\.com", "a@b\\.com"} - ) + name = "receiveemail.filter.patterns", + values = {".+@gerritcodereview\\.com", "a@b\\.com"}) public void listFilterWhitelistFiltersNotListedUser() throws Exception { ChangeInfo changeInfo = createChangeAndReplyByEmail(); // Check that the comments from the email have NOT been persisted @@ -73,9 +71,8 @@ public class ListMailFilterIT extends AbstractMailIT { @Test @GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST") @GerritConfig( - name = "receiveemail.filter.patterns", - values = {".+@gerritcodereview\\.com", "a@b\\.com"} - ) + name = "receiveemail.filter.patterns", + values = {".+@gerritcodereview\\.com", "a@b\\.com"}) public void listFilterBlacklistDoesNotFilterNotListedUser() throws Exception { ChangeInfo changeInfo = createChangeAndReplyByEmail(); // Check that the comments from the email have been persisted @@ -86,9 +83,8 @@ public class ListMailFilterIT extends AbstractMailIT { @Test @GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST") @GerritConfig( - name = "receiveemail.filter.patterns", - values = {".+@example\\.com", "a@b\\.com"} - ) + name = "receiveemail.filter.patterns", + values = {".+@example\\.com", "a@b\\.com"}) public void listFilterBlacklistFiltersListedUser() throws Exception { ChangeInfo changeInfo = createChangeAndReplyByEmail(); // Check that the comments from the email have been persisted diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/UploadArchiveIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/UploadArchiveIT.java index bcdc86664e..b8fd95f762 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/UploadArchiveIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/UploadArchiveIT.java @@ -56,9 +56,8 @@ public class UploadArchiveIT extends AbstractDaemonTest { @Test @GerritConfig( - name = "download.archive", - values = {"tar", "tbz2", "tgz", "txz"} - ) + name = "download.archive", + values = {"tar", "tbz2", "tgz", "txz"}) public void zipFormatDisabled() throws Exception { archiveNotPermitted(); } diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java index 37a2d9024b..3a74bc87e5 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java @@ -162,20 +162,18 @@ public class Daemon extends SiteProgram { private boolean polyGerritDev; @Option( - name = "--init", - aliases = {"-i"}, - usage = "Init site before starting the daemon" - ) + name = "--init", + aliases = {"-i"}, + usage = "Init site before starting the daemon") private boolean doInit; @Option(name = "--stop-only", usage = "Stop the daemon", hidden = true) private boolean stopOnly; @Option( - name = "--migrate-to-note-db", - usage = "Automatically migrate changes to NoteDb", - handler = ExplicitBooleanOptionHandler.class - ) + name = "--migrate-to-note-db", + usage = "Automatically migrate changes to NoteDb", + handler = ExplicitBooleanOptionHandler.class) private boolean migrateToNoteDb; @Option(name = "--trial", usage = "(With --migrate-to-note-db) " + MigrateToNoteDb.TRIAL_USAGE) diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java index 6e7e3de8a3..b9c70684dd 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java @@ -44,10 +44,9 @@ import org.kohsuke.args4j.Option; /** Initialize a new Gerrit installation. */ public class Init extends BaseInit { @Option( - name = "--batch", - aliases = {"-b"}, - usage = "Batch mode; skip interactive prompting" - ) + name = "--batch", + aliases = {"-b"}, + usage = "Batch mode; skip interactive prompting") private boolean batchMode; @Option(name = "--delete-caches", usage = "Delete all persistent caches without asking") @@ -69,9 +68,8 @@ public class Init extends BaseInit { private boolean installAllPlugins; @Option( - name = "--secure-store-lib", - usage = "Path to jar providing SecureStore implementation class" - ) + name = "--secure-store-lib", + usage = "Path to jar providing SecureStore implementation class") private String secureStoreLib; @Option(name = "--dev", usage = "Setup site with default options suitable for developers") diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/MigrateAccountPatchReviewDb.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/MigrateAccountPatchReviewDb.java index 3feab72a0d..4ace62b77f 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/MigrateAccountPatchReviewDb.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/MigrateAccountPatchReviewDb.java @@ -43,9 +43,8 @@ public class MigrateAccountPatchReviewDb extends SiteProgram { private String sourceUrl; @Option( - name = "--chunkSize", - usage = "chunk size of fetching from source and push to target on each time" - ) + name = "--chunkSize", + usage = "chunk size of fetching from source and push to target on each time") private static long chunkSize = 100000; @Override diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/MigrateToNoteDb.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/MigrateToNoteDb.java index 10761c7917..0b44ccfd73 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/MigrateToNoteDb.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/MigrateToNoteDb.java @@ -55,46 +55,42 @@ public class MigrateToNoteDb extends SiteProgram { private Integer threads; @Option( - name = "--project", - usage = - "Only rebuild these projects, do no other migration; incompatible with --change;" - + " recommended for debugging only" - ) + name = "--project", + usage = + "Only rebuild these projects, do no other migration; incompatible with --change;" + + " recommended for debugging only") private List projects = new ArrayList<>(); @Option( - name = "--change", - usage = - "Only rebuild these changes, do no other migration; incompatible with --project;" - + " recommended for debugging only" - ) + name = "--change", + usage = + "Only rebuild these changes, do no other migration; incompatible with --project;" + + " recommended for debugging only") private List changes = new ArrayList<>(); @Option( - name = "--force", - usage = - "Force rebuilding changes where ReviewDb is still the source of truth, even if they" - + " were previously migrated" - ) + name = "--force", + usage = + "Force rebuilding changes where ReviewDb is still the source of truth, even if they" + + " were previously migrated") private boolean force; @Option(name = "--trial", usage = TRIAL_USAGE) private boolean trial; @Option( - name = "--sequence-gap", - usage = - "gap in change sequence numbers between last ReviewDb number and first NoteDb number;" - + " negative indicates using the value of noteDb.changes.initialSequenceGap (default" - + " 1000)" - ) + name = "--sequence-gap", + usage = + "gap in change sequence numbers between last ReviewDb number and first NoteDb number;" + + " negative indicates using the value of noteDb.changes.initialSequenceGap (default" + + " 1000)") private int sequenceGap; @Option( - name = "--reindex", - usage = "Reindex all changes after migration; defaults to false in trial mode, true otherwise", - handler = ExplicitBooleanOptionHandler.class - ) + name = "--reindex", + usage = + "Reindex all changes after migration; defaults to false in trial mode, true otherwise", + handler = ExplicitBooleanOptionHandler.class) private Boolean reindex; private Injector dbInjector; diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Passwd.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Passwd.java index d9c3c5d836..457cae3148 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Passwd.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Passwd.java @@ -38,11 +38,10 @@ public class Passwd extends SiteProgram { private String key; @Argument( - metaVar = "SECTION.KEY", - index = 0, - required = true, - usage = "Section and key separated by a dot of the password to set" - ) + metaVar = "SECTION.KEY", + index = 0, + required = true, + usage = "Section and key separated by a dot of the password to set") private String sectionAndKey; @Argument(metaVar = "PASSWORD", index = 1, required = false, usage = "Password to set") diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/ProtoGen.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/ProtoGen.java index f659bb0783..4fe6cf6f93 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/ProtoGen.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/ProtoGen.java @@ -32,12 +32,11 @@ import org.kohsuke.args4j.Option; public class ProtoGen extends AbstractProgram { @Option( - name = "--output", - aliases = {"-o"}, - required = true, - metaVar = "FILE", - usage = "File to write .proto into" - ) + name = "--output", + aliases = {"-o"}, + required = true, + metaVar = "FILE", + usage = "File to write .proto into") private File file; @Override diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/ProtobufImport.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/ProtobufImport.java index d97085608a..0732b28217 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/ProtobufImport.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/ProtobufImport.java @@ -65,12 +65,11 @@ import org.kohsuke.args4j.Option; */ public class ProtobufImport extends SiteProgram { @Option( - name = "--file", - aliases = {"-f"}, - required = true, - metaVar = "FILE", - usage = "File to import from" - ) + name = "--file", + aliases = {"-f"}, + required = true, + metaVar = "FILE", + usage = "File to import from") private File file; private final LifecycleManager manager = new LifecycleManager(); diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Reindex.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Reindex.java index bee9928153..cdaaf170c5 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Reindex.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Reindex.java @@ -57,9 +57,8 @@ public class Reindex extends SiteProgram { private int threads = Runtime.getRuntime().availableProcessors(); @Option( - name = "--changes-schema-version", - usage = "Schema version to reindex, for changes; default is most recent version" - ) + name = "--changes-schema-version", + usage = "Schema version to reindex, for changes; default is most recent version") private Integer changesVersion; @Option(name = "--verbose", usage = "Output debug information for each change") diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Rulec.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Rulec.java index 1e542176f1..add06ef11d 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Rulec.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Rulec.java @@ -44,11 +44,10 @@ public class Rulec extends SiteProgram { private boolean quiet; @Argument( - index = 0, - multiValued = true, - metaVar = "PROJECT", - usage = "project to compile rules for" - ) + index = 0, + multiValued = true, + metaVar = "PROJECT", + usage = "project to compile rules for") private List projectNames = new ArrayList<>(); private Injector dbInjector; diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/SwitchSecureStore.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/SwitchSecureStore.java index 1a2216224c..1cdd8a8b67 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/SwitchSecureStore.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/SwitchSecureStore.java @@ -57,10 +57,9 @@ public class SwitchSecureStore extends SiteProgram { private static final Logger log = LoggerFactory.getLogger(SwitchSecureStore.class); @Option( - name = "--new-secure-store-lib", - usage = "Path to new SecureStore implementation", - required = true - ) + name = "--new-secure-store-lib", + usage = "Path to new SecureStore implementation", + required = true) private String newSecureStoreLib; @Override diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/SiteProgram.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/SiteProgram.java index b59e085858..1325b78857 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/SiteProgram.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/SiteProgram.java @@ -64,10 +64,9 @@ import org.kohsuke.args4j.Option; public abstract class SiteProgram extends AbstractProgram { @Option( - name = "--site-path", - aliases = {"-d"}, - usage = "Local directory containing site data" - ) + name = "--site-path", + aliases = {"-d"}, + usage = "Local directory containing site data") private void setSitePath(String path) { sitePath = Paths.get(path); } diff --git a/gerrit-server/src/main/java/com/google/gerrit/metrics/dropwizard/ListMetrics.java b/gerrit-server/src/main/java/com/google/gerrit/metrics/dropwizard/ListMetrics.java index 59f6b97a48..012894db7a 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/metrics/dropwizard/ListMetrics.java +++ b/gerrit-server/src/main/java/com/google/gerrit/metrics/dropwizard/ListMetrics.java @@ -39,11 +39,10 @@ class ListMetrics implements RestReadView { boolean dataOnly; @Option( - name = "--prefix", - aliases = {"-p"}, - metaVar = "PREFIX", - usage = "match metric by exact match or prefix" - ) + name = "--prefix", + aliases = {"-p"}, + metaVar = "PREFIX", + usage = "match metric by exact match or prefix") List query = new ArrayList<>(); @Inject diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/access/ListAccess.java b/gerrit-server/src/main/java/com/google/gerrit/server/access/ListAccess.java index 99e6a9facd..a2cedbfde3 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/access/ListAccess.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/access/ListAccess.java @@ -34,11 +34,10 @@ import org.kohsuke.args4j.Option; public class ListAccess implements RestReadView { @Option( - name = "--project", - aliases = {"-p"}, - metaVar = "PROJECT", - usage = "projects for which the access rights should be returned" - ) + name = "--project", + aliases = {"-p"}, + metaVar = "PROJECT", + usage = "projects for which the access rights should be returned") private List projects = new ArrayList<>(); private final GetAccess getAccess; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/account/GetAvatar.java b/gerrit-server/src/main/java/com/google/gerrit/server/account/GetAvatar.java index 0818a0ef80..7ee9112ee7 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/account/GetAvatar.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/account/GetAvatar.java @@ -31,10 +31,9 @@ public class GetAvatar implements RestReadView { private int size; @Option( - name = "--size", - aliases = {"-s"}, - usage = "recommended size in pixels, height and width" - ) + name = "--size", + aliases = {"-s"}, + usage = "recommended size in pixels, height and width") public void setSize(int s) { size = s; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/account/QueryAccounts.java b/gerrit-server/src/main/java/com/google/gerrit/server/account/QueryAccounts.java index e6ac0f69c4..c23e16f682 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/account/QueryAccounts.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/account/QueryAccounts.java @@ -66,11 +66,10 @@ public class QueryAccounts implements RestReadView { } @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of users to return" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of users to return") public void setLimit(int n) { queryProcessor.setUserProvidedLimit(n); @@ -94,21 +93,19 @@ public class QueryAccounts implements RestReadView { } @Option( - name = "--query", - aliases = {"-q"}, - metaVar = "QUERY", - usage = "match users" - ) + name = "--query", + aliases = {"-q"}, + metaVar = "QUERY", + usage = "match users") public void setQuery(String query) { this.query = query; } @Option( - name = "--start", - aliases = {"-S"}, - metaVar = "CNT", - usage = "Number of accounts to skip" - ) + name = "--start", + aliases = {"-S"}, + metaVar = "CNT", + usage = "Number of accounts to skip") public void setStart(int start) { this.start = start; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeEdits.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeEdits.java index 323a31c4f8..2ab2bf8792 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeEdits.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeEdits.java @@ -380,10 +380,9 @@ public class ChangeEdits private final ProjectCache projectCache; @Option( - name = "--base", - aliases = {"-b"}, - usage = "whether to load the content on the base revision instead of the change edit" - ) + name = "--base", + aliases = {"-b"}, + usage = "whether to load the content on the base revision instead of the change edit") private boolean base; @Inject @@ -482,10 +481,9 @@ public class ChangeEdits private final ChangeEditUtil editUtil; @Option( - name = "--base", - aliases = {"-b"}, - usage = "whether to load the message on the base revision instead of the change edit" - ) + name = "--base", + aliases = {"-b"}, + usage = "whether to load the message on the base revision instead of the change edit") private boolean base; @Inject diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/GetBlame.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/GetBlame.java index 4702b5a549..4810ca0c76 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/GetBlame.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/GetBlame.java @@ -59,12 +59,11 @@ public class GetBlame implements RestReadView { private final AutoMerger autoMerger; @Option( - name = "--base", - aliases = {"-b"}, - usage = - "whether to load the blame of the base revision (the direct" - + " parent of the change) instead of the change" - ) + name = "--base", + aliases = {"-b"}, + usage = + "whether to load the blame of the base revision (the direct" + + " parent of the change) instead of the change") private boolean base; @Inject diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/GetPureRevert.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/GetPureRevert.java index 27c5d49c2f..1afc4b1157 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/GetPureRevert.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/GetPureRevert.java @@ -54,10 +54,9 @@ public class GetPureRevert implements RestReadView { private final PatchSetUtil psUtil; @Option( - name = "--claimed-original", - aliases = {"-o"}, - usage = "SHA1 (40 digit hex) of the original commit" - ) + name = "--claimed-original", + aliases = {"-o"}, + usage = "SHA1 (40 digit hex) of the original commit") @Nullable private String claimedOriginal; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/Mergeable.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/Mergeable.java index d1c085a062..a8a297e9ce 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/Mergeable.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/Mergeable.java @@ -55,10 +55,9 @@ public class Mergeable implements RestReadView { private static final Logger log = LoggerFactory.getLogger(Mergeable.class); @Option( - name = "--other-branches", - aliases = {"-o"}, - usage = "test mergeability for other branches too" - ) + name = "--other-branches", + aliases = {"-o"}, + usage = "test mergeability for other branches too") private boolean otherBranches; private final GitRepositoryManager gitManager; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/SuggestChangeReviewers.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/SuggestChangeReviewers.java index 1235e63ad6..4d3abb24eb 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/SuggestChangeReviewers.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/SuggestChangeReviewers.java @@ -43,10 +43,9 @@ public class SuggestChangeReviewers extends SuggestReviewers implements RestReadView { @Option( - name = "--exclude-groups", - aliases = {"-e"}, - usage = "exclude groups from query" - ) + name = "--exclude-groups", + aliases = {"-e"}, + usage = "exclude groups from query") boolean excludeGroups; private final PermissionBackend permissionBackend; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/SuggestReviewers.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/SuggestReviewers.java index 2ed80718a1..6124f42e11 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/SuggestReviewers.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/SuggestReviewers.java @@ -39,21 +39,19 @@ public class SuggestReviewers { protected final int maxSuggestedReviewers; @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of reviewers to list" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of reviewers to list") public void setLimit(int l) { this.limit = l <= 0 ? maxSuggestedReviewers : Math.min(l, maxSuggestedReviewers); } @Option( - name = "--query", - aliases = {"-q"}, - metaVar = "QUERY", - usage = "match reviewers query" - ) + name = "--query", + aliases = {"-q"}, + metaVar = "QUERY", + usage = "match reviewers query") public void setQuery(String q) { this.query = q; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/receive/ReceiveCommits.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/receive/ReceiveCommits.java index 740c9ab0cc..0afa3bd65f 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/receive/ReceiveCommits.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/receive/ReceiveCommits.java @@ -1172,11 +1172,10 @@ class ReceiveCommits { String topic; @Option( - name = "--draft", - usage = - "Will be removed. Before that, this option will be mapped to '--private'" - + "for new changes and '--edit' for existing changes" - ) + name = "--draft", + usage = + "Will be removed. Before that, this option will be mapped to '--private'" + + "for new changes and '--edit' for existing changes") boolean draft; boolean publish; @@ -1188,20 +1187,18 @@ class ReceiveCommits { boolean removePrivate; @Option( - name = "--wip", - aliases = {"-work-in-progress"}, - usage = "mark change as work in progress" - ) + name = "--wip", + aliases = {"-work-in-progress"}, + usage = "mark change as work in progress") boolean workInProgress; @Option(name = "--ready", usage = "mark change as ready") boolean ready; @Option( - name = "--edit", - aliases = {"-e"}, - usage = "upload as change edit" - ) + name = "--edit", + aliases = {"-e"}, + usage = "upload as change edit") boolean edit; @Option(name = "--submit", usage = "immediately submit the change") @@ -1214,19 +1211,17 @@ class ReceiveCommits { private boolean publishComments; @Option( - name = "--no-publish-comments", - aliases = {"--np"}, - usage = "do not publish draft comments" - ) + name = "--no-publish-comments", + aliases = {"--np"}, + usage = "do not publish draft comments") private boolean noPublishComments; @Option( - name = "--notify", - usage = - "Notify handling that defines to whom email notifications " - + "should be sent. Allowed values are NONE, OWNER, " - + "OWNER_REVIEWERS, ALL. If not set, the default is ALL." - ) + name = "--notify", + usage = + "Notify handling that defines to whom email notifications " + + "should be sent. Allowed values are NONE, OWNER, " + + "OWNER_REVIEWERS, ALL. If not set, the default is ALL.") private NotifyHandling notify; @Option(name = "--notify-to", metaVar = "USER", usage = "user that should be notified") @@ -1239,11 +1234,10 @@ class ReceiveCommits { List bccs = new ArrayList<>(); @Option( - name = "--reviewer", - aliases = {"-r"}, - metaVar = "EMAIL", - usage = "add reviewer to changes" - ) + name = "--reviewer", + aliases = {"-r"}, + metaVar = "EMAIL", + usage = "add reviewer to changes") void reviewer(Account.Id id) { reviewer.add(id); } @@ -1254,11 +1248,10 @@ class ReceiveCommits { } @Option( - name = "--label", - aliases = {"-l"}, - metaVar = "LABEL+VALUE", - usage = "label(s) to assign (defaults to +1 if no value provided" - ) + name = "--label", + aliases = {"-l"}, + metaVar = "LABEL+VALUE", + usage = "label(s) to assign (defaults to +1 if no value provided") void addLabel(String token) throws CmdLineException { LabelVote v = LabelVote.parse(token); try { @@ -1271,11 +1264,10 @@ class ReceiveCommits { } @Option( - name = "--message", - aliases = {"-m"}, - metaVar = "MESSAGE", - usage = "Comment message to apply to the review" - ) + name = "--message", + aliases = {"-m"}, + metaVar = "MESSAGE", + usage = "Comment message to apply to the review") void addMessage(String token) { // Many characters have special meaning in the context of a git ref. // @@ -1293,11 +1285,10 @@ class ReceiveCommits { } @Option( - name = "--hashtag", - aliases = {"-t"}, - metaVar = "HASHTAG", - usage = "add hashtag to changes" - ) + name = "--hashtag", + aliases = {"-t"}, + metaVar = "HASHTAG", + usage = "add hashtag to changes") void addHashtag(String token) throws CmdLineException { if (!notesMigration.readChanges()) { throw clp.reject("cannot add hashtags; noteDb is disabled"); diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java b/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java index 910468f6e2..480139deab 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java @@ -90,37 +90,33 @@ public class ListGroups implements RestReadView { private String suggest; @Option( - name = "--project", - aliases = {"-p"}, - usage = "projects for which the groups should be listed" - ) + name = "--project", + aliases = {"-p"}, + usage = "projects for which the groups should be listed") public void addProject(ProjectControl project) { projects.add(project); } @Option( - name = "--visible-to-all", - usage = "to list only groups that are visible to all registered users" - ) + name = "--visible-to-all", + usage = "to list only groups that are visible to all registered users") public void setVisibleToAll(boolean visibleToAll) { this.visibleToAll = visibleToAll; } @Option( - name = "--user", - aliases = {"-u"}, - usage = "user for which the groups should be listed" - ) + name = "--user", + aliases = {"-u"}, + usage = "user for which the groups should be listed") public void setUser(Account.Id user) { this.user = user; } @Option( - name = "--owned", - usage = - "to list only groups that are owned by the" - + " specified user or by the calling user if no user was specifed" - ) + name = "--owned", + usage = + "to list only groups that are owned by the" + + " specified user or by the calling user if no user was specifed") public void setOwned(boolean owned) { this.owned = owned; } @@ -133,68 +129,61 @@ public class ListGroups implements RestReadView { */ @Deprecated @Option( - name = "--query", - aliases = {"-q"}, - usage = "group to inspect (deprecated: use --group/-g instead)" - ) + name = "--query", + aliases = {"-q"}, + usage = "group to inspect (deprecated: use --group/-g instead)") void addGroup_Deprecated(AccountGroup.UUID uuid) { addGroup(uuid); } @Option( - name = "--group", - aliases = {"-g"}, - usage = "group to inspect" - ) + name = "--group", + aliases = {"-g"}, + usage = "group to inspect") public void addGroup(AccountGroup.UUID uuid) { groupsToInspect.add(uuid); } @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of groups to list" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of groups to list") public void setLimit(int limit) { this.limit = limit; } @Option( - name = "--start", - aliases = {"-S"}, - metaVar = "CNT", - usage = "number of groups to skip" - ) + name = "--start", + aliases = {"-S"}, + metaVar = "CNT", + usage = "number of groups to skip") public void setStart(int start) { this.start = start; } @Option( - name = "--match", - aliases = {"-m"}, - metaVar = "MATCH", - usage = "match group substring" - ) + name = "--match", + aliases = {"-m"}, + metaVar = "MATCH", + usage = "match group substring") public void setMatchSubstring(String matchSubstring) { this.matchSubstring = matchSubstring; } @Option( - name = "--regex", - aliases = {"-r"}, - metaVar = "REGEX", - usage = "match group regex" - ) + name = "--regex", + aliases = {"-r"}, + metaVar = "REGEX", + usage = "match group regex") public void setMatchRegex(String matchRegex) { this.matchRegex = matchRegex; } @Option( - name = "--suggest", - aliases = {"-s"}, - usage = "to get a suggestion of groups" - ) + name = "--suggest", + aliases = {"-s"}, + usage = "to get a suggestion of groups") public void setSuggest(String suggest) { this.suggest = suggest; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/group/QueryGroups.java b/gerrit-server/src/main/java/com/google/gerrit/server/group/QueryGroups.java index c5fd2cbb15..bc77f761a0 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/group/QueryGroups.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/group/QueryGroups.java @@ -50,30 +50,27 @@ public class QueryGroups implements RestReadView { // removed we want to rename --query2 to --query here. /** --query (-q) is already used by {@link ListGroups} */ @Option( - name = "--query2", - aliases = {"-q2"}, - usage = "group query" - ) + name = "--query2", + aliases = {"-q2"}, + usage = "group query") public void setQuery(String query) { this.query = query; } @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of groups to list" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of groups to list") public void setLimit(int limit) { this.limit = limit; } @Option( - name = "--start", - aliases = {"-S"}, - metaVar = "CNT", - usage = "number of groups to skip" - ) + name = "--start", + aliases = {"-S"}, + metaVar = "CNT", + usage = "number of groups to skip") public void setStart(int start) { this.start = start; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/ListPlugins.java b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/ListPlugins.java index 989e839646..ee7cd5c582 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/ListPlugins.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/ListPlugins.java @@ -47,50 +47,45 @@ public class ListPlugins implements RestReadView { private String matchRegex; @Option( - name = "--all", - aliases = {"-a"}, - usage = "List all plugins, including disabled plugins" - ) + name = "--all", + aliases = {"-a"}, + usage = "List all plugins, including disabled plugins") public void setAll(boolean all) { this.all = all; } @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of plugins to list" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of plugins to list") public void setLimit(int limit) { this.limit = limit; } @Option( - name = "--start", - aliases = {"-S"}, - metaVar = "CNT", - usage = "number of plugins to skip" - ) + name = "--start", + aliases = {"-S"}, + metaVar = "CNT", + usage = "number of plugins to skip") public void setStart(int start) { this.start = start; } @Option( - name = "--prefix", - aliases = {"-p"}, - metaVar = "PREFIX", - usage = "match plugin prefix" - ) + name = "--prefix", + aliases = {"-p"}, + metaVar = "PREFIX", + usage = "match plugin prefix") public void setMatchPrefix(String matchPrefix) { this.matchPrefix = matchPrefix; } @Option( - name = "--match", - aliases = {"-m"}, - metaVar = "MATCH", - usage = "match plugin substring" - ) + name = "--match", + aliases = {"-m"}, + metaVar = "MATCH", + usage = "match plugin substring") public void setMatchSubstring(String matchSubstring) { this.matchSubstring = matchSubstring; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/CheckMergeability.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/CheckMergeability.java index 1ab2dbd5b2..ab48143a2c 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/CheckMergeability.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/CheckMergeability.java @@ -42,23 +42,21 @@ public class CheckMergeability implements RestReadView { private SubmitType submitType; @Option( - name = "--source", - metaVar = "COMMIT", - usage = - "the source reference to merge, which could be any git object " - + "references expression, refer to " - + "org.eclipse.jgit.lib.Repository#resolve(String)", - required = true - ) + name = "--source", + metaVar = "COMMIT", + usage = + "the source reference to merge, which could be any git object " + + "references expression, refer to " + + "org.eclipse.jgit.lib.Repository#resolve(String)", + required = true) public void setSource(String source) { this.source = source; } @Option( - name = "--strategy", - metaVar = "STRATEGY", - usage = "name of the merge strategy, refer to org.eclipse.jgit.merge.MergeStrategy" - ) + name = "--strategy", + metaVar = "STRATEGY", + usage = "name of the merge strategy, refer to org.eclipse.jgit.merge.MergeStrategy") public void setStrategy(String strategy) { this.strategy = strategy; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/GetReflog.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/GetReflog.java index 44d6a4f9dd..81f08731be 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/GetReflog.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/GetReflog.java @@ -42,37 +42,34 @@ public class GetReflog implements RestReadView { private final GitRepositoryManager repoManager; @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of reflog entries to list" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of reflog entries to list") public GetReflog setLimit(int limit) { this.limit = limit; return this; } @Option( - name = "--from", - metaVar = "TIMESTAMP", - usage = - "timestamp from which the reflog entries should be listed (UTC, format: " - + TimestampHandler.TIMESTAMP_FORMAT - + ")" - ) + name = "--from", + metaVar = "TIMESTAMP", + usage = + "timestamp from which the reflog entries should be listed (UTC, format: " + + TimestampHandler.TIMESTAMP_FORMAT + + ")") public GetReflog setFrom(Timestamp from) { this.from = from; return this; } @Option( - name = "--to", - metaVar = "TIMESTAMP", - usage = - "timestamp until which the reflog entries should be listed (UTC, format: " - + TimestampHandler.TIMESTAMP_FORMAT - + ")" - ) + name = "--to", + metaVar = "TIMESTAMP", + usage = + "timestamp until which the reflog entries should be listed (UTC, format: " + + TimestampHandler.TIMESTAMP_FORMAT + + ")") public GetReflog setTo(Timestamp to) { this.to = to; return this; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListBranches.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListBranches.java index b2edc6b77a..9227f3ddde 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListBranches.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListBranches.java @@ -60,41 +60,37 @@ public class ListBranches implements RestReadView { private final WebLinks webLinks; @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of branches to list" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of branches to list") public void setLimit(int limit) { this.limit = limit; } @Option( - name = "--start", - aliases = {"-S", "-s"}, - metaVar = "CNT", - usage = "number of branches to skip" - ) + name = "--start", + aliases = {"-S", "-s"}, + metaVar = "CNT", + usage = "number of branches to skip") public void setStart(int start) { this.start = start; } @Option( - name = "--match", - aliases = {"-m"}, - metaVar = "MATCH", - usage = "match branches substring" - ) + name = "--match", + aliases = {"-m"}, + metaVar = "MATCH", + usage = "match branches substring") public void setMatchSubstring(String matchSubstring) { this.matchSubstring = matchSubstring; } @Option( - name = "--regex", - aliases = {"-r"}, - metaVar = "REGEX", - usage = "match branches regex" - ) + name = "--regex", + aliases = {"-r"}, + metaVar = "REGEX", + usage = "match branches regex") public void setMatchRegex(String matchRegex) { this.matchRegex = matchRegex; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java index 16585bda25..887dfe3360 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java @@ -152,21 +152,19 @@ public class ListProjects implements RestReadView { private OutputFormat format = OutputFormat.TEXT; @Option( - name = "--show-branch", - aliases = {"-b"}, - usage = "displays the sha of each project in the specified branch" - ) + name = "--show-branch", + aliases = {"-b"}, + usage = "displays the sha of each project in the specified branch") public void addShowBranch(String branch) { showBranch.add(branch); } @Option( - name = "--tree", - aliases = {"-t"}, - usage = - "displays project inheritance in a tree-like format\n" - + "this option does not work together with the show-branch option" - ) + name = "--tree", + aliases = {"-t"}, + usage = + "displays project inheritance in a tree-like format\n" + + "this option does not work together with the show-branch option") public void setShowTree(boolean showTree) { this.showTree = showTree; } @@ -177,10 +175,9 @@ public class ListProjects implements RestReadView { } @Option( - name = "--description", - aliases = {"-d"}, - usage = "include description of project in list" - ) + name = "--description", + aliases = {"-d"}, + usage = "include description of project in list") public void setShowDescription(boolean showDescription) { this.showDescription = showDescription; } @@ -191,41 +188,37 @@ public class ListProjects implements RestReadView { } @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of projects to list" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of projects to list") public void setLimit(int limit) { this.limit = limit; } @Option( - name = "--start", - aliases = {"-S"}, - metaVar = "CNT", - usage = "number of projects to skip" - ) + name = "--start", + aliases = {"-S"}, + metaVar = "CNT", + usage = "number of projects to skip") public void setStart(int start) { this.start = start; } @Option( - name = "--prefix", - aliases = {"-p"}, - metaVar = "PREFIX", - usage = "match project prefix" - ) + name = "--prefix", + aliases = {"-p"}, + metaVar = "PREFIX", + usage = "match project prefix") public void setMatchPrefix(String matchPrefix) { this.matchPrefix = matchPrefix; } @Option( - name = "--match", - aliases = {"-m"}, - metaVar = "MATCH", - usage = "match project substring" - ) + name = "--match", + aliases = {"-m"}, + metaVar = "MATCH", + usage = "match project substring") public void setMatchSubstring(String matchSubstring) { this.matchSubstring = matchSubstring; } @@ -236,10 +229,9 @@ public class ListProjects implements RestReadView { } @Option( - name = "--has-acl-for", - metaVar = "GROUP", - usage = "displays only projects on which access rights for this group are directly assigned" - ) + name = "--has-acl-for", + metaVar = "GROUP", + usage = "displays only projects on which access rights for this group are directly assigned") public void setGroupUuid(AccountGroup.UUID groupUuid) { this.groupUuid = groupUuid; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListTags.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListTags.java index d57234aa8f..58ee77da0d 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListTags.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListTags.java @@ -57,41 +57,37 @@ public class ListTags implements RestReadView { private final WebLinks links; @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "maximum number of tags to list" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "maximum number of tags to list") public void setLimit(int limit) { this.limit = limit; } @Option( - name = "--start", - aliases = {"-S", "-s"}, - metaVar = "CNT", - usage = "number of tags to skip" - ) + name = "--start", + aliases = {"-S", "-s"}, + metaVar = "CNT", + usage = "number of tags to skip") public void setStart(int start) { this.start = start; } @Option( - name = "--match", - aliases = {"-m"}, - metaVar = "MATCH", - usage = "match tags substring" - ) + name = "--match", + aliases = {"-m"}, + metaVar = "MATCH", + usage = "match tags substring") public void setMatchSubstring(String matchSubstring) { this.matchSubstring = matchSubstring; } @Option( - name = "--regex", - aliases = {"-r"}, - metaVar = "REGEX", - usage = "match tags regex" - ) + name = "--regex", + aliases = {"-r"}, + metaVar = "REGEX", + usage = "match tags regex") public void setMatchRegex(String matchRegex) { this.matchRegex = matchRegex; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryChanges.java b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryChanges.java index 8ad0e0b3e4..73bb1d7d4c 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryChanges.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryChanges.java @@ -42,19 +42,17 @@ public class QueryChanges implements RestReadView { private EnumSet options; @Option( - name = "--query", - aliases = {"-q"}, - metaVar = "QUERY", - usage = "Query string" - ) + name = "--query", + aliases = {"-q"}, + metaVar = "QUERY", + usage = "Query string") private List queries; @Option( - name = "--limit", - aliases = {"-n"}, - metaVar = "CNT", - usage = "Maximum number of results to return" - ) + name = "--limit", + aliases = {"-n"}, + metaVar = "CNT", + usage = "Maximum number of results to return") public void setLimit(int limit) { imp.setUserProvidedLimit(limit); } @@ -70,11 +68,10 @@ public class QueryChanges implements RestReadView { } @Option( - name = "--start", - aliases = {"-S"}, - metaVar = "CNT", - usage = "Number of changes to skip" - ) + name = "--start", + aliases = {"-S"}, + metaVar = "CNT", + usage = "Number of changes to skip") public void setStart(int start) { imp.setStart(start); } diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AdminSetParent.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AdminSetParent.java index 0d7fa24e42..22eafd6927 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AdminSetParent.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AdminSetParent.java @@ -45,41 +45,36 @@ import org.slf4j.LoggerFactory; @RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER) @CommandMetaData( - name = "set-project-parent", - description = "Change the project permissions are inherited from" -) + name = "set-project-parent", + description = "Change the project permissions are inherited from") final class AdminSetParent extends SshCommand { private static final Logger log = LoggerFactory.getLogger(AdminSetParent.class); @Option( - name = "--parent", - aliases = {"-p"}, - metaVar = "NAME", - usage = "new parent project" - ) + name = "--parent", + aliases = {"-p"}, + metaVar = "NAME", + usage = "new parent project") private ProjectControl newParent; @Option( - name = "--children-of", - metaVar = "NAME", - usage = "parent project for which the child projects should be reparented" - ) + name = "--children-of", + metaVar = "NAME", + usage = "parent project for which the child projects should be reparented") private ProjectControl oldParent; @Option( - name = "--exclude", - metaVar = "NAME", - usage = "child project of old parent project which should not be reparented" - ) + name = "--exclude", + metaVar = "NAME", + usage = "child project of old parent project which should not be reparented") private List excludedChildren = new ArrayList<>(); @Argument( - index = 0, - required = false, - multiValued = true, - metaVar = "NAME", - usage = "projects to modify" - ) + index = 0, + required = false, + multiValued = true, + metaVar = "NAME", + usage = "projects to modify") private List children = new ArrayList<>(); @Inject private ProjectCache projectCache; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AproposCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AproposCommand.java index 577b58fec3..d3db70d1db 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AproposCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AproposCommand.java @@ -27,10 +27,9 @@ import java.util.List; import org.kohsuke.args4j.Argument; @CommandMetaData( - name = "apropos", - description = "Search in Gerrit documentation", - runsAt = MASTER_OR_SLAVE -) + name = "apropos", + description = "Search in Gerrit documentation", + runsAt = MASTER_OR_SLAVE) final class AproposCommand extends SshCommand { @Inject private QueryDocumentationExecutor searcher; @Inject @CanonicalWebUrl String url; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/BanCommitCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/BanCommitCommand.java index d06f65c49a..3699073d6f 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/BanCommitCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/BanCommitCommand.java @@ -32,34 +32,30 @@ import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Option; @CommandMetaData( - name = "ban-commit", - description = "Ban a commit from a project's repository", - runsAt = MASTER -) + name = "ban-commit", + description = "Ban a commit from a project's repository", + runsAt = MASTER) public class BanCommitCommand extends SshCommand { @Option( - name = "--reason", - aliases = {"-r"}, - metaVar = "REASON", - usage = "reason for banning the commit" - ) + name = "--reason", + aliases = {"-r"}, + metaVar = "REASON", + usage = "reason for banning the commit") private String reason; @Argument( - index = 0, - required = true, - metaVar = "PROJECT", - usage = "name of the project for which the commit should be banned" - ) + index = 0, + required = true, + metaVar = "PROJECT", + usage = "name of the project for which the commit should be banned") private ProjectControl projectControl; @Argument( - index = 1, - required = true, - multiValued = true, - metaVar = "COMMIT", - usage = "commit(s) that should be banned" - ) + index = 1, + required = true, + multiValued = true, + metaVar = "COMMIT", + usage = "commit(s) that should be banned") private List commitsToBan = new ArrayList<>(); @Inject private BanCommit banCommit; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/BaseTestPrologCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/BaseTestPrologCommand.java index 56ff5eacac..e66422abee 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/BaseTestPrologCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/BaseTestPrologCommand.java @@ -42,17 +42,15 @@ abstract class BaseTestPrologCommand extends SshCommand { protected String changeId; @Option( - name = "-s", - usage = - "Read prolog script from stdin instead of reading rules.pl from the refs/meta/config branch" - ) + name = "-s", + usage = + "Read prolog script from stdin instead of reading rules.pl from the refs/meta/config branch") protected boolean useStdin; @Option( - name = "--no-filters", - aliases = {"-n"}, - usage = "Don't run the submit_filter/2 from the parent projects" - ) + name = "--no-filters", + aliases = {"-n"}, + usage = "Don't run the submit_filter/2 from the parent projects") void setNoFilters(boolean no) { input.filters = no ? Filters.SKIP : Filters.RUN; } diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CloseConnection.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CloseConnection.java index 0e101a900a..4640211059 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CloseConnection.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CloseConnection.java @@ -40,10 +40,9 @@ import org.slf4j.LoggerFactory; @AdminHighPriorityCommand @RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER) @CommandMetaData( - name = "close-connection", - description = "Close the specified SSH connection", - runsAt = MASTER_OR_SLAVE -) + name = "close-connection", + description = "Close the specified SSH connection", + runsAt = MASTER_OR_SLAVE) final class CloseConnection extends SshCommand { private static final Logger log = LoggerFactory.getLogger(CloseConnection.class); @@ -51,12 +50,11 @@ final class CloseConnection extends SshCommand { @Inject private SshDaemon sshDaemon; @Argument( - index = 0, - multiValued = true, - required = true, - metaVar = "SESSION_ID", - usage = "List of SSH session IDs to be closed" - ) + index = 0, + multiValued = true, + required = true, + metaVar = "SESSION_ID", + usage = "List of SSH session IDs to be closed") private final List sessionIds = new ArrayList<>(); @Option(name = "--wait", usage = "wait for connection to close before exiting") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateAccountCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateAccountCommand.java index 0c63fb3271..93b56953b0 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateAccountCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateAccountCommand.java @@ -42,11 +42,10 @@ import org.kohsuke.args4j.Option; @CommandMetaData(name = "create-account", description = "Create a new batch/role account") final class CreateAccountCommand extends SshCommand { @Option( - name = "--group", - aliases = {"-g"}, - metaVar = "GROUP", - usage = "groups to add account to" - ) + name = "--group", + aliases = {"-g"}, + metaVar = "GROUP", + usage = "groups to add account to") private List groups = new ArrayList<>(); @Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account") @@ -59,10 +58,9 @@ final class CreateAccountCommand extends SshCommand { private String sshKey; @Option( - name = "--http-password", - metaVar = "PASSWORD", - usage = "password for HTTP authentication" - ) + name = "--http-password", + metaVar = "PASSWORD", + usage = "password for HTTP authentication") private String httpPassword; @Argument(index = 0, required = true, metaVar = "USERNAME", usage = "name of the user account") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateBranchCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateBranchCommand.java index 5962faaa32..46cfc9ab4a 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateBranchCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateBranchCommand.java @@ -34,11 +34,10 @@ public final class CreateBranchCommand extends SshCommand { private String name; @Argument( - index = 2, - required = true, - metaVar = "REVISION", - usage = "base revision of the new branch" - ) + index = 2, + required = true, + metaVar = "REVISION", + usage = "base revision of the new branch") private String revision; @Inject GerritApi gApi; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateGroupCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateGroupCommand.java index 6b5d6323ed..1855f41b13 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateGroupCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateGroupCommand.java @@ -50,19 +50,17 @@ import org.kohsuke.args4j.Option; @CommandMetaData(name = "create-group", description = "Create a new account group") final class CreateGroupCommand extends SshCommand { @Option( - name = "--owner", - aliases = {"-o"}, - metaVar = "GROUP", - usage = "owning group, if not specified the group will be self-owning" - ) + name = "--owner", + aliases = {"-o"}, + metaVar = "GROUP", + usage = "owning group, if not specified the group will be self-owning") private AccountGroup.Id ownerGroupId; @Option( - name = "--description", - aliases = {"-d"}, - metaVar = "DESC", - usage = "description of group" - ) + name = "--description", + aliases = {"-d"}, + metaVar = "DESC", + usage = "description of group") private String groupDescription = ""; @Argument(index = 0, required = true, metaVar = "GROUP", usage = "name of group to be created") @@ -71,11 +69,10 @@ final class CreateGroupCommand extends SshCommand { private final Set initialMembers = new HashSet<>(); @Option( - name = "--member", - aliases = {"-m"}, - metaVar = "USERNAME", - usage = "initial set of users to become members of the group" - ) + name = "--member", + aliases = {"-m"}, + metaVar = "USERNAME", + usage = "initial set of users to become members of the group") void addMember(Account.Id id) { initialMembers.add(id); } @@ -86,11 +83,10 @@ final class CreateGroupCommand extends SshCommand { private final Set initialGroups = new HashSet<>(); @Option( - name = "--group", - aliases = "-g", - metaVar = "GROUP", - usage = "initial set of groups to be included in the group" - ) + name = "--group", + aliases = "-g", + metaVar = "GROUP", + usage = "initial set of groups to be included in the group") void addGroup(AccountGroup.UUID id) { initialGroups.add(id); } diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateProjectCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateProjectCommand.java index 0df2a80949..8ccf8645d3 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateProjectCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateProjectCommand.java @@ -42,50 +42,44 @@ import org.kohsuke.args4j.Option; /** Create a new project. * */ @RequiresCapability(GlobalCapability.CREATE_PROJECT) @CommandMetaData( - name = "create-project", - description = "Create a new project and associated Git repository" -) + name = "create-project", + description = "Create a new project and associated Git repository") final class CreateProjectCommand extends SshCommand { @Option( - name = "--suggest-parents", - aliases = {"-S"}, - usage = - "suggest parent candidates, " - + "if this option is used all other options and arguments are ignored" - ) + name = "--suggest-parents", + aliases = {"-S"}, + usage = + "suggest parent candidates, " + + "if this option is used all other options and arguments are ignored") private boolean suggestParent; @Option( - name = "--owner", - aliases = {"-o"}, - usage = "owner(s) of project" - ) + name = "--owner", + aliases = {"-o"}, + usage = "owner(s) of project") private List ownerIds; @Option( - name = "--parent", - aliases = {"-p"}, - metaVar = "NAME", - usage = "parent project" - ) + name = "--parent", + aliases = {"-p"}, + metaVar = "NAME", + usage = "parent project") private ProjectControl newParent; @Option(name = "--permissions-only", usage = "create project for use only as parent") private boolean permissionsOnly; @Option( - name = "--description", - aliases = {"-d"}, - metaVar = "DESCRIPTION", - usage = "description of project" - ) + name = "--description", + aliases = {"-d"}, + metaVar = "DESCRIPTION", + usage = "description of project") private String projectDescription = ""; @Option( - name = "--submit-type", - aliases = {"-t"}, - usage = "project submit type" - ) + name = "--submit-type", + aliases = {"-t"}, + usage = "project submit type") private SubmitType submitType; @Option(name = "--contributor-agreements", usage = "if contributor agreement is required") @@ -101,25 +95,22 @@ final class CreateProjectCommand extends SshCommand { private InheritableBoolean requireChangeID = InheritableBoolean.INHERIT; @Option( - name = "--new-change-for-all-not-in-target", - usage = "if a new change will be created for every commit not in target branch" - ) + name = "--new-change-for-all-not-in-target", + usage = "if a new change will be created for every commit not in target branch") private InheritableBoolean createNewChangeForAllNotInTarget = InheritableBoolean.INHERIT; @Option( - name = "--use-contributor-agreements", - aliases = {"--ca"}, - usage = "if contributor agreement is required" - ) + name = "--use-contributor-agreements", + aliases = {"--ca"}, + usage = "if contributor agreement is required") void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) { contributorAgreements = InheritableBoolean.TRUE; } @Option( - name = "--use-signed-off-by", - aliases = {"--so"}, - usage = "if signed-off-by is required" - ) + name = "--use-signed-off-by", + aliases = {"--so"}, + usage = "if signed-off-by is required") void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) { signedOffBy = InheritableBoolean.TRUE; } @@ -130,29 +121,26 @@ final class CreateProjectCommand extends SshCommand { } @Option( - name = "--require-change-id", - aliases = {"--id"}, - usage = "if change-id is required" - ) + name = "--require-change-id", + aliases = {"--id"}, + usage = "if change-id is required") void setRequireChangeId(@SuppressWarnings("unused") boolean on) { requireChangeID = InheritableBoolean.TRUE; } @Option( - name = "--create-new-change-for-all-not-in-target", - aliases = {"--ncfa"}, - usage = "if a new change will be created for every commit not in target branch" - ) + name = "--create-new-change-for-all-not-in-target", + aliases = {"--ncfa"}, + usage = "if a new change will be created for every commit not in target branch") void setNewChangeForAllNotInTarget(@SuppressWarnings("unused") boolean on) { createNewChangeForAllNotInTarget = InheritableBoolean.TRUE; } @Option( - name = "--branch", - aliases = {"-b"}, - metaVar = "BRANCH", - usage = "initial branch name\n(default: master)" - ) + name = "--branch", + aliases = {"-b"}, + metaVar = "BRANCH", + usage = "initial branch name\n(default: master)") private List branch; @Option(name = "--empty-commit", usage = "to create initial empty commit") @@ -162,9 +150,8 @@ final class CreateProjectCommand extends SshCommand { private String maxObjectSizeLimit; @Option( - name = "--plugin-config", - usage = "plugin configuration parameter with format '.='" - ) + name = "--plugin-config", + usage = "plugin configuration parameter with format '.='") private List pluginConfigValues; @Argument(index = 0, metaVar = "NAME", usage = "name of project to be created") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/FlushCaches.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/FlushCaches.java index 392fd29d7e..d9c892d6fa 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/FlushCaches.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/FlushCaches.java @@ -37,10 +37,9 @@ import org.kohsuke.args4j.Option; /** Causes the caches to purge all entries and reload. */ @RequiresAnyCapability({FLUSH_CACHES, MAINTAIN_SERVER}) @CommandMetaData( - name = "flush-caches", - description = "Flush some/all server caches from memory", - runsAt = MASTER_OR_SLAVE -) + name = "flush-caches", + description = "Flush some/all server caches from memory", + runsAt = MASTER_OR_SLAVE) final class FlushCaches extends SshCommand { @Option(name = "--cache", usage = "flush named cache", metaVar = "NAME") private List caches = new ArrayList<>(); diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/GarbageCollectionCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/GarbageCollectionCommand.java index b0b26faf1d..c4b4d6084b 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/GarbageCollectionCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/GarbageCollectionCommand.java @@ -48,12 +48,11 @@ public class GarbageCollectionCommand extends SshCommand { private boolean aggressive; @Argument( - index = 0, - required = false, - multiValued = true, - metaVar = "NAME", - usage = "projects for which the Git garbage collection should be run" - ) + index = 0, + required = false, + multiValued = true, + metaVar = "NAME", + usage = "projects for which the Git garbage collection should be run") private List projects = new ArrayList<>(); @Inject private ProjectCache projectCache; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/IndexChangesCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/IndexChangesCommand.java index 821257c696..b624ee1d3e 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/IndexChangesCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/IndexChangesCommand.java @@ -34,12 +34,11 @@ final class IndexChangesCommand extends SshCommand { @Inject private ChangeArgumentParser changeArgumentParser; @Argument( - index = 0, - required = true, - multiValued = true, - metaVar = "CHANGE", - usage = "changes to index" - ) + index = 0, + required = true, + multiValued = true, + metaVar = "CHANGE", + usage = "changes to index") void addChange(String token) { try { changeArgumentParser.addChange(token, changes, null, false); diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/IndexProjectCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/IndexProjectCommand.java index 476c25bfe4..9c8c01cc28 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/IndexProjectCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/IndexProjectCommand.java @@ -34,12 +34,11 @@ final class IndexProjectCommand extends SshCommand { @Inject private Index index; @Argument( - index = 0, - required = true, - multiValued = true, - metaVar = "PROJECT", - usage = "projects for which the changes should be indexed" - ) + index = 0, + required = true, + multiValued = true, + metaVar = "PROJECT", + usage = "projects for which the changes should be indexed") private List projects = new ArrayList<>(); @Override diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListGroupsCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListGroupsCommand.java index ac3784a058..59bfa069f4 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListGroupsCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListGroupsCommand.java @@ -33,23 +33,21 @@ import java.util.Optional; import org.kohsuke.args4j.Option; @CommandMetaData( - name = "ls-groups", - description = "List groups visible to the caller", - runsAt = MASTER_OR_SLAVE -) + name = "ls-groups", + description = "List groups visible to the caller", + runsAt = MASTER_OR_SLAVE) public class ListGroupsCommand extends SshCommand { @Inject private GroupCache groupCache; @Inject @Options public ListGroups listGroups; @Option( - name = "--verbose", - aliases = {"-v"}, - usage = - "verbose output format with tab-separated columns for the " - + "group name, UUID, description, owner group name, " - + "owner group UUID, and whether the group is visible to all" - ) + name = "--verbose", + aliases = {"-v"}, + usage = + "verbose output format with tab-separated columns for the " + + "group name, UUID, description, owner group name, " + + "owner group UUID, and whether the group is visible to all") private boolean verboseOutput; @Override diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListLoggingLevelCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListLoggingLevelCommand.java index bb50fb1606..c8b8fa111d 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListLoggingLevelCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListLoggingLevelCommand.java @@ -29,10 +29,9 @@ import org.kohsuke.args4j.Argument; @RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER) @CommandMetaData( - name = "ls-level", - description = "list the level of loggers", - runsAt = MASTER_OR_SLAVE -) + name = "ls-level", + description = "list the level of loggers", + runsAt = MASTER_OR_SLAVE) public class ListLoggingLevelCommand extends SshCommand { @Argument(index = 0, required = false, metaVar = "NAME", usage = "used to match loggers") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListMembersCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListMembersCommand.java index ffaf923b81..568c431bea 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListMembersCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListMembersCommand.java @@ -37,10 +37,9 @@ import org.kohsuke.args4j.Argument; /** Implements a command that allows the user to see the members of a group. */ @CommandMetaData( - name = "ls-members", - description = "List the members of a given group", - runsAt = MASTER_OR_SLAVE -) + name = "ls-members", + description = "List the members of a given group", + runsAt = MASTER_OR_SLAVE) public class ListMembersCommand extends SshCommand { @Inject ListMembersCommandImpl impl; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListProjectsCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListProjectsCommand.java index 7ef1e2083a..db0929e2c0 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListProjectsCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListProjectsCommand.java @@ -24,10 +24,9 @@ import com.google.inject.Inject; import java.util.List; @CommandMetaData( - name = "ls-projects", - description = "List projects visible to the caller", - runsAt = MASTER_OR_SLAVE -) + name = "ls-projects", + description = "List projects visible to the caller", + runsAt = MASTER_OR_SLAVE) public class ListProjectsCommand extends SshCommand { @Inject @Options public ListProjects impl; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/LsUserRefs.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/LsUserRefs.java index 275da7cdb5..8927850313 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/LsUserRefs.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/LsUserRefs.java @@ -42,10 +42,9 @@ import org.kohsuke.args4j.Option; @RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER) @CommandMetaData( - name = "ls-user-refs", - description = "List refs visible to a specific user", - runsAt = MASTER_OR_SLAVE -) + name = "ls-user-refs", + description = "List refs visible to a specific user", + runsAt = MASTER_OR_SLAVE) public class LsUserRefs extends SshCommand { @Inject private AccountResolver accountResolver; @Inject private OneOffRequestContext requestContext; @@ -53,21 +52,19 @@ public class LsUserRefs extends SshCommand { @Inject private GitRepositoryManager repoManager; @Option( - name = "--project", - aliases = {"-p"}, - metaVar = "PROJECT", - required = true, - usage = "project for which the refs should be listed" - ) + name = "--project", + aliases = {"-p"}, + metaVar = "PROJECT", + required = true, + usage = "project for which the refs should be listed") private ProjectControl projectControl; @Option( - name = "--user", - aliases = {"-u"}, - metaVar = "USER", - required = true, - usage = "user for which the groups should be listed" - ) + name = "--user", + aliases = {"-u"}, + metaVar = "USER", + required = true, + usage = "user for which the groups should be listed") private String userName; @Option(name = "--only-refs-heads", usage = "list only refs under refs/heads") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/PluginInstallCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/PluginInstallCommand.java index 820052c17f..f649c759f8 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/PluginInstallCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/PluginInstallCommand.java @@ -37,10 +37,9 @@ import org.kohsuke.args4j.Option; @CommandMetaData(name = "install", description = "Install/Add a plugin", runsAt = MASTER_OR_SLAVE) final class PluginInstallCommand extends SshCommand { @Option( - name = "--name", - aliases = {"-n"}, - usage = "install under name" - ) + name = "--name", + aliases = {"-n"}, + usage = "install under name") private String name; @Option(name = "-") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Query.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Query.java index 2e5bf71e08..3fe0396a95 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Query.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Query.java @@ -43,9 +43,8 @@ public class Query extends SshCommand { } @Option( - name = "--all-approvals", - usage = "Include information about all patch sets and approvals" - ) + name = "--all-approvals", + usage = "Include information about all patch sets and approvals") void setApprovals(boolean on) { if (on) { processor.setIncludePatchSets(on); @@ -84,21 +83,19 @@ public class Query extends SshCommand { } @Option( - name = "--start", - aliases = {"-S"}, - usage = "Number of changes to skip" - ) + name = "--start", + aliases = {"-S"}, + usage = "Number of changes to skip") void setStart(int start) { processor.setStart(start); } @Argument( - index = 0, - required = true, - multiValued = true, - metaVar = "QUERY", - usage = "Query to execute" - ) + index = 0, + required = true, + multiValued = true, + metaVar = "QUERY", + usage = "Query to execute") private List query; @Override diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Receive.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Receive.java index 0f68d613c6..262e57a78c 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Receive.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Receive.java @@ -46,9 +46,8 @@ import org.slf4j.LoggerFactory; /** Receives change upload over SSH using the Git receive-pack protocol. */ @CommandMetaData( - name = "receive-pack", - description = "Standard Git server side command for client side git push" -) + name = "receive-pack", + description = "Standard Git server side command for client side git push") final class Receive extends AbstractGitCommand { private static final Logger log = LoggerFactory.getLogger(Receive.class); @@ -61,21 +60,19 @@ final class Receive extends AbstractGitCommand { MultimapBuilder.hashKeys(2).hashSetValues().build(); @Option( - name = "--reviewer", - aliases = {"--re"}, - metaVar = "EMAIL", - usage = "request reviewer for change(s)" - ) + name = "--reviewer", + aliases = {"--re"}, + metaVar = "EMAIL", + usage = "request reviewer for change(s)") void addReviewer(Account.Id id) { reviewers.put(ReviewerStateInternal.REVIEWER, id); } @Option( - name = "--cc", - aliases = {}, - metaVar = "EMAIL", - usage = "CC user on change(s)" - ) + name = "--cc", + aliases = {}, + metaVar = "EMAIL", + usage = "CC user on change(s)") void addCC(Account.Id id) { reviewers.put(ReviewerStateInternal.CC, id); } diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/RenameGroupCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/RenameGroupCommand.java index 6ec3a28e4d..53b6b32c77 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/RenameGroupCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/RenameGroupCommand.java @@ -30,11 +30,10 @@ import org.kohsuke.args4j.Argument; @CommandMetaData(name = "rename-group", description = "Rename an account group") public class RenameGroupCommand extends SshCommand { @Argument( - index = 0, - required = true, - metaVar = "GROUP", - usage = "name of the group to be renamed" - ) + index = 0, + required = true, + metaVar = "GROUP", + usage = "name of the group to be renamed") private String groupName; @Argument(index = 1, required = true, metaVar = "NEWNAME", usage = "new name of the group") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java index 46d6dcae9c..a6dd0b1bd4 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java @@ -73,12 +73,11 @@ public class ReviewCommand extends SshCommand { private final Set patchSets = new HashSet<>(); @Argument( - index = 0, - required = true, - multiValued = true, - metaVar = "{COMMIT | CHANGE,PATCHSET}", - usage = "list of commits or patch sets to review" - ) + index = 0, + required = true, + multiValued = true, + metaVar = "{COMMIT | CHANGE,PATCHSET}", + usage = "list of commits or patch sets to review") void addPatchSetId(String token) { try { PatchSet ps = psParser.parsePatchSet(token, projectControl, branch); @@ -91,29 +90,26 @@ public class ReviewCommand extends SshCommand { } @Option( - name = "--project", - aliases = "-p", - usage = "project containing the specified patch set(s)" - ) + name = "--project", + aliases = "-p", + usage = "project containing the specified patch set(s)") private ProjectControl projectControl; @Option(name = "--branch", aliases = "-b", usage = "branch containing the specified patch set(s)") private String branch; @Option( - name = "--message", - aliases = "-m", - usage = "cover message to publish on change(s)", - metaVar = "MESSAGE" - ) + name = "--message", + aliases = "-m", + usage = "cover message to publish on change(s)", + metaVar = "MESSAGE") private String changeComment; @Option( - name = "--notify", - aliases = "-n", - usage = "Who to send email notifications to after the review is stored.", - metaVar = "NOTIFYHANDLING" - ) + name = "--notify", + aliases = "-n", + usage = "Who to send email notifications to after the review is stored.", + metaVar = "NOTIFYHANDLING") private NotifyHandling notify; @Option(name = "--abandon", usage = "abandon the specified change(s)") @@ -135,19 +131,17 @@ public class ReviewCommand extends SshCommand { private boolean json; @Option( - name = "--tag", - aliases = "-t", - usage = "applies a tag to the given review", - metaVar = "TAG" - ) + name = "--tag", + aliases = "-t", + usage = "applies a tag to the given review", + metaVar = "TAG") private String changeTag; @Option( - name = "--label", - aliases = "-l", - usage = "custom label(s) to assign", - metaVar = "LABEL=VALUE" - ) + name = "--label", + aliases = "-l", + usage = "custom label(s) to assign", + metaVar = "LABEL=VALUE") void addLabel(String token) { LabelVote v = LabelVote.parseWithEquals(token); LabelType.checkName(v.label()); // Disallow SUBM. diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetAccountCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetAccountCommand.java index 033b4c6589..f413461688 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetAccountCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetAccountCommand.java @@ -65,11 +65,10 @@ import org.kohsuke.args4j.Option; final class SetAccountCommand extends SshCommand { @Argument( - index = 0, - required = true, - metaVar = "USER", - usage = "full name, email-address, ssh username or account id" - ) + index = 0, + required = true, + metaVar = "USER", + usage = "full name, email-address, ssh username or account id") private Account.Id id; @Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account") @@ -85,34 +84,30 @@ final class SetAccountCommand extends SshCommand { private List addEmails = new ArrayList<>(); @Option( - name = "--delete-email", - metaVar = "EMAIL", - usage = "email addresses to delete from the account" - ) + name = "--delete-email", + metaVar = "EMAIL", + usage = "email addresses to delete from the account") private List deleteEmails = new ArrayList<>(); @Option( - name = "--preferred-email", - metaVar = "EMAIL", - usage = "a registered email address from the account" - ) + name = "--preferred-email", + metaVar = "EMAIL", + usage = "a registered email address from the account") private String preferredEmail; @Option(name = "--add-ssh-key", metaVar = "-|KEY", usage = "public keys to add to the account") private List addSshKeys = new ArrayList<>(); @Option( - name = "--delete-ssh-key", - metaVar = "-|KEY", - usage = "public keys to delete from the account" - ) + name = "--delete-ssh-key", + metaVar = "-|KEY", + usage = "public keys to delete from the account") private List deleteSshKeys = new ArrayList<>(); @Option( - name = "--http-password", - metaVar = "PASSWORD", - usage = "password for HTTP authentication for the account" - ) + name = "--http-password", + metaVar = "PASSWORD", + usage = "password for HTTP authentication for the account") private String httpPassword; @Option(name = "--clear-http-password", usage = "clear HTTP password for the account") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetLoggingLevelCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetLoggingLevelCommand.java index bea4da138b..cfdd73562c 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetLoggingLevelCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetLoggingLevelCommand.java @@ -33,10 +33,9 @@ import org.kohsuke.args4j.Argument; @RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER) @CommandMetaData( - name = "set-level", - description = "Change the level of loggers", - runsAt = MASTER_OR_SLAVE -) + name = "set-level", + description = "Change the level of loggers", + runsAt = MASTER_OR_SLAVE) public class SetLoggingLevelCommand extends SshCommand { private static final String LOG_CONFIGURATION = "log4j.properties"; private static final String JAVA_OPTIONS_LOG_CONFIG = "log4j.configuration"; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetMembersCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetMembersCommand.java index 9062b52eeb..84a9f84e31 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetMembersCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetMembersCommand.java @@ -44,50 +44,44 @@ import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Option; @CommandMetaData( - name = "set-members", - description = "Modify members of specific group or number of groups" -) + name = "set-members", + description = "Modify members of specific group or number of groups") public class SetMembersCommand extends SshCommand { @Option( - name = "--add", - aliases = {"-a"}, - metaVar = "USER", - usage = "users that should be added as group member" - ) + name = "--add", + aliases = {"-a"}, + metaVar = "USER", + usage = "users that should be added as group member") private List accountsToAdd = new ArrayList<>(); @Option( - name = "--remove", - aliases = {"-r"}, - metaVar = "USER", - usage = "users that should be removed from the group" - ) + name = "--remove", + aliases = {"-r"}, + metaVar = "USER", + usage = "users that should be removed from the group") private List accountsToRemove = new ArrayList<>(); @Option( - name = "--include", - aliases = {"-i"}, - metaVar = "GROUP", - usage = "group that should be included as group member" - ) + name = "--include", + aliases = {"-i"}, + metaVar = "GROUP", + usage = "group that should be included as group member") private List groupsToInclude = new ArrayList<>(); @Option( - name = "--exclude", - aliases = {"-e"}, - metaVar = "GROUP", - usage = "group that should be excluded from the group" - ) + name = "--exclude", + aliases = {"-e"}, + metaVar = "GROUP", + usage = "group that should be excluded from the group") private List groupsToRemove = new ArrayList<>(); @Argument( - index = 0, - required = true, - multiValued = true, - metaVar = "GROUP", - usage = "groups to modify" - ) + index = 0, + required = true, + multiValued = true, + metaVar = "GROUP", + usage = "groups to modify") private List groups = new ArrayList<>(); @Inject private AddMembers addMembers; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetProjectCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetProjectCommand.java index c275af83b1..6b3fcf2770 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetProjectCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetProjectCommand.java @@ -35,18 +35,16 @@ final class SetProjectCommand extends SshCommand { private ProjectControl projectControl; @Option( - name = "--description", - aliases = {"-d"}, - metaVar = "DESCRIPTION", - usage = "description of project" - ) + name = "--description", + aliases = {"-d"}, + metaVar = "DESCRIPTION", + usage = "description of project") private String projectDescription; @Option( - name = "--submit-type", - aliases = {"-t"}, - usage = "project submit type\n(default: MERGE_IF_NECESSARY)" - ) + name = "--submit-type", + aliases = {"-t"}, + usage = "project submit type\n(default: MERGE_IF_NECESSARY)") private SubmitType submitType; @Option(name = "--contributor-agreements", usage = "if contributor agreement is required") @@ -62,37 +60,33 @@ final class SetProjectCommand extends SshCommand { private InheritableBoolean requireChangeID; @Option( - name = "--use-contributor-agreements", - aliases = {"--ca"}, - usage = "if contributor agreement is required" - ) + name = "--use-contributor-agreements", + aliases = {"--ca"}, + usage = "if contributor agreement is required") void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) { contributorAgreements = InheritableBoolean.TRUE; } @Option( - name = "--no-contributor-agreements", - aliases = {"--nca"}, - usage = "if contributor agreement is not required" - ) + name = "--no-contributor-agreements", + aliases = {"--nca"}, + usage = "if contributor agreement is not required") void setNoContributorArgreements(@SuppressWarnings("unused") boolean on) { contributorAgreements = InheritableBoolean.FALSE; } @Option( - name = "--use-signed-off-by", - aliases = {"--so"}, - usage = "if signed-off-by is required" - ) + name = "--use-signed-off-by", + aliases = {"--so"}, + usage = "if signed-off-by is required") void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) { signedOffBy = InheritableBoolean.TRUE; } @Option( - name = "--no-signed-off-by", - aliases = {"--nso"}, - usage = "if signed-off-by is not required" - ) + name = "--no-signed-off-by", + aliases = {"--nso"}, + usage = "if signed-off-by is not required") void setNoSignedOffBy(@SuppressWarnings("unused") boolean on) { signedOffBy = InheritableBoolean.FALSE; } @@ -103,36 +97,32 @@ final class SetProjectCommand extends SshCommand { } @Option( - name = "--no-content-merge", - usage = "don't allow automatic conflict resolving within files" - ) + name = "--no-content-merge", + usage = "don't allow automatic conflict resolving within files") void setNoContentMerge(@SuppressWarnings("unused") boolean on) { contentMerge = InheritableBoolean.FALSE; } @Option( - name = "--require-change-id", - aliases = {"--id"}, - usage = "if change-id is required" - ) + name = "--require-change-id", + aliases = {"--id"}, + usage = "if change-id is required") void setRequireChangeId(@SuppressWarnings("unused") boolean on) { requireChangeID = InheritableBoolean.TRUE; } @Option( - name = "--no-change-id", - aliases = {"--nid"}, - usage = "if change-id is not required" - ) + name = "--no-change-id", + aliases = {"--nid"}, + usage = "if change-id is not required") void setNoChangeId(@SuppressWarnings("unused") boolean on) { requireChangeID = InheritableBoolean.FALSE; } @Option( - name = "--project-state", - aliases = {"--ps"}, - usage = "project's visibility state" - ) + name = "--project-state", + aliases = {"--ps"}, + usage = "project's visibility state") private ProjectState state; @Option(name = "--max-object-size-limit", usage = "max Git object size for this project") diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetReviewersCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetReviewersCommand.java index 026f9b7aa6..52a790bf01 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetReviewersCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/SetReviewersCommand.java @@ -49,30 +49,27 @@ public class SetReviewersCommand extends SshCommand { private ProjectControl projectControl; @Option( - name = "--add", - aliases = {"-a"}, - metaVar = "REVIEWER", - usage = "user or group that should be added as reviewer" - ) + name = "--add", + aliases = {"-a"}, + metaVar = "REVIEWER", + usage = "user or group that should be added as reviewer") private List toAdd = new ArrayList<>(); @Option( - name = "--remove", - aliases = {"-r"}, - metaVar = "REVIEWER", - usage = "user that should be removed from the reviewer list" - ) + name = "--remove", + aliases = {"-r"}, + metaVar = "REVIEWER", + usage = "user that should be removed from the reviewer list") void optionRemove(Account.Id who) { toRemove.add(who); } @Argument( - index = 0, - required = true, - multiValued = true, - metaVar = "CHANGE", - usage = "changes to modify" - ) + index = 0, + required = true, + multiValued = true, + metaVar = "CHANGE", + usage = "changes to modify") void addChange(String token) { try { changeArgumentParser.addChange(token, changes, projectControl); diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowCaches.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowCaches.java index 1ed7db3a44..20e77c7f38 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowCaches.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowCaches.java @@ -57,10 +57,9 @@ import org.kohsuke.args4j.Option; /** Show the current cache states. */ @RequiresAnyCapability({VIEW_CACHES, MAINTAIN_SERVER}) @CommandMetaData( - name = "show-caches", - description = "Display current cache statistics", - runsAt = MASTER_OR_SLAVE -) + name = "show-caches", + description = "Display current cache statistics", + runsAt = MASTER_OR_SLAVE) final class ShowCaches extends SshCommand { private static volatile long serverStarted; @@ -90,11 +89,10 @@ final class ShowCaches extends SshCommand { @Inject private PermissionBackend permissionBackend; @Option( - name = "--width", - aliases = {"-w"}, - metaVar = "COLS", - usage = "width of output table" - ) + name = "--width", + aliases = {"-w"}, + metaVar = "COLS", + usage = "width of output table") private int columns = 80; private int nw; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowConnections.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowConnections.java index afbdf5d57e..d3bb8feacd 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowConnections.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowConnections.java @@ -50,23 +50,20 @@ import org.kohsuke.args4j.Option; /** Show the current SSH connections. */ @RequiresCapability(GlobalCapability.VIEW_CONNECTIONS) @CommandMetaData( - name = "show-connections", - description = "Display active client SSH connections", - runsAt = MASTER_OR_SLAVE -) + name = "show-connections", + description = "Display active client SSH connections", + runsAt = MASTER_OR_SLAVE) final class ShowConnections extends SshCommand { @Option( - name = "--numeric", - aliases = {"-n"}, - usage = "don't resolve names" - ) + name = "--numeric", + aliases = {"-n"}, + usage = "don't resolve names") private boolean numeric; @Option( - name = "--wide", - aliases = {"-w"}, - usage = "display without line width truncation" - ) + name = "--wide", + aliases = {"-w"}, + usage = "display without line width truncation") private boolean wide; @Inject private SshDaemon daemon; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowQueue.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowQueue.java index 0296690d0f..84c460f1dd 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowQueue.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowQueue.java @@ -45,23 +45,20 @@ import org.kohsuke.args4j.Option; /** Display the current work queue. */ @AdminHighPriorityCommand @CommandMetaData( - name = "show-queue", - description = "Display the background work queues", - runsAt = MASTER_OR_SLAVE -) + name = "show-queue", + description = "Display the background work queues", + runsAt = MASTER_OR_SLAVE) final class ShowQueue extends SshCommand { @Option( - name = "--wide", - aliases = {"-w"}, - usage = "display without line width truncation" - ) + name = "--wide", + aliases = {"-w"}, + usage = "display without line width truncation") private boolean wide; @Option( - name = "--by-queue", - aliases = {"-q"}, - usage = "group tasks by queue and print queue info" - ) + name = "--by-queue", + aliases = {"-q"}, + usage = "group tasks by queue and print queue info") private boolean groupByQueue; @Inject private PermissionBackend permissionBackend; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StreamEvents.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StreamEvents.java index bdc5f4b5d7..e84221025e 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StreamEvents.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StreamEvents.java @@ -60,11 +60,10 @@ final class StreamEvents extends BaseCommand { private static final int BATCH_SIZE = 32; @Option( - name = "--subscribe", - aliases = {"-s"}, - metaVar = "SUBSCRIBE", - usage = "subscribe to specific stream-events" - ) + name = "--subscribe", + aliases = {"-s"}, + metaVar = "SUBSCRIBE", + usage = "subscribe to specific stream-events") private List subscribedToEvents = new ArrayList<>(); @Inject private IdentifiedUser currentUser; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/UploadArchive.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/UploadArchive.java index 9a3e6aba3e..f90650f9f3 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/UploadArchive.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/UploadArchive.java @@ -56,15 +56,14 @@ public class UploadArchive extends AbstractGitCommand { */ static class Options { @Option( - name = "-f", - aliases = {"--format"}, - usage = - "Format of the" - + " resulting archive: tar or zip... If this option is not given, and" - + " the output file is specified, the format is inferred from the" - + " filename if possible (e.g. writing to \"foo.zip\" makes the output" - + " to be in the zip format). Otherwise the output format is tar." - ) + name = "-f", + aliases = {"--format"}, + usage = + "Format of the" + + " resulting archive: tar or zip... If this option is not given, and" + + " the output file is specified, the format is inferred from the" + + " filename if possible (e.g. writing to \"foo.zip\" makes the output" + + " to be in the zip format). Otherwise the output format is tar.") private String format = "tar"; @Option(name = "--prefix", usage = "Prepend / to each filename in the archive.") @@ -98,25 +97,23 @@ public class UploadArchive extends AbstractGitCommand { private boolean level8; @Option( - name = "-9", - usage = - "Highest and slowest compression level. You " - + "can specify any number from 1 to 9 to adjust compression speed and " - + "ratio." - ) + name = "-9", + usage = + "Highest and slowest compression level. You " + + "can specify any number from 1 to 9 to adjust compression speed and " + + "ratio.") private boolean level9; @Argument(index = 0, required = true, usage = "The tree or commit to produce an archive for.") private String treeIsh = "master"; @Argument( - index = 1, - multiValued = true, - usage = - "Without an optional path parameter, all files and subdirectories of " - + "the current working directory are included in the archive. If one " - + "or more paths are specified, only these are included." - ) + index = 1, + multiValued = true, + usage = + "Without an optional path parameter, all files and subdirectories of " + + "the current working directory are included in the archive. If one " + + "or more paths are specified, only these are included.") private List path; }