Skip to content

Commit 03c8697

Browse files
committed
clean project.
1 parent d5c01d7 commit 03c8697

4 files changed

Lines changed: 12 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ TCC忽略不说。LCN与TXC两种框架实现的事务模式到底那个更优
3232
3. txlcn-logger:*日志模块。(默认提供日志持久化到MySQL的支持)*
3333
4. txlcn-tm:*TXLCN事务管理器*
3434
5. txlcn-txmsg:*事务消息扩展接口*
35-
6. txlcn-txmsg-netty:*Netty的事务消息接口实现*
35+
6. txlcn-txmsg-netty:*事务消息接口的Netty实现*
3636
7. txlcn-tracing:*分布式事务追踪工具*
3737

3838
## 官网文档

txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Maps.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,27 @@ public static <K, V> Map<K, V> newHashMap(K key1, V value1, K key2, V value2, K
5252
return map;
5353
}
5454

55-
public static <K, V> Map<K, V> newImmutableMap(K key1, V value1) {
55+
public static <K, V> Map<K, V> of(K key1, V value1) {
5656
ImmutableMap<K, V> map = new ImmutableMap<>();
5757
map.put(key1, value1);
5858
return map;
5959
}
6060

61-
public static <K, V> Map<K, V> newImmutableMap(K key1, V value1, K key2, V value2) {
61+
public static <K, V> Map<K, V> of(K key1, V value1, K key2, V value2) {
6262
ImmutableMap<K, V> map = new ImmutableMap<>();
6363
map.put(key1, value1);
6464
map.put(key2, value2);
6565
return map;
6666
}
6767

68-
public static <K, V> Map<K, V> newImmutableMap(K key1, V value1, K key2, V value2, K key3, V value3) {
69-
Map<K, V> map = newImmutableMap(key1, value1, key2, value2);
68+
public static <K, V> Map<K, V> of(K key1, V value1, K key2, V value2, K key3, V value3) {
69+
Map<K, V> map = of(key1, value1, key2, value2);
7070
map.put(key3, value3);
7171
return map;
7272
}
7373

74-
public static <K, V> Map<K, V> newImmutableMap(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) {
75-
Map<K, V> map = newImmutableMap(key1, value1, key2, value2, key3, value3);
74+
public static <K, V> Map<K, V> of(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) {
75+
Map<K, V> map = of(key1, value1, key2, value2, key3, value3);
7676
map.put(key3, value4);
7777
return map;
7878
}
@@ -173,6 +173,7 @@ public V put(K k, V v) {
173173
}
174174

175175
@Override
176+
@SuppressWarnings("unchecked")
176177
public V remove(Object o) {
177178
if (containsKey(o)) {
178179
int index = keyIndex((K) o);

txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Strings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.codingapi.txlcn.common.util;
22

3-
import java.nio.charset.StandardCharsets;
43
import java.util.Map;
54
import java.util.Optional;
65

@@ -57,6 +56,6 @@ public static String format(String input, Map<String, Object> params, Object...
5756

5857
public static void main(String[] args) {
5958
String s1 = "hello, {}. {} is in {}";
60-
System.out.println(format(s1, Maps.newImmutableMap("who", "ujued"), "world", "jinan"));
59+
System.out.println(format(s1, Maps.of("who", "ujued"), "world", "jinan"));
6160
}
6261
}

txlcn-logger/src/main/java/com/codingapi/txlcn/logger/helper/MysqlLoggerHelper.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ public int insert(TxLog txLoggerInfo) {
7777
if (logDbProperties.isEnabled()) {
7878
String sql = "insert into t_logger(group_id,unit_id,tag,content,create_time,app_name) values(?,?,?,?,?,?)";
7979
return dbHelper.update(sql, txLoggerInfo.getGroupId(), txLoggerInfo.getUnitId(), txLoggerInfo.getTag(),
80-
Strings.format(
81-
txLoggerInfo.getContent(), Maps.newImmutableMap(
82-
"xid", txLoggerInfo.getGroupId(), "uid", txLoggerInfo.getUnitId()),
83-
txLoggerInfo.getArgs()), txLoggerInfo.getCreateTime(), txLoggerInfo.getAppName());
80+
Strings.format(txLoggerInfo.getContent(), Maps.of("xid", txLoggerInfo.getGroupId(),
81+
"uid", txLoggerInfo.getUnitId()), txLoggerInfo.getArgs()),
82+
txLoggerInfo.getCreateTime(), txLoggerInfo.getAppName());
8483
} else {
8584
throw new NotEnableLogException("not enable logger");
8685
}

0 commit comments

Comments
 (0)