mbien commented on code in PR #5279:
URL: https://github.com/apache/netbeans/pull/5279#discussion_r1067766660
##########
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:
##########
@@ -683,7 +683,7 @@ private abstract static class Match {
}
final boolean apply(final FileObject fo) {
- if (name.equals(fo.getNameExt())) {
+ if (fo.getNameExt().equals(name)) {
Review Comment:
good that getNameExt() returns empty Strings. This makes it better than the
JDK 20 proposal of the Path API which was luckily dropped last minute because
of it returning null:
https://bugs.openjdk.org/browse/JDK-8297814
I already had a [code
inspection](https://github.com/mbien/jackpot-inspections/commit/89c3f68840351b745d16f9cc4a0b4191e6afe1d6)
for that ready expecting it to be a common bug.
new version is the PR 11545 which might make it into JDK 21 following the
same null safe logic
good choice back then @jtulach!
--
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]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists