avoid repeating the same ref

This commit is contained in:
sonora 2016-12-02 19:42:17 +01:00
parent 4670bd4a65
commit a12dd24cf8

View file

@ -145,7 +145,7 @@ public class RouteDataObject {
public String getDestinationName(String lang, boolean transliterate, boolean direction){ public String getDestinationName(String lang, boolean transliterate, boolean direction){
//Issue #3289: Treat destination:ref like a destination, not like a ref //Issue #3289: Treat destination:ref like a destination, not like a ref
String destRef = (getDestinationRef(direction) == null) ? "" : getDestinationRef(direction); String destRef = ((getDestinationRef(direction) == null) || getDestinationRef(direction).equals(getRef(direction)) ? "" : getDestinationRef(direction);
String destRef1 = ("".equals(destRef)) ? "" : destRef + ", "; String destRef1 = ("".equals(destRef)) ? "" : destRef + ", ";
if(names != null) { if(names != null) {
@ -188,8 +188,9 @@ public class RouteDataObject {
} }
if(transliterate && destinationDefault != null) { if(transliterate && destinationDefault != null) {
return destRef1 + Junidecode.unidecode(destinationDefault); return destRef1 + Junidecode.unidecode(destinationDefault);
} else if (destinationDefault != null) {
return destRef1 + destinationDefault;
} }
return destRef1 + destinationDefault;
} }
return "".equals(destRef) ? null : destRef; return "".equals(destRef) ? null : destRef;
} }