Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329389 - [evaluator] allInstances suspect on Abstract classes
Summary: [evaluator] allInstances suspect on Abstract classes
Status: CLOSED WORKSFORME
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-03 14:47 EDT by Ed Willink CLA
Modified: 2014-05-27 09:53 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2010-11-03 14:47:49 EDT
Eike Stepper reports that a customer got an exception while evaluating allInstances on an abstract class and asked whether use on abstract classes was valid.

The OCL specification specifies that allInstances returns instances of a classifier and its subtypes provide the number of instances is finite.

A quick examination of the evaluation code suggests that it finds only exact type matches, and so potentially returns null provoking the reported exception when an empty collection was expected.
Comment 1 Ed Willink CLA 2012-05-08 05:35:28 EDT
Just tried EModelElement.allInstances() on Ecore.ecore with both legacy and Xtext consoles. Both show lots of instances of the abstract class.
Comment 2 Ed Willink CLA 2013-02-15 05:47:19 EST
(In reply to comment #0)
> Eike Stepper reports that a customer got an exception while evaluating
> allInstances on an abstract class and asked whether use on abstract classes
> was valid.

 Bug 400907 raised against CDO.
Comment 3 Ed Willink CLA 2014-05-27 09:45:26 EDT
CLOSED after more than a year in RESOLVED state.
Comment 4 Ed Willink CLA 2014-05-27 09:53:07 EDT
and CLOSE