walterlife commented on code in PR #2555:
URL:
https://github.com/apache/incubator-eventmesh/pull/2555#discussion_r1045209299
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/IPUtils.java:
##########
@@ -57,22 +58,17 @@ public static String getLocalAddress() {
//priority of networkInterface when generating client ip
String priority = System.getProperty("networkInterface.priority",
"eth0<eth1<bond1");
- ArrayList<String> preferList = new ArrayList<String>();
- for (String eth : priority.split("<")) {
- preferList.add(eth);
- }
+ ArrayList<String> preferList = new
ArrayList<>(Arrays.asList(priority.split("<")));
Review Comment:
It is recommended to split it into two lines. The responsibilities of each
line will be clearer.
ArrayList<String> preferList = new ArrayList<String>();
preferList.addAll(Arrays.asList(priority.split("<"));
@weihubeats
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]