diff --git a/src/main/java/net/revelc/code/formatter/FormatterMojo.java b/src/main/java/net/revelc/code/formatter/FormatterMojo.java index 1c948a00..bac9bdb9 100644 --- a/src/main/java/net/revelc/code/formatter/FormatterMojo.java +++ b/src/main/java/net/revelc/code/formatter/FormatterMojo.java @@ -608,7 +608,7 @@ private void storeFileHashCache(final Properties props) { try (var sw = new StringWriter()) { props.store(sw, null); getLog().debug("Writing sorted files to cache without timestamp:\n\n" + props); - Files.write(cacheFile, (Iterable) sw.toString().lines().skip(1).sorted()::iterator, + Files.write(cacheFile, (Iterable) sw.toString().lines().skip(1).sorted().toList(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } catch (final IOException e) { this.getLog().warn("Cannot store file hash cache properties file", e);