Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364185 - Differences of behavior when getting the first element of an empty sequence and an ordered set.
Summary: Differences of behavior when getting the first element of an empty sequence a...
Status: NEW
Alias: None
Product: MMT.ATL
Classification: Modeling
Component: emfvm (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: mmt-atl.toolkit-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-18 12:56 EST by Dominique Blouin CLA
Modified: 2011-11-18 12:56 EST (History)
0 users

See Also:


Attachments
Source code of the modified class. (89.28 KB, text/x-java)
2011-11-18 12:56 EST, Dominique Blouin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique Blouin CLA 2011-11-18 12:56:20 EST
Created attachment 207234 [details]
Source code of the modified class.

There is a discrepancy in the behavior of getting the first element of an empty ordered set and a sequence. When the collection is a sequence, getting the first element of the sequence returns null. When it is an ordered set, a no such element exception is thrown. On the other hand, getting the last element of an empty ordered set returns null. For the regular vm, null is returned for all these cases.

This can be fixed by modifying the ExecEnv class by changing the implementation of the registered ordered set first operation. The class is attached.