When layers are created from FileLoaders, (ex. from a shp or a jml), sevarl layers with the same name can be created. This should be avoided. With several layers having the same name, the layer returned by LayerManager#getLayer(layerName) is undetermined.
Fixed in r3843