jaxb
  1. jaxb
  2. JAXB-862

StackOverflowError when XmlElementDecl.name and substitutionHeadName are the same

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.4
    • Fix Version/s: None
    • Component/s: runtime
    • Labels:
      None
    • Environment:

      Windows 7

      Description

      For an ObjectFactory method of the form:

      @XmlElementDecl(name = "product", substitutionHeadNamespace = "", substitutionHeadName = "product")
      public JAXBElement<ProductType> createProduct(ProductType value)

      { return new JAXBElement<ProductType>(_Product_QNAME, ProductType.class, null, value); }

      I get an exception of the form:

      java.lang.StackOverflowError
      at java.util.LinkedHashMap.access$000(LinkedHashMap.java:147)
      at java.util.LinkedHashMap$Entry.recordAccess(LinkedHashMap.java:350)
      at java.util.HashMap.put(HashMap.java:396)
      at java.util.HashSet.add(HashSet.java:217)
      at com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl.addGenericElement(ReferencePropertyInfoImpl.java:335)
      at com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl.addGenericElement(ReferencePropertyInfoImpl.java:337)
      at com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl.addGenericElement(ReferencePropertyInfoImpl.java:337)
      at com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl.addGenericElement(ReferencePropertyInfoImpl.java:337)
      at com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl.addGenericElement(ReferencePropertyInfoImpl.java:337)

      ... (ad inf.)

      This should either be allowed (as an element technically is substitutable for itself) or a more constructive error should be logged.

        Activity

        Hide
        Iaroslav Savytskyi added a comment -

        I'm not sure if is has a lot of sense to mart element as a itself substitution group.

        Show
        Iaroslav Savytskyi added a comment - I'm not sure if is has a lot of sense to mart element as a itself substitution group.
        Hide
        Martin Grebac added a comment -

        No need to waive minor issues.

        Show
        Martin Grebac added a comment - No need to waive minor issues.

          People

          • Assignee:
            Iaroslav Savytskyi
            Reporter:
            pwfullbright
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: