Jira issue originally created by user venimus:
If Entities have no namespace set (e.g. custom AutoLoader) schema tool fails to find the original methods and properties and always append the definitions to the end of the file, which leads to duplications of class definitions.
This is because in \Doctrine\ORM\Tools\EntitiesGenerator.php at line 441:
441: $lastSeenClass = $lastSeenNamespace . '\\' . $token;
$lastSeenClass is always prefixed with "\" when checking for existing definitions
it could be fixed as:
441: $lastSeenClass = $lastSeenNamespace. ($lastSeenNamespace ? '\\' : '') . $token;
I had an environment where the classes without any specified namespace are autoloaded from Entities directory, which makes generate-entities fail to work properly since Doctrine 2.0.4
Comment created by @beberlei:
Issue was closed with resolution "Fixed"