aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-duplications/src/main/java/org/sonar/duplications
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-duplications/src/main/java/org/sonar/duplications')
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/block/FileBlocks.java18
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java4
2 files changed, 3 insertions, 19 deletions
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/block/FileBlocks.java b/sonar-duplications/src/main/java/org/sonar/duplications/block/FileBlocks.java
index 2ac876651a1..898200c8b36 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/block/FileBlocks.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/block/FileBlocks.java
@@ -24,22 +24,6 @@ import java.util.List;
/**
* Represents all blocks in a file.
*/
-public final class FileBlocks {
-
- private final String resourceId;
- private final List<Block> blocks;
-
- public FileBlocks(String resourceId, List<Block> blocks) {
- this.resourceId = resourceId;
- this.blocks = blocks;
- }
-
- public String resourceId() {
- return resourceId;
- }
-
- public List<Block> blocks() {
- return blocks;
- }
+public record FileBlocks(String resourceId, List<Block> blocks) {
}
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java
index 7c799001623..c48ced1f41b 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java
@@ -69,8 +69,8 @@ public final class TextSet extends AbstractText {
@Override
public Object symbolAt(int index) {
Object obj = super.symbolAt(index);
- if (obj instanceof Block) {
- return ((Block) obj).getBlockHash();
+ if (obj instanceof Block block) {
+ return block.getBlockHash();
}
return obj;
}