addOrMergeLayer(layers.getMarkerLayer(), findMarkerMergeLayer(gpxLayer));
layers.getPostLayerTask().run();
}
private <L extends Layer> L addOrMergeLayer(L layer, L mergeLayer) {
if (layer == null) return null;
<BUG>if (newLayer || mergeLayer == null) {
Main.main.addLayer(layer);
return layer;</BUG>
} else {
<BUG>mergeLayer.mergeFrom(layer);
Main.map.repaint();
return mergeLayer;</BUG>
}

addOrMergeLayer(layers.getMarkerLayer(), findMarkerMergeLayer(gpxLayer));
layers.getPostLayerTask().run();
}
private <L extends Layer> L addOrMergeLayer(L layer, L mergeLayer) {
if (layer == null) return null;
if (newLayer || mergeLayer == null) {
if (Main.main != null) {
Main.main.addLayer(layer);
}
return layer;
} else {
mergeLayer.mergeFrom(layer);
if (Main.map != null) {
