Recently I ran into a problem which I believe was caused by name collision.

I have a package named Artefact and within this package I have a class called ArtefactPackage (and it needs to be called this). When I generate model codes there are many compilation errors, which I believe was caused by the fact that ArtefactPackage is generated for the Package but Java confuses this with the ArtefactPackage element in the Package.