Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

AlternateMailboxCollection parses only the first entry #425

Open
@thomaswoeckinger

Description

@thomaswoeckinger

The loadFromXML(...) method of AlternateMailboxCollection checks the wrong end element, therefore only the first AlternateMailbox entry will be parsed and returned.

XmlElementNames.AlternateMailbox must be replaced with XmlElementNames.AlternateMailboxes

The code should be corrected to:

  public static AlternateMailboxCollection loadFromXml(EwsXmlReader reader)
      throws Exception {
    AlternateMailboxCollection instance = new AlternateMailboxCollection();

    do {
      reader.read();

      if ((reader.getNodeType().getNodeType() == XmlNodeType.START_ELEMENT) &&
          (reader.getLocalName()
              .equals(XmlElementNames.AlternateMailbox))) {
        instance.getEntries().add(
            AlternateMailbox.loadFromXml(reader));
      }
    } while (!reader.isEndElement(XmlNamespace.Autodiscover,
        XmlElementNames.AlternateMailboxes));

    return instance;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions