jinmeiliao commented on a change in pull request #5680:
URL: https://github.com/apache/geode/pull/5680#discussion_r521683541



##########
File path: 
geode-common/src/main/java/org/apache/geode/internal/inet/LocalHostUtil.java
##########
@@ -54,70 +59,80 @@
   private static final boolean useLinkLocalAddresses =
       Boolean.getBoolean(USE_LINK_LOCAL_ADDRESSES_PROPERTY);
 
-  /**
-   * we cache localHost to avoid bug #40619, access-violation in native code
-   */
-  private static final InetAddress localHost;
-
   /**
    * all classes should use this variable to determine whether to use IPv4 or 
IPv6 addresses
    */
   @MakeNotStatic
   private static boolean useIPv6Addresses = 
!Boolean.getBoolean("java.net.preferIPv4Stack")
       && Boolean.getBoolean("java.net.preferIPv6Addresses");
 
-  static {
-    InetAddress inetAddress = null;
+  /**
+   * Resolves local host. Will retry if resolution fails.
+   *
+   * @return local host if resolved otherwise null.
+   */
+  private static InetAddress resolveLocalHost() {

Review comment:
       that method has to be a static method and we have to use powermock to 
mock a static method. We are trying to steer away from using power mock as far 
as I understand.
   
   There are tests for Retry.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to