-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.StackOverflowError for large PactDslJsonBody #1286
Labels
bug
Indicates an unexpected problem or unintended behavior
Comments
uglyog
pushed a commit
that referenced
this issue
Jan 20, 2021
Looks like you can already split the large call chain up. I was about to remove the error by splitting out four objects: PactDslJsonBody productSpecification = new PactDslJsonBody()
.integerType("multiPackQuantity", 1)
.booleanType("copyrightInd", false)
.stringType("copyrightDets", "sample_data")
.booleanType("batteryRequired", true)
.booleanType("batteryIncluded", false)
.booleanType("beabApproved", false)
.stringType("beabCertNo", "sample_data")
.booleanType("plugRequired", false)
.booleanType("plugIncluded", false)
.booleanType("bulbRequired", false)
.booleanType("bulbIncluded", false)
.decimalType("voltage", 10.10)
.decimalType("wattage", 10.10); and then in the main body: .object("productSpecification", productSpecification) This will add "productSpecification" as a object defined by the |
uglyog
pushed a commit
that referenced
this issue
Jan 20, 2021
uglyog
pushed a commit
that referenced
this issue
Jan 20, 2021
uglyog
pushed a commit
that referenced
this issue
Jan 20, 2021
You can now also split out the object definitions with PactDslJsonBody colours = new PactDslJsonBody()
.stringType("name", "sample_data")
.booleanType("primary", false)
.stringType("colourCode", "sample_data")
.stringType("hexCode", "sample_data")
.stringType("rgbCode", "sample_data");
minArrayLike("colours", 1, colours) |
This was referenced Mar 15, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A PactDslJsonBody with 432+ lines causes a java.lang.StackOverflowError on the Java 1.8 compiler. I can't include the example directly here, but @uglyog has access via slack and I'm happy to provide directly on request:
https://pact-foundation.slack.com/archives/G01D62WEB60/p1609953945002100
Pact Version:
<groupId>au.com.dius</groupId> <artifactId>pact-jvm-provider-maven</artifactId> <version>4.0.10</version>
Java Version
java -version openjdk version "1.8.0_252" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.252-b09, mixed mode)
The text was updated successfully, but these errors were encountered: