Skip to content

Commit

Permalink
Update spotless to meet JDK-21 baseline (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
reta authored Feb 9, 2024
1 parent bfab315 commit 6c4400d
Show file tree
Hide file tree
Showing 67 changed files with 44 additions and 64 deletions.
1 change: 0 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
java:
- 11
- 17
- 21
fail-fast: false
runs-on: [ubuntu-latest]
name: Building PA package
Expand Down
15 changes: 8 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")

default_bwc_version = System.getProperty("bwc.version", "2.11.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.11.0-SNAPSHOT", opensearch_version]
versions = ["2.12.0-SNAPSHOT", opensearch_version]
numberOfNodes = 3
plugin(provider(new Callable<RegularFile>() {
@Override
Expand Down
1 change: 1 addition & 0 deletions licenses/netty-buffer-4.1.104.Final.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
756797174b94a3aee11ce83522473f3c18287a43
1 change: 0 additions & 1 deletion licenses/netty-buffer-4.1.106.Final.jar.sha1

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d4da9f7237ac3ac292891e0b2d5364acbce128cf

This file was deleted.

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 @@ -155,8 +155,12 @@ Field getField(String className, String fieldName)

@VisibleForTesting
public Object getSearchBackPressureStats()
throws InvocationTargetException, IllegalAccessException, NoSuchMethodException,
NoSuchFieldException, NoSuchFieldError, ClassNotFoundException {
throws InvocationTargetException,
IllegalAccessException,
NoSuchMethodException,
NoSuchFieldException,
NoSuchFieldError,
ClassNotFoundException {

// Get the static instance of Bootstrap
Object bootStrapSInstance =
Expand Down Expand Up @@ -416,6 +420,7 @@ public ResourceUsageTrackerStats(
this.rollingAvg = rollingAvg;
this.fragment = fragment;
}

// Getters and Setters
public long getCancellationCount() {
return cancellationCount;
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
Loading

0 comments on commit 6c4400d

Please sign in to comment.