• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • MCore: Business Modelling & Operations
  • Bugs
MCore: Business Modelling & Operations

deepCopy() does not handle references correctly

ECore + OCL to add static and dynamic semantics to models

Brought to you by: aigdalov, gavmkutter, ghillairet, max_stepanov, and 3 others
  • Summary
  • Files
  • Reviews
  • Support
  • Wiki
  • Tickets ▾
    • Bugs
    • Feature Requests
  • News
  • Code
  • Code
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

  • v1.0_(example)

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#19 deepCopy() does not handle references correctly

open
nobody
None
5
2010-07-06
2010-07-06
Massimiliano Zattera
No

If we use the CL standard library deepCopy() method on a collection, references
among the objects in the collection are not correctly dealed: if the object a1
and a2, with a2 pointing to a1 are copied, the resulting a3 and a4 should be
such that a4 points to a3, but actually a4 points to a1!

To check this bug, use attached project, implement and run it, then in the
model instance you will find, add a Copy instance to the last item in the table
editor.

That will crate a Copy instance which items are copied form items in the
corresponding Box specified in the copyFrom field for the Copier class.

Basically, three new items are created, but as you can see the new items will
not reference each other, they will reference original items instead.

Discussion

  • Massimiliano Zattera

    Massimiliano Zattera - 2010-07-06
     
    DeepCopyTest.zip
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2026 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise