Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Allow registering closeables if already closed (#7407)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsamuel-bs authored Oct 28, 2024
1 parent aca8719 commit a5fbe0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.palantir.atlasdb.transaction.impl;

import com.google.common.io.Closer;
import com.palantir.logsafe.exceptions.SafeIllegalStateException;
import com.palantir.logsafe.logger.SafeLogger;
import com.palantir.logsafe.logger.SafeLoggerFactory;
import java.io.Closeable;
Expand All @@ -38,7 +37,7 @@ public synchronized <C extends Closeable> C register(C closeable) {
} catch (IOException e) {
throw new RuntimeException(e);
}
throw new SafeIllegalStateException("cannot register new closeable if already closed");
// throw new SafeIllegalStateException("cannot register new closeable if already closed");
}
return closer.register(closeable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.palantir.logsafe.exceptions.SafeIllegalStateException;
import java.io.Closeable;
import java.io.IOException;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

Expand All @@ -37,6 +38,7 @@ void closes_onClose() throws IOException {
}

@Test
@Disabled
void throws_ifAlreadyClosed() throws IOException {
closer.close();
Closeable closeable = Mockito.mock(Closeable.class);
Expand Down

0 comments on commit a5fbe0f

Please sign in to comment.