[QFJ-667] for a custom data dictionary, some fields are generated twice, and so compilation fails with XY.java: get(quickfix.field.Currency) is already defined in quickfix.fix44.XY Created: 03/Feb/12  Updated: 03/Feb/12  Resolved: 03/Feb/12

Status: Closed
Project: QuickFIX/J
Component/s: Message Generation
Affects Version/s: 1.5.2
Fix Version/s: None

Type: Bug Priority: Default
Reporter: Heiko Seebach Assignee: Christoph John
Resolution: Not a bug Votes: 0
Labels: generation
Environment:

I tried it under Linux (Ubuntu 11.10) AND Windows 7 with Sun-JDK6,and only under Linux with OpenJDK6 and OpenJDK7



 Description   

Steps to reproduce:
1. Take the - probably relatively often used - datadictionary from http://www.fxprogrammers.com/apisupport/FXCM_FIX.zip (wich is officially published in http://forexforums.dailyfx.com/fix-api-support/453300-fix-documentation-subscribe-updates-2.html)
2. copy the file FIXFXCM10.xml from this zip and to core/src/main/resource/FIX44.xml
3. run "ant clean jar"
Then you (at least I) get 100 errors like this:

[javac] Compiling 1924 source files to /home/hk/ws/e/quickfix-1.5.2/core/target/classes/main
[javac] Advertisement.java:1886: set(quickfix.field.Currency) is already defined in quickfix.fix44.Advertisement
[javac] public void set(quickfix.field.Currency value) {
[javac] ^
[javac] Advertisement.java:1890: get(quickfix.field.Currency) is already defined in quickfix.fix44.Advertisement
[javac] public quickfix.field.Currency get(quickfix.field.Currency value)
[javac] ^
[javac] Advertisement.java:1897: getCurrency() is already defined in quickfix.fix44.Advertisement
[javac] public quickfix.field.Currency getCurrency() throws FieldNotFound {
[javac] ^
[javac] Advertisement.java:1904: isSet(quickfix.field.Currency) is already defined in quickfix.fix44.Advertisement
[javac] public boolean isSet(quickfix.field.Currency field) {
[javac] ^
[javac] Advertisement.java:1908: isSetCurrency() is already defined in quickfix.fix44.Advertisement
[javac] public boolean isSetCurrency() {
[javac] ^
[javac] AllocationInstruction.java:2997: set(quickfix.field.Currency) is already defined in quickfix.fix44.AllocationInstruction
[javac] public void set(quickfix.field.Currency value) {
[javac] ^
[javac] AllocationInstruction.java:3001: get(quickfix.field.Currency) is already defined in quickfix.fix44.AllocationInstruction
[javac] public quickfix.field.Currency get(quickfix.field.Currency value)
[javac] ^

The problem is, that these methods are really generated twice. I've no idea how this might happen.

Any ideas?
Thank you very much,
Heiko Seebach



 Comments   
Comment by Christoph John [ 03/Feb/12 ]

Hi Heiko,

actually, this could only be an issue with the custom data dictionary since it is working with the original one. Fields can get created multiple times for a message if they are listed multiple times on the same message.

This applies to the custom data dictionary. E.g. the Currency is defined on Advertisement (standard) and then also on the Instrument component (custom usage). Since the Instrument component is used on the Advertisement, the Currency field will appear twice which is not allowed. Please bear in mind that components are not the same as repeating groups (in which a field could appear multiple times).

The fields which are defined multiple times are: Currency, RoundLot, FXCMPegFluctuatePts and PrevClosePx. They have been added to the components Instrument or PegInstructions. PrevClosePx was defined multiple times on the NewOrderSingle itself.

Just as a note for the future: maybe first ask the people who have created the data dictionary.

Cheers,
Chris.

Comment by Heiko Seebach [ 03/Feb/12 ]

Hi Christoph,

thank you very much for this analysis.
> maybe first ask the people who have created the data dictionary
well yes, normally I would have done that, but I couldn't image, that they didn't found out that themselves, and I'm not so much into the topic, that I found out these double definitions myself.

Thank you very much, I'll contact FXCM then,

Heiko Seebach

Comment by Christoph John [ 03/Feb/12 ]

Hi Heiko,
you're welcome.
Cheers

Comment by Christoph John [ 03/Feb/12 ]

BTW, it is a different topic if you just use the data dictionary for incoming message validation or if you really create the message classes from the data dictionary. For the first case, the error will probably go undetected for a longer time.

Generated at Fri May 03 06:16:37 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.