Commit 2f70d6b
authored
SONARJAVA-4826 S6880 Use switch instead of if else for pattern matching (#4726)
* SONARJAVA-4826 S6880 Use switch instead of if else for pattern matching
* Prototype implementation of quickfix
* Refactor + Improve quickfix indents
* Test first 3 quickfixes
* More rigorous implementation without quickfix
* Make test cases follow the spec more closely
* Implement quickfix
* Add test for guards + Test first quickfix
* Don't generate guards for constant cases + add tests
* Fix bugs with constant cases + Refactor
* Add test
* Inline constant argument
* Handle non-block branches + add tests
* Add test
* Add tests
* Fix autoscan
* Apply requested changes
* Lift returns when possible
* Add test case
* Reformatting1 parent 61ef9d2 commit 2f70d6b
9 files changed
Lines changed: 890 additions & 0 deletions
File tree
- its/autoscan/src/test/resources/autoscan
- diffs
- java-checks-test-sources/default/src/main/java/checks
- java-checks/src
- main/java/org/sonar/java/checks
- test/java/org/sonar/java/checks
- sonar-java-plugin/src/main
- java/org/sonar/plugins/java
- resources/org/sonar/l10n/java/rules/java
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2957 | 2957 | | |
2958 | 2958 | | |
2959 | 2959 | | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
2960 | 2966 | | |
2961 | 2967 | | |
2962 | 2968 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments