[OpenJDK 2D-Dev] RFR: 8252999: Cleanup: replace .equals("") with .isEmpty() within all codebase

Alan Bateman alanb at openjdk.java.net
Thu Sep 10 10:42:57 UTC 2020

On Thu, 10 Sep 2020 08:47:35 GMT, Dmitriy Dumanskiy <github.com+1536494+doom369 at openjdk.org> wrote:

>> Before this Enhancement can be formally reviewed, you will need a JBS bug ID. If you are already working with a
>> Committer or Reviewer in the `jdk` project who has agreed to sponsor your change, they can file the Enhancement
>> request. Otherwise, you can file it using the web interface at [bugreport.java.com](https://bugreport.java.com/). Once
>> you have a JBS bug ID, you need to edit the PR title to include that bug ID (without the `JDK-`) replacing
>> "Improvement".   Since this PR cuts across many functional areas (each gray label represents a functional area), you
>> should expect a longer review process, since someone from each functional area will need to look at the changes in
>> their area (like @mrserb started to do for the `2d` area).
> @kevinrushforth thanks. Done.
> Similar issues:
> https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8215014
> https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8251246
> https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8223237
> could be joined somehow?

The code in java.base was updated to use String::isEmpty in JDK 12 (JDK-8215281). There was follow-up in JDK 13 to do
the same in the java.desktop module (JDK-8223237). Changing the remaining usages make sense although I see that more
more than half are in tests.

It would be good to hear from security-dev on the changes to the Apache Santuario code (in java.xml.crypto module) in
case it would be better to contribute those upstream instead. Ditto for the Apache Xalan code (in the java.xml module)
but it may be significantly forked already that it doesn't matter.

I assume you can use JDK-8215014 rather than creating a new issue.


PR: https://git.openjdk.java.net/jdk/pull/29

More information about the 2d-dev mailing list