Bug 441310 - [xbase][validation] Revise approach to unused variables
Summary: [xbase][validation] Revise approach to unused variables
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.6.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-07 03:07 EDT by Sebastian Zarnekow CLA
Modified: 2014-08-07 03:07 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 Sebastian Zarnekow CLA 2014-08-07 03:07:24 EDT
Currently we perform a local find references operation for each private method, variable declaration and private field. In addition, AA allow to mark fields as read or initialized by means of the ReadAndWriteTracking.

There are a couple of issues with that:
- The XbaseUsageCrossReference impl contradicts (the comment in) EcoreUtil2.findReferences
- ReadAndWriteTracking seems to be sticky, that is, the adapter is never removed (not an issue with fields since they are newly inferred all the time, but would be an issue for local vars)
- Some scenarios are not caught, e.g. non-overridden methods in private classes / anonymous classes are not detected
- basic for-loop vars are not analyzed
- parameters of private methods / non-overridden methods in final classs are not analyzed
- switch variables are not analyzed
- cycles are not detected (private def void m() { m() })
- only the primary JVM element is analyzed which doesn't play well with active annotations

We should maintain the read / write access information during linking and use that one in the validation.