Merge changes from topic 'checkstyle-cleanup'
* changes: Remove redundant 'private' modifier on constructors Remove redundant 'static' modifiers InitIndex: Add comment in empty if-block Declare variables on separate lines Change class modifier order to follow Java Language Spec Add missing whitespace around keywords, operators and braces
This commit is contained in:
@@ -39,7 +39,7 @@ public class GarbageCollectionResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class Error {
|
public static class Error {
|
||||||
public static enum Type {
|
public enum Type {
|
||||||
/** Git garbage collection was already scheduled for this project */
|
/** Git garbage collection was already scheduled for this project */
|
||||||
GC_ALREADY_SCHEDULED,
|
GC_ALREADY_SCHEDULED,
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ import org.eclipse.jgit.diff.Edit;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PatchScript {
|
public class PatchScript {
|
||||||
public static enum DisplayMethod {
|
public enum DisplayMethod {
|
||||||
NONE, DIFF, IMG
|
NONE, DIFF, IMG
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum FileMode {
|
public enum FileMode {
|
||||||
FILE, SYMLINK, GITLINK
|
FILE, SYMLINK, GITLINK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package com.google.gerrit.common.data;
|
|||||||
public class PermissionRule implements Comparable<PermissionRule> {
|
public class PermissionRule implements Comparable<PermissionRule> {
|
||||||
public static final String FORCE_PUSH = "Force Push";
|
public static final String FORCE_PUSH = "Force Push";
|
||||||
public static final String FORCE_EDIT = "Force Edit";
|
public static final String FORCE_EDIT = "Force Edit";
|
||||||
public static enum Action {
|
public enum Action {
|
||||||
ALLOW, DENY, BLOCK,
|
ALLOW, DENY, BLOCK,
|
||||||
|
|
||||||
INTERACTIVE, BATCH
|
INTERACTIVE, BATCH
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import java.util.Objects;
|
|||||||
* Describes the state required to submit a change.
|
* Describes the state required to submit a change.
|
||||||
*/
|
*/
|
||||||
public class SubmitRecord {
|
public class SubmitRecord {
|
||||||
public static enum Status {
|
public enum Status {
|
||||||
/** The change is ready for submission. */
|
/** The change is ready for submission. */
|
||||||
OK,
|
OK,
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ public class SubmitRecord {
|
|||||||
public String errorMessage;
|
public String errorMessage;
|
||||||
|
|
||||||
public static class Label {
|
public static class Label {
|
||||||
public static enum Status {
|
public enum Status {
|
||||||
/**
|
/**
|
||||||
* This label provides what is necessary for submission.
|
* This label provides what is necessary for submission.
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import com.google.gerrit.extensions.client.SubmitType;
|
|||||||
* Describes the submit type for a change.
|
* Describes the submit type for a change.
|
||||||
*/
|
*/
|
||||||
public class SubmitTypeRecord {
|
public class SubmitTypeRecord {
|
||||||
public static enum Status {
|
public enum Status {
|
||||||
/** The type was computed successfully */
|
/** The type was computed successfully */
|
||||||
OK,
|
OK,
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class ReviewInput {
|
|||||||
*/
|
*/
|
||||||
public String onBehalfOf;
|
public String onBehalfOf;
|
||||||
|
|
||||||
public static enum DraftHandling {
|
public enum DraftHandling {
|
||||||
/** Delete pending drafts on this revision only. */
|
/** Delete pending drafts on this revision only. */
|
||||||
DELETE,
|
DELETE,
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ public class ReviewInput {
|
|||||||
PUBLISH_ALL_REVISIONS
|
PUBLISH_ALL_REVISIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum NotifyHandling {
|
public enum NotifyHandling {
|
||||||
NONE, OWNER, OWNER_REVIEWERS, ALL
|
NONE, OWNER, OWNER_REVIEWERS, ALL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public interface Projects {
|
|||||||
ListRequest list();
|
ListRequest list();
|
||||||
|
|
||||||
public abstract class ListRequest {
|
public abstract class ListRequest {
|
||||||
public static enum FilterType {
|
public enum FilterType {
|
||||||
CODE, PARENT_CANDIDATES, PERMISSIONS, ALL
|
CODE, PARENT_CANDIDATES, PERMISSIONS, ALL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class DiffPreferencesInfo {
|
|||||||
public static final short[] CONTEXT_CHOICES =
|
public static final short[] CONTEXT_CHOICES =
|
||||||
{3, 10, 25, 50, 75, 100, WHOLE_FILE_CONTEXT};
|
{3, 10, 25, 50, 75, 100, WHOLE_FILE_CONTEXT};
|
||||||
|
|
||||||
public static enum Whitespace {
|
public enum Whitespace {
|
||||||
IGNORE_NONE,
|
IGNORE_NONE,
|
||||||
IGNORE_TRAILING,
|
IGNORE_TRAILING,
|
||||||
IGNORE_LEADING_AND_TRAILING,
|
IGNORE_LEADING_AND_TRAILING,
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ public class GeneralPreferencesInfo {
|
|||||||
public static final int[] PAGESIZE_CHOICES = {10, 25, 50, 100};
|
public static final int[] PAGESIZE_CHOICES = {10, 25, 50, 100};
|
||||||
|
|
||||||
/** Preferred method to download a change. */
|
/** Preferred method to download a change. */
|
||||||
public static enum DownloadCommand {
|
public enum DownloadCommand {
|
||||||
REPO_DOWNLOAD, PULL, CHECKOUT, CHERRY_PICK, FORMAT_PATCH
|
REPO_DOWNLOAD, PULL, CHECKOUT, CHERRY_PICK, FORMAT_PATCH
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum DateFormat {
|
public enum DateFormat {
|
||||||
/** US style dates: Apr 27, Feb 14, 2010 */
|
/** US style dates: Apr 27, Feb 14, 2010 */
|
||||||
STD("MMM d", "MMM d, yyyy"),
|
STD("MMM d", "MMM d, yyyy"),
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ public class GeneralPreferencesInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum ReviewCategoryStrategy {
|
public enum ReviewCategoryStrategy {
|
||||||
NONE,
|
NONE,
|
||||||
NAME,
|
NAME,
|
||||||
EMAIL,
|
EMAIL,
|
||||||
@@ -72,18 +72,18 @@ public class GeneralPreferencesInfo {
|
|||||||
ABBREV
|
ABBREV
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum DiffView {
|
public enum DiffView {
|
||||||
SIDE_BY_SIDE,
|
SIDE_BY_SIDE,
|
||||||
UNIFIED_DIFF
|
UNIFIED_DIFF
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum EmailStrategy {
|
public enum EmailStrategy {
|
||||||
ENABLED,
|
ENABLED,
|
||||||
CC_ON_OWN_COMMENTS,
|
CC_ON_OWN_COMMENTS,
|
||||||
DISABLED
|
DISABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum TimeFormat {
|
public enum TimeFormat {
|
||||||
/** 12-hour clock: 1:15 am, 2:13 pm */
|
/** 12-hour clock: 1:15 am, 2:13 pm */
|
||||||
HHMM_12("h:mm a"),
|
HHMM_12("h:mm a"),
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public enum GerritTopMenu {
|
|||||||
|
|
||||||
public final String menuName;
|
public final String menuName;
|
||||||
|
|
||||||
private GerritTopMenu() {
|
GerritTopMenu() {
|
||||||
menuName = name().substring(0, 1) + name().substring(1).toLowerCase();
|
menuName = name().substring(0, 1) + name().substring(1).toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public enum ListChangesOption {
|
|||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
private ListChangesOption(int v) {
|
ListChangesOption(int v) {
|
||||||
this.value = v;
|
this.value = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public enum ListGroupsOption {
|
|||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
private ListGroupsOption(int v) {
|
ListGroupsOption(int v) {
|
||||||
this.value = v;
|
this.value = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class DiffInfo {
|
|||||||
// Binary file
|
// Binary file
|
||||||
public Boolean binary;
|
public Boolean binary;
|
||||||
|
|
||||||
public static enum IntraLineStatus {
|
public enum IntraLineStatus {
|
||||||
OK,
|
OK,
|
||||||
TIMEOUT,
|
TIMEOUT,
|
||||||
FAILURE
|
FAILURE
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
package com.google.gerrit.extensions.common;
|
package com.google.gerrit.extensions.common;
|
||||||
|
|
||||||
public class ProblemInfo {
|
public class ProblemInfo {
|
||||||
public static enum Status {
|
public enum Status {
|
||||||
FIXED, FIX_FAILED
|
FIXED, FIX_FAILED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.google.gwt.core.client.GWT;
|
|||||||
import com.google.gwt.i18n.client.Constants;
|
import com.google.gwt.i18n.client.Constants;
|
||||||
|
|
||||||
interface CopyableLabelText extends Constants {
|
interface CopyableLabelText extends Constants {
|
||||||
static final CopyableLabelText I = GWT.create(CopyableLabelText.class);
|
final CopyableLabelText I = GWT.create(CopyableLabelText.class);
|
||||||
|
|
||||||
String tooltip();
|
String tooltip();
|
||||||
String copied();
|
String copied();
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class AttMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static interface Tag {
|
private interface Tag {
|
||||||
void assertSafe(String name, String value);
|
void assertSafe(String name, String value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import com.google.gwt.user.client.ui.UIObject;
|
|||||||
/** Displays custom tooltip message below an element. */
|
/** Displays custom tooltip message below an element. */
|
||||||
public class Tooltip {
|
public class Tooltip {
|
||||||
interface Resources extends ClientBundle {
|
interface Resources extends ClientBundle {
|
||||||
static final Resources I = GWT.create(Resources.class);
|
final Resources I = GWT.create(Resources.class);
|
||||||
|
|
||||||
@Source("tooltip.css")
|
@Source("tooltip.css")
|
||||||
Css css();
|
Css css();
|
||||||
|
|||||||
@@ -211,7 +211,9 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
|
|||||||
protected void display(final GroupInfo group, final boolean canModify) {
|
protected void display(final GroupInfo group, final boolean canModify) {
|
||||||
groupUUIDLabel.setText(group.getGroupUUID().get());
|
groupUUIDLabel.setText(group.getGroupUUID().get());
|
||||||
groupNameTxt.setText(group.name());
|
groupNameTxt.setText(group.name());
|
||||||
ownerTxt.setText(group.owner() != null?group.owner():Util.M.deletedReference(group.getOwnerUUID().get()));
|
ownerTxt.setText(group.owner() != null
|
||||||
|
? group.owner()
|
||||||
|
: Util.M.deletedReference(group.getOwnerUUID().get()));
|
||||||
descTxt.setText(group.description());
|
descTxt.setText(group.description());
|
||||||
visibleToAllCheckBox.setValue(group.options().isVisibleToAll());
|
visibleToAllCheckBox.setValue(group.options().isVisibleToAll());
|
||||||
setMembersTabVisible(AccountGroup.isInternalGroup(group.getGroupUUID()));
|
setMembersTabVisible(AccountGroup.isInternalGroup(group.getGroupUUID()));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ abstract class ActionMessageBox extends Composite {
|
|||||||
interface Binder extends UiBinder<HTMLPanel, ActionMessageBox> {}
|
interface Binder extends UiBinder<HTMLPanel, ActionMessageBox> {}
|
||||||
private static final Binder uiBinder = GWT.create(Binder.class);
|
private static final Binder uiBinder = GWT.create(Binder.class);
|
||||||
|
|
||||||
static interface Style extends CssResource {
|
interface Style extends CssResource {
|
||||||
String popup();
|
String popup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class FileTable extends FlowPanel {
|
|||||||
String restoreDelete();
|
String restoreDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum Mode {
|
public enum Mode {
|
||||||
REVIEW,
|
REVIEW,
|
||||||
EDIT
|
EDIT
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class Message extends Composite {
|
|||||||
interface Binder extends UiBinder<HTMLPanel, Message> {}
|
interface Binder extends UiBinder<HTMLPanel, Message> {}
|
||||||
private static final Binder uiBinder = GWT.create(Binder.class);
|
private static final Binder uiBinder = GWT.create(Binder.class);
|
||||||
|
|
||||||
static interface Style extends CssResource {
|
interface Style extends CssResource {
|
||||||
String closed();
|
String closed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class RelatedChanges extends TabPanel {
|
|||||||
abstract String getTitle(int count);
|
abstract String getTitle(int count);
|
||||||
abstract String getTitle(String count);
|
abstract String getTitle(String count);
|
||||||
|
|
||||||
private Tab(String defaultTitle, String tooltip) {
|
Tab(String defaultTitle, String tooltip) {
|
||||||
this.defaultTitle = defaultTitle;
|
this.defaultTitle = defaultTitle;
|
||||||
this.tooltip = tooltip;
|
this.tooltip = tooltip;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import com.google.gwt.resources.client.CssResource;
|
|||||||
|
|
||||||
public interface Resources extends ClientBundle {
|
public interface Resources extends ClientBundle {
|
||||||
public static final Resources I = GWT.create(Resources.class);
|
public static final Resources I = GWT.create(Resources.class);
|
||||||
static final ChangeConstants C = GWT.create(ChangeConstants.class);
|
final ChangeConstants C = GWT.create(ChangeConstants.class);
|
||||||
static final ChangeMessages M = GWT.create(ChangeMessages.class);
|
final ChangeMessages M = GWT.create(ChangeMessages.class);
|
||||||
|
|
||||||
@Source("common.css") Style style();
|
@Source("common.css") Style style();
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ import com.google.gwt.core.client.JavaScriptObject;
|
|||||||
import com.google.gwt.core.client.JsArray;
|
import com.google.gwt.core.client.JsArray;
|
||||||
|
|
||||||
public class ReviewInput extends JavaScriptObject {
|
public class ReviewInput extends JavaScriptObject {
|
||||||
public static enum NotifyHandling {
|
public enum NotifyHandling {
|
||||||
NONE, OWNER, OWNER_REVIEWERS, ALL
|
NONE, OWNER, OWNER_REVIEWERS, ALL
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum DraftHandling {
|
public enum DraftHandling {
|
||||||
DELETE, PUBLISH, KEEP, PUBLISH_ALL_REVISIONS
|
DELETE, PUBLISH, KEEP, PUBLISH_ALL_REVISIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class StarredChanges {
|
|||||||
private static final Event.Type<ChangeStarHandler> TYPE = new Event.Type<>();
|
private static final Event.Type<ChangeStarHandler> TYPE = new Event.Type<>();
|
||||||
|
|
||||||
/** Handler that can receive notifications of a change's starred status. */
|
/** Handler that can receive notifications of a change's starred status. */
|
||||||
public static interface ChangeStarHandler {
|
public interface ChangeStarHandler {
|
||||||
void onChangeStar(ChangeStarEvent event);
|
void onChangeStar(ChangeStarEvent event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class Header extends Composite {
|
|||||||
Resources.I.style().ensureInjected();
|
Resources.I.style().ensureInjected();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static enum ReviewedState {
|
private enum ReviewedState {
|
||||||
AUTO_REVIEW, LOADED
|
AUTO_REVIEW, LOADED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class PublishedBox extends CommentBox {
|
|||||||
interface Binder extends UiBinder<HTMLPanel, PublishedBox> {}
|
interface Binder extends UiBinder<HTMLPanel, PublishedBox> {}
|
||||||
private static final Binder uiBinder = GWT.create(Binder.class);
|
private static final Binder uiBinder = GWT.create(Binder.class);
|
||||||
|
|
||||||
static interface Style extends CssResource {
|
interface Style extends CssResource {
|
||||||
String closed();
|
String closed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import com.google.gwt.resources.client.ImageResource;
|
|||||||
|
|
||||||
/** Resources used by diff. */
|
/** Resources used by diff. */
|
||||||
interface Resources extends ClientBundle {
|
interface Resources extends ClientBundle {
|
||||||
static final Resources I = GWT.create(Resources.class);
|
final Resources I = GWT.create(Resources.class);
|
||||||
|
|
||||||
@Source("CommentBox.css") CommentBox.Style style();
|
@Source("CommentBox.css") CommentBox.Style style();
|
||||||
@Source("Scrollbar.css") Scrollbar.Style scrollbarStyle();
|
@Source("Scrollbar.css") Scrollbar.Style scrollbarStyle();
|
||||||
|
|||||||
@@ -357,7 +357,8 @@ class SideBySideCommentManager extends CommentManager {
|
|||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lineA, lineB;
|
int lineA;
|
||||||
|
int lineB;
|
||||||
if (line == 0) {
|
if (line == 0) {
|
||||||
lineA = lineB = 0;
|
lineA = lineB = 0;
|
||||||
} else if (side == DisplaySide.A) {
|
} else if (side == DisplaySide.A) {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.google.gwt.core.client.GWT;
|
|||||||
import com.google.gwt.i18n.client.Constants;
|
import com.google.gwt.i18n.client.Constants;
|
||||||
|
|
||||||
interface EditConstants extends Constants {
|
interface EditConstants extends Constants {
|
||||||
static final EditConstants I = GWT.create(EditConstants.class);
|
final EditConstants I = GWT.create(EditConstants.class);
|
||||||
|
|
||||||
String closeUnsavedChanges();
|
String closeUnsavedChanges();
|
||||||
String cancelUnsavedChanges();
|
String cancelUnsavedChanges();
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public abstract class Screen extends View {
|
|||||||
public void registerKeys() {
|
public void registerKeys() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static enum Cols {
|
private enum Cols {
|
||||||
West, Title, East, FarEast
|
West, Title, East, FarEast
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import com.google.gwt.resources.client.DataResource.DoNotEmbed;
|
|||||||
import com.google.gwt.resources.client.ExternalTextResource;
|
import com.google.gwt.resources.client.ExternalTextResource;
|
||||||
|
|
||||||
interface Lib extends ClientBundle {
|
interface Lib extends ClientBundle {
|
||||||
static final Lib I = GWT.create(Lib.class);
|
final Lib I = GWT.create(Lib.class);
|
||||||
|
|
||||||
@Source("cm.css")
|
@Source("cm.css")
|
||||||
ExternalTextResource css();
|
ExternalTextResource css();
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ class PluginServletContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static interface API {
|
interface API {
|
||||||
String getContextPath();
|
String getContextPath();
|
||||||
String getInitParameter(String name);
|
String getInitParameter(String name);
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class BaseServiceImplementation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Arbitrary action to run with a database connection. */
|
/** Arbitrary action to run with a database connection. */
|
||||||
public static interface Action<T> {
|
public interface Action<T> {
|
||||||
/**
|
/**
|
||||||
* Perform this action, returning the onSuccess value.
|
* Perform this action, returning the onSuccess value.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -143,7 +143,8 @@ final class WrappableSearcherManager extends ReferenceManager<IndexSearcher> {
|
|||||||
@Override
|
@Override
|
||||||
protected IndexSearcher refreshIfNeeded(IndexSearcher referenceToRefresh) throws IOException {
|
protected IndexSearcher refreshIfNeeded(IndexSearcher referenceToRefresh) throws IOException {
|
||||||
final IndexReader r = referenceToRefresh.getIndexReader();
|
final IndexReader r = referenceToRefresh.getIndexReader();
|
||||||
assert r instanceof DirectoryReader: "searcher's IndexReader should be a DirectoryReader, but got " + r;
|
assert r instanceof DirectoryReader :
|
||||||
|
"searcher's IndexReader should be a DirectoryReader, but got " + r;
|
||||||
final IndexReader newReader = DirectoryReader.openIfChanged((DirectoryReader) r);
|
final IndexReader newReader = DirectoryReader.openIfChanged((DirectoryReader) r);
|
||||||
if (newReader == null) {
|
if (newReader == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -171,7 +172,8 @@ final class WrappableSearcherManager extends ReferenceManager<IndexSearcher> {
|
|||||||
final IndexSearcher searcher = acquire();
|
final IndexSearcher searcher = acquire();
|
||||||
try {
|
try {
|
||||||
final IndexReader r = searcher.getIndexReader();
|
final IndexReader r = searcher.getIndexReader();
|
||||||
assert r instanceof DirectoryReader: "searcher's IndexReader should be a DirectoryReader, but got " + r;
|
assert r instanceof DirectoryReader :
|
||||||
|
"searcher's IndexReader should be a DirectoryReader, but got " + r;
|
||||||
return ((DirectoryReader) r).isCurrent();
|
return ((DirectoryReader) r).isCurrent();
|
||||||
} finally {
|
} finally {
|
||||||
release(searcher);
|
release(searcher);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package com.google.gerrit.httpd.auth.openid;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
final class DiscoveryResult {
|
final class DiscoveryResult {
|
||||||
static enum Status {
|
enum Status {
|
||||||
/** Provider was discovered and {@code providerUrl} is valid. */
|
/** Provider was discovered and {@code providerUrl} is valid. */
|
||||||
VALID,
|
VALID,
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class InitIndex implements InitStep {
|
|||||||
site, def.getLatest().getVersion(), true);
|
site, def.getLatest().getVersion(), true);
|
||||||
}
|
}
|
||||||
if ((site.isNew || isEmptySite()) && type == IndexType.LUCENE) {
|
if ((site.isNew || isEmptySite()) && type == IndexType.LUCENE) {
|
||||||
|
// Do nothing
|
||||||
} else {
|
} else {
|
||||||
final String message = String.format(
|
final String message = String.format(
|
||||||
"\nThe index must be %sbuilt before starting Gerrit:\n"
|
"\nThe index must be %sbuilt before starting Gerrit:\n"
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ public class InitPlugins implements InitStep {
|
|||||||
@Override
|
@Override
|
||||||
public int compare(PluginData a, PluginData b) {
|
public int compare(PluginData a, PluginData b) {
|
||||||
return a.name.compareTo(b.name);
|
return a.name.compareTo(b.name);
|
||||||
}});
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private final ConsoleUI ui;
|
private final ConsoleUI ui;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class PrologCompiler implements Callable<PrologCompiler.Status> {
|
|||||||
PrologCompiler create(Repository git);
|
PrologCompiler create(Repository git);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum Status {
|
public enum Status {
|
||||||
NO_RULES, COMPILED
|
NO_RULES, COMPILED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ import java.sql.Timestamp;
|
|||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public final class Account {
|
public final class Account {
|
||||||
public static enum FieldName {
|
public enum FieldName {
|
||||||
FULL_NAME, USER_NAME, REGISTER_NEW_EMAIL
|
FULL_NAME, USER_NAME, REGISTER_NEW_EMAIL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ public final class Change {
|
|||||||
* codes ('A'..'Z') indicate a change that is closed and cannot be further
|
* codes ('A'..'Z') indicate a change that is closed and cannot be further
|
||||||
* modified.
|
* modified.
|
||||||
* */
|
* */
|
||||||
public static enum Status {
|
public enum Status {
|
||||||
/**
|
/**
|
||||||
* Change is open and pending review, or review is in progress.
|
* Change is open and pending review, or review is in progress.
|
||||||
*
|
*
|
||||||
@@ -356,7 +356,7 @@ public final class Change {
|
|||||||
private final boolean closed;
|
private final boolean closed;
|
||||||
private final ChangeStatus changeStatus;
|
private final ChangeStatus changeStatus;
|
||||||
|
|
||||||
private Status(char c, ChangeStatus cs) {
|
Status(char c, ChangeStatus cs) {
|
||||||
code = c;
|
code = c;
|
||||||
closed = !(MIN_OPEN <= c && c <= MAX_OPEN);
|
closed = !(MIN_OPEN <= c && c <= MAX_OPEN);
|
||||||
changeStatus = cs;
|
changeStatus = cs;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public final class Patch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Type of modification made to the file path. */
|
/** Type of modification made to the file path. */
|
||||||
public static enum ChangeType implements CodedEnum {
|
public enum ChangeType implements CodedEnum {
|
||||||
/** Path is being created/introduced by this patch. */
|
/** Path is being created/introduced by this patch. */
|
||||||
ADDED('A'),
|
ADDED('A'),
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ public final class Patch {
|
|||||||
|
|
||||||
private final char code;
|
private final char code;
|
||||||
|
|
||||||
private ChangeType(final char c) {
|
ChangeType(final char c) {
|
||||||
code = c;
|
code = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ public final class Patch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Type of formatting for this patch. */
|
/** Type of formatting for this patch. */
|
||||||
public static enum PatchType implements CodedEnum {
|
public enum PatchType implements CodedEnum {
|
||||||
/**
|
/**
|
||||||
* A textual difference between two versions.
|
* A textual difference between two versions.
|
||||||
*
|
*
|
||||||
@@ -148,7 +148,7 @@ public final class Patch {
|
|||||||
|
|
||||||
private final char code;
|
private final char code;
|
||||||
|
|
||||||
private PatchType(final char c) {
|
PatchType(final char c) {
|
||||||
code = c;
|
code = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,14 +60,14 @@ public final class PatchLineComment {
|
|||||||
public static final char STATUS_DRAFT = 'd';
|
public static final char STATUS_DRAFT = 'd';
|
||||||
public static final char STATUS_PUBLISHED = 'P';
|
public static final char STATUS_PUBLISHED = 'P';
|
||||||
|
|
||||||
public static enum Status {
|
public enum Status {
|
||||||
DRAFT(STATUS_DRAFT),
|
DRAFT(STATUS_DRAFT),
|
||||||
|
|
||||||
PUBLISHED(STATUS_PUBLISHED);
|
PUBLISHED(STATUS_PUBLISHED);
|
||||||
|
|
||||||
private final char code;
|
private final char code;
|
||||||
|
|
||||||
private Status(final char c) {
|
Status(final char c) {
|
||||||
code = c;
|
code = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class Description {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum FieldOrdering {
|
public enum FieldOrdering {
|
||||||
/** Default ordering places fields at end of the parent metric name. */
|
/** Default ordering places fields at end of the parent metric name. */
|
||||||
AT_END,
|
AT_END,
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class PrologEnvironment extends BufferingPrologControl {
|
|||||||
private static final Logger log =
|
private static final Logger log =
|
||||||
LoggerFactory.getLogger(PrologEnvironment.class);
|
LoggerFactory.getLogger(PrologEnvironment.class);
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
/**
|
/**
|
||||||
* Construct a new Prolog interpreter.
|
* Construct a new Prolog interpreter.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
/** Access control management for server-wide capabilities. */
|
/** Access control management for server-wide capabilities. */
|
||||||
public class CapabilityControl {
|
public class CapabilityControl {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
CapabilityControl create(CurrentUser user);
|
CapabilityControl create(CurrentUser user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class CreateAccount implements RestModifyView<TopLevelResource, Input> {
|
|||||||
public List<String> groups;
|
public List<String> groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
CreateAccount create(String username);
|
CreateAccount create(String username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
public class CreateEmail implements RestModifyView<AccountResource, EmailInput> {
|
public class CreateEmail implements RestModifyView<AccountResource, EmailInput> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(CreateEmail.class);
|
private static final Logger log = LoggerFactory.getLogger(CreateEmail.class);
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
CreateEmail create(String email);
|
CreateEmail create(String email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public enum ArchiveFormat {
|
|||||||
private final ArchiveCommand.Format<?> format;
|
private final ArchiveCommand.Format<?> format;
|
||||||
private final String mimeType;
|
private final String mimeType;
|
||||||
|
|
||||||
private ArchiveFormat(String mimeType, ArchiveCommand.Format<?> format) {
|
ArchiveFormat(String mimeType, ArchiveCommand.Format<?> format) {
|
||||||
this.format = format;
|
this.format = format;
|
||||||
this.mimeType = mimeType;
|
this.mimeType = mimeType;
|
||||||
ArchiveCommand.registerFormat(name(), format);
|
ArchiveCommand.registerFormat(name(), format);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ import java.util.Set;
|
|||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
public class ChangeInserter extends BatchUpdate.InsertChangeOp {
|
public class ChangeInserter extends BatchUpdate.InsertChangeOp {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
ChangeInserter create(Change.Id cid, RevCommit rc, String refName);
|
ChangeInserter create(Change.Id cid, RevCommit rc, String refName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ public class GetDiff implements RestReadView<FileResource> {
|
|||||||
|
|
||||||
private final DiffPreferencesInfo.Whitespace whitespace;
|
private final DiffPreferencesInfo.Whitespace whitespace;
|
||||||
|
|
||||||
private IgnoreWhitespace(DiffPreferencesInfo.Whitespace whitespace) {
|
IgnoreWhitespace(DiffPreferencesInfo.Whitespace whitespace) {
|
||||||
this.whitespace = whitespace;
|
this.whitespace = whitespace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class PatchSetInserter extends BatchUpdate.Op {
|
|||||||
private static final Logger log =
|
private static final Logger log =
|
||||||
LoggerFactory.getLogger(PatchSetInserter.class);
|
LoggerFactory.getLogger(PatchSetInserter.class);
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
PatchSetInserter create(RefControl refControl, PatchSet.Id psId,
|
PatchSetInserter create(RefControl refControl, PatchSet.Id psId,
|
||||||
RevCommit commit);
|
RevCommit commit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class RebaseUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@AutoValue
|
@AutoValue
|
||||||
static abstract class Base {
|
abstract static class Base {
|
||||||
private static Base create(ChangeControl ctl, PatchSet ps) {
|
private static Base create(ChangeControl ctl, PatchSet ps) {
|
||||||
if (ctl == null) {
|
if (ctl == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class ReviewerResource implements RestResource {
|
|||||||
public static final TypeLiteral<RestView<ReviewerResource>> REVIEWER_KIND =
|
public static final TypeLiteral<RestView<ReviewerResource>> REVIEWER_KIND =
|
||||||
new TypeLiteral<RestView<ReviewerResource>>() {};
|
new TypeLiteral<RestView<ReviewerResource>>() {};
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
ReviewerResource create(ChangeResource change, Account.Id id);
|
ReviewerResource create(ChangeResource change, Account.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import java.util.TreeMap;
|
|||||||
public class ListCaches implements RestReadView<ConfigResource> {
|
public class ListCaches implements RestReadView<ConfigResource> {
|
||||||
private final DynamicMap<Cache<?, ?>> cacheMap;
|
private final DynamicMap<Cache<?, ?>> cacheMap;
|
||||||
|
|
||||||
public static enum OutputFormat {
|
public enum OutputFormat {
|
||||||
LIST, TEXT_LIST
|
LIST, TEXT_LIST
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class PostCaches implements RestModifyView<ConfigResource, Input> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum Operation {
|
public enum Operation {
|
||||||
FLUSH_ALL, FLUSH
|
FLUSH_ALL, FLUSH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ import java.util.TimeZone;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class ChangeEditModifier {
|
public class ChangeEditModifier {
|
||||||
|
|
||||||
private static enum TreeOperation {
|
private enum TreeOperation {
|
||||||
CHANGE_ENTRY,
|
CHANGE_ENTRY,
|
||||||
DELETE_ENTRY,
|
DELETE_ENTRY,
|
||||||
RENAME_ENTRY,
|
RENAME_ENTRY,
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class BatchUpdate implements AutoCloseable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Order of execution of the various phases. */
|
/** Order of execution of the various phases. */
|
||||||
public static enum Order {
|
public enum Order {
|
||||||
/**
|
/**
|
||||||
* Update the repository and execute all ref updates before touching the
|
* Update the repository and execute all ref updates before touching the
|
||||||
* database.
|
* database.
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class GroupCollector {
|
|||||||
return rsrc.getPatchSet().getGroups();
|
return rsrc.getPatchSet().getGroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static interface Lookup {
|
private interface Lookup {
|
||||||
List<String> lookup(PatchSet.Id psId)
|
List<String> lookup(PatchSet.Id psId)
|
||||||
throws OrmException, NoSuchChangeException;
|
throws OrmException, NoSuchChangeException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -706,7 +706,7 @@ public class MergeOp implements AutoCloseable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@AutoValue
|
@AutoValue
|
||||||
static abstract class BranchBatch {
|
abstract static class BranchBatch {
|
||||||
@Nullable abstract SubmitType submitType();
|
@Nullable abstract SubmitType submitType();
|
||||||
abstract List<ChangeData> changes();
|
abstract List<ChangeData> changes();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class MergeUtil {
|
|||||||
: MergeStrategy.RESOLVE;
|
: MergeStrategy.RESOLVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
MergeUtil create(ProjectState project);
|
MergeUtil create(ProjectState project);
|
||||||
MergeUtil create(ProjectState project, boolean useContentMerge);
|
MergeUtil create(ProjectState project, boolean useContentMerge);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import java.util.EnumSet;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class NotifyConfig implements Comparable<NotifyConfig> {
|
public class NotifyConfig implements Comparable<NotifyConfig> {
|
||||||
public static enum Header {
|
public enum Header {
|
||||||
TO, CC, BCC
|
TO, CC, BCC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ public class WorkQueue {
|
|||||||
* <li>{@link #DONE}: finished executing, if not periodic.</li>
|
* <li>{@link #DONE}: finished executing, if not periodic.</li>
|
||||||
* </ol>
|
* </ol>
|
||||||
*/
|
*/
|
||||||
public static enum State {
|
public enum State {
|
||||||
// Ordered like this so ordinal matches the order we would
|
// Ordered like this so ordinal matches the order we would
|
||||||
// prefer to see tasks sorted in: done before running,
|
// prefer to see tasks sorted in: done before running,
|
||||||
// running before ready, ready before sleeping.
|
// running before ready, ready before sleeping.
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public enum CommitMergeStatus {
|
|||||||
|
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
private CommitMergeStatus(String message) {
|
CommitMergeStatus(String message) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class CommitValidators {
|
|||||||
private static final Logger log = LoggerFactory
|
private static final Logger log = LoggerFactory
|
||||||
.getLogger(CommitValidators.class);
|
.getLogger(CommitValidators.class);
|
||||||
|
|
||||||
public static enum Policy {
|
public enum Policy {
|
||||||
/** Use {@link #validateForGerritCommits}. */
|
/** Use {@link #validateForGerritCommits}. */
|
||||||
GERRIT,
|
GERRIT,
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
@RequiresCapability(GlobalCapability.CREATE_GROUP)
|
@RequiresCapability(GlobalCapability.CREATE_GROUP)
|
||||||
public class CreateGroup implements RestModifyView<TopLevelResource, GroupInput> {
|
public class CreateGroup implements RestModifyView<TopLevelResource, GroupInput> {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
CreateGroup create(@Assisted String name);
|
CreateGroup create(@Assisted String name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import com.google.inject.assistedinject.Assisted;
|
|||||||
|
|
||||||
/** Send notice about a change being abandoned by its owner. */
|
/** Send notice about a change being abandoned by its owner. */
|
||||||
public class AbandonedSender extends ReplyToChangeSender {
|
public class AbandonedSender extends ReplyToChangeSender {
|
||||||
public static interface Factory extends
|
public interface Factory extends
|
||||||
ReplyToChangeSender.Factory<AbandonedSender> {
|
ReplyToChangeSender.Factory<AbandonedSender> {
|
||||||
@Override
|
@Override
|
||||||
AbandonedSender create(Project.NameKey project, Change.Id change);
|
AbandonedSender create(Project.NameKey project, Change.Id change);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import com.google.inject.assistedinject.Assisted;
|
|||||||
|
|
||||||
/** Asks a user to review a change. */
|
/** Asks a user to review a change. */
|
||||||
public class AddReviewerSender extends NewChangeSender {
|
public class AddReviewerSender extends NewChangeSender {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
AddReviewerSender create(Project.NameKey project, Change.Id id);
|
AddReviewerSender create(Project.NameKey project, Change.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class CommentSender extends ReplyToChangeSender {
|
|||||||
private static final Logger log = LoggerFactory
|
private static final Logger log = LoggerFactory
|
||||||
.getLogger(CommentSender.class);
|
.getLogger(CommentSender.class);
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
CommentSender create(Project.NameKey project, Change.Id id);
|
CommentSender create(Project.NameKey project, Change.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class CreateChangeSender extends NewChangeSender {
|
|||||||
private static final Logger log =
|
private static final Logger log =
|
||||||
LoggerFactory.getLogger(CreateChangeSender.class);
|
LoggerFactory.getLogger(CreateChangeSender.class);
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
CreateChangeSender create(Project.NameKey project, Change.Id id);
|
CreateChangeSender create(Project.NameKey project, Change.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import com.google.inject.assistedinject.Assisted;
|
|||||||
|
|
||||||
/** Send notice about a vote that was removed from a change. */
|
/** Send notice about a vote that was removed from a change. */
|
||||||
public class DeleteVoteSender extends ReplyToChangeSender {
|
public class DeleteVoteSender extends ReplyToChangeSender {
|
||||||
public static interface Factory extends
|
public interface Factory extends
|
||||||
ReplyToChangeSender.Factory<DeleteVoteSender> {
|
ReplyToChangeSender.Factory<DeleteVoteSender> {
|
||||||
@Override
|
@Override
|
||||||
DeleteVoteSender create(Project.NameKey project, Change.Id change);
|
DeleteVoteSender create(Project.NameKey project, Change.Id change);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import com.google.inject.assistedinject.Assisted;
|
|||||||
|
|
||||||
/** Send notice about a change failing to merged. */
|
/** Send notice about a change failing to merged. */
|
||||||
public class MergeFailSender extends ReplyToChangeSender {
|
public class MergeFailSender extends ReplyToChangeSender {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
MergeFailSender create(Project.NameKey project, Change.Id id);
|
MergeFailSender create(Project.NameKey project, Change.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import com.google.inject.assistedinject.Assisted;
|
|||||||
|
|
||||||
/** Send notice about a change successfully merged. */
|
/** Send notice about a change successfully merged. */
|
||||||
public class MergedSender extends ReplyToChangeSender {
|
public class MergedSender extends ReplyToChangeSender {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
MergedSender create(Project.NameKey project, Change.Id id);
|
MergedSender create(Project.NameKey project, Change.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
/** Send notice of new patch sets for reviewers. */
|
/** Send notice of new patch sets for reviewers. */
|
||||||
public class ReplacePatchSetSender extends ReplyToChangeSender {
|
public class ReplacePatchSetSender extends ReplyToChangeSender {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
ReplacePatchSetSender create(Project.NameKey project, Change.Id id);
|
ReplacePatchSetSender create(Project.NameKey project, Change.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import com.google.gwtorm.server.OrmException;
|
|||||||
|
|
||||||
/** Alert a user to a reply to a change, usually commentary made during review. */
|
/** Alert a user to a reply to a change, usually commentary made during review. */
|
||||||
public abstract class ReplyToChangeSender extends ChangeEmail {
|
public abstract class ReplyToChangeSender extends ChangeEmail {
|
||||||
public static interface Factory<T extends ReplyToChangeSender> {
|
public interface Factory<T extends ReplyToChangeSender> {
|
||||||
T create(Project.NameKey project, Change.Id id);
|
T create(Project.NameKey project, Change.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import com.google.inject.assistedinject.Assisted;
|
|||||||
|
|
||||||
/** Send notice about a change being restored by its owner. */
|
/** Send notice about a change being restored by its owner. */
|
||||||
public class RestoredSender extends ReplyToChangeSender {
|
public class RestoredSender extends ReplyToChangeSender {
|
||||||
public static interface Factory extends
|
public interface Factory extends
|
||||||
ReplyToChangeSender.Factory<RestoredSender> {
|
ReplyToChangeSender.Factory<RestoredSender> {
|
||||||
@Override
|
@Override
|
||||||
RestoredSender create(Project.NameKey project, Change.Id id);
|
RestoredSender create(Project.NameKey project, Change.Id id);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import com.google.inject.assistedinject.Assisted;
|
|||||||
|
|
||||||
/** Send notice about a change being reverted. */
|
/** Send notice about a change being reverted. */
|
||||||
public class RevertedSender extends ReplyToChangeSender {
|
public class RevertedSender extends ReplyToChangeSender {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
RevertedSender create(Project.NameKey project, Change.Id id);
|
RevertedSender create(Project.NameKey project, Change.Id id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class SmtpEmailSender implements EmailSender {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum Encryption {
|
public enum Encryption {
|
||||||
NONE, SSL, TLS
|
NONE, SSL, TLS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public abstract class AbstractChangeNotes<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@AutoValue
|
@AutoValue
|
||||||
public static abstract class LoadHandle implements AutoCloseable {
|
public abstract static class LoadHandle implements AutoCloseable {
|
||||||
public static LoadHandle create(RevWalk walk, ObjectId id) {
|
public static LoadHandle create(RevWalk walk, ObjectId id) {
|
||||||
return new AutoValue_AbstractChangeNotes_LoadHandle(
|
return new AutoValue_AbstractChangeNotes_LoadHandle(
|
||||||
checkNotNull(walk), id != null ? id.copy() : null);
|
checkNotNull(walk), id != null ? id.copy() : null);
|
||||||
|
|||||||
@@ -447,7 +447,8 @@ public class ChangeBundle {
|
|||||||
checkArgument(a.getClass() == b.getClass());
|
checkArgument(a.getClass() == b.getClass());
|
||||||
Class<?> clazz = a.getClass();
|
Class<?> clazz = a.getClass();
|
||||||
|
|
||||||
Timestamp ta, tb;
|
Timestamp ta;
|
||||||
|
Timestamp tb;
|
||||||
try {
|
try {
|
||||||
Field f = clazz.getDeclaredField(field);
|
Field f = clazz.getDeclaredField(field);
|
||||||
checkArgument(f.getAnnotation(Column.class) != null);
|
checkArgument(f.getAnnotation(Column.class) != null);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class ChangeDraftUpdate extends AbstractChangeUpdate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@AutoValue
|
@AutoValue
|
||||||
static abstract class Key {
|
abstract static class Key {
|
||||||
abstract RevId revId();
|
abstract RevId revId();
|
||||||
abstract PatchLineComment.Key key();
|
abstract PatchLineComment.Key key();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public enum ReviewerStateInternal {
|
|||||||
private final FooterKey footerKey;
|
private final FooterKey footerKey;
|
||||||
private final ReviewerState state;
|
private final ReviewerState state;
|
||||||
|
|
||||||
private ReviewerStateInternal(FooterKey footerKey, ReviewerState state) {
|
ReviewerStateInternal(FooterKey footerKey, ReviewerState state) {
|
||||||
this.footerKey = footerKey;
|
this.footerKey = footerKey;
|
||||||
this.state = state;
|
this.state = state;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import java.util.List;
|
|||||||
public class IntraLineDiff implements Serializable {
|
public class IntraLineDiff implements Serializable {
|
||||||
static final long serialVersionUID = IntraLineDiffKey.serialVersionUID;
|
static final long serialVersionUID = IntraLineDiffKey.serialVersionUID;
|
||||||
|
|
||||||
public static enum Status implements CodedEnum {
|
public enum Status implements CodedEnum {
|
||||||
EDIT_LIST('e'), DISABLED('D'), TIMEOUT('T'), ERROR('E');
|
EDIT_LIST('e'), DISABLED('D'), TIMEOUT('T'), ERROR('E');
|
||||||
|
|
||||||
private final char code;
|
private final char code;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import java.util.regex.Pattern;
|
|||||||
class IntraLineLoader implements Callable<IntraLineDiff> {
|
class IntraLineLoader implements Callable<IntraLineDiff> {
|
||||||
static final Logger log = LoggerFactory.getLogger(IntraLineLoader.class);
|
static final Logger log = LoggerFactory.getLogger(IntraLineLoader.class);
|
||||||
|
|
||||||
static interface Factory {
|
interface Factory {
|
||||||
IntraLineLoader create(IntraLineDiffKey key, IntraLineDiffArgs args);
|
IntraLineLoader create(IntraLineDiffKey key, IntraLineDiffArgs args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ package com.google.gerrit.server.plugins;
|
|||||||
public interface HttpModuleGenerator extends ModuleGenerator {
|
public interface HttpModuleGenerator extends ModuleGenerator {
|
||||||
void export(String javascript);
|
void export(String javascript);
|
||||||
|
|
||||||
static class NOP extends ModuleGenerator.NOP
|
class NOP extends ModuleGenerator.NOP
|
||||||
implements HttpModuleGenerator {
|
implements HttpModuleGenerator {
|
||||||
@Override
|
@Override
|
||||||
public void export(String javascript) {
|
public void export(String javascript) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public interface ModuleGenerator {
|
|||||||
|
|
||||||
Module create() throws InvalidPluginException;
|
Module create() throws InvalidPluginException;
|
||||||
|
|
||||||
static class NOP implements ModuleGenerator {
|
class NOP implements ModuleGenerator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPluginName(String name) {
|
public void setPluginName(String name) {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import java.util.jar.Attributes;
|
|||||||
import java.util.jar.Manifest;
|
import java.util.jar.Manifest;
|
||||||
|
|
||||||
public abstract class Plugin {
|
public abstract class Plugin {
|
||||||
public static enum ApiType {
|
public enum ApiType {
|
||||||
EXTENSION, PLUGIN, JS
|
EXTENSION, PLUGIN, JS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ public class PluginLoader implements LifecycleListener {
|
|||||||
for (String name : pluginPaths.keys()) {
|
for (String name : pluginPaths.keys()) {
|
||||||
for (Path pluginPath : pluginPaths.asMap().get(name)) {
|
for (Path pluginPath : pluginPaths.asMap().get(name)) {
|
||||||
if (!pluginPath.getFileName().toString().endsWith(".disabled")) {
|
if (!pluginPath.getFileName().toString().endsWith(".disabled")) {
|
||||||
assert(!activePlugins.containsKey(name));
|
assert !activePlugins.containsKey(name);
|
||||||
activePlugins.put(name, pluginPath);
|
activePlugins.put(name, pluginPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -656,7 +656,7 @@ public class PluginLoader implements LifecycleListener {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Path winner = Iterables.getFirst(enabled, null);
|
Path winner = Iterables.getFirst(enabled, null);
|
||||||
assert(winner != null);
|
assert winner != null;
|
||||||
// Disable all loser plugins by renaming their file names to
|
// Disable all loser plugins by renaming their file names to
|
||||||
// "file.disabled" and replace the disabled files in the multimap.
|
// "file.disabled" and replace the disabled files in the multimap.
|
||||||
Collection<Path> elementsToRemove = Lists.newArrayList();
|
Collection<Path> elementsToRemove = Lists.newArrayList();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class CreateBranch implements RestModifyView<ProjectResource, Input> {
|
|||||||
public String revision;
|
public String revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
CreateBranch create(String ref);
|
CreateBranch create(String ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ import java.util.List;
|
|||||||
|
|
||||||
@RequiresCapability(GlobalCapability.CREATE_PROJECT)
|
@RequiresCapability(GlobalCapability.CREATE_PROJECT)
|
||||||
public class CreateProject implements RestModifyView<TopLevelResource, ProjectInput> {
|
public class CreateProject implements RestModifyView<TopLevelResource, ProjectInput> {
|
||||||
public static interface Factory {
|
public interface Factory {
|
||||||
CreateProject create(String name);
|
CreateProject create(String name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ import java.util.TreeSet;
|
|||||||
public class ListProjects implements RestReadView<TopLevelResource> {
|
public class ListProjects implements RestReadView<TopLevelResource> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(ListProjects.class);
|
private static final Logger log = LoggerFactory.getLogger(ListProjects.class);
|
||||||
|
|
||||||
public static enum FilterType {
|
public enum FilterType {
|
||||||
CODE {
|
CODE {
|
||||||
@Override
|
@Override
|
||||||
boolean matches(Repository git) throws IOException {
|
boolean matches(Repository git) throws IOException {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class OutputStreamQuery {
|
|||||||
private static final DateTimeFormatter dtf =
|
private static final DateTimeFormatter dtf =
|
||||||
DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss zzz");
|
DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss zzz");
|
||||||
|
|
||||||
public static enum OutputFormat {
|
public enum OutputFormat {
|
||||||
TEXT, JSON
|
TEXT, JSON
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class DataSourceProvider implements Provider<DataSource>,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum Context {
|
public enum Context {
|
||||||
SINGLE_USER, MULTI_USER
|
SINGLE_USER, MULTI_USER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class ToolsCatalog {
|
|||||||
|
|
||||||
/** A file served out of the tools root directory. */
|
/** A file served out of the tools root directory. */
|
||||||
public static class Entry {
|
public static class Entry {
|
||||||
public static enum Type {
|
public enum Type {
|
||||||
DIR, FILE
|
DIR, FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import java.util.SortedSet;
|
|||||||
|
|
||||||
public class TreeFormatter {
|
public class TreeFormatter {
|
||||||
|
|
||||||
public static interface TreeNode {
|
public interface TreeNode {
|
||||||
String getDisplayName();
|
String getDisplayName();
|
||||||
boolean isVisible();
|
boolean isVisible();
|
||||||
SortedSet<? extends TreeNode> getChildren();
|
SortedSet<? extends TreeNode> getChildren();
|
||||||
|
|||||||
@@ -488,12 +488,12 @@ public abstract class BaseCommand implements Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Runnable function which can throw an exception. */
|
/** Runnable function which can throw an exception. */
|
||||||
public static interface CommandRunnable {
|
public interface CommandRunnable {
|
||||||
void run() throws Exception;
|
void run() throws Exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Runnable function which can retrieve a project name related to the task */
|
/** Runnable function which can retrieve a project name related to the task */
|
||||||
public static interface ProjectCommandRunnable extends CommandRunnable {
|
public interface ProjectCommandRunnable extends CommandRunnable {
|
||||||
// execute parser command before running, in order to be able to retrieve
|
// execute parser command before running, in order to be able to retrieve
|
||||||
// project name
|
// project name
|
||||||
void executeParseCommand() throws Exception;
|
void executeParseCommand() throws Exception;
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
|
|||||||
private static final Logger sshDaemonLog =
|
private static final Logger sshDaemonLog =
|
||||||
LoggerFactory.getLogger(SshDaemon.class);
|
LoggerFactory.getLogger(SshDaemon.class);
|
||||||
|
|
||||||
public static enum SshSessionBackend {
|
public enum SshSessionBackend {
|
||||||
MINA,
|
MINA,
|
||||||
NIO2
|
NIO2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class QueryShell {
|
|||||||
QueryShell create(@Assisted InputStream in, @Assisted OutputStream out);
|
QueryShell create(@Assisted InputStream in, @Assisted OutputStream out);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum OutputFormat {
|
public enum OutputFormat {
|
||||||
PRETTY, JSON, JSON_SINGLE
|
PRETTY, JSON, JSON_SINGLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class SetLoggingLevelCommand extends SshCommand {
|
|||||||
private static final String LOG_CONFIGURATION = "log4j.properties";
|
private static final String LOG_CONFIGURATION = "log4j.properties";
|
||||||
private static final String JAVA_OPTIONS_LOG_CONFIG = "log4j.configuration";
|
private static final String JAVA_OPTIONS_LOG_CONFIG = "log4j.configuration";
|
||||||
|
|
||||||
private static enum LevelOption {
|
private enum LevelOption {
|
||||||
ALL,
|
ALL,
|
||||||
TRACE,
|
TRACE,
|
||||||
DEBUG,
|
DEBUG,
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ final class StreamEvents extends BaseCommand {
|
|||||||
|
|
||||||
/** Special event to notify clients they missed other events. */
|
/** Special event to notify clients they missed other events. */
|
||||||
private static final class DroppedOutputEvent extends Event {
|
private static final class DroppedOutputEvent extends Event {
|
||||||
private final static String TYPE = "dropped-output";
|
private static final String TYPE = "dropped-output";
|
||||||
public DroppedOutputEvent() {
|
public DroppedOutputEvent() {
|
||||||
super(TYPE);
|
super(TYPE);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user