{"action":"created","issue":{"url":"https://api.github.com/repos/google/flatbuffers/issues/301","labels_url":"https://api.github.com/repos/google/flatbuffers/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/google/flatbuffers/issues/301/comments","events_url":"https://api.github.com/repos/google/flatbuffers/issues/301/events","html_url":"https://github.com/google/flatbuffers/issues/301","id":112365984,"number":301,"title":"[FlatBuffers: object serialization must not be nested] message is necessary ?","user":{"login":"hash-X","id":13306859,"avatar_url":"https://avatars.githubusercontent.com/u/13306859?v=3","gravatar_id":"","url":"https://api.github.com/users/hash-X","html_url":"https://github.com/hash-X","followers_url":"https://api.github.com/users/hash-X/followers","following_url":"https://api.github.com/users/hash-X/following{/other_user}","gists_url":"https://api.github.com/users/hash-X/gists{/gist_id}","starred_url":"https://api.github.com/users/hash-X/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hash-X/subscriptions","organizations_url":"https://api.github.com/users/hash-X/orgs","repos_url":"https://api.github.com/users/hash-X/repos","events_url":"https://api.github.com/users/hash-X/events{/privacy}","received_events_url":"https://api.github.com/users/hash-X/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-20T13:15:06Z","updated_at":"2015-10-21T00:38:08Z","closed_at":null,"body":"Here is the schema\r\n```\r\ntable ClassInfo {\r\n    numTeacher:short;\r\n    stu:[Student];\r\n}\r\n\r\ntable Student {\r\n     name:string;\r\n     age:short;\r\n     id:int;\r\n}\r\n```\r\nand I will have two ways of Serialization and Deserialization about table ClassInfo. methodOne have no problem, But methodTwo will throw a message of \"Exception in thread \"main\" java.lang.AssertionError: FlatBuffers: object serialization must not be nested.\" So I remove the notNested() in FlatBufferBuilder and then get the right answer. So I am not sure this remind is necessary. If necessary,Why ?  How can I fix my code [ methodTwo ] and run the problem collectly ? Thank you !\r\n\r\n```\r\npackage test.genstudent;\r\n\r\nimport com.google.flatbuffers.FlatBufferBuilder;\r\nimport src.genstudent.ClassInfo;\r\nimport src.genstudent.Student;\r\n\r\n/**\r\n * Created by minglei on 15-10-20.\r\n */\r\npublic class TestStudent1 {\r\n\r\n  static void methodOne(FlatBufferBuilder fbb) {\r\n    int[] data =\r\n        {\r\n            Student.createStudent(fbb, fbb.createString(\"zhangsan\"),\r\n                (short)19,\r\n                1)};\r\n    int stu = 0;\r\n\r\n    stu = ClassInfo.createStuVector(fbb, data);\r\n    int classInfoOffset = ClassInfo.createClassInfo(fbb, (short)3, stu);\r\n    ClassInfo.finishClassInfoBuffer(fbb, classInfoOffset);\r\n\r\n    ClassInfo classInfo = ClassInfo.getRootAsClassInfo(fbb.dataBuffer());\r\n    String name = classInfo.stu(0).name();\r\n    System.out.println(name);\r\n  }\r\n  // it is a wrong method\r\n  static void methodTwo(FlatBufferBuilder fbb) {\r\n    ClassInfo.startClassInfo(fbb);\r\n    ClassInfo.addNumTeacher(fbb, (short)3);\r\n    int stuOffset = Student.createStudent(fbb,\r\n        fbb.createString(\"lisi\"), (short)19, 1);\r\n    ClassInfo.addStu(fbb, stuOffset);\r\n    int env = ClassInfo.endClassInfo(fbb);\r\n    ClassInfo.finishClassInfoBuffer(fbb, env);\r\n    ClassInfo classInfo = ClassInfo.getRootAsClassInfo(fbb.dataBuffer());\r\n    String name = classInfo.stu(0).name();\r\n    System.out.println(name);\r\n  }\r\n\r\n  public static void main(String[] args) {\r\n    FlatBufferBuilder fbb = new FlatBufferBuilder();\r\n//    methodOne(fbb);\r\n    methodTwo(fbb);\r\n  }\r\n}\r\n\r\n```\r\n "},"comment":{"url":"https://api.github.com/repos/google/flatbuffers/issues/comments/149744267","html_url":"https://github.com/google/flatbuffers/issues/301#issuecomment-149744267","issue_url":"https://api.github.com/repos/google/flatbuffers/issues/301","id":149744267,"user":{"login":"gwvo","id":6145400,"avatar_url":"https://avatars.githubusercontent.com/u/6145400?v=3","gravatar_id":"","url":"https://api.github.com/users/gwvo","html_url":"https://github.com/gwvo","followers_url":"https://api.github.com/users/gwvo/followers","following_url":"https://api.github.com/users/gwvo/following{/other_user}","gists_url":"https://api.github.com/users/gwvo/gists{/gist_id}","starred_url":"https://api.github.com/users/gwvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwvo/subscriptions","organizations_url":"https://api.github.com/users/gwvo/orgs","repos_url":"https://api.github.com/users/gwvo/repos","events_url":"https://api.github.com/users/gwvo/events{/privacy}","received_events_url":"https://api.github.com/users/gwvo/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T00:38:08Z","updated_at":"2015-10-21T00:38:08Z","body":"field `stu` needs to be a `[Student]`, but you serialize it as a `Student`."}}