dsmiley commented on code in PR #3185:
URL: https://github.com/apache/solr/pull/3185#discussion_r1958467972


##########
solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java:
##########
@@ -391,25 +393,22 @@ public boolean exists(String path) throws IOException {
   public final Directory get(String path, DirContext dirContext, String 
rawLockType)
       throws IOException {
     String fullPath = normalize(path);
+    Directory directory;
+    CacheValue cacheValue;
     synchronized (this) {
       if (closed) {
         throw new AlreadyClosedException("Already closed");
       }
 
-      final CacheValue cacheValue = byPathCache.get(fullPath);
-      Directory directory = null;
-      if (cacheValue != null) {
-        directory = cacheValue.directory;
-      }
-
-      if (directory == null) {
+      cacheValue = byPathCache.get(fullPath);
+      if (cacheValue == null) {
         directory = create(fullPath, createLockFactory(rawLockType), 
dirContext);

Review Comment:
   In a separate issue/PR, the `create` method should not contain the 
dirContext leaving a TODO now.  Or if you wish, make that change here; it's 
rather internal.



-- 
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...@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to