pan3793 commented on PR #231:
URL: https://github.com/apache/ranger/pull/231#issuecomment-1632042270

   @mneethiraj @kumaab could you guys give some background on why should use 
`gethostname4j`?
   
   Based on 
https://stackoverflow.com/questions/7348711/recommended-way-to-get-hostname-in-java
   
   I suppose it could be replaced with 
`org.apache.commons.lang3.SystemUtils#getHostName`
   
   ```
      /**
        * Gets the host name from an environment variable
        * (COMPUTERNAME on Windows, HOSTNAME elsewhere).
        *
        * <p>
        * If you want to know what the network stack says is the host name, you 
should use {@code InetAddress.getLocalHost().getHostName()}.
        * </p>
        *
        * @return the host name. Will be {@code null} if the environment 
variable is not defined.
        * @since 3.6
        */
       public static String getHostName() {
           return IS_OS_WINDOWS ? System.getenv("COMPUTERNAME") : 
System.getenv("HOSTNAME");
       }
   ```


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

Reply via email to