Skip to content

Commit

Permalink
upgrade errorprone and nullaway static analyzers
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Oct 20, 2023
1 parent 2fc358c commit 2640bf0
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
required: true
description: The JDK version
early-access:
default: '21'
default: '22'
required: false
description: The early access release
graal:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ env:
schemastore.org:443
www.graalvm.org:443
PUBLISH_JDK: 11
EA_JDK: 21
EA_JDK: 22

jobs:
compile:
Expand All @@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 20, 21, GraalVM ]
java: [ 11, 21, 22, GraalVM ]
env:
JAVA_VERSION: ${{ matrix.java }}
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,18 +563,18 @@ public void testToArray2() {
// mustEqual(y, x);
// }

static final int SIZE = 10000;
static ConcurrentMap<Long, Long> longMap;

static ConcurrentMap<Long, Long> longMap() {
if (longMap == null) {
longMap = bounded();
for (int i = 0; i < SIZE; ++i) {
longMap.put(Long.valueOf(i), Long.valueOf(2 *i));
}
}
return longMap;
}
// static final int SIZE = 10000;
// static ConcurrentMap<Long, Long> longMap;
//
// static ConcurrentMap<Long, Long> longMap() {
// if (longMap == null) {
// longMap = bounded();
// for (int i = 0; i < SIZE; ++i) {
// longMap.put(Long.valueOf(i), Long.valueOf(2 *i));
// }
// }
// return longMap;
// }

// explicit function class to avoid type inference problems
static class AddKeys implements BiFunction<Map.Entry<Long,Long>, Map.Entry<Long,Long>, Map.Entry<Long,Long>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
*/
@SuppressWarnings({"AnnotateFormatMethod", "CollectionToArray", "EqualsIncompatibleType",
"FunctionalInterfaceClash", "JavaUtilDate", "JUnit3FloatingPointComparisonWithoutDelta",
"NumericEquality", "rawtypes", "ReferenceEquality",
"NonFinalStaticField", "NumericEquality", "rawtypes", "ReferenceEquality",
"RethrowReflectiveOperationExceptionAsLinkageError", "serial", "SwitchDefault",
"ThreadPriorityCheck", "try", "unchecked", "UndefinedEquals"})
public class JSR166TestCase extends TestCase {
Expand Down
12 changes: 6 additions & 6 deletions examples/coalescing-bulkloader-reactor/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[Reactor][reactor] data streams facilitate the consolidation of independent asynchronous loads into
batches at the cost of a small buffering delay. The [bufferTimeout][] operator accumulates requests
until reaching a maximum size or time limit. Since each request consists of a key and its pending
result, when the subscriber is notified it performs the batch load and completes the key's future
with its corresponding value.

It some scenarios it may be desirable to only aggregate cache refreshes rather than imposing delays
on callers awaiting explicit loads. An automated reload initiated by `refreshAfterWrite` will occur
on the first stale request for an entry. While the key is being refreshed the previous value
continues to be returned, in contrast to eviction which forces retrievals to wait until the value
is loaded anew. In such cases, batching these optimistic reloads can minimize the impact on the
source system without adversely affecting the responsiveness of the explicit requests.

[Reactor][reactor] data streams facilitate the consolidation of independent asynchronous loads into
batches at the cost of a small buffering delay. The [bufferTimeout][] operator accumulates requests
until reaching a maximum size or time limit. Since each request consists of a key and its pending
result, when the subscriber is notified it performs the batch load and completes the key's future
with its corresponding value.

### Refresh coalescing
A [Sink][sink] collects requests, buffering them up to the configured threshold, and subsequently
delivers the batch to the subscriber. The `parallelism` setting determines the number of concurrent
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ coveralls = "2.12.2"
dependency-check = "8.4.0"
eclipse-collections = "12.0.0.M3"
ehcache3 = "3.10.8"
errorprone-core = "2.22.0"
errorprone-core = "2.23.0"
errorprone-plugin = "3.1.0"
errorprone-support = "0.14.0"
expiring-map = "0.5.11"
Expand Down Expand Up @@ -64,7 +64,7 @@ kotlin = "1.9.10"
lincheck = "2.18.1"
mockito = "5.6.0"
nexus-publish = "2.0.0-rc-1"
nullaway-core = "0.10.14"
nullaway-core = "0.10.15"
nullaway-plugin = "1.6.0"
ohc = "0.6.1"
osgi-annotations = "1.5.1"
Expand All @@ -81,7 +81,7 @@ snakeyaml = "2.2"
sonarqube = "4.4.1.3373"
spotbugs-contrib = "7.6.0"
spotbugs-core = "4.8.0"
spotbugs-plugin = "6.0.0-beta.5"
spotbugs-plugin = "6.0.0-rc.2"
stream = "2.9.8"
tcache = "2.0.1"
testng = "7.8.0"
Expand Down
13 changes: 10 additions & 3 deletions gradle/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,15 @@ dependencies {
}

tasks.withType<DependencyUpdatesTask> {
val ignoredGroups = listOf("org.jetbrains.kotlin", "org.gradle.kotlin.kotlin-dsl")
rejectVersionIf {
(candidate.group in ignoredGroups) && (candidate.version != currentVersion)
resolutionStrategy {
componentSelection {
val ignoredGroups = listOf("org.jetbrains.kotlin", "org.gradle.kotlin.kotlin-dsl")
all {
if ((candidate.group in ignoredGroups) && (candidate.version != currentVersion)) {
reject("kotlin dsl")
}
}
}
force(libs.bnd)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ tasks.named<DependencyUpdatesTask>("dependencyUpdates").configure {
}
}
force(libs.guice)
force(libs.lincheck)
force(libs.bundles.coherence.get())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ fun enabledChecks() = listOf(
"MissingDefault",
"MutableGuiceModule",
"NoAllocation",
"NonFinalStaticField",
"OverridingMethodInconsistentArgumentNamesChecker",
"PackageLocation",
"PreferredInterfaceType",
Expand All @@ -120,6 +121,7 @@ fun enabledChecks() = listOf(
"RemoveUnusedImports",
"ReturnsNullCollection",
"SelfAlwaysReturnsThis",
"StringFormatWithLiteral",
"StronglyTypeByteString",
"StronglyTypeTime",
"SwitchDefault",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@
public final class TypesafeConfigurator {
static final Logger logger = System.getLogger(TypesafeConfigurator.class.getName());

@SuppressWarnings("NonFinalStaticField")
static ConfigSource configSource = TypesafeConfigurator::resolveConfig;
@SuppressWarnings("NonFinalStaticField")
static FactoryCreator factoryCreator = FactoryBuilder::factoryOf;

private TypesafeConfigurator() {}
Expand Down

0 comments on commit 2640bf0

Please sign in to comment.