From fb2aebd45c0f45da25bd9f977a5ba2326175a608 Mon Sep 17 00:00:00 2001 From: Ben Manes Date: Sun, 29 Sep 2024 10:49:50 -0700 Subject: [PATCH] enable qodana caching between runs --- .github/workflows/qodana.yml | 3 ++- .../com/github/benmanes/caffeine/cache/BoundedLocalCache.java | 1 + .../com/github/benmanes/caffeine/cache/LocalCacheSubject.java | 3 ++- gradle/libs.versions.toml | 2 +- gradle/plugins/build.gradle.kts | 4 +++- qodana.yaml | 1 + 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/qodana.yml b/.github/workflows/qodana.yml index 245fe4267a..9c449455d6 100644 --- a/.github/workflows/qodana.yml +++ b/.github/workflows/qodana.yml @@ -61,13 +61,14 @@ jobs: with: java: ${{ env.JAVA_VERSION }} cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - arguments: build -x test + arguments: check -x test - name: Qodana - Code Inspection uses: JetBrains/qodana-action@84494be4d1a2f64ec1c4bfdf475406e246e34672 # v2024.2.3 env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} with: upload-result: true + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload SARIF file for GitHub Advanced Security Dashboard uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 with: diff --git a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java index d5074c2539..8b4ddcbd01 100644 --- a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java +++ b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java @@ -1671,6 +1671,7 @@ void performCleanUp(@Nullable Runnable task) { * schedule an asynchronous maintenance task. This may occur due to a concurrent write after the * maintenance work had started or if the amortized threshold of work per clean up was reached. */ + @SuppressWarnings("resource") void rescheduleCleanUpIfIncomplete() { if (drainStatusOpaque() != REQUIRED) { return; diff --git a/caffeine/src/test/java/com/github/benmanes/caffeine/cache/LocalCacheSubject.java b/caffeine/src/test/java/com/github/benmanes/caffeine/cache/LocalCacheSubject.java index c1dc2c6141..e4163ad913 100644 --- a/caffeine/src/test/java/com/github/benmanes/caffeine/cache/LocalCacheSubject.java +++ b/caffeine/src/test/java/com/github/benmanes/caffeine/cache/LocalCacheSubject.java @@ -299,7 +299,8 @@ private void checkLinks(BoundedLocalCache bounded, Set> seen = Sets.newIdentityHashSet(); for (var cell : deques.cellSet()) { long weightedSize = scanLinks(bounded, cell.getValue(), seen); - check(cell.getRowKey()).that(weightedSize).isEqualTo(cell.getColumnKey()); + check("%s: %s in %s", cell.getRowKey(), cell.getValue(), bounded.data) + .that(weightedSize).isEqualTo(cell.getColumnKey()); totalSize += cell.getValue().size(); totalWeightedSize += weightedSize; } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6ec9d3fae6..2303e8a6d7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ bouncycastle-jdk18on = "1.78.1" cache2k = "2.6.1.Final" caffeine = "3.1.8" checker-framework = "3.47.0" -checkstyle = "10.18.1" +checkstyle = "10.18.2" coherence = "22.06.2" commons-collections4 = "4.4" commons-compress = "1.27.1" diff --git a/gradle/plugins/build.gradle.kts b/gradle/plugins/build.gradle.kts index e762cc3309..83ef0690e1 100644 --- a/gradle/plugins/build.gradle.kts +++ b/gradle/plugins/build.gradle.kts @@ -90,4 +90,6 @@ fun setProjectEncoding() { } } -setProjectEncoding() +if (System.getenv("CI").isNullOrEmpty()) { + setProjectEncoding() +} diff --git a/qodana.yaml b/qodana.yaml index 705621c19b..9f15e6adb1 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,5 +1,6 @@ version: "1.0" projectJDK: "21" +linter: jetbrains/qodana-jvm-community:2024.2 profile: name: qodana.recommended licenseRules: