mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
fix(v0.11): 第六轮走查——legacy 去除 System.out 演示入口与 Kafka 消费端日志
- AESUtils / RSAUtils / SM4Utils / CustomXssUtil / SnowFlakeSerialCode:删除仅用于本地演示的 main,消除生产源码中的 System.out。
- KafkaConsumer:移除 printStackTrace;异常改为 logger.error(msg, e);Class.newInstance 改为 getDeclaredConstructor().newInstance()。
对应 docs/reviews 05 工程卫生项;全量 maven-cloudwalk-legacy-public 已通过 compile。
Made-with: Cursor
Former-commit-id: 2d9fa1c9de
This commit is contained in:
-23
@@ -279,29 +279,6 @@ this.workId = workId;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
ArrayList<String> tmpMacList = new ArrayList<>();
|
||||
while (en.hasMoreElements()) {
|
||||
NetworkInterface iface = en.nextElement();
|
||||
List<InterfaceAddress> addrs = iface.getInterfaceAddresses();
|
||||
for (InterfaceAddress addr : addrs) {
|
||||
InetAddress ip = addr.getAddress();
|
||||
NetworkInterface network = NetworkInterface.getByInetAddress(ip);
|
||||
if (network == null)
|
||||
continue; byte[] mac = network.getHardwareAddress();
|
||||
if (mac == null)
|
||||
continue; sb.delete(0, sb.length());
|
||||
for (int i = 0; i < mac.length; ) { sb.append(String.format("%02X%s", new Object[] { Byte.valueOf(mac[i]), (i < mac.length - 1) ? "-" : "" })); i++; }
|
||||
tmpMacList.add(sb.toString());
|
||||
}
|
||||
} if (tmpMacList.size() <= 0) {
|
||||
System.out.println("mac地址列表为空");
|
||||
}
|
||||
for (String mac : tmpMacList)
|
||||
System.out.println(mac);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user