Rainer pointed out to me the class JrePlatform [1], which has a helper field called IS_WINDOWS.

I think that it would make sense to add a constant field OS_NAME, as well as IS_LINUX and IS_MACOS, and use these fields instead of calling System.getProperty("os.name") in multiple places - some examples [2] [3] [4].

If there is no objection, I can go ahead and refactor that.

Best,

Igal

[1] https://github.com/apache/tomcat/blob/trunk/java/org/apache/tomcat/util/compat/JrePlatform.java

[2] https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/util/ServerInfo.java#L113

[3] https://github.com/apache/tomcat/blob/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java#L56

[4] https://github.com/apache/tomcat/blob/trunk/test/org/apache/tomcat/util/net/TesterSupport.java#L196


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to