Skip to content

Commit

Permalink
refactor list creation to route through ConjureCollections
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarcaur committed Nov 25, 2024
1 parent ec5769c commit 74269fc
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 44 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.palantir.conjure.CaseConverter;
import com.palantir.conjure.java.ConjureAnnotations;
import com.palantir.conjure.java.Options;
import com.palantir.conjure.java.lib.internal.ConjureCollections;
import com.palantir.conjure.java.util.JavaNameSanitizer;
import com.palantir.conjure.java.util.Javadoc;
import com.palantir.conjure.java.util.Packages;
Expand Down Expand Up @@ -259,7 +260,7 @@ private static MethodSpec createConstructor(Collection<EnrichedField> fields, Co
// is private and necessarily called from the builder, which does its own defensive copying.
if (field.conjureDef().getType().accept(TypeVisitor.IS_LIST)) {
// TODO(melliot): contribute a fix to JavaPoet that parses $T correctly for a JavaPoet FieldSpec
body.addStatement("this.$1N = $2T.unmodifiableList($1N)", spec, Collections.class);
body.addStatement("this.$1N = $2T.unmodifiableList($1N)", spec, ConjureCollections.class);
} else if (field.conjureDef().getType().accept(TypeVisitor.IS_SET)) {
body.addStatement("this.$1N = $2T.unmodifiableSet($1N)", spec, Collections.class);
} else if (field.conjureDef().getType().accept(TypeVisitor.IS_MAP)) {
Expand Down

0 comments on commit 74269fc

Please sign in to comment.