From: Reimar Döffinger Date: Sat, 11 Apr 2020 22:50:09 +0000 (+0200) Subject: Remove unused functions that cause warnings. X-Git-Url: http://gitweb.fperrin.net/?p=DictionaryPC.git;a=commitdiff_plain;h=945daa063c34b972b075860414a395ddfb560576 Remove unused functions that cause warnings. --- diff --git a/src/com/hughes/util/MapUtil.java b/src/com/hughes/util/MapUtil.java index a62a86e..0976288 100644 --- a/src/com/hughes/util/MapUtil.java +++ b/src/com/hughes/util/MapUtil.java @@ -16,40 +16,11 @@ package com.hughes.util; import java.util.Map; -@SuppressWarnings({"WeakerAccess", "unused"}) public class MapUtil { - - public static V safeGet(final Map map, K key, V defaultValue) { - if (!map.containsKey(key)) { - return defaultValue; - } - return map.get(key); - } - - public static V safeGetOrPut(final Map map, K key, V defaultValue) { - if (!map.containsKey(key)) { - map.put(key, defaultValue); - } - return map.get(key); - } - - public static V safeGet(final Map map, K key, Class valueClass) { - if (!map.containsKey(key)) { - try { - map.put(key, valueClass.newInstance()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - return map.get(key); - } - public static V safeRemove(final Map map, K key, V defaultValue) { if (!map.containsKey(key)) { return defaultValue; } return map.remove(key); } - - }