Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347377 - Validation and content assist don't handle changes to in-workspace schema
Summary: Validation and content assist don't handle changes to in-workspace schema
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JAXB (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard: fix_ready
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-26 17:14 EDT by Paul Fullbright CLA
Modified: 2011-06-23 13:51 EDT (History)
1 user (show)

See Also:
neil.hauge: review+


Attachments
proposed patch (5.70 KB, patch)
2011-06-08 16:13 EDT, Paul Fullbright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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