From b037b98c1118178fa185851d202a348c3944f878 Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 2 Aug 2018 11:37:31 +0300 Subject: [PATCH] remove unnecessary method --- .../resources/IncrementalChangesManager.java | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java b/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java index 1251d01358..880526d709 100644 --- a/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java @@ -14,14 +14,10 @@ import java.io.File; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URLEncoder; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TreeMap; @@ -81,7 +77,7 @@ public class IncrementalChangesManager { List list = new ArrayList(regionUpdateFiles.monthUpdates.keySet()); for (String month : list) { RegionUpdate ru = regionUpdateFiles.monthUpdates.get(month); - if (checkIfItemOutdated(ru, dateCreated)) { + if (ru.obfCreated <= dateCreated) { log.info("Delete overlapping month update " + ru.file.getName()); resourceManager.closeFile(ru.file.getName()); regionUpdateFiles.monthUpdates.remove(month); @@ -101,7 +97,7 @@ public class IncrementalChangesManager { if(ru == null) { continue; } - if ((checkIfItemOutdated(ru, dateCreated)) || + if (ru.obfCreated <= dateCreated || (monthRu != null && ru.obfCreated < monthRu.obfCreated)) { log.info("Delete overlapping day update " + ru.file.getName()); resourceManager.closeFile(ru.file.getName()); @@ -415,27 +411,4 @@ public class IncrementalChangesManager { } return timestamp; } - - private boolean checkIfItemOutdated(RegionUpdate ru, long dateMainMapCreated) { - boolean outdated = false; - Date strDate = null; - String date = ru.date; - if (ru.obfCreated < dateMainMapCreated) { - outdated = true; - } else if (!Algorithms.isEmpty(date) && ru.obfCreated == dateMainMapCreated) { - try { - if (date.endsWith("00")) { - strDate = new SimpleDateFormat("yy_MM", Locale.getDefault()).parse(date); - } else { - strDate = new SimpleDateFormat("yy_MM_dd", Locale.getDefault()).parse(date); - } - } catch (ParseException e) { - e.printStackTrace(); - } - if (strDate != null && dateMainMapCreated > strDate.getTime()) { - outdated = true; - } - } - return outdated; - } }