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

ObjectLiteralToLambda: fix false positive when using Java interfaces with default methods #4203

Merged
merged 2 commits into from
Oct 29, 2021

Conversation

t-kameyama
Copy link
Contributor

Fixes #4161

@codecov
Copy link

codecov bot commented Oct 28, 2021

Codecov Report

Merging #4203 (6c64ab3) into main (ea00969) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #4203      +/-   ##
============================================
- Coverage     84.20%   84.19%   -0.02%     
+ Complexity     3233     3231       -2     
============================================
  Files           468      468              
  Lines         10183    10181       -2     
  Branches       1785     1784       -1     
============================================
- Hits           8575     8572       -3     
  Misses          669      669              
- Partials        939      940       +1     
Impacted Files Coverage Δ
...rbosch/detekt/rules/style/ObjectLiteralToLambda.kt 83.78% <100.00%> (-3.40%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea00969...6c64ab3. Read the comment docs.

override fun foo() {
println()
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea about this. Isn't it possible to use SAM when the interface has only one method but it has a default?

Copy link
Contributor Author

@t-kameyama t-kameyama Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A default method is not an abstract method.
スクリーンショット 2021-10-29 8 32 15

@chao2zhang chao2zhang merged commit dd61654 into detekt:main Oct 29, 2021
@t-kameyama t-kameyama deleted the issue_4161 branch October 29, 2021 21:36
@cortinico cortinico added this to the 1.19.0 milestone Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ObjectLiteralToLambda false positive when using Java interfaces with default methods
4 participants