Skip to content
New issue

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

ThrowingExceptionsWithoutMessageOrCause false positive #1065

Closed
vanniktech opened this issue Aug 27, 2018 · 1 comment
Closed

ThrowingExceptionsWithoutMessageOrCause false positive #1065

vanniktech opened this issue Aug 27, 2018 · 1 comment
Milestone

Comments

@vanniktech
Copy link
Contributor

The following code get's flagged with a ThrowingExceptionsWithoutMessageOrCause:

@Test fun fragmentListenerContextToType() {
  `when`(fragment.context).thenReturn(preBookingActivity)
  assertThat(fragment.listener<PreBookingActivity>()).isEqualTo(preBookingActivity)
  assertThatIllegalStateException().isThrownBy { fragment.listener<MoovelBookSdk>() }
}

The line that is referred to is assertThatIllegalStateException() which is a function from assertj import org.assertj.core.api.Assertions.assertThatIllegalStateException. I'm assuming it uses some mechanism that does not detect that this is a method call.

@arturbosch arturbosch added this to the RC9 milestone Sep 10, 2018
DSamaryan pushed a commit to DSamaryan/detekt that referenced this issue Oct 18, 2018
@lock
Copy link

lock bot commented Jun 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants