membrane / soa-model

Toolkit and Java API for WSDL, WADL and XML Schema.
http://www.membrane-soa.org/soa-model/
Apache License 2.0
93 stars 73 forks source link

MissingPropertyException when simple type changes to choice #158

Closed ithena closed 11 years ago

ithena commented 11 years ago

When a definition changes from an element to a choice (or vice versa) a MissingPropertyException is thrown.

groovy.lang.MissingPropertyException: No such property: elements for class: com.predic8.schema.Element
    at com.predic8.schema.diff.AbstractModelDiffGenerator.compareUnit(AbstractModelDiffGenerator.groovy:27)
    at com.predic8.schema.diff.UnitDiffGenerator.compare(UnitDiffGenerator.groovy:31)
    at com.predic8.schema.diff.SchemaDiffGenerator.compareChoice(SchemaDiffGenerator.groovy:86)
    at com.predic8.schema.Choice.compare(Choice.groovy:35)
    at com.predic8.schema.diff.SequenceDiffGenerator.compareUnit_closure4(SequenceDiffGenerator.groovy:56)
    at groovy.lang.Closure.call(Closure.java:411)
    at com.predic8.schema.diff.SequenceDiffGenerator.compareUnit(SequenceDiffGenerator.groovy:41)
    at com.predic8.schema.diff.UnitDiffGenerator.compare(UnitDiffGenerator.groovy:31)
    at com.predic8.schema.diff.SchemaDiffGenerator.compareSequence(SchemaDiffGenerator.groovy:82)
    at com.predic8.schema.Sequence.compare(Sequence.groovy:34)
    at com.predic8.schema.diff.ComplexTypeDiffGenerator.compareModel(ComplexTypeDiffGenerator.groovy:48)
    at com.predic8.schema.diff.ComplexTypeDiffGenerator.compareUnit(ComplexTypeDiffGenerator.groovy:37)
    at com.predic8.schema.diff.UnitDiffGenerator.compare(UnitDiffGenerator.groovy:31)
    at com.predic8.schema.diff.SchemaDiffGenerator.compareComplexType(SchemaDiffGenerator.groovy:78)
    at com.predic8.schema.ComplexType.compare(ComplexType.groovy:98)
    at com.predic8.schema.ComplexType.compare(ComplexType.groovy:97)
    at com.predic8.schema.diff.ComplexTypesDiffGenerator.compareUnit(ComplexTypesDiffGenerator.groovy:34)
    at com.predic8.schema.diff.ListDiffGenerator.compare_closure1(ListDiffGenerator.groovy:25)
    at groovy.lang.Closure.call(Closure.java:411)
    at groovy.lang.Closure.call(Closure.java:427)
    at com.predic8.schema.diff.ListDiffGenerator.compare(ListDiffGenerator.groovy:24)
    at com.predic8.schema.diff.SchemaDiffGenerator.compareComplexTypes(SchemaDiffGenerator.groovy:74)
    at com.predic8.schema.diff.SchemaDiffGenerator.compare(SchemaDiffGenerator.groovy:66)
    at be.tln.icc.BaseCompareSpec.compareSchema(BaseCompareSpec.groovy:27)
    at be.tln.icc.SchemaCompareBugsTest.verify schema comparison where choice changes to simple type(SchemaCompareBugsTest.groovy:15)

Example schema files that can be compared to reproduce the problem:

https://www.dropbox.com/s/24ui1tzii2ohxsj/Common_v001.xsd https://www.dropbox.com/s/l7mzdvrt2g271hq/Common_v001.xsd

keshavarzi commented 11 years ago

Hi Ruben,

thank you for your report. We take a look at this as soon as possible.