[ 
https://issues.apache.org/jira/browse/OAK-11571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17935496#comment-17935496
 ] 

Manfred Baedke commented on OAK-11571:
--------------------------------------

This fails:
 
{code:java}
@Test
public void compareClosers() {
  com.google.common.io.Closer guavaCloser = 
com.google.common.io.Closer.create();
  org.apache.jackrabbit.oak.commons.pio.Closer oakCloser = 
org.apache.jackrabbit.oak.commons.pio.Closer.create();
  Exception oakException = null;
  Exception guavaException = null;
  try {
    oakCloser.register(() -> {});
    throw oakCloser.rethrow(new InterruptedException());
  } catch (Exception e) {}
  try {
    guavaCloser.register(() -> {});
    throw guavaCloser.rethrow(new InterruptedException());
  } catch (Exception e) {}
  try {
    oakCloser.close();
  } catch (Exception e) {
    oakException = e;
  }
  try {
    guavaCloser.close();
  } catch (Exception e) {
    guavaException = e;
  }
  assertTrue(guavaException == null);
  //will fail because oakException is an instance of RuntimeException
  assertTrue(oakException == null);
}{code}

> commons: add Closer class (similar to Guava Closer)
> ---------------------------------------------------
>
>                 Key: OAK-11571
>                 URL: https://issues.apache.org/jira/browse/OAK-11571
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>          Components: commons
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>
> ... but not to o.a.j.o.commons.io - because I'm reluctant to put things like 
> this into a public package.
> Maybe "pio" for "private io"?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to