From 6cccd4462c6e8f6387d7b5c6c2eb3eb072601bbd Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 27 Apr 2016 16:51:12 -0400 Subject: [PATCH] Wrap Version at 140 columns and remove its checkstyle_suppression line --- .../resources/checkstyle_suppressions.xml | 1 - .../main/java/org/elasticsearch/Version.java | 24 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/buildSrc/src/main/resources/checkstyle_suppressions.xml b/buildSrc/src/main/resources/checkstyle_suppressions.xml index 8394e430777..ecd95b27ae3 100644 --- a/buildSrc/src/main/resources/checkstyle_suppressions.xml +++ b/buildSrc/src/main/resources/checkstyle_suppressions.xml @@ -16,7 +16,6 @@ - diff --git a/core/src/main/java/org/elasticsearch/Version.java b/core/src/main/java/org/elasticsearch/Version.java index 72e8f215574..56d245ddc51 100644 --- a/core/src/main/java/org/elasticsearch/Version.java +++ b/core/src/main/java/org/elasticsearch/Version.java @@ -34,12 +34,11 @@ import java.io.IOException; */ @SuppressWarnings("deprecation") public class Version { - - // The logic for ID is: XXYYZZAA, where XX is major version, YY is minor version, ZZ is revision, and AA is alpha/beta/rc indicator - // AA values below 25 are for alpha builder (since 5.0), and above 25 and below 50 are beta builds, and below 99 are RC builds, with 99 indicating a release - // the (internal) format of the id is there so we can easily do after/before checks on the id - - + /* + * The logic for ID is: XXYYZZAA, where XX is major version, YY is minor version, ZZ is revision, and AA is alpha/beta/rc indicator AA + * values below 25 are for alpha builder (since 5.0), and above 25 and below 50 are beta builds, and below 99 are RC builds, with 99 + * indicating a release the (internal) format of the id is there so we can easily do after/before checks on the id + */ public static final int V_2_0_0_beta1_ID = 2000001; public static final Version V_2_0_0_beta1 = new Version(V_2_0_0_beta1_ID, org.apache.lucene.util.Version.LUCENE_5_2_1); public static final int V_2_0_0_beta2_ID = 2000002; @@ -129,12 +128,15 @@ public class Version { /** * Return the {@link Version} of Elasticsearch that has been used to create an index given its settings. * - * @throws IllegalStateException if the given index settings doesn't contain a value for the key {@value IndexMetaData#SETTING_VERSION_CREATED} + * @throws IllegalStateException if the given index settings doesn't contain a value for the key + * {@value IndexMetaData#SETTING_VERSION_CREATED} */ public static Version indexCreated(Settings indexSettings) { final Version indexVersion = indexSettings.getAsVersion(IndexMetaData.SETTING_VERSION_CREATED, null); if (indexVersion == null) { - throw new IllegalStateException("[" + IndexMetaData.SETTING_VERSION_CREATED + "] is not present in the index settings for index with uuid: [" + indexSettings.get(IndexMetaData.SETTING_INDEX_UUID) + "]"); + throw new IllegalStateException( + "[" + IndexMetaData.SETTING_VERSION_CREATED + "] is not present in the index settings for index with uuid: [" + + indexSettings.get(IndexMetaData.SETTING_INDEX_UUID) + "]"); } return indexVersion; } @@ -163,7 +165,8 @@ public class Version { } String[] parts = version.split("\\.|\\-"); if (parts.length < 3 || parts.length > 4) { - throw new IllegalArgumentException("the version needs to contain major, minor, and revision, and optionally the build: " + version); + throw new IllegalArgumentException( + "the version needs to contain major, minor, and revision, and optionally the build: " + version); } try { @@ -247,7 +250,8 @@ public class Version { @SuppressForbidden(reason = "System.out.*") public static void main(String[] args) { - System.out.println("Version: " + Version.CURRENT + ", Build: " + Build.CURRENT.shortHash() + "/" + Build.CURRENT.date() + ", JVM: " + JvmInfo.jvmInfo().version()); + System.out.println("Version: " + Version.CURRENT + ", Build: " + Build.CURRENT.shortHash() + "/" + Build.CURRENT.date() + ", JVM: " + + JvmInfo.jvmInfo().version()); } @Override