Script for automatically adding initializers


we have an example solution with plain Java code. At some point of development, we applied quick fixes after type checking. The problem is that this removed initializers of for instance variable declarations. Now the compiler complaints about non-initialized variables: "The local variable test may not have been initialized".

Is there something like a script that automatically adds initializers?

Thanks and cheers



Comment actions Permalink

You can use the MPS console to execute a command. See to get an idea about how it works.

Also, do you remember what fix you applied or what were the typechecking problems? Sounds like the fix shouldn't have removed the initializers so we should fix the fix :)

Comment actions Permalink

Thanks for the hint! We already identified the problem and it was not related MPS's core. In particular, we use a language that adds variability to BaseLanguage (in the sense of SPL engineering) and data flow analysis was not variability-aware. So no need to fix the fix :D 


Please sign in to leave a comment.