# False positive: S1143 reports return inside lamba function

**URL:** <https://community.sonarsource.com/t/false-positive-s1143-reports-return-inside-lamba-function/6784>\
**Category:** Report False-positive / False-negative...\
**Created:** [February 11, 2019, 2:09pm UTC](https://community.sonarsource.com/t/false-positive-s1143-reports-return-inside-lamba-function/6784 "2019-02-11T14:09:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrbig](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@mrbig](https://community.sonarsource.com/u/mrbig)\
**Post date:** [February 11, 2019, 2:09pm UTC](https://community.sonarsource.com/t/false-positive-s1143-reports-return-inside-lamba-function/6784/1 "2019-02-11T14:09:04Z")

</div>

Dear Sonar community!

Using SonarLint 4.1.0.201901311043 I encountered the following false positive: S1143 reports that return statements should not be used inside finally blocks even if the return is in a lambda function.

Quick example, where the line `return obj.length() > 42;` is identified as a return from the finally block, but actually it isn’t:

```
try {
    // do something
}
finally {
    List<String> list = new LinkedList<>();
    // do something with the list
    List<String> filtered = list.stream()
        .filter(obj -> {
            return obj.length() > 42;
        })
        .collect(Collectors.toList());
}

```

Expected result: this line should not be reported because it’s inside the lambda block.

Thank you, and I hope I can help to make this good product even better.
