diff --git a/atlasdb-client/build.gradle b/atlasdb-client/build.gradle index a1f43d19cdc..3c7b06d9baa 100644 --- a/atlasdb-client/build.gradle +++ b/atlasdb-client/build.gradle @@ -54,6 +54,7 @@ dependencies { implementation 'com.palantir.common:streams' implementation 'com.palantir.conjure.java:conjure-lib' implementation 'com.palantir.goethe:goethe' + implementation 'com.palantir.javapoet:javapoet' implementation 'com.palantir.nylon:nylon-threads' implementation 'com.palantir.refreshable:refreshable' implementation 'com.palantir.safe-logging:safe-logging' @@ -64,7 +65,6 @@ dependencies { implementation 'com.palantir.tritium:tritium-ids' implementation 'com.palantir.tritium:tritium-lib' implementation 'com.palantir.tritium:tritium-registry' - implementation 'com.squareup:javapoet' implementation 'io.dropwizard.metrics:metrics-core' implementation 'org.apache.commons:commons-lang3' implementation 'org.xerial.snappy:snappy-java' diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/Renderers.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/Renderers.java index 5ffe437e5f1..d5f5c19553b 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/Renderers.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/Renderers.java @@ -21,7 +21,7 @@ import com.palantir.atlasdb.table.description.NamedColumnDescription; import com.palantir.atlasdb.table.description.TableDefinition; import com.palantir.atlasdb.table.description.TableMetadata; -import com.squareup.javapoet.MethodSpec; +import com.palantir.javapoet.MethodSpec; import java.util.List; import java.util.Locale; import java.util.stream.Collectors; diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/TableClassRendererV2.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/TableClassRendererV2.java index 3d7c9e78aa4..99f51cff35b 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/TableClassRendererV2.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/TableClassRendererV2.java @@ -46,14 +46,14 @@ import com.palantir.common.base.BatchingVisitableView; import com.palantir.common.persist.Persistables; import com.palantir.goethe.Goethe; -import com.squareup.javapoet.AnnotationSpec; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.FieldSpec; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.MethodSpec; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeSpec; +import com.palantir.javapoet.AnnotationSpec; +import com.palantir.javapoet.ClassName; +import com.palantir.javapoet.FieldSpec; +import com.palantir.javapoet.JavaFile; +import com.palantir.javapoet.MethodSpec; +import com.palantir.javapoet.ParameterizedTypeName; +import com.palantir.javapoet.TypeName; +import com.palantir.javapoet.TypeSpec; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -679,7 +679,7 @@ private MethodSpec renderNamedDeleteRow() { SortedSet namedColumns = ColumnRenderers.namedColumns(tableMetadata); deleteRowBuilder .addStatement("$T row = $T.of($L)", rowType, rowType, getArgumentsFromRowComponents(tableMetadata)) - .addStatement("byte[] rowBytes = row.persistToBytes()", Persistables.class) + .addStatement("byte[] rowBytes = row.persistToBytes()") .addStatement( "$T<$T> cells = $T.newHashSetWithExpectedSize($L)", Set.class, @@ -707,7 +707,7 @@ private MethodSpec renderNamedDeleteColumn(NamedColumnDescription col) { return deleteColumnBuilder .addStatement("$T row = $T.of($L)", rowType, rowType, getArgumentsFromRowComponents(tableMetadata)) - .addStatement("byte[] rowBytes = row.persistToBytes()", Persistables.class) + .addStatement("byte[] rowBytes = row.persistToBytes()") .addStatement( "$T<$T> cells = $T.of($T.create(rowBytes, $T.toCachedBytes($L)))", Set.class, diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/TableFactoryRenderer.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/TableFactoryRenderer.java index 2830d5c7915..f4cd87a7358 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/TableFactoryRenderer.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/table/description/render/TableFactoryRenderer.java @@ -25,16 +25,16 @@ import com.palantir.atlasdb.table.generation.Triggers; import com.palantir.atlasdb.transaction.api.Transaction; import com.palantir.goethe.Goethe; -import com.squareup.javapoet.AnnotationSpec; -import com.squareup.javapoet.ArrayTypeName; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.FieldSpec; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.MethodSpec; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeSpec; -import com.squareup.javapoet.WildcardTypeName; +import com.palantir.javapoet.AnnotationSpec; +import com.palantir.javapoet.ArrayTypeName; +import com.palantir.javapoet.ClassName; +import com.palantir.javapoet.FieldSpec; +import com.palantir.javapoet.JavaFile; +import com.palantir.javapoet.MethodSpec; +import com.palantir.javapoet.ParameterizedTypeName; +import com.palantir.javapoet.TypeName; +import com.palantir.javapoet.TypeSpec; +import com.palantir.javapoet.WildcardTypeName; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/atlasdb-processors/build.gradle b/atlasdb-processors/build.gradle index 44bfc661969..5d93ae2e130 100644 --- a/atlasdb-processors/build.gradle +++ b/atlasdb-processors/build.gradle @@ -7,8 +7,8 @@ dependencies { // these three dependencies should be implementation, but that breaks IntelliJ currently api 'com.google.guava:guava' - api 'com.squareup:javapoet' api 'com.palantir.goethe:goethe' + api 'com.palantir.javapoet:javapoet' implementation 'com.google.errorprone:error_prone_annotations' } diff --git a/atlasdb-processors/src/main/java/com/palantir/processors/AutoDelegateProcessor.java b/atlasdb-processors/src/main/java/com/palantir/processors/AutoDelegateProcessor.java index 3ab71166192..db2cd257dc1 100644 --- a/atlasdb-processors/src/main/java/com/palantir/processors/AutoDelegateProcessor.java +++ b/atlasdb-processors/src/main/java/com/palantir/processors/AutoDelegateProcessor.java @@ -19,11 +19,11 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.MapMaker; import com.palantir.goethe.Goethe; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.MethodSpec; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeSpec; -import com.squareup.javapoet.TypeVariableName; +import com.palantir.javapoet.JavaFile; +import com.palantir.javapoet.MethodSpec; +import com.palantir.javapoet.TypeName; +import com.palantir.javapoet.TypeSpec; +import com.palantir.javapoet.TypeVariableName; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; diff --git a/atlasdb-processors/src/main/java/com/palantir/processors/ProcessorUtils.java b/atlasdb-processors/src/main/java/com/palantir/processors/ProcessorUtils.java index c2748f8b757..bb3b71c16e4 100644 --- a/atlasdb-processors/src/main/java/com/palantir/processors/ProcessorUtils.java +++ b/atlasdb-processors/src/main/java/com/palantir/processors/ProcessorUtils.java @@ -15,7 +15,7 @@ */ package com.palantir.processors; -import com.squareup.javapoet.ParameterSpec; +import com.palantir.javapoet.ParameterSpec; import java.util.List; import java.util.stream.Collectors; import javax.lang.model.element.ExecutableElement; diff --git a/changelog/@unreleased/pr-7420.v2.yml b/changelog/@unreleased/pr-7420.v2.yml new file mode 100644 index 00000000000..ad40a175abb --- /dev/null +++ b/changelog/@unreleased/pr-7420.v2.yml @@ -0,0 +1,5 @@ +type: improvement +improvement: + description: Migrate squareup javapoet to Palantir javapoet + links: + - https://github.com/palantir/atlasdb/pull/7420 diff --git a/versions.lock b/versions.lock index fa3c15c7913..29c78d29b36 100644 --- a/versions.lock +++ b/versions.lock @@ -83,7 +83,8 @@ com.palantir.dialogue:dialogue-core:4.1.0 (3 constraints: d13cee3b) com.palantir.dialogue:dialogue-futures:4.1.0 (3 constraints: 26332534) com.palantir.dialogue:dialogue-serde:4.1.0 (3 constraints: 0f2e732c) com.palantir.dialogue:dialogue-target:4.1.0 (7 constraints: 98774329) -com.palantir.goethe:goethe:0.12.0 (1 constraints: 3505293b) +com.palantir.goethe:goethe:0.14.0 (1 constraints: 37052f3b) +com.palantir.javapoet:javapoet:0.5.0 (2 constraints: c7103ed1) com.palantir.nylon:nylon-threads:0.4.0 (2 constraints: 1115e1a9) com.palantir.refreshable:refreshable:2.5.0 (4 constraints: aa380a8b) com.palantir.ri:resource-identifier:2.7.0 (5 constraints: 4e5ad307) @@ -110,7 +111,7 @@ com.palantir.tritium:tritium-registry:0.93.0 (14 constraints: ab0189b2) com.palantir.tritium:tritium-slf4j:0.93.0 (2 constraints: 7e20193e) com.palantir.tritium:tritium-time:0.93.0 (1 constraints: 840e8c59) com.palantir.tritium:tritium-tracing:0.93.0 (2 constraints: 7e20193e) -com.squareup:javapoet:1.13.0 (4 constraints: 102cc1ed) +com.squareup:javapoet:1.13.0 (3 constraints: da26c350) com.squareup:kotlinpoet:1.11.0 (1 constraints: 790e1a5d) com.thinkaurelius.thrift:thrift-server:0.3.7 (1 constraints: 980f6c88) com.zaxxer:HikariCP:5.1.0 (1 constraints: 08050736) diff --git a/versions.props b/versions.props index f060bf6d89a..f5de9cfdf95 100644 --- a/versions.props +++ b/versions.props @@ -24,14 +24,14 @@ com.palantir.conjure.java:* = 8.28.0 com.palantir.conjure:conjure = 4.49.0 com.palantir.dialogue:* = 4.1.0 com.palantir.docker.proxy:* = 1.6.0 -com.palantir.goethe:* = 0.12.0 +com.palantir.goethe:* = 0.14.0 +com.palantir.javapoet:javapoet = 0.5.0 com.palantir.nylon:* = 0.4.0 com.palantir.refreshable:refreshable = 2.5.0 com.palantir.safe-logging:* = 3.7.0 com.palantir.sls.versions:* = 1.5.0 com.palantir.tracing:* = 6.20.0 com.palantir.tritium:* = 0.93.0 -com.squareup:javapoet = 1.13.0 com.zaxxer:HikariCP = 5.1.0 commons-cli:* = 1.9.0 commons-codec:* = 1.17.1