Skip to content

Commit

Permalink
dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Dec 21, 2024
1 parent d491293 commit 5c1ff5b
Show file tree
Hide file tree
Showing 35 changed files with 100 additions and 64 deletions.
6 changes: 3 additions & 3 deletions .github/actions/run-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ runs:
toolchainVersion=$(grep -oP '(?<=^toolchainVersion=).*' gradle/gradle-daemon-jvm.properties)
echo "toolchainVersion=${toolchainVersion}" >> $GITHUB_ENV
- name: Set up JDK ${{ env.toolchainVersion }}
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
java-version: ${{ env.toolchainVersion }}
distribution: temurin
Expand All @@ -50,7 +50,7 @@ runs:
echo "JAVA_VERSION=${{ inputs.java }}" >> $GITHUB_ENV
fi
- name: Set up JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
java-version: ${{
inputs.java == 'GraalVM' && inputs.graal ||
Expand All @@ -67,7 +67,7 @@ runs:
echo "JAVA_TOOL_OPTIONS=-Dorg.gradle.workers.max=$((2 * $(nproc)))" >> $GITHUB_ENV
echo "ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download=false" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
add-job-summary: never
cache-read-only: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jobs:
find . -path */jacoco/*.exec -o -path */results/*.xml
| tar czf ${{ env.ARTIFACT_NAME }}.tar.gz --files-from -
- name: Upload test results
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
if: always() && (env.JAVA_VERSION == env.PUBLISH_JDK)
with:
retention-days: 1
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
continue-on-error: true
- name: Publish to Codecov
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Publish to Codacy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
if: steps.check_files.outputs.files_exists == 'true'
run: jq -c '.runs |= unique_by({tool, invocations, results})' < results.sarif > codacy.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
if: steps.check_files.outputs.files_exists == 'true'
continue-on-error: true
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
java: ${{ env.JAVA_VERSION }}
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Initialize CodeQL
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
languages: java
- name: Autobuild
uses: github/codeql-action/autobuild@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
with:
files: build/reports/dependency-check-report.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
if: steps.check_files.outputs.files_exists == 'true'
with:
sarif_file: build/reports/dependency-check-report.sarif
2 changes: 1 addition & 1 deletion .github/workflows/dependency-submission-pr-retreive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
repo1.maven.org:443
services.gradle.org:443
- name: Retrieve and submit dependency graph
uses: gradle/actions/dependency-submission@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/dependency-submission@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
dependency-graph: download-and-submit
4 changes: 2 additions & 2 deletions .github/workflows/dependency-submission-pr-submit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
services.gradle.org:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
- name: Submit Dependency Graph
uses: gradle/actions/dependency-submission@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/dependency-submission@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
dependency-graph: generate-and-upload
4 changes: 2 additions & 2 deletions .github/workflows/dependency-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
services.gradle.org:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
- name: Submit Dependency Graph
uses: gradle/actions/dependency-submission@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/dependency-submission@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/devskim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
- name: Run DevSkim scanner
uses: microsoft/DevSkim-Action@914fa647b406c387000300b2f09bb28691be2b6d # v1.0.14
- name: Upload DevSkim scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: devskim-results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
github.com:443
services.gradle.org:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: gradle/actions/wrapper-validation@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
- uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
4 changes: 2 additions & 2 deletions .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
arguments: check -x test
- name: Qodana - Code Inspection
uses: JetBrains/qodana-action@b46847499776819f38aad1d4298e16e52f17c4c5 # v2024.3.2
uses: JetBrains/qodana-action@c9aae269126c597c4332ef4b11f0547262f240b5 # v2024.3.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@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
4 changes: 2 additions & 2 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ jobs:
results_file: results.sarif
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: results.sarif
5 changes: 1 addition & 4 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ jobs:
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
with:
files: results.sarif
- name: Remove duplicate rules
if: steps.check_files.outputs.files_exists == 'true'
run: jq -c '.runs[0].tool.driver.rules |= unique_by(.id)' < results.sarif > semgrep.sarif
- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
if: steps.check_files.outputs.files_exists == 'true'
continue-on-error: true
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
files: snyk.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
if: steps.check_files.outputs.files_exists == 'true'
with:
sarif_file: snyk.sarif
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
objects.githubusercontent.com:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Typos
uses: crate-ci/typos@d1c850b2b5d502763520c25fb4a6a1128ad99bd9 # v1.28.3
uses: crate-ci/typos@9d890159570d5018df91fedfa40b4730cd4a81b1 # v1.28.4
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
files: results.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
if: steps.check_files.outputs.files_exists == 'true'
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion caffeine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ dependencies {
testImplementation(libs.ycsb) {
isTransitive = false
}
testImplementation(libs.jazzer)
testImplementation(libs.picocli)
testImplementation(libs.jctools)
testImplementation(libs.fastutil)
testImplementation(libs.lincheck)
testImplementation(libs.commons.lang3)
testImplementation(libs.bundles.jazzer)
testImplementation(libs.bundles.slf4j.test)
testImplementation(libs.commons.collections4)
testImplementation(libs.commons.collections4) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static java.util.Objects.requireNonNull;

import java.time.Duration;
import java.time.format.DateTimeParseException;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -145,7 +146,7 @@ Caffeine<Object, Object> toBuilder() {
public static CaffeineSpec parse(String specification) {
var spec = new CaffeineSpec(specification);
for (String option : specification.split(SPLIT_OPTIONS)) {
spec.parseOption(option.trim());
spec.parseOption(option.strip());
}
return spec;
}
Expand All @@ -162,8 +163,8 @@ void parseOption(String option) {
requireArgument(keyAndValue.length <= 2,
"key-value pair %s with more than one equals sign", option);

String key = keyAndValue[0].trim();
String value = (keyAndValue.length == 1) ? null : keyAndValue[1].trim();
String key = keyAndValue[0].strip();
String value = (keyAndValue.length == 1) ? null : keyAndValue[1].strip();

configure(option, key, value);
}
Expand Down Expand Up @@ -298,13 +299,27 @@ static Duration parseDuration(String key, @Nullable String value) {

@SuppressWarnings("NullAway")
boolean isIsoFormat = value.contains("p") || value.contains("P");
if (isIsoFormat) {
Duration duration = Duration.parse(value);
requireArgument(!duration.isNegative(),
"key %s invalid format; was %s, but the duration cannot be negative", key, value);
return duration;
Duration duration = isIsoFormat
? parseIsoDuration(key, value)
: parseSimpleDuration(key, value);
requireArgument(!duration.isNegative(),
"key %s invalid format; was %s, but the duration cannot be negative", key, value);
return duration;

}

/** Returns a parsed duration using the ISO-8601 format. */
static Duration parseIsoDuration(String key, String value) {
try {
return Duration.parse(value);
} catch (DateTimeParseException e) {
throw new IllegalArgumentException(String.format(US,
"key %s invalid format; was %s, but the duration cannot be parsed", key, value), e);
}
}

/** Returns a parsed duration using the simple time unit format. */
static Duration parseSimpleDuration(String key, String value) {
@SuppressWarnings("NullAway")
long duration = parseLong(key, value.substring(0, value.length() - 1));
TimeUnit unit = parseTimeUnit(key, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,35 @@ public void parseLong_exception() {
}

@Test
public void parseTimeUnit_exception() {
assertThrows(IllegalArgumentException.class, () -> CaffeineSpec.parseTimeUnit("key", "value"));
public void parseDuration_exception() {
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseDuration("key", "value"));
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseTimeUnit("key", "value"));
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseIsoDuration("key", "value"));
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseSimpleDuration("key", "value"));

// ISO
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseDuration("key", "-PT7H3M"));
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseDuration("key", "p3xyz"));

