Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Copy&Paste between maps fails in Sample Ecore Editor
Copy&Paste between maps fails in Sample Ecore Editor [message #1848236] Thu, 25 November 2021 17:59 Go to next message
Harald Mackamul is currently offline Harald MackamulFriend
Messages: 15
Registered: November 2016
Junior Member
I have a meta model with an element that contains two maps. The maps have different content.
The model instance can be created in the sample editor and the data can be entered and stored. But a copy operation of one map entry ("Bob" in the example) to another object ("Basket1" in the example) creates an entry in the wrong map.
Any further attempt to move or delete the copied object leads to an Eclipse IDE that does not respond any more.

I assume that the cause of the problem is the use of the map entries in both cases.
Is there a possibility to avoid this situation (while keeping the two maps) ?

Best regards
Harald

I created a small example to show the problem:

class NumericData wraps java.util.Map$Entry {
	String key
	Long value
}

class TextData wraps java.util.Map$Entry {
	String key
	String value
}

class Element {
	String name
	contains NumericData[] numbers
	contains TextData[] strings
}

class Root {
	contains Element[] elements
}


Model file before the copy operation:
  <elements
      name="Basket1">
    <numbers
        key="2"
        value="123"/>
    <strings
        key="Mary"
        value="abc"/>
  </elements>
  <elements
      name="Basket2">
    <strings
        key="Bob"
        value="abc"/>
  </elements>


Model file after the copy operation:
  <elements
      name="Basket1">
    <numbers
        key="2"
        value="123"/>
    <numbers
        xsi:type="test:TextData"
        key="Bob"
        value="abc"/>
    <strings
        key="Mary"
        value="abc"/>
  </elements>
...

Re: Copy&Paste between maps fails in Sample Ecore Editor [message #1848259 is a reply to message #1848236] Fri, 26 November 2021 07:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Yes, that looks quite wrong. Please open a Bugzilla and I'll have a look when I'm back in the office.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Copy&Paste between maps fails in Sample Ecore Editor [message #1848269 is a reply to message #1848259] Fri, 26 November 2021 09:23 Go to previous message
Harald Mackamul is currently offline Harald MackamulFriend
Messages: 15
Registered: November 2016
Junior Member
Thanks.
I created bug 577479 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=577479).
Previous Topic:[CDO] Startup error on linux getConfig().getBufferProvider() == null
Next Topic:Access EMF object in Xtend
Goto Forum:
  


Current Time: Thu Apr 25 16:51:54 GMT 2024

Powered by FUDForum. Page generated in 0.03442 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top