Hi Ockert!
This behaviour is changing in Mendix 8. Sadly we can’t disable it in 7, since quite some 3rd party modules and existing projects are relying on code generation to behave this way.
https://docs.mendix.com/refguide/moving-from-7-to-8#8-java-code-generation
You might think that renaming is “random”, but in fact what modeler is trying to do is name collision prevention (it’s just not doing it in a very smart way). So if you currently have an entity or a data set whose name is the same as one of the names of Java Action parameters – you will get a code generation error.
It’s super easy to fix – either rename the Entity or the conflicting parameter.
In Mendix 8 this behaviour wouldn’t occur anymore.