Skip to content

Commit

Permalink
[GEODE-2381] spotless: line break on enum constants.
Browse files Browse the repository at this point in the history
* Change the style XML file to insert a line break after each constant
  of an enum.
* This commit is just the style file change; spotless will be applied
  next.
* Apply spotless to fix enums and nothing else in this commit.

There may be a better way to do this and allow simple enums to be all on
one line, but this looks better to me.

This closes apache#368
  • Loading branch information
galen-pivotal authored and kirklund committed Feb 6, 2017
1 parent e769796 commit 2df3063
Show file tree
Hide file tree
Showing 19 changed files with 256 additions and 227 deletions.
2 changes: 1 addition & 1 deletion etc/eclipse-java-google-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ public enum ListenerEventType {
/**
* HttpSessionAttributeListener
*/
SESSION_ATTRIBUTE_ADDED, SESSION_ATTRIBUTE_REMOVED, SESSION_ATTRIBUTE_REPLACED,
SESSION_ATTRIBUTE_ADDED,
SESSION_ATTRIBUTE_REMOVED,
SESSION_ATTRIBUTE_REPLACED,

/**
* HttpSessionBindingListener
*/
SESSION_VALUE_BOUND, SESSION_VALUE_UNBOUND,
SESSION_VALUE_BOUND,
SESSION_VALUE_UNBOUND,

/**
* HttpSessionListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,10 +853,10 @@ protected String toString(final String value) {
* as a Cache Server, a Locator or a Manager).
*/
public static enum Status {
NOT_RESPONDING(LocalizedStrings.Launcher_Status_NOT_RESPONDING.toLocalizedString()), ONLINE(
LocalizedStrings.Launcher_Status_ONLINE.toLocalizedString()), STARTING(
LocalizedStrings.Launcher_Status_STARTING.toLocalizedString()), STOPPED(
LocalizedStrings.Launcher_Status_STOPPED.toLocalizedString());
NOT_RESPONDING(LocalizedStrings.Launcher_Status_NOT_RESPONDING.toLocalizedString()),
ONLINE(LocalizedStrings.Launcher_Status_ONLINE.toLocalizedString()),
STARTING(LocalizedStrings.Launcher_Status_STARTING.toLocalizedString()),
STOPPED(LocalizedStrings.Launcher_Status_STOPPED.toLocalizedString());

private final String description;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1843,10 +1843,11 @@ public LocatorLauncher build() {
* An enumerated type representing valid commands to the Locator launcher.
*/
public static enum Command {
START("start", "bind-address", "hostname-for-clients", "port", "force", "debug",
"help"), STATUS("status", "bind-address", "port", "member", "pid", "dir", "debug",
"help"), STOP("stop", "member", "pid", "dir", "debug",
"help"), VERSION("version"), UNSPECIFIED("unspecified");
START("start", "bind-address", "hostname-for-clients", "port", "force", "debug", "help"),
STATUS("status", "bind-address", "port", "member", "pid", "dir", "debug", "help"),
STOP("stop", "member", "pid", "dir", "debug", "help"),
VERSION("version"),
UNSPECIFIED("unspecified");

private final List<String> options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2484,9 +2484,11 @@ public ServerLauncher build() {
*/
public static enum Command {
START("start", "assign-buckets", "disable-default-server", "rebalance", SERVER_BIND_ADDRESS,
"server-port", "force", "debug",
"help"), STATUS("status", "member", "pid", "dir", "debug", "help"), STOP("stop", "member",
"pid", "dir", "debug", "help"), UNSPECIFIED("unspecified"), VERSION("version");
"server-port", "force", "debug", "help"),
STATUS("status", "member", "pid", "dir", "debug", "help"),
STOP("stop", "member", "pid", "dir", "debug", "help"),
UNSPECIFIED("unspecified"),
VERSION("version");

private final List<String> options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,33 @@
*
*/
public enum ResourceEvent {
CACHE_CREATE, REGION_CREATE, DISKSTORE_CREATE, GATEWAYSENDER_CREATE, LOCKSERVICE_CREATE, CACHE_REMOVE, REGION_REMOVE, DISKSTORE_REMOVE, GATEWAYSENDER_REMOVE, LOCKSERVICE_REMOVE, MANAGER_CREATE, MANAGER_START, MANAGER_STOP, LOCATOR_START, ASYNCEVENTQUEUE_CREATE, SYSTEM_ALERT, CACHE_SERVER_START, CACHE_SERVER_STOP, GATEWAYRECEIVER_START, GATEWAYRECEIVER_STOP, GATEWAYRECEIVER_CREATE, GATEWAYSENDER_START, GATEWAYSENDER_STOP, GATEWAYSENDER_PAUSE, GATEWAYSENDER_RESUME, CACHE_SERVICE_CREATE, CACHE_SERVICE_REMOVE
CACHE_CREATE,
REGION_CREATE,
DISKSTORE_CREATE,
GATEWAYSENDER_CREATE,
LOCKSERVICE_CREATE,
CACHE_REMOVE,
REGION_REMOVE,
DISKSTORE_REMOVE,
GATEWAYSENDER_REMOVE,
LOCKSERVICE_REMOVE,
MANAGER_CREATE,
MANAGER_START,
MANAGER_STOP,
LOCATOR_START,
ASYNCEVENTQUEUE_CREATE,
SYSTEM_ALERT,
CACHE_SERVER_START,
CACHE_SERVER_STOP,
GATEWAYRECEIVER_START,
GATEWAYRECEIVER_STOP,
GATEWAYRECEIVER_CREATE,
GATEWAYSENDER_START,
GATEWAYSENDER_STOP,
GATEWAYSENDER_PAUSE,
GATEWAYSENDER_RESUME,
CACHE_SERVICE_CREATE,
CACHE_SERVICE_REMOVE

}

Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ public static String processOutgoingClassName(String name, DataOutput out) {
* @since GemFire 6.6.2
*/
private static enum SERIALIZATION_VERSION {
vINVALID, v660, // includes 6.6.0.x and 6.6.1.x. Note that no serialization changes were made in
// 6.6 until 6.6.2
vINVALID,
v660, // includes 6.6.0.x and 6.6.1.x. Note that no serialization changes were made in
// 6.6 until 6.6.2
v662 // 6.6.2.x or later
// NOTE if you add a new constant make sure and update "latestVersion".
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,20 @@ public class FilterProfile implements DataSerializableFixedID {

/** enumeration of distributed profile operations */
static enum operationType {
REGISTER_KEY, REGISTER_KEYS, REGISTER_PATTERN, REGISTER_FILTER, UNREGISTER_KEY, UNREGISTER_KEYS, UNREGISTER_PATTERN, UNREGISTER_FILTER, CLEAR, HAS_CQ, REGISTER_CQ, CLOSE_CQ, STOP_CQ, SET_CQ_STATE
REGISTER_KEY,
REGISTER_KEYS,
REGISTER_PATTERN,
REGISTER_FILTER,
UNREGISTER_KEY,
UNREGISTER_KEYS,
UNREGISTER_PATTERN,
UNREGISTER_FILTER,
CLEAR,
HAS_CQ,
REGISTER_CQ,
CLOSE_CQ,
STOP_CQ,
SET_CQ_STATE
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4004,11 +4004,22 @@ public String toString() {
private static GIITestHook internalAfterSavedRVVEnd;

public enum GIITestHookType {
BeforeGetInitialImage, BeforeRequestRVV, AfterRequestRVV, AfterCalculatedUnfinishedOps, BeforeSavedReceivedRVV, AfterSavedReceivedRVV, AfterSentRequestImage,

AfterReceivedRequestImage, DuringPackingImage, AfterSentImageReply,

AfterReceivedImageReply, DuringApplyDelta, BeforeCleanExpiredTombstones, AfterSavedRVVEnd
BeforeGetInitialImage,
BeforeRequestRVV,
AfterRequestRVV,
AfterCalculatedUnfinishedOps,
BeforeSavedReceivedRVV,
AfterSavedReceivedRVV,
AfterSentRequestImage,

AfterReceivedRequestImage,
DuringPackingImage,
AfterSentImageReply,

AfterReceivedImageReply,
DuringApplyDelta,
BeforeCleanExpiredTombstones,
AfterSavedRVVEnd
}

public static GIITestHook getGIITestHookForCheckingPurpose(final GIITestHookType type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@
*/
public class TransactionalOperation {
static public enum ServerRegionOperation {
CONTAINS_KEY, CONTAINS_VALUE, CONTAINS_VALUE_FOR_KEY, DESTROY, // includes REMOVE(k,v)
EXECUTE_FUNCTION, GET, GET_ENTRY, GET_ALL, INVALIDATE, KEY_SET, PUT, // includes PUT_IF_ABSENT
PUT_ALL, REMOVE_ALL;
CONTAINS_KEY,
CONTAINS_VALUE,
CONTAINS_VALUE_FOR_KEY,
DESTROY, // includes REMOVE(k,v)
EXECUTE_FUNCTION,
GET,
GET_ENTRY,
GET_ALL,
INVALIDATE,
KEY_SET,
PUT, // includes PUT_IF_ABSENT
PUT_ALL,
REMOVE_ALL;

/**
* @param op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,22 @@
*/
// TODO future - replace constants in CacheXml with this Enum completely
public enum CacheXmlVersion {
GEMFIRE_3_0(CacheXml.VERSION_3_0, CacheXml.PUBLIC_ID_3_0, CacheXml.SYSTEM_ID_3_0, null,
null), GEMFIRE_4_0(CacheXml.VERSION_4_0, CacheXml.PUBLIC_ID_4_0, CacheXml.SYSTEM_ID_4_0, null,
null), GEMFIRE_4_1(CacheXml.VERSION_4_1, CacheXml.PUBLIC_ID_4_1, CacheXml.SYSTEM_ID_4_1,
null, null), GEMFIRE_5_0(CacheXml.VERSION_5_0, CacheXml.PUBLIC_ID_5_0,
CacheXml.SYSTEM_ID_5_0, null, null), GEMFIRE_5_1(CacheXml.VERSION_5_1,
CacheXml.PUBLIC_ID_5_1, CacheXml.SYSTEM_ID_5_1, null, null), GEMFIRE_5_5(
CacheXml.VERSION_5_5, CacheXml.PUBLIC_ID_5_5, CacheXml.SYSTEM_ID_5_5,
null, null), GEMFIRE_5_7(CacheXml.VERSION_5_7, CacheXml.PUBLIC_ID_5_7,
CacheXml.SYSTEM_ID_5_7, null, null), GEMFIRE_5_8(CacheXml.VERSION_5_8,
CacheXml.PUBLIC_ID_5_8, CacheXml.SYSTEM_ID_5_8, null,
null), GEMFIRE_6_0(CacheXml.VERSION_6_0, CacheXml.PUBLIC_ID_6_0,
CacheXml.SYSTEM_ID_6_0, null, null), GEMFIRE_6_1(
CacheXml.VERSION_6_1, CacheXml.PUBLIC_ID_6_1,
CacheXml.SYSTEM_ID_6_1, null, null), GEMFIRE_6_5(
CacheXml.VERSION_6_5, CacheXml.PUBLIC_ID_6_5,
CacheXml.SYSTEM_ID_6_5, null, null), GEMFIRE_6_6(
CacheXml.VERSION_6_6, CacheXml.PUBLIC_ID_6_6,
CacheXml.SYSTEM_ID_6_6, null, null), GEMFIRE_7_0(
CacheXml.VERSION_7_0, CacheXml.PUBLIC_ID_7_0,
CacheXml.SYSTEM_ID_7_0, null,
null), GEMFIRE_8_0(CacheXml.VERSION_8_0,
CacheXml.PUBLIC_ID_8_0,
CacheXml.SYSTEM_ID_8_0, null,
null), GEMFIRE_8_1(CacheXml.VERSION_8_1,
null, null,
CacheXml.SCHEMA_8_1_LOCATION,
CacheXml.GEMFIRE_NAMESPACE),
GEMFIRE_3_0(CacheXml.VERSION_3_0, CacheXml.PUBLIC_ID_3_0, CacheXml.SYSTEM_ID_3_0, null, null),
GEMFIRE_4_0(CacheXml.VERSION_4_0, CacheXml.PUBLIC_ID_4_0, CacheXml.SYSTEM_ID_4_0, null, null),
GEMFIRE_4_1(CacheXml.VERSION_4_1, CacheXml.PUBLIC_ID_4_1, CacheXml.SYSTEM_ID_4_1, null, null),
GEMFIRE_5_0(CacheXml.VERSION_5_0, CacheXml.PUBLIC_ID_5_0, CacheXml.SYSTEM_ID_5_0, null, null),
GEMFIRE_5_1(CacheXml.VERSION_5_1, CacheXml.PUBLIC_ID_5_1, CacheXml.SYSTEM_ID_5_1, null, null),
GEMFIRE_5_5(CacheXml.VERSION_5_5, CacheXml.PUBLIC_ID_5_5, CacheXml.SYSTEM_ID_5_5, null, null),
GEMFIRE_5_7(CacheXml.VERSION_5_7, CacheXml.PUBLIC_ID_5_7, CacheXml.SYSTEM_ID_5_7, null, null),
GEMFIRE_5_8(CacheXml.VERSION_5_8, CacheXml.PUBLIC_ID_5_8, CacheXml.SYSTEM_ID_5_8, null, null),
GEMFIRE_6_0(CacheXml.VERSION_6_0, CacheXml.PUBLIC_ID_6_0, CacheXml.SYSTEM_ID_6_0, null, null),
GEMFIRE_6_1(CacheXml.VERSION_6_1, CacheXml.PUBLIC_ID_6_1, CacheXml.SYSTEM_ID_6_1, null, null),
GEMFIRE_6_5(CacheXml.VERSION_6_5, CacheXml.PUBLIC_ID_6_5, CacheXml.SYSTEM_ID_6_5, null, null),
GEMFIRE_6_6(CacheXml.VERSION_6_6, CacheXml.PUBLIC_ID_6_6, CacheXml.SYSTEM_ID_6_6, null, null),
GEMFIRE_7_0(CacheXml.VERSION_7_0, CacheXml.PUBLIC_ID_7_0, CacheXml.SYSTEM_ID_7_0, null, null),
GEMFIRE_8_0(CacheXml.VERSION_8_0, CacheXml.PUBLIC_ID_8_0, CacheXml.SYSTEM_ID_8_0, null, null),
GEMFIRE_8_1(CacheXml.VERSION_8_1, null, null, CacheXml.SCHEMA_8_1_LOCATION,
CacheXml.GEMFIRE_NAMESPACE),

// Ordinality matters here, so keep the 1.0 version after the 8.x versions
// Version 1.0 is the start of Geode versions. In terms of releases, Geode 1.0 > GemFire 8.x.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ public enum OffHeapIdentifier {
*/
DEFAULT("DEFAULT"),

ENTRY_EVENT_NEW_VALUE("org.apache.geode.internal.cache.KeyInfo.newValue"), ENTRY_EVENT_OLD_VALUE(
"org.apache.geode.internal.cache.EntryEventImpl.oldValue"), TX_ENTRY_STATE(
"org.apache.geode.internal.cache.originalVersionId"), GATEWAY_SENDER_EVENT_IMPL_VALUE(
"org.apache.geode.internal.cache.wan.GatewaySenderEventImpl.valueObj"), TEST_OFF_HEAP_REGION_BASE_LISTENER(
"org.apache.geode.internal.offheap.OffHeapRegionBase.MyCacheListener.ohOldValue and ohNewValue"), REGION_ENTRY_VALUE(
""), ABSTRACT_REGION_ENTRY_PREPARE_VALUE_FOR_CACHE(
"org.apache.geode.internal.cache.AbstractRegionEntry.prepareValueForCache(...)"), ABSTRACT_REGION_ENTRY_FILL_IN_VALUE(
"org.apache.geode.internal.cache.AbstractRegionEntry.fillInValue(...)"), GEMFIRE_TRANSACTION_BYTE_SOURCE(
""),
ENTRY_EVENT_NEW_VALUE("org.apache.geode.internal.cache.KeyInfo.newValue"),
ENTRY_EVENT_OLD_VALUE("org.apache.geode.internal.cache.EntryEventImpl.oldValue"),
TX_ENTRY_STATE("org.apache.geode.internal.cache.originalVersionId"),
GATEWAY_SENDER_EVENT_IMPL_VALUE(
"org.apache.geode.internal.cache.wan.GatewaySenderEventImpl.valueObj"),
TEST_OFF_HEAP_REGION_BASE_LISTENER(
"org.apache.geode.internal.offheap.OffHeapRegionBase.MyCacheListener.ohOldValue and ohNewValue"),
REGION_ENTRY_VALUE(""),
ABSTRACT_REGION_ENTRY_PREPARE_VALUE_FOR_CACHE(
"org.apache.geode.internal.cache.AbstractRegionEntry.prepareValueForCache(...)"),
ABSTRACT_REGION_ENTRY_FILL_IN_VALUE(
"org.apache.geode.internal.cache.AbstractRegionEntry.fillInValue(...)"),
GEMFIRE_TRANSACTION_BYTE_SOURCE(""),

/**
* Used to declare possible grouping that are not yet identified.
Expand Down
Loading

0 comments on commit 2df3063

Please sign in to comment.