Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322878 - XSDSchema Validation returns bad diagnostics for elements with duplicate names
Summary: XSDSchema Validation returns bad diagnostics for elements with duplicate names
Status: NEW
Alias: None
Product: EMF
Classification: Modeling
Component: XSD (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-17 04:18 EDT by Dimitar Donchev CLA
Modified: 2023-01-12 11:49 EST (History)
0 users

See Also:


Attachments
JUnit tests reproducing the issue (14.12 KB, application/x-zip)
2010-08-17 04:23 EDT, Dimitar Donchev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitar Donchev CLA 2010-08-17 04:18:55 EDT
Build Identifier: 20100218-1602

The XSDSchema.validate() method, creates validation diagnostics for the schema.
For the invalid case of global elements/types with identical names, the created diagnostics are not consistent.
1. If there are 3 elements with duplicate names, only 2 of them have an error diagnostic.
2. If the same document is reopened, validated, again only 2 but most probably different ( at random principle) elements have diagnostics.

3. If a new identical element/type with the same name is added and validation is performed, the elements which have error diagnostics mix at random principle (the one which has none is again randomly chosen)

Though when parsing the document, the second element with the same name figures invalid, there is no guarantee that the first element is meant to be valid and others invalid by the user. 
All duplicate elements should be marked. This way the user will be completely informed of the issue

I'll attach JUnit Tests reproducing the random change of marked elements, and the fact that all but one get diagnosed with error.

Reproducible: Always

Steps to Reproduce:
1.Download the attached project
2.import into eclipse workspace
3.rut the AllTests test suite as plug-in test
Comment 1 Dimitar Donchev CLA 2010-08-17 04:23:24 EDT
Created attachment 176765 [details]
JUnit tests reproducing the issue