Fix Windows compile break in executor example by aligning LastShares quantity type (FIX 4.0/4.1/4.2)#1237
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/ccfce0ae-26ab-44a4-822c-4c0cbc9ec351 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Windows compile failure due to incompatible quantity types
Fix Windows compile break in executor example by aligning LastShares quantity type (FIX 4.0/4.1/4.2)
May 22, 2026
LastShares quantity type (FIX 4.0/4.1/4.2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows Java CI fails to compile
quickfixj-examples-executordue todoublevalues being passed toLastSharescall sites that requireintin the affected generated message APIs.This change makes quantity handling type-correct at the three failing locations while preserving existing behavior in surrounding execution-report construction.
Error from the build job: (this happened only intermittently on Windows builds)
Type correction in execution report fill paths
orderQty.getValue()once tointand pass toLastShares.ExecutionReportconstructor path.executionReport.set(new LastShares(...)).Behavior preserved
CumQty,LastPx, andAvgPxpaths remain unchanged.Original prompt
Fix the Windows compile failure in the quickfix-j/quickfixj repository caused by incompatible quantity types in
quickfixj-examples/executor/src/main/java/quickfix/examples/executor/Application.java.Context:
.github/workflows/maven.yml.quickfixj-examples-executormodule during the Windows matrix build.1b325a9627e66a82249282266248134cb9b26709Compiler errors:
Application.java:[154,86] incompatible types: possible lossy conversion from double to intApplication.java:[252,37] incompatible types: possible lossy conversion from double to intApplication.java:[287,64] incompatible types: possible lossy conversion from double to intRelevant file:
quickfixj-examples/executor/src/main/java/quickfix/examples/executor/Application.javaWhat to do:
Application.javato fix the compile errors by using the correct types for the affected FIX field constructors/setters.Goal:
Make the repository build pass again by correcting the quantity type usage in the executor example code.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failing job is a compile failure in
quickfixj-examples/executor/src/main/java/quickfix/examples/executor/Application.javaon Windows/JDK 8–21, in the workflow job defined by.github/workflows/maven.yml(test-windows, Maven install step). The actual failure is here:Application.java:154Application.java:252Application.java:287Source:
Root cause
The code passes
doublevalues into FIX field constructors that expectint-typed quantity values.The errors line up with these calls:
orderQty.getValue()is adouble, but in these FIX versions the corresponding field constructors expect anint, so Java reports:Fix
Use an explicit conversion before constructing
LastShares/CumQty, or use the constructor/setter overload that matches the field type expected by the generated QuickFIX/J classes.A minimal safe patch is to convert the quantity once and reuse it.
Suggested patch