Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317860 - EolCollection#includesAll returns true for disjoint sets
Summary: EolCollection#includesAll returns true for disjoint sets
Status: CLOSED FIXED
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dimitris Kolovos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-24 12:57 EDT by Louis Rose CLA
Modified: 2012-02-06 10:59 EST (History)
0 users

See Also:


Attachments
Patch for EolCollection (1.46 KB, patch)
2010-06-24 12:57 EDT, Louis Rose CLA
no flags Details | Diff
Patch for org.eclipse.epsilon.eol.engine.test.unit (3.26 KB, patch)
2010-06-24 12:57 EDT, Louis Rose CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Louis Rose CLA 2010-06-24 12:57:04 EDT
Created attachment 172642 [details]
Patch for EolCollection

The following returns true (it should return false):

EolSequence abc = new EolSequence(Arrays.asList("a", "b", "c"));
EolSequence d   = new EolSequence(Arrays.asList("d"));

abc.includesAll(d); // returns true

The attached patches fix this problem (and a symmetric problem in excludesAll), and provide tests cases to prevent regressions.
Comment 1 Louis Rose CLA 2010-06-24 12:57:37 EDT
Created attachment 172643 [details]
Patch for org.eclipse.epsilon.eol.engine.test.unit
Comment 2 Louis Rose CLA 2010-06-24 13:02:13 EDT
A workaround is to redefine includesAll and excludesAll in your EOL/ETL/EVL/etc file:

operation Collection includesAll(other : Collection) : Boolean {
  return other.forAll(e|self.includes(e));
}

operation Collection excludesAll(other : Collection) : Boolean {
  return other.forAll(e|self.excludes(e));
}
Comment 3 Dimitris Kolovos CLA 2010-07-06 11:57:58 EDT
This has now been fixed in the SVN and the latest interim version.
Comment 4 Dimitris Kolovos CLA 2010-11-25 08:17:07 EST
Fixed in 0.9.0.