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

Suppress this-escape warning for JDK21 #101519

Merged
merged 2 commits into from
Oct 31, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public abstract class AbstractInstrument<T> implements Instrument {
private final String description;
private final String unit;

@SuppressWarnings("this-escape")
public AbstractInstrument(Meter meter, String name, String description, String unit) {
this.name = Objects.requireNonNull(name);
this.description = Objects.requireNonNull(description);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ public Clusters(int total, int successful, int skipped) {
this.clusterInfo = Collections.emptyMap(); // will never be used if created from this constructor
}

@SuppressWarnings("this-escape")
public Clusters(StreamInput in) throws IOException {
this.total = in.readVInt();
int successfulTemp = in.readVInt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ protected HandledTransportAction(
this(actionName, true, transportService, actionFilters, requestReader, executor);
}

@SuppressWarnings("this-escape")
protected HandledTransportAction(
String actionName,
boolean canTripCircuitBreaker,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ protected TransportNodesAction(
* @deprecated Use the local-only constructor instead.
*/
@Deprecated(forRemoval = true)
@SuppressWarnings("this-escape")
protected TransportNodesAction(
String actionName,
ThreadPool threadPool,
Expand Down
17 changes: 17 additions & 0 deletions x-pack/plugin/esql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,23 @@ tasks.register("regen") {
ant.replaceregexp(match: '\t', flags: 'g', replace: ' ', encoding: 'UTF-8') {
fileset(dir: outputPath, includes: 'EsqlBase*.java')
}
// suppress this-escape warnings on EsqlBaseLexer
ant.replaceregexp(
match: 'public EsqlBaseLexer',
replace: '@SuppressWarnings("this-escape")${line.separator} public EsqlBaseLexer',
encoding: 'UTF-8'
) {
fileset(dir: outputPath, includes: 'EsqlBaseLexer.java')
}
// suppress this-escape warnings on all internal EsqlBaseParser class constructores
ant.replaceregexp(
match: '([ ]+)public ([A-Z][a-z]+[a-z,A-Z]+\\()',
flags: 'g',
replace: '\\1@SuppressWarnings("this-escape")${line.separator}\\1public \\2',
encoding: 'UTF-8'
) {
fileset(dir: outputPath, includes: 'EsqlBaseParser.java')
}
// fix line endings
ant.fixcrlf(srcdir: outputPath, eol: 'lf') {
patternset(includes: 'EsqlBase*.java')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class DocVector extends AbstractVector implements Vector {

final DocBlock block;

@SuppressWarnings("this-escape")
public DocVector(IntVector shards, IntVector segments, IntVector docs, Boolean singleSegmentNonDecreasing) {
super(shards.getPositionCount(), null);
this.shards = shards;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public Vocabulary getVocabulary() {
}


@SuppressWarnings("this-escape")
public EsqlBaseLexer(CharStream input) {
super(input);
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
Expand Down
Loading