Skip to content

Commit

Permalink
Prepare for JDK 21
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHegarty committed Aug 27, 2024
1 parent ed51513 commit 2eaa25c
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17
21
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17
21
5 changes: 5 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4204,6 +4204,11 @@
<sha256 value="878fbe521731c072d14d2d65b983b1beae6ad06fda0007b6a8bae81f73f433c4" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-analysis" version="9.7">
<artifact name="asm-analysis-9.7.jar">
<sha256 value="7bc6bcbc21379948a0c8c467fb0f864206e5b818f6bc0b546872f5c9f941556f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-commons" version="7.2">
<artifact name="asm-commons-7.2.jar">
<sha256 value="0e86b8b179c5fb223d1a880a0ff4960b6978223984b94e62e71135f2d8ea3558" origin="Generated by Gradle"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public static class Request extends MasterNodeReadRequest<Request> {

private final EnumSet<Metric> metrics;

@SuppressWarnings("this-escape")
public Request(TimeValue masterNodeTimeout, TaskId parentTaskId, EnumSet<Metric> metrics) {
super(masterNodeTimeout);
setParentTask(parentTaskId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ public ResolveClusterActionRequest(String[] names) {
this(names, DEFAULT_INDICES_OPTIONS);
}

@SuppressWarnings("this-escape")
public ResolveClusterActionRequest(String[] names, IndicesOptions indicesOptions) {
this.names = names;
this.localIndicesRequested = localIndicesPresent(names);
this.indicesOptions = indicesOptions;
}

@SuppressWarnings("this-escape")
public ResolveClusterActionRequest(StreamInput in) throws IOException {
super(in);
if (in.getTransportVersion().before(TransportVersions.V_8_13_0)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class DeleteRequestBuilder extends ReplicationRequestBuilder<DeleteReques
private Long term;
private WriteRequest.RefreshPolicy refreshPolicy;

@SuppressWarnings("this-escape")
public DeleteRequestBuilder(ElasticsearchClient client, @Nullable String index) {
super(client, TransportDeleteAction.TYPE);
setIndex(index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public IndexRequestBuilder(ElasticsearchClient client) {
this(client, null);
}

@SuppressWarnings("this-escape")
public IndexRequestBuilder(ElasticsearchClient client, @Nullable String index) {
super(client, TransportIndexAction.TYPE);
setIndex(index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public UpdateRequestBuilder(ElasticsearchClient client) {
this(client, null, null);
}

@SuppressWarnings("this-escape")
public UpdateRequestBuilder(ElasticsearchClient client, String index, String id) {
super(client, TransportUpdateAction.TYPE);
setIndex(index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public abstract class AbstractClient implements Client {
private final ThreadPool threadPool;
private final AdminClient admin;

@SuppressWarnings("this-escape")
public AbstractClient(Settings settings, ThreadPool threadPool) {
this.settings = settings;
this.threadPool = threadPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public static class DeduplicateFieldInfosCodec extends FilterCodec {

private final DeduplicatingFieldInfosFormat deduplicatingFieldInfosFormat;

@SuppressWarnings("this-escape")
protected DeduplicateFieldInfosCodec(String name, Codec delegate) {
super(name, delegate);
this.deduplicatingFieldInfosFormat = new DeduplicatingFieldInfosFormat(super.fieldInfosFormat());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public abstract static class Builder {

private String leafName;

@SuppressWarnings("this-escape")
protected Builder(String leafName) {
setLeafName(leafName);
}
Expand Down Expand Up @@ -55,6 +56,7 @@ default boolean supportsVersion(IndexVersion indexCreatedVersion) {

private final String leafName;

@SuppressWarnings("this-escape")
public Mapper(String leafName) {
Objects.requireNonNull(leafName);
this.leafName = internFieldName(leafName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public DeleteByQueryRequestBuilder(ElasticsearchClient client) {
this(client, new SearchRequestBuilder(client));
}

@SuppressWarnings("this-escape")
private DeleteByQueryRequestBuilder(ElasticsearchClient client, SearchRequestBuilder search) {
super(client, DeleteByQueryAction.INSTANCE, search);
source().setFetchSource(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static boolean hasMetric(String name) {
protected final double max;
protected final double sum;

@SuppressWarnings("this-escape")
public InternalStats(
String name,
long count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ public class RankFeatureResult extends SearchPhaseResult {

public RankFeatureResult() {}

@SuppressWarnings("this-escape")
public RankFeatureResult(ShardSearchContextId id, SearchShardTarget shardTarget, ShardSearchRequest request) {
this.contextId = id;
setSearchShardTarget(shardTarget);
setShardSearchRequest(request);
}

@SuppressWarnings("this-escape")
public RankFeatureResult(StreamInput in) throws IOException {
super(in);
contextId = new ShardSearchContextId(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public void collect(int doc, long bucket) throws IOException {
}
assertEquals(size, Math.min(queue.size(), expected.length - pos));
int ptr = pos + ((int) queue.size() - 1);
pos += queue.size();
pos += Math.toIntExact(queue.size());
last = null;
while (queue.size() > pos) {
CompositeKey key = queue.toCompositeKey(queue.pop());
Expand Down
6 changes: 3 additions & 3 deletions test/logger-usage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
apply plugin: 'elasticsearch.java'

dependencies {
api 'org.ow2.asm:asm:9.2'
api 'org.ow2.asm:asm-tree:9.2'
api 'org.ow2.asm:asm-analysis:9.2'
api 'org.ow2.asm:asm:9.7'
api 'org.ow2.asm:asm-tree:9.7'
api 'org.ow2.asm:asm-analysis:9.7'
api "org.apache.logging.log4j:log4j-api:${versions.log4j}"
testImplementation project(":test:framework")
}
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ protected int computeCacheFileRegionSize(long fileLength, int region) {
final var blobLength = randomLongBetween(1L, cacheSize);

int regions = Math.toIntExact(blobLength / regionSize);
regions += (blobLength % regionSize == 0L ? 0L : 1L);
regions += (blobLength % regionSize == 0 ? 0 : 1);
assertThat(
cacheService.computeCacheFileRegionSize(blobLength, randomFrom(regions)),
equalTo(BlobCacheUtils.toIntBytes(regionSize))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public abstract class YamlTemplateRegistry extends IndexTemplateRegistry {
private final FeatureService featureService;
private volatile boolean enabled;

@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "this-escape" })
public YamlTemplateRegistry(
Settings nodeSettings,
ClusterService clusterService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public Set<String> getSupportedAnnotationTypes() {

@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.RELEASE_17;
return SourceVersion.RELEASE_21;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Set<String> getSupportedAnnotationTypes() {

@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest();
return SourceVersion.RELEASE_21;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Set<String> getSupportedAnnotationTypes() {

@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.RELEASE_17;
return SourceVersion.RELEASE_21;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public class EsqlFunctionRegistry {

private SnapshotFunctionRegistry snapshotRegistry = null;

@SuppressWarnings("this-escape")
public EsqlFunctionRegistry() {
register(functions());
buildDataTypesForStringLiteralConversion(functions());
Expand Down

0 comments on commit 2eaa25c

Please sign in to comment.