Skip to content

Commit a440384

Browse files
committed
Small optimization checking the file length
1 parent d41dd81 commit a440384

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/CachingOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public CachingOutputStream( Path path )
4949
public void close() throws IOException
5050
{
5151
byte[] data = toByteArray();
52-
if ( Files.exists( path ) )
52+
if ( Files.exists( path ) && Files.size( path ) == data.length )
5353
{
5454
byte[] old = Files.readAllBytes( path );
5555
if ( Arrays.equals( old, data ) )

0 commit comments

Comments
 (0)