)]}'
{
  "commit": "be6d4fdf013290f96184063a48bc45ba6c3b2e40",
  "tree": "d9af7d3cdedbb2079e0e62bd8cc16e6857b57148",
  "parents": [
    "c60c3d853277cb4c73a9303a7f56eb8d78124803"
  ],
  "author": {
    "name": "OritMarkus",
    "email": "oritmarkus@gmail.com",
    "time": "Fri Dec 10 01:18:01 2021 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Dec 10 00:18:01 2021 +0100"
  },
  "message": "fix bug - Marshalling an object that overrides the parent\u0027s method, the XML that created contains both child\u0027s and parent\u0027s tag, the problem was in serializeBody method in the reflection section. the condition should check if the super class contains the declared field that the child overrides. (#1590)\n\n* fix bug - Marshalling an object that overrides the parent\u0027s method, the XML that created contains both child\u0027s and parent\u0027s tag, the problem was in serializeBody method in the reflection section. the condition should check if the super class contains the declared field that the child overrides.\r\n\r\nDTOs:\r\n@XmlRootElement(name \u003d \"parent\")\r\npublic class ParentDTO {\r\n\tProtected String name;\r\n\t\r\n\t@XmlElement(name\u003d “parentName”)\r\n\tgetName) {\r\n        return name;\r\n    }\r\n\tsetName(String name) {\r\n        this.name \u003d name;\r\n    }\r\n}\r\n\r\n@XmlRootElement(name \u003d \"child\")\r\npublic class ChildDTO extends ParentDTO {\r\n\t\r\n   @Override\r\n   @XmlElement(name\u003d\"childName\")\r\n    public String getName() {\r\n        return name;\r\n    }\r\n}\r\n\r\n\r\nProgram:\r\nChild child \u003d new Child();\r\nchild.setName(\"aaa\");\r\n\r\nfinal Marshaller marshaller \u003d JAXBContext.newInstance(ChildDTO.class).createMarshaller();\r\n        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);\r\n        StringWriter stringWriter \u003d new StringWriter();\r\n        marshaller.marshal(ChildDTO, stringWriter);\r\n        String xmlAsString \u003d stringWriter.toString();\r\n\r\n\r\nXML after Marshall: \r\n\u003cchild\u003e\r\n\t\u003cparentName\u003e aa \u003c/parentName \u003e\r\n\t\u003cchildName\u003e aa \u003c/ childName \u003e\r\n\u003c/child\u003e\r\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6e6dcf385d1becd5e8c10a1491879f6b50960d92",
      "old_mode": 33188,
      "old_path": "jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java",
      "new_id": "45312d0ccabb7d00ecbf11a9532c4c188a129c6d",
      "new_mode": 33188,
      "new_path": "jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java"
    }
  ]
}
