[
https://issues.apache.org/jira/browse/CAMEL-6323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13645396#comment-13645396
]
Charles Moulliard commented on CAMEL-6323:
------------------------------------------
The issue is related to the fact that positions of fields is not guarantee
anymore when camel bindy reads several classes and linked them. By example if
we have an Order class with 2 fields in poistion 1 and 7 and a link to a class
SubRec containing the position 4, then the DataField, AnnotatedField Map will
contain 3 entries with position 1, 7 & 4
But when the record AAABBBCCC will be parsed (1, 4, 7) it will be mapped to
positions 1, 7 and 4 (fieldA, fieldC and fieldB) which is not correct
So I propose to do the following modification LinkedHashMap --> TreeMap
{code}
public class BindyFixedLengthFactory extends BindyAbstractFactory implements
BindyFactory {
private Map<Integer, DataField> dataFields = new LinkedHashMap<Integer,
DataField>();
private Map<Integer, Field> annotatedFields = new LinkedHashMap<Integer,
Field>();
{code}
{code}
public class BindyFixedLengthFactory extends BindyAbstractFactory implements
BindyFactory {
private Map<Integer, DataField> dataFields = new TreeMap<Integer,
DataField>();
private Map<Integer, Field> annotatedFields = new TreeMap<Integer, Field>();
{code}
> FixedLength Bindy DataFormat does not work with @Link
> -----------------------------------------------------
>
> Key: CAMEL-6323
> URL: https://issues.apache.org/jira/browse/CAMEL-6323
> Project: Camel
> Issue Type: Bug
> Components: camel-bindy
> Affects Versions: 2.10.4, 2.11.0
> Reporter: Charles Moulliard
> Assignee: Charles Moulliard
>
> FixedLength Bindy DataFormat does not work with @Link
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira