so what I am currently working on is a plugin for java classes that makes all eligible variables final.
I think I have covered about 90% of the potential cases when a variable (either local, member or parameter) can be made final.
Now while working on the last tedious ~10% of coverage and after having learned about a small fraction of the API, I wanted to ask whether there is an easier way to determine data assignments of variables - rather than to count those myself (with various other conditions in mind, of course).
Especially when it comes to branching (if-else and switch statements), it can get tricky to determine what counts as a further data assignment or just an alternative.
So my question is really a 2-part question:
1) Considering the whole potential final modifier for variables: Is there a simple way to determine those variables?
2) Considering the previously mentioned branching statements: Is there a simple way to determine data assignments of variables with the final modifier in mind?
I'm talking about API mechanisms or the such which might make things easier. For one thing, it would be annoying to find out that there is a much simpler solution after having put a lot of effort into development. Furthermore, using suitable inherent mechanisms to achieve a goal might turn out to featuer better performance and in general a higher level of thoroughness.