RFR: 8346722: (fs) Files.probeContentType throws ClassCastException with custom file system provider [v2]

Brian Burkhalter bpb at openjdk.org
Fri Jan 10 16:32:43 UTC 2025


On Fri, 10 Jan 2025 16:08:54 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> test/jdk/java/nio/file/spi/testapp/testapp/Main.java line 65:
>> 
>>> 63:         String fileType = Files.probeContentType(Path.of("."));
>>> 64:         if (fileType != null)
>>> 65:             throw new RuntimeException("File type non-null: " + fileType);
>> 
>> Calling Files.probeContentType is enough to exercise the code, I would be worried that it returns something based on the name of the directory, is that possible?
>
>> I would be worried that it returns something based on the name of the directory, is that possible?
> 
> I doubt it, but it might be prudent to ignore the returned value to avert future noise.

Returned value ignored in 1be6091.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23019#discussion_r1910626328


More information about the nio-dev mailing list