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

Bug 347377

Summary: Validation and content assist don't handle changes to in-workspace schema
Product: [WebTools] Dali JPA Tools Reporter: Paul Fullbright <paul.fullbright>
Component: JAXBAssignee: Paul Fullbright <paul.fullbright>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: neil.hauge
Version: 3.0Flags: neil.hauge: review+
Target Milestone: 3.0.1   
Hardware: PC   
OS: Windows Vista   
Whiteboard: fix_ready
Attachments:
Description Flags
proposed patch none

Description Paul Fullbright CLA 2011-05-26 17:14:23 EDT
- Generate classes from in-workspace schema file (adds schema to project library).
- Make changes to schema that will affect validation and content assist (e.g. change the name of an element)
- JAXB model will not validate or provide content assist with respect to new version of schema, only the version as it existed when it was compiled.

We'll likely need to reload schemas at certain points, perhaps at validation beginning and when content assist is invoked.  There doesn't look to be a way to create an XSD model that stays in synch with its resource.
Comment 1 Paul Fullbright CLA 2011-06-08 16:13:33 EDT
Created attachment 197641 [details]
proposed patch

Adds two API methods to SchemaLibrary (a noextend interface):

refreshSchema(String namespace);
refreshAllSchemas();

The project refreshes all schemas before validation.

The type or package refreshes the schema with the appropriate namespace before content assist.
Comment 2 Neil Hauge CLA 2011-06-22 11:56:20 EDT
I assume the refresh would never be a long running operation?
Comment 3 Paul Fullbright CLA 2011-06-22 12:05:22 EDT
Define "long running"?

Certainly no longer than adding the schema in the first place.  And most likely significantly less than a validation run time.  The times I've tested, the content assist had no (additional) lag time.
Comment 4 Paul Fullbright CLA 2011-06-23 13:51:26 EDT
fixed post 3.0