Skip to content
Success

Changes

Summary

  1. fix bug - Marshalling an object that overrides the parent's method, the XML that created contains both child's and parent's 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) (commit: be6d4fd) (details)
  2. add a test for #1590 (commit: db536c9) (details)
  3. Include default namespace in DOMScanner (commit: a0872e1) (details)
  4. bump src/bin level to jdk 11, (commit: ef1d7b3) (details)
Commit be6d4fdf013290f96184063a48bc45ba6c3b2e40 by noreply
fix bug - Marshalling an object that overrides the parent's method, the XML that created contains both child's and parent's 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)

* fix bug - Marshalling an object that overrides the parent's method, the XML that created contains both child's and parent's 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.

DTOs:
@XmlRootElement(name = "parent")
public class ParentDTO {
Protected String name;

@XmlElement(name= “parentName”)
getName) {
        return name;
    }
setName(String name) {
        this.name = name;
    }
}

@XmlRootElement(name = "child")
public class ChildDTO extends ParentDTO {

   @Override
   @XmlElement(name="childName")
    public String getName() {
        return name;
    }
}


Program:
Child child = new Child();
child.setName("aaa");

final Marshaller marshaller = JAXBContext.newInstance(ChildDTO.class).createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
        StringWriter stringWriter = new StringWriter();
        marshaller.marshal(ChildDTO, stringWriter);
        String xmlAsString = stringWriter.toString();


XML after Marshall:
<child>
<parentName> aa </parentName >
<childName> aa </ childName >
</child>
(commit: be6d4fd)
The file was modified jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java (diff)
Commit db536c9957f23202c47b2bca8e171e382b891fb8 by Lukas Jungmann
add a test for #1590

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
(commit: db536c9)
The file was addedjaxb-ri/runtime/impl/src/test/java/org/glassfish/jaxb/runtime/v2/runtime/ChildDTO.java
The file was modified jaxb-ri/runtime/impl/pom.xml (diff)
The file was addedjaxb-ri/runtime/impl/src/test/java/org/glassfish/jaxb/runtime/v2/runtime/InheritanceTest.java
The file was addedjaxb-ri/runtime/impl/src/test/java/org/glassfish/jaxb/runtime/v2/runtime/ParentDTO.java
Commit a0872e1e711240477d2c1af4f5748d4f4c061b02 by Lukas Jungmann
Include default namespace in DOMScanner
(commit: a0872e1)
The file was addedjaxb-ri/core/src/test/java/org/glassfish/jaxb/core/unmarshaller/DOMScannerTest.java
The file was modified jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/unmarshaller/DOMScanner.java (diff)
The file was addedjaxb-ri/core/src/test/resources/parentDefaultNs.xml
Commit ef1d7b3e2467bfe64b4ef277070dc06886c3c554 by Lukas Jungmann
bump src/bin level to jdk 11,
drop some mr jars,
integrate latest dependencies

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
(commit: ef1d7b3)
The file was modified jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/CatalogUtil.java (diff)
The file was modified jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/StackHelper.java (diff)
The file was modified jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenTask.java (diff)
The file was modified jaxb-ri/bundles/jxc/pom.xml (diff)
The file was modified jaxb-ri/external/pom.xml (diff)
The file was modified jaxb-ri/bundles/runtime/pom.xml (diff)
The file was removedjaxb-ri/jxc/src/main/java-mr/9/com/sun/tools/jxc/SchemaGenTask.java
The file was removedjaxb-ri/core/src/main/java-mr/9/org/glassfish/jaxb/core/StackHelper.java
The file was modified jaxb-ri/jxc/pom.xml (diff)
The file was modified jaxb-ri/xjc/pom.xml (diff)
The file was modified jaxb-ri/bundles/osgi/osgi/pom.xml (diff)
The file was modified jaxb-ri/bundles/core/pom.xml (diff)
The file was modified jaxb-ri/bundles/xjc/pom.xml (diff)
The file was modified jaxb-ri/codemodel/pom.xml (diff)
The file was removedjaxb-ri/runtime/impl/src/main/java-mr/9/org/glassfish/jaxb/runtime/v2/MUtils.java
The file was modified jaxb-ri/core/pom.xml (diff)
The file was removedjaxb-ri/xjc/src/main/java-mr/9/com/sun/tools/xjc/CatalogUtil.java
The file was modified jaxb-ri/boms/bom/pom.xml (diff)
The file was modified jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/MUtils.java (diff)
The file was modified jaxb-ri/runtime/impl/pom.xml (diff)
The file was modified jaxb-ri/xsom/pom.xml (diff)
The file was modified jaxb-ri/pom.xml (diff)