gnodet commented on code in PR #1692:
URL: https://github.com/apache/maven-resolver/pull/1692#discussion_r2571708956


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTrackingFileManager.java:
##########
@@ -61,15 +62,14 @@ public Properties read(File file) {
     @Override
     public Properties read(Path path) {
         if (Files.isReadable(path)) {
-            synchronized (getMutex(path)) {
-                try {
-                    long fileSize = Files.size(path);
-                    try (FileChannel fileChannel = FileChannel.open(path, 
StandardOpenOption.READ);
-                            FileLock unused = fileLock(fileChannel, 
Math.max(1, fileSize), true)) {
-                        Properties props = new Properties();
-                        props.load(Channels.newInputStream(fileChannel));
-                        return props;
-                    }
+            synchronized (mutex(path)) {
+                try (FileChannel fileChannel = FileChannel.open(path, 
StandardOpenOption.READ);
+                        FileLock unused = fileLock(fileChannel, Math.max(1, 
fileChannel.size()), true)) {

Review Comment:
   And it forces to add a call to retrieve the file size...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to