// Simple
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseDuration("key", "-1s"));
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseDuration("key", "xyzs"));
assertThrows(IllegalArgumentException.class,
() -> CaffeineSpec.parseDuration("key", "1xyzs"));
}

@Test
@SuppressWarnings("NullAway")
public void parse_exception() {
assertThrows(NullPointerException.class, () -> CaffeineSpec.parse(null));
assertThrows(IllegalArgumentException.class, () -> CaffeineSpec.parse("="));
assertThrows(IllegalArgumentException.class, () -> CaffeineSpec.parse("=="));
assertThrows(IllegalArgumentException.class, () -> CaffeineSpec.parse("key="));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ final class LinkedDequeSubject extends CollectionSubject {
private LinkedDequeSubject(FailureMetadata metadata, @Nullable LinkedDeque<?> subject) {
super(metadata, subject);
this.actual = requireNonNull((LinkedDeque<Object>) subject);

}

public static Factory<LinkedDequeSubject, LinkedDeque<?>> deque() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.github.benmanes.caffeine.fuzz;

import com.code_intelligence.jazzer.api.FuzzedDataProvider;
import com.code_intelligence.jazzer.junit.FuzzTest;
import com.code_intelligence.jazzer.mutation.annotation.NotNull;
import com.github.benmanes.caffeine.cache.CaffeineSpec;

/**
Expand All @@ -28,9 +28,9 @@ public final class CaffeineSpecFuzzer {

@FuzzTest(maxDuration = "5m")
@SuppressWarnings("CheckReturnValue")
public void parse(FuzzedDataProvider data) {
public void parse(@NotNull String specification) {
try {
CaffeineSpec.parse(data.consumeRemainingAsString());
CaffeineSpec.parse(specification);
} catch (IllegalArgumentException expected) { /* ignored */ }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
caffeine = "3.1.8"
junit = "5.11.3"
junit = "5.11.4"
reactor = "3.7.1"
truth = "1.4.4"
versions = "0.51.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion examples/graal-native/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
caffeine = "3.1.8"
graal = "0.10.4"
junit = "5.11.3"
junit = "5.11.4"
truth = "1.4.4"
versions = "0.51.0"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion examples/hibernate/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
caffeine = "3.1.8"
h2 = "2.3.232"
hibernate = "7.0.0.Beta3"
junit = "5.11.3"
junit = "5.11.4"
log4j2 = "3.0.0-beta2"
truth = "1.4.4"
versions = "0.51.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions examples/indexable/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
caffeine = "3.1.8"
guava = "33.3.1-jre"
junit-jupiter = "5.11.3"
guava = "33.4.0-jre"
junit-jupiter = "5.11.4"
truth = "1.4.4"
versions = "0.51.0"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading

0 comments on commit 5c1ff5b

Please sign in to comment.