Skip to content
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

FieldType.CHAR does not define Character.class as java type. #820

Open
ishabandi67 opened this issue Jun 6, 2024 · 3 comments · May be fixed by #819
Open

FieldType.CHAR does not define Character.class as java type. #820

ishabandi67 opened this issue Jun 6, 2024 · 3 comments · May be fixed by #819
Labels

Comments

@ishabandi67
Copy link

Describe the bug
FieldType.CHAR does not define a javaType for itself and defaults to String.class as it's java type.

To Reproduce
Pick up any FIX message, with a CharField (for example : RootPartyIDSource)
Create a rawstring with any delimiter (example: | )
Try to parse the message using : MessageUtils.parse()
The field returned is a StringField instead of CharField.

Expected behavior
FieldType.CHAR.getJavaType() should return Character.class like other primitive types.

system information:

  • OS: [Windows]
  • Java version [JDK 17]
  • QFJ Version [e.g. 2.3.1]

#819

@ishabandi67 ishabandi67 added the bug label Jun 6, 2024
@chrjohn chrjohn linked a pull request Jun 7, 2024 that will close this issue
@chrjohn chrjohn changed the title FieldType.CHAR does not define Character.class as java type. FieldType.CHAR does not define Character.class as java type. Jun 7, 2024
@chrjohn
Copy link
Member

chrjohn commented Jun 7, 2024

Hi @ishabandi67
Thanks for the bug and the PR.
Sounds sensible, just wanted to ask for your use case on this. Is there a specific problem with this?
Thanks
Chris

@ishabandi67
Copy link
Author

Use case:
We store the fix messages in json format for maintaining the audit history of the trade.
In some case, we want to load up the previous message in order to create a new message, for which we need to identify the java types for each tag-value.
The Message creation is successful even without this PR, however it creates StringField instead of CharField , which in turn causes the message validation to fail.

@chrjohn
Copy link
Member

chrjohn commented Jun 9, 2024

Could you post a code snippet where the validation is failing? When parsing the message and creating a FIX message it is assumed that all fields are strings anyway since that is the format in which they are sent over the wire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants