From 3ff2445b9f14f9dbbed019b5e9a423ac5e4920ba Mon Sep 17 00:00:00 2001 From: Ben Manes Date: Fri, 10 Jan 2025 20:13:44 -0800 Subject: [PATCH] migrate to the maintained javapoet project --- .../cache/LocalCacheFactoryGenerator.java | 10 +++++----- .../caffeine/cache/NodeFactoryGenerator.java | 12 ++++++------ .../caffeine/cache/Specifications.java | 10 +++++----- .../caffeine/cache/local/AddConstructor.java | 2 +- .../caffeine/cache/local/AddDeques.java | 6 +++--- .../cache/local/AddExpirationTicker.java | 4 ++-- .../cache/local/AddExpireAfterAccess.java | 4 ++-- .../cache/local/AddExpireAfterWrite.java | 4 ++-- .../caffeine/cache/local/AddFastPath.java | 2 +- .../cache/local/AddKeyValueStrength.java | 6 +++--- .../caffeine/cache/local/AddMaximum.java | 6 +++--- .../caffeine/cache/local/AddPacer.java | 4 ++-- .../cache/local/AddRefreshAfterWrite.java | 4 ++-- .../cache/local/AddRemovalListener.java | 4 ++-- .../caffeine/cache/local/AddStats.java | 4 ++-- .../caffeine/cache/local/Finalize.java | 2 +- .../cache/local/LocalCacheContext.java | 6 +++--- .../caffeine/cache/node/AddConstructors.java | 2 +- .../caffeine/cache/node/AddExpiration.java | 4 ++-- .../caffeine/cache/node/AddFactoryMethods.java | 4 ++-- .../caffeine/cache/node/AddHealth.java | 2 +- .../benmanes/caffeine/cache/node/AddKey.java | 8 ++++---- .../caffeine/cache/node/AddMaximum.java | 4 ++-- .../benmanes/caffeine/cache/node/AddValue.java | 10 +++++----- .../benmanes/caffeine/cache/node/Finalize.java | 4 ++-- .../caffeine/cache/node/NodeContext.java | 18 +++++++++--------- gradle/libs.versions.toml | 6 +++--- 27 files changed, 76 insertions(+), 76 deletions(-) diff --git a/caffeine/src/javaPoet/java/com/github/benmanes/caffeine/cache/LocalCacheFactoryGenerator.java b/caffeine/src/javaPoet/java/com/github/benmanes/caffeine/cache/LocalCacheFactoryGenerator.java index 24b398fe5f..31cb7c1d83 100644 --- a/caffeine/src/javaPoet/java/com/github/benmanes/caffeine/cache/LocalCacheFactoryGenerator.java +++ b/caffeine/src/javaPoet/java/com/github/benmanes/caffeine/cache/LocalCacheFactoryGenerator.java @@ -59,11 +59,11 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.google.common.io.Resources; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeSpec; +import com.palantir.javapoet.ClassName; +import com.palantir.javapoet.JavaFile; +import com.palantir.javapoet.ParameterizedTypeName; +import com.palantir.javapoet.TypeName; +import com.palantir.javapoet.TypeSpec; /** * Generates a factory that creates the cache optimized for the user specified configuration. diff --git a/caffeine/src/javaPoet/java/com/github/benmanes/caffeine/cache/NodeFactoryGenerator.java b/caffeine/src/javaPoet/java/com/github/benmanes/caffeine/cache/NodeFactoryGenerator.java index 89a53b7026..415773199b 100644 --- a/caffeine/src/javaPoet/java/com/github/benmanes/caffeine/cache/NodeFactoryGenerator.java +++ b/caffeine/src/javaPoet/java/com/github/benmanes/caffeine/cache/NodeFactoryGenerator.java @@ -54,11 +54,11 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.google.common.io.Resources; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeSpec; +import com.palantir.javapoet.ClassName; +import com.palantir.javapoet.JavaFile; +import com.palantir.javapoet.ParameterizedTypeName; +import com.palantir.javapoet.TypeName; +import com.palantir.javapoet.TypeSpec; /** * Generates the cache entry's specialized type. These entries are optimized for the configuration @@ -171,7 +171,7 @@ private TypeSpec makeNodeSpec(String className, boolean isFinal, ImmutableSet statement = builder -> builder .addStatement("$L = lookup.findVarHandle($T.class, $L.$L, $T.class)", fieldName, - ClassName.bestGuess(className), NODE_FACTORY.rawType.simpleName(), + ClassName.bestGuess(className), NODE_FACTORY.rawType().simpleName(), fieldName, type); varHandles.add(statement); } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7ec8b1702b..429b660bc0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -47,7 +47,7 @@ jakarta-inject = "2.0.1" jamm = "0.4.0" java-object-layout = "0.17" javax-inject = "1" -javapoet = "1.13.0" +javapoet = "0.6.0" jazzer = "0.23.0" jcache = "1.1.1" jcommander = "1.82" @@ -87,7 +87,7 @@ sigstore = "1.2.0" sonarqube = "6.0.1.5171" spotbugs = "4.8.6" spotbugs-contrib = "7.6.9" -spotbugs-plugin = "6.0.27" +spotbugs-plugin = "6.1.0" stream = "2.9.8" tcache = "2.0.1" testng = "7.10.2" @@ -149,7 +149,7 @@ jacoco-ant = { module = "org.jacoco:org.jacoco.ant", version.ref = "jacoco" } jakarta-inject = { module = "jakarta.inject:jakarta.inject-api", version.ref = "jakarta-inject" } jamm = { module = "com.github.jbellis:jamm", version.ref = "jamm" } java-object-layout = { module = "org.openjdk.jol:jol-cli", version.ref = "java-object-layout" } -javapoet = { module = "com.squareup:javapoet", version.ref = "javapoet" } +javapoet = { module = "com.palantir.javapoet:javapoet", version.ref = "javapoet" } javax-inject = { module = "javax.inject:javax.inject", version.ref = "javax-inject" } jazzer = { module = "com.code-intelligence:jazzer", version.ref = "jazzer" } jazzer-junit = { module = "com.code-intelligence:jazzer-junit", version.ref = "jazzer" }