What is the smallest, simplest way to reproduce the problem?
public class CloseableHttpEntityTest {
@Mock
private HttpEntity httpEntity;
@Test
public void testCloseOnNullDoNotThrow() throws IOException {
final CloseableHttpEntity closeableHttpEntity = new CloseableHttpEntity(null);
closeableHttpEntity.close();
}
}
@RequiredArgsConstructor
public class CloseableHttpEntity implements Closeable {
@Nullable
private final HttpEntity httpEntity;
@Override
public void close() throws IOException {
EntityUtils.consume(this.httpEntity);
}
}
What did you expect to see?
@Test
public void testCloseOnNullDoNotThrow() throws IOException {
final CloseableHttpEntity closeableHttpEntity = new CloseableHttpEntity(null);
closeableHttpEntity.close();
}
What did you see instead?
@Test
public void testCloseOnNullDoNotThrow() {
final CloseableHttpEntity closeableHttpEntity = new CloseableHttpEntity(null);
closeableHttpEntity.close();
}
What is the full stack trace of any errors you encountered?
/workplace/mnr/InsistorRedux/src/JavelinRenderingService/tst/com/amazon/javelinrenderingservice/aax/model/CloseableHttpEntityTest.java:46: error: unreported exception IOException; must be caught or declared to be thrown
closeableHttpEntity.close()
Are you interested in [contributing a fix to OpenRewrite]
What version of OpenRewrite are you using?
I am using 6.6.3
How are you running OpenRewrite?
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
What did you see instead?
What is the full stack trace of any errors you encountered?
Are you interested in [contributing a fix to OpenRewrite]
Yes