boolean (@Nullable Pattern pattern, @Nullable String path) { if (pattern == null || path == null) { return false; } String[] parts = getParts(pattern); boolean result = false; if (parts.length == 0 || matchAllParts(parts, path)) { try { result = pattern.matcher(path).find(); } catch (StringIndexOutOfBoundsException ignored) { } } return result; }