Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322878

Summary: XSDSchema Validation returns bad diagnostics for elements with duplicate names
Product: [Modeling] EMF Reporter: Dimitar Donchev <dimitar.donchev>
Component: XSDAssignee: Ed Merks <Ed.Merks>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
JUnit tests reproducing the issue none

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