From 605159295d607a7d2749a65b22d8831a0d88d363 Mon Sep 17 00:00:00 2001 From: weishu Date: Mon, 9 Oct 2023 16:58:02 +0800 Subject: [PATCH] Convert to Kotlin to fix the packaging error --- src/main/kotlin/MaxSizeHashMap.kt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/MaxSizeHashMap.kt b/src/main/kotlin/MaxSizeHashMap.kt index c03704b..7548d72 100644 --- a/src/main/kotlin/MaxSizeHashMap.kt +++ b/src/main/kotlin/MaxSizeHashMap.kt @@ -1,19 +1,9 @@ -import java.util.LinkedHashMap; -import java.util.Map; - /** * @author weishu * @date 2023/10/9. */ -public class MaxSizeHashMap extends LinkedHashMap { - private final int maxSize; - - public MaxSizeHashMap(int maxSize) { - this.maxSize = maxSize; - } - - @Override - protected boolean removeEldestEntry(Map.Entry eldest) { - return size() > maxSize; +class MaxSizeHashMap(private val maxSize: Int) : LinkedHashMap() { + override fun removeEldestEntry(eldest: Map.Entry): Boolean { + return size > maxSize } }