From 215f8403a6c4a131b9592457fd95a280274237de Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Thu, 23 Sep 2021 11:16:04 -0500 Subject: Fix code quality issues --- .../java/org/sonar/duplications/detector/original/BlocksGroup.java | 5 ++--- .../main/java/org/sonar/duplications/java/JavaTokenProducer.java | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'sonar-duplications') diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java index 67847f76c3f..65e182b11eb 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java @@ -30,18 +30,17 @@ import org.sonar.duplications.utils.FastStringComparator; * Set of {@link Block}s, which internally stored as a sorted list. */ final class BlocksGroup { + final List blocks; /** * Factory method. - * + * * @return new empty group */ public static BlocksGroup empty() { return new BlocksGroup(); } - protected final List blocks; - private BlocksGroup() { this.blocks = new ArrayList<>(); } diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/java/JavaTokenProducer.java b/sonar-duplications/src/main/java/org/sonar/duplications/java/JavaTokenProducer.java index 2e4f7c732bb..8df5f633523 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/java/JavaTokenProducer.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/java/JavaTokenProducer.java @@ -32,10 +32,6 @@ import org.sonar.duplications.token.TokenChunker; *

*/ public final class JavaTokenProducer { - - private JavaTokenProducer() { - } - private static final String NORMALIZED_CHARACTER_LITERAL = "$CHARS"; private static final String NORMALIZED_NUMERIC_LITERAL = "$NUMBER"; @@ -45,6 +41,9 @@ public final class JavaTokenProducer { private static final String FLOAT_SUFFIX = "[fFdD]"; private static final String INT_SUFFIX = "[lL]"; + private JavaTokenProducer() { + } + public static TokenChunker build() { return TokenChunker.builder() // White Space -- cgit v1.2.3