Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339921 - improve error message resulting from faulty call to error in check method
Summary: improve error message resulting from faulty call to error in check method
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-14 12:48 EDT by Henrik Lindberg CLA
Modified: 2017-09-19 17:06 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Lindberg CLA 2011-03-14 12:48:59 EDT
When calling error or warning in a @Check method, and passing the wrong literal, the error message could be more helpful.

In my case - the call:

error(
"A selector expression must have at least one right side entry", o,
PPPackage.Literals.BINARY_EXPRESSION__LEFT_EXPRESSION, INSIGNIFICANT_INDEX,
IPPDiagnostics.ISSUE__NULL_EXPRESSION);

Produced the error: EClass 'SelectorExpression' does not expose a feature 'leftExpr'.

I should have used PARAMETERIZED_EXPRESSION__LEFT_EXPRESSION but was fooled by seeing only the name 'leftExpr' (which it indeed does expose).

Suggest that either the full identifier "BINARY_EXPRESSION__LEFT_EXPRESSION" is displayed, or that it also checks if the feature reference is made with a compatible EClass.
Comment 1 Sebastian Zarnekow CLA 2012-04-02 16:24:43 EDT
Easy fix. Thanks for the suggestion.
Comment 2 Karsten Thoms CLA 2017-09-19 16:55:31 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:06:22 EDT
Closing all bugs that were set to RESOLVED before Neon.0