Skip to content

Commit

Permalink
#2 Remove space from prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
iprever committed Apr 13, 2017
1 parent c312c98 commit 5708634
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void run() {
throw new IllegalArgumentException("'redis.[index].prefix' must not be null");
}

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

host = redis.get("host");
Expand Down
16 changes: 16 additions & 0 deletions src/test/java/com/pangdata/apps/redis/UtilTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.pangdata.apps.redis;

import org.junit.Assert;
import org.junit.Test;

public class UtilTests {

@Test
public void spaceTest() {
String s = "a b c";
s = s.replaceAll("\\s", "");
Assert.assertTrue(s.equals("abc"));
System.out.println(s);
}

}

0 comments on commit 5708634

Please sign in to comment.