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

Bug 337564

Summary: CountedUnit should return false when a negative count is set
Product: [Modeling] EMFT.Henshin Reporter: Felix Rieger <riegerf>
Component: CoreAssignee: Project Inbox <henshin.interpreter-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Felix Rieger CLA 2011-02-18 08:51:49 EST
Executing a countedUnit with count < -1 currently results in no Rule being applied, but the execution returns true nonetheless. Compare this with specifying too large a count, where no Rule will be applied and the execution returns false. 

Therefore, executing countedUnits with count < -1 should always return false. (Count can not be set via a Parameter, so specifying negative values clearly is a user error, i.e. returning false and applying no Rules makes sense.)
Comment 1 Enrico Biermann CLA 2011-02-24 05:36:53 EST
A count < -1 is not valid. Proper values are N+ and "-1" (as long as possible). Executing a counted unit with -1 should always return true, because the subunit was executed "as long as possible" no matter how often this was.
A proper value of N+ or -1 should be ensured by model constraints for correct Henshin diagrams or the different editors.
Comment 2 Stefan Jurack CLA 2011-07-07 07:58:06 EDT
ocl constraint added