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

Bug 342082

Summary: Guard against null model baseLocations
Product: [WebTools] WTP Source Editing Reporter: Nick Sandonato <nsand.dev>
Component: wst.xmlAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 Flags: thatnitind: review+
Version: 3.2.3   
Target Milestone: 3.2.4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch
none
patch with doc update none

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.