Skip to content

Commit e8b9370

Browse files
committed
TEXT-126: WIP fixing checkstyle order
1 parent 2401af9 commit e8b9370

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/main/java/org/apache/commons/text/similarity/SorensenDiceSimilarity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
*/
1717
package org.apache.commons.text.similarity;
1818

19-
import org.apache.commons.lang3.StringUtils;
20-
2119
import java.util.ArrayList;
2220
import java.util.Collection;
2321
import java.util.List;
2422
import java.util.function.Function;
2523

24+
import org.apache.commons.lang3.StringUtils;
25+
2626
/**
2727
* A similarity algorithm indicating the percentage of matched characters
2828
* between two character sequences.
@@ -120,7 +120,7 @@ public Double apply(final CharSequence left, final CharSequence right) {
120120
/**
121121
* Converter class for creating Bigrams for SorensenDice similarity.
122122
*/
123-
private static class SorensenDiceConverter implements Function<CharSequence, Collection<Integer>> {
123+
private static final class SorensenDiceConverter implements Function<CharSequence, Collection<Integer>> {
124124
@Override
125125
public Collection<Integer> apply(CharSequence cs) {
126126
final int length = cs.length();

src/test/java/org/apache/commons/text/similarity/SorensenDiceSimilarityTest.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
*/
1717
package org.apache.commons.text.similarity;
1818

19-
import org.junit.jupiter.api.BeforeAll;
20-
import org.junit.jupiter.api.Test;
19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.assertThrows;
2121

2222
import java.math.RoundingMode;
2323
import java.text.DecimalFormat;
2424

25-
import static org.junit.jupiter.api.Assertions.assertEquals;
26-
import static org.junit.jupiter.api.Assertions.assertThrows;
25+
import org.junit.jupiter.api.BeforeAll;
26+
import org.junit.jupiter.api.Test;
2727

2828
/**
2929
* Unit tests for {@link SorensenDiceSimilarity}.
@@ -85,6 +85,12 @@ public void testGetSorensenDicesSimilarity_NullString() {
8585
assertThrows(IllegalArgumentException.class, () -> similarity.apply(null, "clear"));
8686
}
8787

88+
/**
89+
* Format the double to two decimal places rounding it down.
90+
*
91+
* @param value the double value
92+
* @return double formatted to two places rounding it down
93+
*/
8894
public static double printTwoDecimals(double value) {
8995
DecimalFormat df = new DecimalFormat("#.##");
9096
df.setRoundingMode(RoundingMode.DOWN);

0 commit comments

Comments
 (0)