RFR: 8266019: StreamResult(File) writes to incorrect file path if # is part of the file path
Joe Wang
joehw at openjdk.java.net
Wed Jun 2 20:51:43 UTC 2021
On Wed, 2 Jun 2021 18:17:43 GMT, Joe Wang <joehw at openjdk.org> wrote:
> Special characters are different in File and URI. Treat File input as File using FileInputStream instead of converting to an URI, but fall back to URI in case of error for compatibility (in error handling).
Thanks Daniel!
For the question, it will not be dead code as it accepts systemId in String form as well. But as least when File is the input, we don't end up going through a convoluted (if not unnecessary) File -URI -URL - File conversion. I think the later has sth. to do with the fact that Apache still supports older JDKs. While we agree not to touch that code for this fix (and also for not changing the mechanisms, e.g. how errors are handled), we'll keep an eye out on it.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4318
More information about the core-libs-dev
mailing list