Pil0tXia commented on code in PR #4655:
URL: https://github.com/apache/eventmesh/pull/4655#discussion_r1439346871
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/IPUtils.java:
##########
@@ -59,14 +59,19 @@ public static String getLocalAddress() {
List<String> list = Arrays.asList(priority.split("<"));
ArrayList<String> preferList = new ArrayList<>(list);
NetworkInterface preferNetworkInterface = null;
+ boolean matchName = false;
try {
Enumeration<NetworkInterface> enumeration1 =
NetworkInterface.getNetworkInterfaces();
while (enumeration1.hasMoreElements()) {
final NetworkInterface networkInterface =
enumeration1.nextElement();
+ String name = networkInterface.getName();
+ if (preferList.contains(name)) {
+ matchName = true;
+ }
Review Comment:
Please rename `matchName` to `isInterfacePreferred` and `name` to
`interfaceName` for better understanding.
--
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]