RFR: 8285452: Support new API to replace a file content using FileUtils.java [v3]
Roger Riggs
rriggs at openjdk.java.net
Tue Apr 26 16:57:53 UTC 2022
On Fri, 22 Apr 2022 14:35:14 GMT, Sibabrata Sahoo <ssahoo at openjdk.org> wrote:
>> A new API to support replacing selective lines with desired content.
>
> Sibabrata Sahoo has updated the pull request incrementally with one additional commit since the last revision:
>
> Update FileUtils.java
Can you elaborate on the use case, what tests would it be used in?
The hardcoded `from` and `to` seem very rigid and require knowledge of the exact format.
That might lead to very fragile tests.
Is this equivalent to looking for a substring aka `String.contains(xxx)` of the input file to replace (with line ending normalization)?
-------------
PR: https://git.openjdk.java.net/jdk/pull/8360
More information about the core-libs-dev
mailing list