Was digging around how the modified copy task and copy spec changes work 
together within the gradle code based and was wondering how to interpret this 
piece of code within CopySpecBackCopyActionProcessingStream.java.

This is part of an inner FileVisitor() anonymous class declaration.


                   private void visit(FileVisitDetails visitDetails) {
                        DefaultFileCopyDetails details = 
instantiator.newInstance(DefaultFileCopyDetails.class, visitDetails, spec, 
fileSystem);
                        for (Action<? super FileCopyDetails> action : 
spec.getAllCopyActions()) {
                            action.execute(details);
                            if (details.isExcluded()) {
                                return;
                            }
                        }
                        action.processFile(details);
                    }

Why would the details.isExcluded() test be done within the for loop?

Ignore that the action variable appears to be out of scope in this snippet, as 
there is a different variable outside the for loop that is also called action.

-Spencer

Reply via email to