RFR 8214971 : Replace use of string.equals("") with isEmpty()
Roger.Riggs at oracle.com
Fri Dec 7 14:36:39 UTC 2018
I'd take that up as a separate issue. 
A nice thing about the current patch is that the change is uniform and
easier to review.
It would also be good to look at a utility method that efficiently does
the combined check.
 8215014 <https://bugs.openjdk.java.net/browse/JDK-8215014>
On 12/07/2018 04:24 AM, Hannes Wallnöfer wrote:
> Hi Roger,
> There are quite a few occurrences of the reverse calling pattern "".equals(str) in core libs.
> This is a bit more tricky because it allows str to be null, but when used following a null/not-null check it could be replaced with isEmpty() as well.
> I wonder if these should be included in the patch?
>> Am 06.12.2018 um 21:04 schrieb Roger Riggs <Roger.Riggs at oracle.com>:
>> Please review changing string.equals("") to string.isEmpty().
>> isEmpty is preferred, performs better and is easier to optimize.
>> The change is a literal substitution in all files and only in these modules:
>> Thanks, Roger
More information about the core-libs-dev