Hi David,
by using the Java API the variable object (class GRBVar) gives you a unique reference to a specific variable. That also means you can create and use two different variable objects with the same name.
However, variables in MPS files are identified by their unique name. So if you try to write an MPS file of a model that contains multiple variables with the same name the variable names are changed to the default names. You should see a message like
Warning: default variable names used to write mps file
Kostja