RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor

Alexey Ivanov aivanov at openjdk.org
Tue Dec 3 15:56:41 UTC 2024


On Fri, 1 Nov 2024 13:08:54 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> `Properties` doesn't allow `null` values.
> We can replace containsKey+getProperty with getProperty+null check.
> It's clearer and a bit faster.

src/java.desktop/share/classes/java/awt/Cursor.java line 303:

> 301:             String key    = prefix + DOT_FILE_SUFFIX;
> 302: 
> 303:             String fileName = systemCustomCursorProperties.getProperty(key);

You can keep the `final` modifier, probably.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21824#discussion_r1867982490


More information about the client-libs-dev mailing list