Rule "Exception handlers should preserve the original exceptions" false-positive in java 8 lambda expression (SonarQube 6, Java 4.2)

236 views
Skip to first unread message

adere...@gmail.com

unread,
Sep 20, 2016, 11:10:39 AM9/20/16
to SonarQube
Hi all, 

With SonarQube 6 and Java Plugin 4.2 we get a false positive for the rule "ExceptiException handlers should preserve the original exceptions" in the following code fragment. handlers should preserve the original exceptionsException handlers should preserve the original exceptions

 (StreamResource.StreamSource) () -> {
                        final PipedInputStream pipedInputStream = new PipedInputStream();
                        final PipedOutputStream pipedOutputStream;
                        try {
                            pipedOutputStream = new PipedOutputStream(pipedInputStream);
                        } catch (IOException e) {
                        throw new RuntimeException(e)
                        }
};

Regards Alex

Michael Gumowski

unread,
Sep 22, 2016, 9:49:46 AM9/22/16
to adere...@gmail.com, SonarQube
Hey,

Just to let you know that this case will be handled while fixing issues with the semantic, as discussed in this other thread about unused local variables.

Cheers,

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/fbb069dc-b0f4-4e77-a8ed-5f58131bd063%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Michael GUMOWSKI | SonarSource
Software Developer @ Language Team
http://sonarsource.com
Reply all
Reply to author
Forward
0 new messages