RFR: 8290047: (fs) FileSystem.getPathMatcher does not check for ":" at last index [v3]

Alan Bateman alanb at openjdk.org
Tue Aug 2 11:58:06 UTC 2022


On Mon, 1 Aug 2022 19:59:33 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> The existing code downstream of the check handles an empty glob or regex pattern as matching the empty string.
> If I read it correctly, it will now throw an exception instead of not matching. It might be safer to not change that behavior.

I'm 99% sure the original intention was for the empty pattern to be rejected with IAE. It was an implementation but that it checked if the index is length rather than length-1. That was JDK 7 and changing is now without be behavior change. I can't imagine the impact would be significant but I agree it's not worth it and maybe we just drop the check as per the JBS issue and update the spec to document the long standing behavior.

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

PR: https://git.openjdk.org/jdk/pull/9595


More information about the nio-dev mailing list