Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321903 - [editor] inherited names not seen if superclass has qualified name
Summary: [editor] inherited names not seen if superclass has qualified name
Status: CLOSED FIXED
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: 3.0.1   Edit
Assignee: OCL Inbox CLA
QA Contact: Ed Willink CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-05 13:04 EDT by Ed Willink CLA
Modified: 2012-05-29 13:23 EDT (History)
0 users

See Also:


Attachments
Eliminate qualification blindness (2.71 KB, patch)
2010-08-05 13:14 EDT, Ed Willink CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2010-08-05 13:04:37 EDT
The following comes from Fabian Brosig's mdt-ocl newsgroup message: [OCLinEcore] Resolving attributes in OCL Constraints.

-----WORKING EXAMPLE----------------------------------------------------------------------
-- This is the working example.
------------------------------------------------------------------------------------------
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';

package tutorial : tut = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
 class NamedElement
 {
   attribute name : String;
 }
 class Parameter extends NamedElement
 {
     property _'signature'#parameters : Signature[1];
 }
 class Signature  {
     invariant parameterMustHaveUniqueNames: self.parameters->isUnique(p:Parameter | p.name);     property parameters#_'signature' : Parameter[0..*] { composes };
 }
}

-----NOT WORKING----------------------------------------------------------------------
-- This does not work. The reference p.name in the OCL constraint cannot be resolved. -- For 'name', the OCLinEcore Editor shows the following error: -- "Couldn't resolve reference to NamedElementCS 'name'".
------------------------------------------------------------------------------------------
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';

package tutorial : tut = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
 package core : cre = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial/core' {
    class NamedElement
    {
      attribute name : String;
    }   
 }
 class Parameter extends core::NamedElement
 {
   property _'signature'#parameters : Signature[1];
 }
 class Signature  {
   invariant parameterMustHaveUniqueNames: self.parameters->isUnique(p:Parameter | p.name);    property parameters#_'signature' : Parameter[0..*] { composes };
 }
}
Comment 1 Ed Willink CLA 2010-08-05 13:14:20 EDT
Created attachment 175964 [details]
Eliminate qualification blindness

Problem was that the super type was only examined if unqualified, patch
uses the polymorphism to accommodate qualified and unqualified types.

Add the following to LoadTests to activate the test

	public void testLoad_Bug321903_oclinecore() throws IOException, InterruptedException {
		doLoad("Bug321903", "oclinecore");
	}
Comment 2 Ed Willink CLA 2010-08-05 13:14:45 EDT
A candidate for 3.0.1.
Comment 3 Ed Willink CLA 2010-08-05 13:22:44 EDT
Getting carried away; not RESOLVED, till committed to CVS.
Comment 4 Ed Willink CLA 2010-08-17 05:11:56 EDT
Committed to HEAD for 3.1.0M2 and to R3_0_maintenance for 3.0.1RC2.
Comment 5 Ed Willink CLA 2012-05-29 13:23:35 EDT
Closing all bugs resolved in Indigo.