thomasmueller commented on code in PR #2129:
URL: https://github.com/apache/jackrabbit-oak/pull/2129#discussion_r1978989861


##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java:
##########
@@ -1091,7 +1098,7 @@ void retrieve(GarbageCollectableBlobStore blobStore,
             } finally {
                 if (idsIter instanceof Closeable) {
                     try {
-                        Closeables.close((Closeable) idsIter, false);
+                        ((Closeable)idsIter).close();

Review Comment:
   null check



##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java:
##########
@@ -380,7 +375,13 @@ protected void markAndSweep(boolean markOnly, boolean 
forceBlobRetrieve) throws
         } finally {
             statsCollector.updateDuration(sw.elapsed(TimeUnit.MILLISECONDS), 
TimeUnit.MILLISECONDS);
             if (!LOG.isTraceEnabled() && !traceOutput) {
-                Closeables.close(fs, threw);
+                try {
+                    fs.close();

Review Comment:
   What if "fs" is null?



##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/DataStoreBlobStore.java:
##########
@@ -341,9 +340,15 @@ public String writeBlob(InputStream stream, BlobOptions 
options) throws IOExcept
             stats.uploadFailed();
             throw new IOException(e);
         } finally {
-            //DataStore does not closes the stream internally
+            //DataStore does not close the stream internally
             //So close the stream explicitly
-            Closeables.close(stream, threw);
+            try {
+                stream.close();

Review Comment:
   null check



##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java:
##########
@@ -769,7 +770,13 @@ public long checkConsistency(boolean markOnly) throws 
Exception {
             }
         } finally {
             if (!traceOutput && (!LOG.isTraceEnabled() && candidates == 0)) {
-                Closeables.close(fs, threw);
+                try {
+                    fs.close();

Review Comment:
   What if "fs" is null?



##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/AbstractSharedCachingDataStore.java:
##########
@@ -335,7 +334,7 @@ public InputStream getStream() throws DataStoreException {
                         copyInputStreamToFile(in, tmpFile);
                         return new LazyFileInputStream(tmpFile);
                     } finally {
-                        Closeables.close(in, false);
+                        in.close();

Review Comment:
   What if "in" is null?



-- 
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: oak-dev-unsubscr...@jackrabbit.apache.org

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

Reply via email to