wwu-pi / md2-framework

MD2 – Model-driven Mobile Development
Apache License 2.0
14 stars 10 forks source link

Methods of MD2GeneratorUtil should not be static #6

Open sacnl opened 11 years ago

sacnl commented 11 years ago

The state of the qualified name provider etc. should be reset on each new generation. Thus, its methods would best not be static. Otherwise, state (wrt names) from the previous generation might leak into the next generation.

Example: first version of an app contains a button named "reset" and an action named reset. Then, the generated Android code contains errors, because the class .actions.Reset.javacontains a class Reset1 (related to a different bug: line 160 of AndroidGenerator.xtend should use getName as well). Renaming the button to, e.g., "resetBtn" does not help directly, presumably because the old name mapping is still in the cache. Restarting the MD2-Eclipse instance and regenerating again resolves the error.

sacnl commented 11 years ago

The bug with regard to inconsistent naming mentioned above has been resolved. The static naming behavior can still be observed - renaming an object is only reflected after a restart of the Eclipse instance running MD2.