Uploaded image for project: 'WS-Commons'
  1. WS-Commons
  2. WSCOMMONS-120

XmlSchema.equals(Object) returns a false positive result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • XmlSchema
    • None

    Description

      The XmlSchema class inherits the equals(Object) method from XmlSchemaObject.
      This method uses line number, line position and sourceURI for equality
      checking, however line number and position are always zero (they are not
      used yet?). This can cause a false positive when checking equality of two
      different schemas that share the same source URI.

      For example, the WSDL 2.0 testcase at [1] has two inlined schemas. For
      XmlSchema1.equals(XmlSchema2), both XmlSchema objects will have line number
      zero, line position zero and the WSDL URI as their sourceURI and
      XmlSchemaObject.equals will return true, even though in this case the two
      inlined schemas have different target namespaces and xs:include different
      schema documents.

      [1] http://dev.w3.org/cvsweb/~checkout~/2002/ws/desc/test-suite/documents/good/Chameleon-4G/getBalance.wsdl

      I think a solution is to create an equals method on XmlSchema which invokes
      super.equals (i.e. from XmlSchemaObject) and adds further equality checking
      specific to XmlSchema. I have tried the attached patch which fixes my
      testcase, although it may require more equality checking logic in the equals method
      to be more useful generally.

      Attachments

        1. XmlSchema_equals_patch.txt
          2 kB
          John Alan William Kaputin

        Issue Links

          Activity

            People

              dims Davanum Srinivas
              jkaputin John Alan William Kaputin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: