Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] [2.x] Update spotless to meet JDK-21 baseline (#618) #627

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
buildscript {

ext {
opensearch_version = System.getProperty("opensearch.version", "2.12.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "2.13.0-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")

default_bwc_version = System.getProperty("bwc.version", "2.10.0.0")
default_bwc_version = System.getProperty("bwc.version", "2.12.0.0")
pa_bwc_version = System.getProperty("tests.bwc.version", default_bwc_version)
baseName = "paBwcCluster"

Expand Down Expand Up @@ -48,9 +48,9 @@ buildscript {
plugins {
id 'java'
id 'com.netflix.nebula.ospackage' version "11.6.0"
id 'com.github.spotbugs' version '5.0.13'
id 'com.github.spotbugs' version '6.0.7'
id 'jacoco'
id 'com.diffplug.spotless' version '5.11.0'
id 'com.diffplug.spotless' version '6.25.0'
id 'checkstyle'
id 'org.ajoberstar.grgit' version '5.0.0'
id 'org.gradle.test-retry' version '1.5.2'
Expand All @@ -64,7 +64,7 @@ checkstyle {

spotbugsMain {
excludeFilter = file("checkstyle/findbugs-exclude.xml")
effort = 'max'
effort = com.github.spotbugs.snom.Effort.MAX
ignoreFailures = true

reports {
Expand Down Expand Up @@ -104,7 +104,7 @@ noticeFile = rootProject.file('NOTICE.txt')
spotless {
java {
licenseHeaderFile(file('license-header'))
googleJavaFormat('1.12.0').aosp()
googleJavaFormat('1.17.0').aosp()
importOrder()
removeUnusedImports()
trimTrailingWhitespace()
Expand Down Expand Up @@ -212,7 +212,7 @@ tasks.withType(JavaCompile) {
}

jacoco {
toolVersion = "0.8.7"
toolVersion = "0.8.11"
}

jacocoTestReport {
Expand Down Expand Up @@ -295,6 +295,7 @@ dependencies {
force "org.apache.commons:commons-lang3:${versions.commonslang}"
force "org.slf4j:slf4j-api:2.0.0"
force "org.apache.bcel:bcel:6.6.0" // This line should be removed once Spotbugs is upgraded to 4.7.4
force "com.google.guava:guava:${guavaVersion}"
}
}

Expand Down Expand Up @@ -668,7 +669,7 @@ task integTestRemote(type: RestIntegTestTask) {
testClusters {
"${baseName}$i" {
testDistribution = "ARCHIVE"
versions = ["2.10.0-SNAPSHOT", opensearch_version]
versions = ["2.12.0-SNAPSHOT", opensearch_version]
numberOfNodes = 3
plugin(provider(new Callable<RegularFile>() {
@Override
Expand Down
1 change: 0 additions & 1 deletion licenses/netty-buffer-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-buffer-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c5495ba59a627641b3a7c23f6bcb801874c7f7b0
1 change: 0 additions & 1 deletion licenses/netty-codec-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-codec-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
025171b63aa1e7a5fd8a7e4e660d6d3110241ea7
1 change: 0 additions & 1 deletion licenses/netty-codec-http-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-codec-http-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21a07cdf0fc46b313fe2248f1275cdbdac0ba87b
1 change: 0 additions & 1 deletion licenses/netty-codec-http2-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-codec-http2-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
41515e8c51eeaaddceabdb4f86fbc5dbfc25b70e
1 change: 0 additions & 1 deletion licenses/netty-codec-socks-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-codec-socks-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
129f9bd6aa0cf28bfd7d45a8b6a598eed9c67702
1 change: 0 additions & 1 deletion licenses/netty-common-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-common-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
132defb4689f41b51b483b7202b22b6e89fe35fd
1 change: 0 additions & 1 deletion licenses/netty-handler-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-handler-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
874c970c4ff958b1140dde52bc17e6a9e7cde662
1 change: 0 additions & 1 deletion licenses/netty-handler-proxy-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-handler-proxy-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bffc88b7c56d7b553453e4244247a1b0ba1fdc8a
1 change: 0 additions & 1 deletion licenses/netty-resolver-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-resolver-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e185ae573db04939215f94d6ba869758dcecbde9
1 change: 0 additions & 1 deletion licenses/netty-transport-4.1.104.Final.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/netty-transport-4.1.106.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8fcca44ae16b98e15965093e7696832019fd6f27

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2da179bd95903f0fa73218b8f0d02690c0cfbc94
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a7390b56028ff0ec41c0114036cec55a511bfe91
4b687090e06c7e28c0728fb7138628b6139dbb4a
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import org.opensearch.client.Client;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Settings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.action;


import java.util.concurrent.atomic.AtomicLong;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.action;


import org.opensearch.OpenSearchException;
import org.opensearch.action.bulk.BulkResponse;
import org.opensearch.action.search.SearchResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.collectors;


import org.opensearch.action.admin.indices.stats.ShardStats;

@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public void addSubscriberForStringSetting(
stringSettingListenerMap.put(setting, Collections.singletonList(listener));
}
}

/** Bootstraps the listeners and tries to read initial values for cluster settings. */
public void initialize() {
if (!initialized) {
Expand Down Expand Up @@ -248,6 +249,7 @@ private void callStringSettingListeners(final Setting<String> setting, String se
StatsCollector.instance().logException(OPENSEARCH_REQUEST_INTERCEPTOR_ERROR);
}
}

/** Class that handles response to GET /_cluster/settings */
private class ClusterSettingsResponseHandler implements ActionListener<ClusterStateResponse> {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.config.setting;


import org.opensearch.common.settings.Setting;

public final class PerformanceAnalyzerClusterSettings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.config.setting.handler;


import com.google.common.collect.ImmutableList;
import java.io.IOException;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.config.setting.handler;


import org.opensearch.performanceanalyzer.config.PerformanceAnalyzerController;
import org.opensearch.performanceanalyzer.config.setting.ClusterSettingListener;
import org.opensearch.performanceanalyzer.config.setting.ClusterSettingsManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.config.setting.handler;


import java.util.LinkedHashMap;
import java.util.Map;
import org.opensearch.performanceanalyzer.config.PerformanceAnalyzerController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public List<ReplacedRoute> replacedRoutes() {
return REPLACED_ROUTES;
}

/** @return the name of this handler. */
/**
* @return the name of this handler.
*/
@Override
public String getName() {
return PerformanceAnalyzerOverridesClusterConfigAction.class.getSimpleName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.http_action.config;


import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSet;
import java.io.BufferedReader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.http_action.whoami;


import org.opensearch.action.support.ActionFilters;
import org.opensearch.action.support.HandledTransportAction;
import org.opensearch.common.inject.Inject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.http_action.whoami;


import org.opensearch.action.ActionType;
import org.opensearch.core.common.io.stream.Writeable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.http_action.whoami;


import org.opensearch.action.support.nodes.BaseNodesRequest;
import org.opensearch.core.common.io.stream.StreamInput;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.http_action.whoami;


import org.opensearch.action.ActionRequestBuilder;
import org.opensearch.client.ClusterAdminClient;
import org.opensearch.client.OpenSearchClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.http_action.whoami;


import java.io.IOException;
import org.opensearch.core.action.ActionResponse;
import org.opensearch.core.common.io.stream.StreamOutput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.listener;


import org.opensearch.search.internal.SearchContext;

interface SearchListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.transport;


import java.io.IOException;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.logging.log4j.LogManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.transport;


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.performanceanalyzer.config.PerformanceAnalyzerController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.util;


import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import java.io.File;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.Filter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.InputStreamReader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer;


import com.fasterxml.jackson.databind.JsonNode;
import java.util.Iterator;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.bwc;


import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.collectors;


import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.paranamer.ParanamerModule;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.collectors;


import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.paranamer.ParanamerModule;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public void testClusterApplierServiceStats_saveMetricValues() {
@Ignore
@Test
public void testClusterApplierServiceStats_collectMetrics()
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException,
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
JsonProcessingException {
System.out.println("test 1");
MetricsConfiguration.CONFIG_MAP.put(
Expand Down Expand Up @@ -128,7 +130,9 @@ public void testClusterApplierServiceStats_collectMetrics()
@SuppressWarnings("unchecked")
@Test
public void testClusterApplierServiceStats_collectMetricsWithPreviousClusterApplierMetrics()
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException,
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
JsonProcessingException {
System.out.println("test 2");
MetricsConfiguration.CONFIG_MAP.put(
Expand Down
Loading
Loading