Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317860

Summary: EolCollection#includesAll returns true for disjoint sets
Product: [Modeling] Epsilon Reporter: Louis Rose <louis>
Component: CoreAssignee: Dimitris Kolovos <dkolovos>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Patch for EolCollection
none
Patch for org.eclipse.epsilon.eol.engine.test.unit none

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.