@@ -0,0 +1,2475 @@
+package com.alibaba.json.bvt.bug;%0A%0Aimport com.alibaba.fastjson.JSON;%0Aimport com.alibaba.fastjson.annotation.JSONType;%0Aimport junit.framework.TestCase;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class Issue804 extends TestCase %7B%0A    public void test_issue() throws Exception %7B%0A        String json = %22%7B%5Cn%22 +%0A                %22    %5C%22@type%5C%22:%5C%22com.alibaba.json.bvt.bug.Issue804$Room%5C%22,%5Cn%22 +%0A                %22    %5C%22children%5C%22:%5B%5D,%5Cn%22 +%0A                %22    %5C%22name%5C%22:%5C%22Room2_1%5C%22,%5Cn%22 +%0A                %22    %5C%22parent%5C%22:%7B%5Cn%22 +%0A                %22        %5C%22@type%5C%22:%5C%22com.alibaba.json.bvt.bug.Issue804$Area%5C%22,%5Cn%22 +%0A                %22        %5C%22children%5C%22:%5B%5Cn%22 +%0A                %22            %7B%5C%22$ref%5C%22:%5C%22$%5C%22%7D,%5Cn%22 +%0A                %22            %7B%5Cn%22 +%0A                %22                %5C%22@type%5C%22:%5C%22com.alibaba.json.bvt.bug.Issue804$Room%5C%22,%5Cn%22 +%0A                %22                %5C%22children%5C%22:%5B%5D,%5Cn%22 +%0A                %22                %5C%22name%5C%22:%5C%22Room_2%5C%22,%5Cn%22 +%0A                %22                %5C%22parent%5C%22:%7B%5C%22$ref%5C%22:%5C%22$.parent%5C%22%7D%5Cn%22 +%0A                %22            %7D%5Cn%22 +%0A                %22        %5D,%5Cn%22 +%0A                %22        %5C%22name%5C%22:%5C%22Area1%5C%22,%5Cn%22 +%0A                %22        %5C%22parent%5C%22:%7B%5Cn%22 +%0A                %22            %5C%22@type%5C%22:%5C%22com.alibaba.json.bvt.bug.Issue804$Area%5C%22,%5Cn%22 +%0A                %22            %5C%22children%5C%22:%5B%5Cn%22 +%0A                %22                %7B%5C%22$ref%5C%22:%5C%22$.parent%5C%22%7D%5Cn%22 +%0A                %22            %5D,%5Cn%22 +%0A                %22            %5C%22name%5C%22:%5C%22Area0%5C%22%5Cn%22 +%0A                %22        %7D%5Cn%22 +%0A                %22    %7D%5Cn%22 +%0A                %22%7D%22;%0A%0A        Room room = (Room) JSON.parse(json);%0A%0A        assertSame(room, room.parent.children.get(0));%0A    %7D%0A%0A    @JSONType%0A    public static class Node %7B%0A        protected String name;%0A        protected Node parent;%0A        protected List%3CNode%3E children = new ArrayList%3CNode%3E();%0A%0A        public String getName() %7B%0A            return name;%0A        %7D%0A        public void setName(String name) %7B%0A            this.name = name;%0A        %7D%0A        public Node getParent() %7B%0A            return parent;%0A        %7D%0A        public void setParent(Node parent) %7B%0A            this.parent = parent;%0A        %7D%0A        public List%3CNode%3E getChildren() %7B%0A            return children;%0A        %7D%0A        public void setChildren(List%3CNode%3E children) %7B%0A            this.children = children;%0A        %7D%0A    %7D%0A%0A    @JSONType%0A    public static class Area extends Node%7B%0A%0A    %7D%0A%0A    @JSONType%0A    public static class Room extends Node%7B%0A%0A    %7D%0A%7D%0A

add testcase for issue #804