From 945daa063c34b972b075860414a395ddfb560576 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Sun, 12 Apr 2020 00:50:09 +0200 Subject: [PATCH] Remove unused functions that cause warnings. --- src/com/hughes/util/MapUtil.java | 29 ----------------------------- 1 file changed, 29 deletions(-) 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); } - - } -- 2.43.0