Catching InterruptedException using the pipe syntax

7 views
Skip to first unread message

Even Lislebø

unread,
May 23, 2018, 10:11:58 AM5/23/18
to SonarLint
Hi,

When catching an InterruptedException using the pipe syntax it's not reported:

void whatever() {
 
try {
    somethingThatThrowsAnInterruptedException
();
 
catch (InterruptedException | SomeOtherException e) {
    logger
.error("whoops", e);
 
}
}

SonarLint version 3.4.0.2532
IntelliJ IDEA Ultimate 2018.1.4, build #IU-181.5087.20

Nicolas Peru

unread,
May 23, 2018, 10:14:23 AM5/23/18
to Even Lislebø, SonarLint
Hi, thanks for the feedback : this is indeed a false negative as the rule rely on the type of the variable e which is not InterruptedException in case of use of the union type.

Ticket created to handle the issue : https://jira.sonarsource.com/browse/SONARJAVA-2766 

Thanks a lot for the concise reproducer, this is always appreciated.

Cheers, 

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/5a982cf5-5b91-475d-8f7c-14dde5bbd29d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Nicolas Peru | SonarSource

Even Lislebø

unread,
May 23, 2018, 10:28:45 AM5/23/18
to SonarLint
Speedy response, I must say. Cheers!
Reply all
Reply to author
Forward
0 new messages