Skip to content

Commit 5708634

Browse files
committed
#2 Remove space from prefix.
1 parent c312c98 commit 5708634

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/main/java/com/pangdata/apps/redis/ServerStateGetter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void run() {
7676
throw new IllegalArgumentException("'redis.[index].prefix' must not be null");
7777
}
7878

79-
prefix = prefix.trim();
79+
prefix = prefix.trim().replaceAll("\\s+","");
8080
Thread.currentThread().setName(prefix);
8181

8282
host = redis.get("host");
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.pangdata.apps.redis;
2+
3+
import org.junit.Assert;
4+
import org.junit.Test;
5+
6+
public class UtilTests {
7+
8+
@Test
9+
public void spaceTest() {
10+
String s = "a b c";
11+
s = s.replaceAll("\\s", "");
12+
Assert.assertTrue(s.equals("abc"));
13+
System.out.println(s);
14+
}
15+
16+
}

0 commit comments

Comments
 (0)