cstamas commented on a change in pull request #164:
URL: https://github.com/apache/maven-indexer/pull/164#discussion_r797333856



##########
File path: 
indexer-core/src/main/java/org/apache/maven/index/updater/DefaultIndexUpdater.java
##########
@@ -190,9 +191,7 @@ private Date loadIndexDirectory( final IndexUpdateRequest 
updateRequest, final R
         {
             updateRequest.getIndexTempDir().mkdirs();
         }
-        File indexDir = File.createTempFile( remoteIndexFile, ".dir" , 
updateRequest.getIndexTempDir() );
-        indexDir.delete();
-        indexDir.mkdirs();
+        File indexDir = Files.createTempDirectory( 
updateRequest.getIndexTempDir().toPath(), remoteIndexFile ).toFile();

Review comment:
       updateRequest.getIndexTempDir() is nullable, above is nullcheck 
performed. Better make `File indexDir` above IF and then update it in IF (add 
ELSE as well).




-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to