diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/ContentsJsonParser.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/ContentsJsonParser.java index 8852c3a5a3..a6686934cd 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/ContentsJsonParser.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/ContentsJsonParser.java @@ -1,6 +1,6 @@ package net.osmand.plus.wikivoyage.data; -import android.content.Context; +import android.support.annotation.Nullable; import org.json.JSONArray; import org.json.JSONException; @@ -10,15 +10,15 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; - class ContentsJsonParser { - static ContentsContainer parseJsonContents(String contentsJson, Context context) { - LinkedHashMap map = new LinkedHashMap(); - ArrayList listDataHeader = new ArrayList(); - LinkedHashMap> listDataChild = new LinkedHashMap>(); + @Nullable + static ContentsContainer parseJsonContents(String contentsJson) { + LinkedHashMap map = new LinkedHashMap<>(); + ArrayList listDataHeader = new ArrayList<>(); + LinkedHashMap> listDataChild = new LinkedHashMap<>(); - JSONObject reader = null; + JSONObject reader; try { reader = new JSONObject(contentsJson); } catch (JSONException e) { @@ -38,11 +38,11 @@ class ContentsJsonParser { if (level == 2) { listDataHeader.add(reader.names().getString(i)); - secondLevel = new ArrayList(); + secondLevel = new ArrayList<>(); } if (level == 3) { if (secondLevel == null) { - secondLevel = new ArrayList(); + secondLevel = new ArrayList<>(); } secondLevel.add(reader.names().getString(i)); listDataChild.put(listDataHeader.get(listDataHeader.size() - 1), secondLevel); @@ -60,12 +60,12 @@ class ContentsJsonParser { public ArrayList listDataHeader; public LinkedHashMap> listDataChild; - public ContentsContainer(LinkedHashMap map, ArrayList listDataHeader, - LinkedHashMap> listChildData) { + ContentsContainer(LinkedHashMap map, + ArrayList listDataHeader, + LinkedHashMap> listChildData) { this.map = map; this.listDataHeader = listDataHeader; this.listDataChild = listChildData; } - } }