Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-290

QNameSet generated by QNameSet.forArray(QName[]) can't be unioned with other QNameSets

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Version 2
    • Version 2.2.1
    • None
    • None

    Description

      I discovered that a QNameSet created from QNameSet.forArray(QName[]) cannot be used as an argument to QNameSet.union(qnameSetFromArray). The set-based factory method

      QNameSet.forSets(null, Collections.EMPTY_SET, Collections.EMPTY_SET, qnames);

      works fine. I am currently using xmlbeans 2.0 but it looks to me by examining the code that the problem is still present in trunk. I believe that the problem is that in
      public static QNameSet forArray(QName[] includedQNames)

      { if (includedQNames == null) throw new IllegalArgumentException("includedQNames cannot be null"); return new QNameSet(null, new HashSet(), null, new HashSet(Arrays.asList(includedQNames))); }

      the third set is null rather than empty.

      Attachments

        Activity

          People

            Unassigned Unassigned
            djencks David Jencks
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: