From 567a4475bff4d4d033ea7e7851e4b7511cd40ea4 Mon Sep 17 00:00:00 2001 From: Rico Yao Date: Thu, 7 Mar 2019 16:21:20 -0800 Subject: [PATCH] Fix missing comma in Java model constructor --- Examples/Java/Sources/Board.java | 18 +++--- Examples/Java/Sources/Everything.java | 58 +++++++++---------- Examples/Java/Sources/Image.java | 6 +- Examples/Java/Sources/Model.java | 2 +- Examples/Java/Sources/Pin.java | 34 +++++------ Examples/Java/Sources/User.java | 20 +++---- .../Java/Sources/VariableSubtitution.java | 8 +-- Sources/Core/JavaModelRenderer.swift | 2 +- 8 files changed, 74 insertions(+), 74 deletions(-) diff --git a/Examples/Java/Sources/Board.java b/Examples/Java/Sources/Board.java index 1470f0a7..e3ef3e69 100644 --- a/Examples/Java/Sources/Board.java +++ b/Examples/Java/Sources/Board.java @@ -48,15 +48,15 @@ public class Board { private int _bits = 0; private Board( - @Nullable String identifier - @Nullable Set contributors - @Nullable Map counts - @Nullable Date createdAt - @Nullable Map creator - @Nullable String descriptionText - @NonNull Image image - @Nullable String name - @Nullable String url + @Nullable String identifier, + @Nullable Set contributors, + @Nullable Map counts, + @Nullable Date createdAt, + @Nullable Map creator, + @Nullable String descriptionText, + @NonNull Image image, + @Nullable String name, + @Nullable String url, int _bits ) { this.identifier = identifier; diff --git a/Examples/Java/Sources/Everything.java b/Examples/Java/Sources/Everything.java index f37041db..56aefc52 100644 --- a/Examples/Java/Sources/Everything.java +++ b/Examples/Java/Sources/Everything.java @@ -195,35 +195,35 @@ public class Everything { private int _bits = 0; private Everything( - @Nullable List arrayProp - @Nullable Boolean booleanProp - @Nullable Date dateProp - @Nullable @EverythingIntEnum int intEnum - @Nullable Integer intProp - @Nullable List listPolymorphicValues - @Nullable List> listWithListAndOtherModelValues - @Nullable List> listWithMapAndOtherModelValues - @Nullable List listWithObjectValues - @Nullable List listWithOtherModelValues - @Nullable List listWithPrimitiveValues - @Nullable Map mapPolymorphicValues - @Nullable Map mapProp - @Nullable Map> mapWithListAndOtherModelValues - @Nullable Map> mapWithMapAndOtherModelValues - @Nullable Map mapWithObjectValues - @Nullable Map mapWithOtherModelValues - @Nullable Map mapWithPrimitiveValues - @Nullable Double numberProp - @Nullable User otherModelProp - @Nullable EverythingPolymorphicProp polymorphicProp - @Nullable Set setProp - @Nullable Set setPropWithOtherModelValues - @Nullable Set setPropWithPrimitiveValues - @Nullable Set setPropWithValues - @Nullable @EverythingStringEnum String stringEnum - @Nullable String stringProp - @Nullable String type - @Nullable String uriProp + @Nullable List arrayProp, + @Nullable Boolean booleanProp, + @Nullable Date dateProp, + @Nullable @EverythingIntEnum int intEnum, + @Nullable Integer intProp, + @Nullable List listPolymorphicValues, + @Nullable List> listWithListAndOtherModelValues, + @Nullable List> listWithMapAndOtherModelValues, + @Nullable List listWithObjectValues, + @Nullable List listWithOtherModelValues, + @Nullable List listWithPrimitiveValues, + @Nullable Map mapPolymorphicValues, + @Nullable Map mapProp, + @Nullable Map> mapWithListAndOtherModelValues, + @Nullable Map> mapWithMapAndOtherModelValues, + @Nullable Map mapWithObjectValues, + @Nullable Map mapWithOtherModelValues, + @Nullable Map mapWithPrimitiveValues, + @Nullable Double numberProp, + @Nullable User otherModelProp, + @Nullable EverythingPolymorphicProp polymorphicProp, + @Nullable Set setProp, + @Nullable Set setPropWithOtherModelValues, + @Nullable Set setPropWithPrimitiveValues, + @Nullable Set setPropWithValues, + @Nullable @EverythingStringEnum String stringEnum, + @Nullable String stringProp, + @Nullable String type, + @Nullable String uriProp, int _bits ) { this.arrayProp = arrayProp; diff --git a/Examples/Java/Sources/Image.java b/Examples/Java/Sources/Image.java index 4ac2c72b..ff0b2265 100644 --- a/Examples/Java/Sources/Image.java +++ b/Examples/Java/Sources/Image.java @@ -36,9 +36,9 @@ public class Image { private int _bits = 0; private Image( - @Nullable Integer height - @Nullable String url - @Nullable Integer width + @Nullable Integer height, + @Nullable String url, + @Nullable Integer width, int _bits ) { this.height = height; diff --git a/Examples/Java/Sources/Model.java b/Examples/Java/Sources/Model.java index 5f357c3b..58912a2e 100644 --- a/Examples/Java/Sources/Model.java +++ b/Examples/Java/Sources/Model.java @@ -32,7 +32,7 @@ public class Model { private int _bits = 0; private Model( - @Nullable String identifier + @Nullable String identifier, int _bits ) { this.identifier = identifier; diff --git a/Examples/Java/Sources/Pin.java b/Examples/Java/Sources/Pin.java index 14adf39b..71b37146 100644 --- a/Examples/Java/Sources/Pin.java +++ b/Examples/Java/Sources/Pin.java @@ -96,23 +96,23 @@ public class Pin { private int _bits = 0; private Pin( - @Nullable Map attribution - @Nullable List attributionObjects - @Nullable Board board - @Nullable String color - @Nullable Map counts - @NonNull Date createdAt - @NonNull Map creator - @Nullable String descriptionText - @NonNull String identifier - @Nullable Image image - @Nullable @PinInStock int inStock - @Nullable String link - @Nullable Map media - @Nullable String note - @Nullable List> tags - @Nullable String url - @Nullable Map visualSearchAttrs + @Nullable Map attribution, + @Nullable List attributionObjects, + @Nullable Board board, + @Nullable String color, + @Nullable Map counts, + @NonNull Date createdAt, + @NonNull Map creator, + @Nullable String descriptionText, + @NonNull String identifier, + @Nullable Image image, + @Nullable @PinInStock int inStock, + @Nullable String link, + @Nullable Map media, + @Nullable String note, + @Nullable List> tags, + @Nullable String url, + @Nullable Map visualSearchAttrs, int _bits ) { this.attribution = attribution; diff --git a/Examples/Java/Sources/User.java b/Examples/Java/Sources/User.java index cf372538..1a2941ab 100644 --- a/Examples/Java/Sources/User.java +++ b/Examples/Java/Sources/User.java @@ -56,16 +56,16 @@ public class User { private int _bits = 0; private User( - @Nullable String bio - @Nullable Map counts - @Nullable Date createdAt - @Nullable @UserEmailFrequency String emailFrequency - @Nullable String firstName - @Nullable String identifier - @Nullable Image image - @Nullable String lastName - @Nullable String type - @Nullable String username + @Nullable String bio, + @Nullable Map counts, + @Nullable Date createdAt, + @Nullable @UserEmailFrequency String emailFrequency, + @Nullable String firstName, + @Nullable String identifier, + @Nullable Image image, + @Nullable String lastName, + @Nullable String type, + @Nullable String username, int _bits ) { this.bio = bio; diff --git a/Examples/Java/Sources/VariableSubtitution.java b/Examples/Java/Sources/VariableSubtitution.java index 2295747a..65b0185f 100644 --- a/Examples/Java/Sources/VariableSubtitution.java +++ b/Examples/Java/Sources/VariableSubtitution.java @@ -38,10 +38,10 @@ public class VariableSubtitution { private int _bits = 0; private VariableSubtitution( - @Nullable Integer allocProp - @Nullable Integer copyProp - @Nullable Integer mutableCopyProp - @Nullable Integer newProp + @Nullable Integer allocProp, + @Nullable Integer copyProp, + @Nullable Integer mutableCopyProp, + @Nullable Integer newProp, int _bits ) { this.allocProp = allocProp; diff --git a/Sources/Core/JavaModelRenderer.swift b/Sources/Core/JavaModelRenderer.swift index 8172d76b..7b822681 100644 --- a/Sources/Core/JavaModelRenderer.swift +++ b/Sources/Core/JavaModelRenderer.swift @@ -18,7 +18,7 @@ public struct JavaModelRenderer: JavaFileRenderer { func renderModelConstructor() -> JavaIR.Method { let args = -->(transitiveProperties.map { param, schemaObj in - self.typeFromSchema(param, schemaObj) + " " + param.snakeCaseToPropertyName() + self.typeFromSchema(param, schemaObj) + " " + param.snakeCaseToPropertyName() + "," } + ["int _bits"]) return JavaIR.method([.private], className + "(\n" + args + "\n)") {