Skip to content

Commit 8716f0e

Browse files
author
Vincent Potucek
committed
[prone] Add UnusedMethod
Signed-off-by: Vincent Potucek <[email protected]>
1 parent 9ff84a8 commit 8716f0e

30 files changed

+63
-111
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2323
- Implement GRPC Search params `Highlight`and `Sort` ([#19868](https://github.com/opensearch-project/OpenSearch/pull/19868))
2424
- Implement GRPC ConstantScoreQuery, FuzzyQuery, MatchBoolPrefixQuery, MatchPhrasePrefix, PrefixQuery, MatchQuery ([#19854](https://github.com/opensearch-project/OpenSearch/pull/19854))
2525
- Add async periodic flush task support for pull-based ingestion ([#19878](https://github.com/opensearch-project/OpenSearch/pull/19878))
26+
- [prone] Add `UnusedMethod` ([#19896](https://github.com/opensearch-project/OpenSearch/pull/19896))
2627

2728
### Changed
2829
- Faster `terms` query creation for `keyword` field with index and docValues enabled ([#19350](https://github.com/opensearch-project/OpenSearch/pull/19350))

build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ plugins {
5959
id "org.gradle.test-retry" version "1.6.2" apply false
6060
id "test-report-aggregation"
6161
id 'jacoco-report-aggregation'
62+
id 'net.ltgt.errorprone' version '4.3.0' apply false
6263
}
6364

6465
apply from: 'gradle/build-complete.gradle'
@@ -71,13 +72,10 @@ apply from: 'gradle/run.gradle'
7172
apply from: 'gradle/missing-javadoc.gradle'
7273
apply from: 'gradle/code-coverage.gradle'
7374

74-
// Apply FIPS configuration to all projects
7575
allprojects {
76+
apply from: "$rootDir/gradle/error-prone.gradle"
7677
apply from: "$rootDir/gradle/fips.gradle"
77-
}
78-
79-
// common maven publishing configuration
80-
allprojects {
78+
// common maven publishing configuration
8179
group = 'org.opensearch'
8280
version = VersionProperties.getOpenSearch()
8381
description = "OpenSearch subproject ${project.path}"

gradle/error-prone.gradle

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
apply plugin: 'net.ltgt.errorprone'
10+
11+
tasks.withType(JavaCompile).configureEach {
12+
options.errorprone {
13+
disableAllChecks = true // remove once complain
14+
error(
15+
'UnusedMethod'
16+
)
17+
errorproneArgs.add(
18+
'-XepExcludedPaths:' +
19+
'.*AggregatorTestCase.java|' + // https://github.com/google/error-prone/issues/5289
20+
'.*FactoryProvider.java|' +
21+
'.*IT.java|' + // 6+ findings
22+
'.*MockBigArrays.java|' +
23+
'.*MoreTypes.java|' +
24+
'.*OpenSearchNode.java|' +
25+
'.*SnapshotsService.java|' +
26+
'.*Terms.java|' +
27+
'.*Tests.java|' + // 15+ findings
28+
'.*x-content.*' // generated code
29+
)
30+
}
31+
}
32+
33+
dependencies {
34+
errorprone('com.google.errorprone:error_prone_core:2.42.0')
35+
errorprone('tech.picnic.error-prone-support:error-prone-contrib:0.25.0')
36+
}
37+
38+
configurations.configureEach { // remove once in sync (collision resolved)
39+
resolutionStrategy {
40+
force 'com.google.code.findbugs:jsr305:3.0.2'
41+
force 'com.google.errorprone:error_prone_annotations:2.42.0'
42+
force 'com.google.errorprone:error_prone_core:2.42.0'
43+
force 'com.google.guava:guava:33.4.0-jre'
44+
force 'org.checkerframework:checker-qual:3.43.0'
45+
}
46+
}
47+
48+
repositories {
49+
mavenCentral()
50+
}

modules/transport-grpc/licenses/error_prone_annotations-2.24.1.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
57a3eddaddd4f2d412e13d3bcefba29b5ebda1b6

modules/transport-grpc/licenses/guava-33.2.1-jre.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
03fcc0a259f724c7de54a6a55ea7e26d3d5c0cac

plugins/arrow-flight-rpc/licenses/error_prone_annotations-2.31.0.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
57a3eddaddd4f2d412e13d3bcefba29b5ebda1b6

plugins/arrow-flight-rpc/licenses/guava-33.3.1-jre.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)