22
22
import java .io .File ;
23
23
import java .io .IOException ;
24
24
import java .util .Map ;
25
- import java .util .Map .Entry ;
26
25
27
26
import org .apache .maven .plugin .MojoExecutionException ;
28
27
import org .apache .maven .plugin .MojoFailureException ;
@@ -63,11 +62,11 @@ protected void execute(UpToDatePropertySetting config) throws MojoExecutionExcep
63
62
// Treat a file set that yields no files as intrinsically out of date.
64
63
upToDate = !includedFiles .isEmpty ();
65
64
66
- for ( Entry < String , String > entry : includedFiles .entrySet ()) {
65
+ upToDate &= includedFiles .entrySet (). parallelStream (). allMatch ( entry -> {
67
66
// If targetFile is out of date WRT srcFile, note the fact and stop processing.
68
67
File srcFile = getFile (fileSet , false , entry .getKey ());
69
68
File targetFile = getFile (fileSet , true , entry .getValue ());
70
- upToDate = isUpToDate (srcFile , targetFile );
69
+ boolean isUpToDate = isUpToDate (srcFile , targetFile );
71
70
72
71
if (getLog ().isDebugEnabled ()) {
73
72
try {
@@ -76,7 +75,7 @@ protected void execute(UpToDatePropertySetting config) throws MojoExecutionExcep
76
75
msg .append (" (nonexistent)" );
77
76
}
78
77
msg .append ("\n \t is " )
79
- .append (upToDate ? "up to date" : "out of date" )
78
+ .append (isUpToDate ? "up to date" : "out of date" )
80
79
.append (" with respect to \n \t " )
81
80
.append (srcFile .getCanonicalPath ());
82
81
if (!srcFile .exists ()) {
@@ -89,10 +88,8 @@ protected void execute(UpToDatePropertySetting config) throws MojoExecutionExcep
89
88
}
90
89
}
91
90
92
- if (!upToDate ) {
93
- break ;
94
- }
95
- }
91
+ return isUpToDate ;
92
+ });
96
93
} catch (MapperException e ) {
97
94
throw new MojoExecutionException ("" , e );
98
95
}
0 commit comments