Skip to content

Commit

Permalink
Folder close comment reviews
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos committed Apr 5, 2024
1 parent 0b21605 commit 0b0769b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 169 deletions.
13 changes: 7 additions & 6 deletions api/src/main/java/jakarta/mail/Folder.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@

public abstract class Folder implements AutoCloseable {

private final AtomicBoolean closed = new AtomicBoolean(false);
/**
* The parent store.
*/
Expand Down Expand Up @@ -652,12 +651,14 @@ public abstract boolean delete(boolean recurse)
*/
@Override
public void close() throws MessagingException {
if (!closed.getAndSet(true)) {
try {
close(true);
} finally {
q.terminateQueue();
try {
close(true);
} catch (IllegalStateException ise) {
if (isOpen()) {
throw ise;
}
} finally {
q.terminateQueue();
}
}

Expand Down
163 changes: 0 additions & 163 deletions api/src/test/java/jakarta/mail/FolderTest.java

This file was deleted.

0 comments on commit 0b0769b

Please sign in to comment.