diff --git a/pom.xml b/pom.xml index af6134b..2f0e77d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,36 +14,36 @@ 0.17 - 1.36 + 1.37 2.10.1 - 2.10.13 - 1.14.4 - 4.1.92.Final - 3.23.1 - 31.1-jre + 2.12.5 + 1.14.11 + 4.1.104.Final + 3.25.1 + 33.0.0-jre 4.4 - 11.0.0 + 11.1.0 1.7.36 1.2.12 - 5.8.2 - 3.23.1 + 5.10.1 + 3.25.1 - 2.5.8 - 2.3.7 + 2.5.11 + 2.3.10 1.5.1 - 2.2.8 - 0.0.16 + 2.2.14 + 0.0.19 0.0.1 - 2.2.3 - 9.3.10.0 + 2.2.4 + 9.4.5.0 ${project.basedir}/cfg/gems ${project.basedir}/cfg/fonts https://github.com/diguage/open-fonts/releases/download/latest 1.0.3 2.0.1 - 1.7.0 + 1.8.0 17 17 UTF-8 diff --git a/src/main/java/com/diguage/truman/StringTest.java b/src/main/java/com/diguage/truman/StringTest.java index 96db0b4..ff64e17 100644 --- a/src/main/java/com/diguage/truman/StringTest.java +++ b/src/main/java/com/diguage/truman/StringTest.java @@ -2,9 +2,9 @@ import org.junit.jupiter.api.Test; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.LockSupport; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -12,6 +12,23 @@ public class StringTest { + + @Test + public void testDedup() { + List lists = new ArrayList<>(1); + for (int i = 0; i < Integer.MAX_VALUE; i++) { + String is = String.valueOf(i); + String s1 = "D瓜哥 · https://www.digauge.com".repeat(i % 10) + is; + lists.add(new String(s1.substring(0, s1.length() - is.length()))); + String s2 = i + "D瓜哥 · https://www.digauge.com"; + lists.add(new String(s2.substring(is.length()))); + System.out.println(lists.size()); + if (i % 1000 == 0) { + LockSupport.parkNanos(TimeUnit.SECONDS.toNanos(2L)); + } + } + } + @Test public void testSplit() { String s = "abc"; @@ -36,6 +53,7 @@ public void testReplaceAll() { * 占位符正则表达式:${\w*} */ private static final Pattern PH_PATTERN = Pattern.compile("(\\u0024\\{\\w*\\})+"); + private static Set getAllPlaceholders(String value) { Matcher matcher = PH_PATTERN.matcher(value); Set placeholders = new HashSet<>();