Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Different behavior in remove and removeAll?
Different behavior in remove and removeAll? [message #574362] Tue, 18 August 2009 18:05
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi list,

I've noticed that remove and removeAll don't seem to work quite the
same, as in this script:

var seq := Sequence { 0 };
seq.println('before, with number: ');
seq.remove(seq.first());
seq.println('after remove, with number: ');
seq.removeAll(Collection { seq.first() });
seq.println('after removeAll, with number: ');

var seq := Sequence { Sequence { 0 } };
seq.println('before, with nested sequence: ');
seq.remove(seq.first());
seq.println('after remove, with nested sequence: ');
seq.removeAll(Collection { seq.first() });
seq.println('after removeAll, with nested sequence: ');

If I run it, I get:

before, with number: Sequence {0}
after remove, with number: Sequence {0}
after removeAll, with number: Sequence {}
before, with nested sequence: Sequence {Sequence {0}}
after remove, with nested sequence: Sequence {Sequence {0}}
after removeAll, with nested sequence: Sequence {}

If I'm not mistaken, I believe that the expected behaviour would be for
both sequences to be empty right after the remove, so removeAll wouldn't
really have to remove anything.

By the way: I thought about using a Native('java.util.LinkedList') to
work around this issue (it also has more convenient methods, such as
removeFirst and getFirst), but no matter what I do, Epsilon seems to
convert it back to an EolCollection. Is there any way I can avoid that
implicit conversion?

Cheers,
Antonio
Previous Topic:"Resource not found" when epsilon.emf.register and permanently=true
Next Topic:"Resource not found" when epsilon.emf.register and permanently=true
Goto Forum:
  


Current Time: Tue Apr 23 15:19:58 GMT 2024

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

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

Back to the top