Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  ElasticContainer: Upgrade V6_8 to elasticsearch 6.8.9
  ElasticVersion: Replace unchecked throw w/ javadoc
  Remove obsolete parts from Java code style guide
  Elasticsearch: Remove support for EOL 6.5 version

Change-Id: Iab0ccdf102d510f001400c1ed140edc6014f2536
This commit is contained in:
David Pursehouse
2020-05-14 08:52:36 +09:00
5 changed files with 10 additions and 30 deletions

View File

@@ -3030,11 +3030,6 @@ Note that the same username and password are used for all servers.
For further information about Elasticsearch security, please refer to the documentation:
* link:https://www.elastic.co/guide/en/x-pack/5.6/security-getting-started.html[Elasticsearch 5.6]
* link:https://www.elastic.co/guide/en/x-pack/6.2/security-getting-started.html[Elasticsearch 6.2]
* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.3/security-getting-started.html[Elasticsearch 6.3]
* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.4/security-getting-started.html[Elasticsearch 6.4]
* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.5/security-getting-started.html[Elasticsearch 6.5]
* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.6/security-getting-started.html[Elasticsearch 6.6]
[[elasticsearch.username]]elasticsearch.username::

View File

@@ -163,7 +163,7 @@ introduced any new Eclipse warnings, mention this in a comment to your
change, so that reviewers will do it for you. Yes, the way to go is to
extend gerrit CI to take care of this, but it's not yet implemented.
Gerrit generally follows the
Gerrit follows the
link:https://google.github.io/styleguide/javaguide.html[Google Java Style
Guide].
@@ -184,19 +184,6 @@ run `./tools/setup_gjf.sh` to download a local copy and set up a
wrapper script. If you run your own copy, please use the same version,
as there may be slight differences between versions.
When considering the style beyond just formatting rules, it is often
more important to match the style of the nearby code which you are
modifying than it is to match the style guide exactly. This is
especially true within the same file.
Additionally, you will notice that most of the newline spacing
is fairly consistent throughout the code in Gerrit, it helps to
stick to the blank line conventions. Here are some specific
examples:
* Keep a blank line between all class and method declarations.
* Do not add blank lines at the beginning or end of class/methods.
When to use `final` modifier and when not (in new code):
Always:

View File

@@ -18,7 +18,6 @@ import com.google.common.base.Joiner;
import java.util.regex.Pattern;
public enum ElasticVersion {
V6_5("6.5.*"),
V6_6("6.6.*"),
V6_7("6.7.*"),
V6_8("6.8.*"),
@@ -48,7 +47,14 @@ public enum ElasticVersion {
}
}
public static ElasticVersion forVersion(String version) throws UnsupportedVersion {
/**
* Convert a version String to an ElasticVersion if supported.
*
* @param version for which to return an ElasticVersion
* @return the corresponding ElasticVersion if supported
* @throws UnsupportedVersion
*/
public static ElasticVersion forVersion(String version) {
for (ElasticVersion value : ElasticVersion.values()) {
if (value.pattern.matcher(version).matches()) {
return value;

View File

@@ -38,14 +38,12 @@ public class ElasticContainer extends ElasticsearchContainer {
private static String getImageName(ElasticVersion version) {
switch (version) {
case V6_5:
return "blacktop/elasticsearch:6.5.4";
case V6_6:
return "blacktop/elasticsearch:6.6.2";
case V6_7:
return "blacktop/elasticsearch:6.7.2";
case V6_8:
return "blacktop/elasticsearch:6.8.8";
return "blacktop/elasticsearch:6.8.9";
case V7_0:
return "blacktop/elasticsearch:7.0.1";
case V7_1:

View File

@@ -22,9 +22,6 @@ import org.junit.Test;
public class ElasticVersionTest extends GerritBaseTests {
@Test
public void supportedVersion() throws Exception {
assertThat(ElasticVersion.forVersion("6.5.0")).isEqualTo(ElasticVersion.V6_5);
assertThat(ElasticVersion.forVersion("6.5.1")).isEqualTo(ElasticVersion.V6_5);
assertThat(ElasticVersion.forVersion("6.6.0")).isEqualTo(ElasticVersion.V6_6);
assertThat(ElasticVersion.forVersion("6.6.1")).isEqualTo(ElasticVersion.V6_6);
@@ -66,7 +63,6 @@ public class ElasticVersionTest extends GerritBaseTests {
@Test
public void atLeastMinorVersion() throws Exception {
assertThat(ElasticVersion.V6_5.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse();
assertThat(ElasticVersion.V6_6.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse();
assertThat(ElasticVersion.V6_7.isAtLeastMinorVersion(ElasticVersion.V6_7)).isTrue();
assertThat(ElasticVersion.V6_8.isAtLeastMinorVersion(ElasticVersion.V6_8)).isTrue();
@@ -81,7 +77,6 @@ public class ElasticVersionTest extends GerritBaseTests {
@Test
public void version6OrLater() throws Exception {
assertThat(ElasticVersion.V6_5.isV6OrLater()).isTrue();
assertThat(ElasticVersion.V6_6.isV6OrLater()).isTrue();
assertThat(ElasticVersion.V6_7.isV6OrLater()).isTrue();
assertThat(ElasticVersion.V6_8.isV6OrLater()).isTrue();
@@ -96,7 +91,6 @@ public class ElasticVersionTest extends GerritBaseTests {
@Test
public void version7OrLater() throws Exception {
assertThat(ElasticVersion.V6_5.isV7OrLater()).isFalse();
assertThat(ElasticVersion.V6_6.isV7OrLater()).isFalse();
assertThat(ElasticVersion.V6_7.isV7OrLater()).isFalse();
assertThat(ElasticVersion.V6_8.isV7OrLater()).isFalse();