Skip to content

@Group annotation ignores order flag #128

Description

@GoogleCodeExporter
What steps will reproduce the problem?  If applicable, please provide a
mapping configuration and sample record input to recreate the problem.

1. Create a Group with one Record and one inner Group
2. Annotate Record with order=1 and inner Group with order=2


What is the expected output?

Text is parsed with no errors.


What do you see instead?

Exception in thread "main" org.beanio.BeanIOConfigurationException: Invalid 
group 'group1', in stream 'test': Order must be set all children at a group 
level, or none at all
    at org.beanio.internal.compiler.ProcessorSupport.process(ProcessorSupport.java:93)
    at org.beanio.internal.compiler.ParserFactorySupport.createStream(ParserFactorySupport.java:88)
    at org.beanio.internal.compiler.StreamCompiler.build(StreamCompiler.java:66)
    at org.beanio.internal.DefaultStreamFactory.define(DefaultStreamFactory.java:53)
    at Main.main(Main.java:19)
Caused by: org.beanio.BeanIOConfigurationException: Order must be set all 
children at a group level, or none at all
    at org.beanio.internal.compiler.Preprocessor.finalizeGroup(Preprocessor.java:198)
    at org.beanio.internal.compiler.ProcessorSupport.handleComponent(ProcessorSupport.java:119)
    at org.beanio.internal.compiler.ProcessorSupport.handleComponent(ProcessorSupport.java:109)
    at org.beanio.internal.compiler.ProcessorSupport.process(ProcessorSupport.java:46)
    ... 4 more


What version of BeanIO are you using? What JDK version?

BeanIO 2.1.0
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)


Please provide any additional information below.

This error occurs because 
org.beanio.internal.config.annotation.AnnotationParser doesn't set 
GroupConfig's order inside the method createGroup(TypeInfo info, Group group).

I've attached a test case and a patch for AnnotationParser.

Original issue reported on code.google.com by ricardom...@gmail.com on 17 Nov 2014 at 5:47

Attachments:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions