Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328309 - validate repeated constant case expression value causing unreachable cases
Summary: validate repeated constant case expression value causing unreachable cases
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: b3 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-20 22:26 EDT by Henrik Lindberg CLA
Modified: 2017-09-13 11:52 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Lindberg CLA 2010-10-20 22:26:13 EDT
An anticipated common user error is to enter the same constant case expression multiple times (either for the same case (harmless), or for different cases (not good).

The constant evaluator can be used to also catch all expression cases. 
Examples:

case 10 : ...
case 5+5 : ...
case 10 : ...

Cases #2 and #3 are unreachable.

The other unreachable cases are validated in the EMF model. But this validation requires access to evaluator - add the validation in the BeeLangJavaValidator.