dongjoon-hyun commented on code in PR #51476:
URL: https://github.com/apache/spark/pull/51476#discussion_r2209124834
##########
common/network-common/src/main/java/org/apache/spark/network/server/TransportServer.java:
##########
@@ -105,11 +104,13 @@ private void init(String hostToBind, int portToBind) {
EventLoopGroup workerGroup = NettyUtils.createEventLoop(ioMode,
conf.serverThreads(),
conf.getModuleName() + "-server");
+ String name = System.getProperty("os.name");
+ boolean isNotWindows = 7 > name.length() || !name.regionMatches(true, 0,
"Windows", 0, 7);
Review Comment:
It's originated from the previous `commons-lang3` code. Initially, I also
thought like you. However, after Liang-Chi commented, I realized that we need
it in the following case.
If `System.getProperty("os.name")` == `Win`, `7 > name.length()` will return
true here. It means `isNotWindows = true`. Otherwise, `isNotWindows` becomes
`false` for `Win`.
```
jshell> String name = "Win"
name ==> "Win"
jshell> !name.regionMatches(true, 0, "Windows", 0, 1)
$3 ==> false
```
--
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]