Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 260497 - Make EcoreUtil.copy null safe
Summary: Make EcoreUtil.copy null safe
Status: VERIFIED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.5.0   Edit
Hardware: PC Linux
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-08 22:44 EST by Andrew H CLA
Modified: 2009-06-25 02:52 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew H CLA 2009-01-08 22:44:25 EST
if the argument to EcoreUtil.copy is null you get a NPE. This causes a fair bit of code bloat in clients that need to check for nulls before calling this method.

A simple
if (eObject == null) return null;

would fix the problem
Comment 1 Ed Merks CLA 2009-01-09 07:40:36 EST
The change is committed to CVS for 2.5.
Comment 2 Nick Boldt CLA 2009-01-15 16:27:04 EST
Fix available in HEAD: 2.5.0.I200901131800.
Comment 3 Dave Steinberg CLA 2009-06-25 02:52:50 EDT
Fix available in HEAD: 2.5.0 (R200906151043).