Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Migrate squareup javapoet to Palantir javapoet #7420

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion atlasdb-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -679,7 +679,7 @@ private MethodSpec renderNamedDeleteRow() {
SortedSet<NamedColumnDescription> 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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion atlasdb-processors/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-7420.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Migrate squareup javapoet to Palantir javapoet
links:
- https://github.com/palantir/atlasdb/pull/7420
5 changes: 3 additions & 2 deletions versions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down