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

Bug 315482

Summary: No error when parsing untyped variable
Product: [Modeling] OCL Reporter: Wayne <wdiu>
Component: CoreAssignee: OCL Inbox <mdt-ocl-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: ed
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to fix the problem none

Description Wayne CLA 2010-06-02 16:11:29 EDT
Build Identifier: CVS HEAD on June 2, 2010

If you have an untyped variable in an OCL expression and run it through HelperUtil.parseInvariant(), the OCLAnalyzer (AbstractOCLAnalyzer) fails to detect that the OCL is invalid.

A patch to fix the problem is attached.

Reproducible: Always
Comment 1 Wayne CLA 2010-06-02 16:11:59 EDT
Created attachment 170877 [details]
Patch to fix the problem
Comment 2 Ed Willink CLA 2010-06-02 17:01:22 EDT
Your patch generates an analysis error when a meta-model property has no type; not when an OCL variable has no type.

A missing meta-model property type is a meta-model validation error not an OCL analysis error.

The role of the analyzer is (now) to report errors that prevent creation of a consistent AST.

The role of the validator is (now) to report errors in the AST.

So this could be a validation check, but I would need to study the ramifications of OCL duplicating EMF validation. I suspect we get an irritating number of duplicate messages. OCL should diagnose the downstream consequence that some expression node has no type.

Please submit a test case if you can demonstrate that it is OCL rather than the meta-model that is wrong.
Comment 3 Ed Willink CLA 2011-05-27 02:58:07 EDT
Closing WONTFIXes.
Comment 4 Ed Willink CLA 2012-05-29 13:22:10 EDT
Closing all bugs resolved in Indigo.