Skip to content

Commit 2022e5b

Browse files
Implement new rule S8908 - @CacheResult methods
This rule detects methods annotated with @CacheResult that return void. Since void methods have no return value to cache, applying @CacheResult to them is meaningless and indicates a misunderstanding of how caching works.
1 parent 72ebc0c commit 2022e5b

12 files changed

Lines changed: 731 additions & 129 deletions

File tree

its/autoscan/src/test/java/org/sonar/java/it/AutoScanTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void javaCheckTestSources() throws Exception {
199199
softly.assertThat(newDiffs).containsExactlyInAnyOrderElementsOf(knownDiffs.values());
200200
softly.assertThat(newTotal).isEqualTo(knownTotal);
201201
softly.assertThat(rulesCausingFPs).hasSize(10);
202-
softly.assertThat(rulesNotReporting).hasSize(19);
202+
softly.assertThat(rulesNotReporting).hasSize(20);
203203

204204
/**
205205
* 4. Check total number of differences (FPs + FNs)

0 commit comments

Comments
 (0)