@@ -0,0 +1,2861 @@
+package org.simpleframework.xml.core;%0D%0A%0D%0Aimport java.io.StringWriter;%0D%0A%0D%0Aimport junit.framework.TestCase;%0D%0A%0D%0Aimport org.simpleframework.xml.Attribute;%0D%0Aimport org.simpleframework.xml.Element;%0D%0Aimport org.simpleframework.xml.Root;%0D%0Aimport org.simpleframework.xml.Serializer;%0D%0A%0D%0A/**%0D%0A * Created by IntelliJ IDEA.%0D%0A * User: e03229%0D%0A * Date: 10/11/10%0D%0A * Time: 10:52%0D%0A * To change this template use File %7C Settings %7C File Templates.%0D%0A */%0D%0Apublic class ConstructorInjectionMatchTest extends TestCase %7B%0D%0A%0D%0A    @Root(name = %22root%22)%0D%0A    private static class RootElement %7B%0D%0A%0D%0A        @Element(name = %22one%22)%0D%0A        private final SimpleElementOne one;%0D%0A%0D%0A        public RootElement(@Element(name = %22one%22) SimpleElementOne one) %7B%0D%0A            this.one = one;%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    private static class SimpleElementOne %7B%0D%0A        @Element(name = %22two%22)%0D%0A        private final SimpleElementTwo two;%0D%0A%0D%0A        public SimpleElementOne(@Element(name = %22two%22) SimpleElementTwo two) %7B%0D%0A            this.two = two;%0D%0A        %7D%0D%0A        %0D%0A        public SimpleElementOne(SimpleElementTwo two, int length) %7B%0D%0A        %09this.two = two;%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    private static class SimpleElementTwo %7B%0D%0A        @Attribute(name = %22value%22)%0D%0A        private final String value;%0D%0A%0D%0A        public SimpleElementTwo(@Attribute(name = %22value%22) String value) %7B%0D%0A            this.value = value;%0D%0A        %7D%0D%0A%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * The stack trace is :%0D%0A     *  org.simpleframework.xml.core.ConstructorException: No match found for field 'two' private final thirdparty.simplexml.ConstructorInjectionTest$SimpleElementTwo thirdparty.simplexml.ConstructorInjectionTest$SimpleElementOne.two in class thirdparty.simplexml.ConstructorInjectionTest$SimpleElementOne%0D%0A     *  at org.simpleframework.xml.core.Scanner.validateConstructor(Scanner.java:513)%0D%0A     *  at org.simpleframework.xml.core.Scanner.validateElements(Scanner.java:452)%0D%0A     *  at org.simpleframework.xml.core.Scanner.validate(Scanner.java:413)%0D%0A     *  at org.simpleframework.xml.core.Scanner.scan(Scanner.java:397)%0D%0A     *  at org.simpleframework.xml.core.Scanner.%3Cinit%3E(Scanner.java:120)%0D%0A     *  at org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:65)%0D%0A     *  %5B...%5D%0D%0A     *  at thirdparty.simplexml.ConstructorInjectionTest.testConstructorInjection(ConstructorInjectionTest.java:78)%0D%0A     */%0D%0A    public void testConstructorInjection() throws Exception %7B%0D%0A        SimpleElementTwo two = new SimpleElementTwo(%22val%22);%0D%0A        SimpleElementOne one = new SimpleElementOne(two);%0D%0A        RootElement root = new RootElement(one);%0D%0A%0D%0A        Serializer serializer = new Persister();%0D%0A        StringWriter output = new StringWriter();%0D%0A        serializer.write(root, output);%0D%0A        System.out.println(output.toString());%0D%0A        serializer.read(RootElement.class, output.toString());%0D%0A    %7D%0D%0A%7D%0D%0A

Add match test