Bug 237441 - Bug throwing nonStaticAttribute error, in AbstractOCLAnalyzer.enumLiteralExpCS(...) method
Summary: Bug throwing nonStaticAttribute error, in AbstractOCLAnalyzer.enumLiteralExpC...
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.2.1   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-06-17 05:29 EDT by Adolfo Sanchez-Barbudo Herrera CLA
Modified: 2011-05-27 02:41 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adolfo Sanchez-Barbudo Herrera CLA 2008-06-17 05:29:30 EDT
The following thrown error doesn't have the offsets well set.

Analyzer-ERROR in enumerationOrClassLiteralExpCS; StandardLibrary.qvto:1 : Static reference to non-static attribute "name"

The problem resides in this piece of code of AbstractOCLAnalyzer:

if (!uml.isStatic(attribute)) {
                    String message = OCLMessages.bind(
                        OCLMessages.NonStaticAttribute_ERROR_,
                        lastToken);
                    ERROR(attribute, "enumerationOrClassLiteralExpCS", message);//$NON-NLS-1$
                }

attribute comes from a found property of a metamodel, which doesn't have correspondence with the text. Using the correspondent cstNode is needed:

ERROR(enumLiteralExpCS.getSimpleNameCS(), "enumerationOrClassLiteralExpCS", message);//$NON-NLS-1$

Cheers,
Adolfo.
Comment 1 Christian Damus CLA 2008-07-16 12:10:25 EDT
Committed the submitter's suggested change.
Comment 2 Christian Damus CLA 2008-07-17 22:10:26 EDT
Fix available in R1_2_maintenance: 1.2.1.M200807161339.
Comment 3 Ed Willink CLA 2010-12-15 13:32:48 EST
This is a one symbol name change, so does not require an IP log entry.
Comment 4 Ed Willink CLA 2011-05-27 02:40:06 EDT
Closing after over a year in verified state.
Comment 5 Ed Willink CLA 2011-05-27 02:41:44 EDT
Closing after over a year in verified state.