ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bodewig <...@git.apache.org>
Subject [GitHub] ant pull request #37: [1.9.x branch] BZ-60644 Fix file corruption during cop...
Date Thu, 28 Sep 2017 10:15:37 GMT
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/37#discussion_r141578555
  
    --- Diff: src/main/org/apache/tools/ant/util/ResourceUtils.java ---
    @@ -666,6 +666,14 @@ private static void copyWithFilterSets(final Resource source, final
Resource des
                                                final String outputEncoding,
                                                final Project project)
             throws IOException {
    +        if (source instanceof FileResource && dest instanceof FileResource) {
    --- End diff --
    
    I think it would be better to use `FileProvider` rather than `FileResource` here (and
in the next blocks). Actually I'd probably move the `instanceof` checks into `areSame` (and
replace them with `resource.as(FileProvider.class)` there. This allows for other resources
that know they are working on files and removes at least one line of duplicate code per `if`
block :-)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message