Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342082 - Guard against null model baseLocations
Summary: Guard against null model baseLocations
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.2.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.4   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 17:41 EDT by Nick Sandonato CLA
Modified: 2011-04-06 20:52 EDT (History)
0 users

See Also:
thatnitind: review+


Attachments
patch (2.20 KB, patch)
2011-04-06 17:42 EDT, Nick Sandonato CLA
no flags Details | Diff
patch with doc update (3.76 KB, patch)
2011-04-06 18:41 EDT, Nick Sandonato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Sandonato CLA 2011-04-06 17:41:31 EDT
It is possible for a model's baseLocation to be null (for example when copying the model), which can  cause assertion failures when generating Paths used in checking for external schema locations.
Comment 1 Nick Sandonato CLA 2011-04-06 17:42:47 EDT
Created attachment 192675 [details]
patch
Comment 2 Nitin Dahyabhai CLA 2011-04-06 18:05:13 EDT
Wouldn't it be better to also copy the base location, given that the IDs have to be different?
Comment 3 Nick Sandonato CLA 2011-04-06 18:41:22 EDT
Created attachment 192680 [details]
patch with doc update

copyModelForEdit, maybe. But createNewInstance is still capable of setting the baseLocation to null. I've updated the doc to reflect this and left the null checks.
Comment 4 Nick Sandonato CLA 2011-04-06 20:52:44 EDT
Thanks for the review. Code checked in.