From a12dd24cf835f10a5969eacc75b5072ed1060e91 Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 2 Dec 2016 19:42:17 +0100 Subject: [PATCH] avoid repeating the same ref --- OsmAnd-java/src/net/osmand/binary/RouteDataObject.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java b/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java index e0c517d020..dc248658c4 100644 --- a/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java +++ b/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java @@ -145,7 +145,7 @@ public class RouteDataObject { public String getDestinationName(String lang, boolean transliterate, boolean direction){ //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 + ", "; if(names != null) { @@ -188,8 +188,9 @@ public class RouteDataObject { } if(transliterate && destinationDefault != null) { return destRef1 + Junidecode.unidecode(destinationDefault); + } else if (destinationDefault != null) { + return destRef1 + destinationDefault; } - return destRef1 + destinationDefault; } return "".equals(destRef) ? null : destRef; }