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

False positive RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT using static imports and Junit 5 #1060

Open
kec2 opened this issue Jan 15, 2020 · 1 comment

Comments

@kec2
Copy link

kec2 commented Jan 15, 2020

False positive.

This yields no errors:

import org.junit.jupiter.api.Assertions;
@Test
public void testToCamelCase4() {
    Assertions.assertThrows(NullPointerException.class, () -> {
        NameUtils.toCamelCase(null, true);
    });
}

This does

import static org.junit.jupiter.api.Assertions.assertThrows;
@Test
public void testToCamelCase4() {
    assertThrows(NullPointerException.class, () -> {
        NameUtils.toCamelCase(null, true);
    });
}
@mikethecalamity
Copy link

This still seems to be an issue with Junit 5.9.2 and Spotbugs 4.7.3, but neither of the above cases work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants