Hi, thanks, Claes for chiming in and explaining. I also went through the code and concur - behavior should not have changed and code is cleaned up nicely.
So I think this backport has received enough reviewer attention. Will push it then as regression tests seem all good, too. 😊 Thanks to all involved, Christoph > -----Original Message----- > From: Claes Redestad <[email protected]> > Sent: Montag, 24. Juni 2019 10:24 > To: Thomas Stüfe <[email protected]>; Langer, Christoph > <[email protected]> > Cc: Java Core Libs <[email protected]>; jdk-updates- > [email protected]; Baesken, Matthias <[email protected]> > Subject: Re: [11u]: RFR: 8215281: Use String.isEmpty() when applicable in > java.base > > Hi, > > > On 2019-06-24 09:27, Thomas Stüfe wrote: > > However, your patch (and the original one) contained the following part I > > do not understand: > > > > > http://cr.openjdk.java.net/~clanger/webrevs/8215281.11u/src/java.base/wi > ndows/classes/sun/nio/ch/FileDispatcherImpl.java.udiff.html > > > > static boolean isFastFileTransferRequested() { > > String fileTransferProp = GetPropertyAction > > - .privilegedGetProperty("jdk.nio.enableFastFileTransfer"); > > - boolean enable; > > - if ("".equals(fileTransferProp)) { > > - enable = true; > > - } else { > > - enable = Boolean.parseBoolean(fileTransferProp); > > - } > > - return enable; > > + .privilegedGetProperty("jdk.nio.enableFastFileTransfer", > > "false"); > > + return fileTransferProp.isEmpty() ? true : > > Boolean.parseBoolean(fileTransferProp); > > } > > > > The old version called GetPropertyAction::privilegedGetProperty() without > > default value. The new versions passes "false" as default value. I fail to > > see how this could ever return an empty string? Also, would that not > change > > default behavior? > > Behavior before and after should be the same. > > Both System.getProperty("jdk.nio.enableFastFileTransfer") and > System.getProperty("jdk.nio.enableFastFileTransfer", "false") will > return "" in case -Djdk.nio.enableFastFileTransfer is specified. The > default "false" only changes so that we don't have to deal with > fileTransferProp being null, which I thought made for a nice little > cleanup. > > /Claes
