We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If the variable's close method throws an exception, it is likely to cause the compilation to fail
the code like:
private void testCleanupCompileError() { @Cleanup BufferedInputStream inputStream = new BufferedInputStream(new ByteArrayInputStream("test".getBytes())); }
and then use mvn install, unable to complete compilation and throw exception java.io.IOException
mvn install
java.io.IOException
Code generated by normal compilation with @Cleanup
@Cleanup
private void testCleanupCompileError() { BufferedInputStream inputStream = new BufferedInputStream(new ByteArrayInputStream("test".getBytes())); if (Collections.singletonList(inputStream).get(0) != null) { inputStream.close(); } }
but the java.io.BufferedInputStream#close will throws IOException,however use @Cleanup he exception is not caught or thrown
java.io.BufferedInputStream#close
I don't know if it's a lombok design, that's it or bug. may hope the exception can be caught automatically.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
If the variable's close method throws an exception, it is likely to cause the compilation to fail
To Reproduce
the code like:
and then use
mvn install
, unable to complete compilation and throw exceptionjava.io.IOException
Reason here
Code generated by normal compilation with
@Cleanup
but the
java.io.BufferedInputStream#close
will throws IOException,however use@Cleanup
he exception is not caught or thrownExpected behavior
I don't know if it's a lombok design, that's it or bug. may hope the exception can be caught automatically.
Version info
The text was updated successfully, but these errors were encountered: