-
Notifications
You must be signed in to change notification settings - Fork 716
SONARJAVA-5936 : S1452 Remove FPs for wildcards in nested types #5391
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,5 @@ | ||
| { | ||
| "org.sonarsource.sonarqube:sonar-server:src/main/java/org/sonar/server/computation/task/projectanalysis/qualitygate/EvaluationResult.java": [ | ||
| 46 | ||
| ], | ||
| "org.sonarsource.sonarqube:sonar-server:src/main/java/org/sonar/server/computation/task/projectanalysis/step/NewCoverageMeasuresStep.java": [ | ||
| 131 | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package checks; | ||
|
|
||
| import com.google.common.collect.Maps; | ||
| import java.util.List; | ||
| import java.util.ArrayList; | ||
|
|
||
| public class WildCardReturnParameterNestedTypeCheck { | ||
| void bar() { | ||
| foo(listOfLists()); | ||
| } | ||
|
|
||
| void foo(List<List<? extends A>> listList) { | ||
|
|
||
| } | ||
|
|
||
| List<List<? extends A>> listOfLists() { | ||
| return new ArrayList<>(); | ||
| } | ||
|
|
||
| private static class A { | ||
| } | ||
|
|
||
| private static class B extends checks.A { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a particulat reason to use |
||
| } | ||
|
|
||
| static class Entry<K, V> { | ||
| } | ||
|
|
||
| @SuppressWarnings("unchecked") | ||
| static <K> Function<Entry<K, ?>, K> keyFunction() { | ||
| throw new UnsupportedOperationException(); | ||
| } | ||
| } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add another example with another data structure to have a more robust test. Something similar to the FP that disappeared from the ITS tests seem like good candidates to me. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's easier to find samples if the filename ends in
...Sample.java. Maybe we can rename all sample for this check?