Skip to content

Commit ed43d2a

Browse files
committed
Sort members
1 parent cd06e60 commit ed43d2a

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@
6969
*/
7070
public class DaitchMokotoffSoundex implements StringEncoder {
7171

72-
/**
73-
* The NUL character.
74-
*/
75-
private static final char NUL = '\0';
76-
7772
/**
7873
* Inner class representing a branch during DM Soundex encoding.
7974
*/
@@ -205,6 +200,11 @@ public String toString() {
205200
}
206201
}
207202

203+
/**
204+
* The NUL character.
205+
*/
206+
private static final char NUL = '\0';
207+
208208
private static final String COMMENT = "//";
209209

210210
private static final String DOUBLE_QUOTE = "\"";

src/main/java/org/apache/commons/codec/language/bm/Rule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@
8080
*/
8181
public class Rule {
8282

83-
private static final String PIPE = "|";
84-
8583
/**
8684
* A phoneme.
8785
*/
@@ -276,6 +274,8 @@ public interface RPattern {
276274
boolean isMatch(CharSequence input);
277275
}
278276

277+
private static final String PIPE = "|";
278+
279279
/**
280280
* Always matches.
281281
*/

src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,18 @@ void testMacHexFile(final HmacAlgorithms hmacAlgorithm, final byte[] standardRes
235235

236236
@ParameterizedTest
237237
@MethodSource("data")
238-
void testMacHexPath(final HmacAlgorithms hmacAlgorithm, final byte[] standardResultBytes, final String standardResultString)
238+
void testMacHexInputStream(final HmacAlgorithms hmacAlgorithm, final byte[] standardResultBytes, final String standardResultString)
239239
throws IOException {
240240
assumeTrue(HmacUtils.isAvailable(hmacAlgorithm));
241-
assertEquals(standardResultString, new HmacUtils(hmacAlgorithm, STANDARD_KEY_BYTES).hmacHex(TempFile));
241+
assertEquals(standardResultString, new HmacUtils(hmacAlgorithm, STANDARD_KEY_BYTES).hmacHex(new ByteArrayInputStream(STANDARD_PHRASE_BYTES)));
242242
}
243243

244244
@ParameterizedTest
245245
@MethodSource("data")
246-
void testMacHexInputStream(final HmacAlgorithms hmacAlgorithm, final byte[] standardResultBytes, final String standardResultString)
246+
void testMacHexPath(final HmacAlgorithms hmacAlgorithm, final byte[] standardResultBytes, final String standardResultString)
247247
throws IOException {
248248
assumeTrue(HmacUtils.isAvailable(hmacAlgorithm));
249-
assertEquals(standardResultString, new HmacUtils(hmacAlgorithm, STANDARD_KEY_BYTES).hmacHex(new ByteArrayInputStream(STANDARD_PHRASE_BYTES)));
249+
assertEquals(standardResultString, new HmacUtils(hmacAlgorithm, STANDARD_KEY_BYTES).hmacHex(TempFile));
250250
}
251251

252252
@ParameterizedTest

src/test/java/org/apache/commons/codec/language/DaitchMokotoffSoundexTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
*/
3636
class DaitchMokotoffSoundexTest extends AbstractStringEncoderTest<DaitchMokotoffSoundex> {
3737

38+
static IntStream getNonLetters() {
39+
return IntStream.rangeClosed(Character.MIN_VALUE, Character.MAX_VALUE).filter(c -> !Character.isLetter(c));
40+
}
41+
3842
@Override
3943
protected DaitchMokotoffSoundex createStringEncoder() {
4044
return new DaitchMokotoffSoundex();
@@ -99,16 +103,6 @@ void testEncodeIgnoreHyphens() throws EncoderException {
99103
"KINGSMI-TH", "KINGSMIT-H", "KINGSMITH-");
100104
}
101105

102-
@Test
103-
void testEncodeIgnoreTrimmable() {
104-
assertEquals("746536", encode(" \t\n\r Washington \t\n\r "));
105-
assertEquals("746536", encode("Washington"));
106-
}
107-
108-
static IntStream getNonLetters() {
109-
return IntStream.rangeClosed(Character.MIN_VALUE, Character.MAX_VALUE).filter(c -> !Character.isLetter(c));
110-
}
111-
112106
@ParameterizedTest
113107
@MethodSource("getNonLetters")
114108
void testEncodeIgnoreNonLetters(final int nonLetterInt) throws EncoderException {
@@ -117,6 +111,12 @@ void testEncodeIgnoreNonLetters(final int nonLetterInt) throws EncoderException
117111
"Washi" + nonLetterChar + "ngton");
118112
}
119113

114+
@Test
115+
void testEncodeIgnoreTrimmable() {
116+
assertEquals("746536", encode(" \t\n\r Washington \t\n\r "));
117+
assertEquals("746536", encode("Washington"));
118+
}
119+
120120
/**
121121
* Examples from http://www.jewishgen.org/infofiles/soundex.html
122122
*/

src/test/java/org/apache/commons/codec/language/bm/RuleTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ private Rule.Phoneme[][] makePhonemes() {
4141
return phonemes;
4242
}
4343

44+
@Test
45+
void testParsePhonemeExprLang311() {
46+
assertEquals(1, Rule.parsePhonemeExpr("()").size());
47+
assertEquals(1, Rule.parsePhonemeExpr("(())").size());
48+
assertEquals(2, Rule.parsePhonemeExpr("(()|)").size());
49+
assertEquals(2, Rule.parsePhonemeExpr("(|())").size());
50+
assertEquals(3, Rule.parsePhonemeExpr("(|()|)").size());
51+
}
52+
4453
@Test
4554
void testPhonemeComparedToLaterIsNegative() {
4655
for (final Rule.Phoneme[] phs : makePhonemes()) {
@@ -63,15 +72,6 @@ void testPhonemeComparedToSelfIsZero() {
6372
}
6473
}
6574

66-
@Test
67-
void testParsePhonemeExprLang311() {
68-
assertEquals(1, Rule.parsePhonemeExpr("()").size());
69-
assertEquals(1, Rule.parsePhonemeExpr("(())").size());
70-
assertEquals(2, Rule.parsePhonemeExpr("(()|)").size());
71-
assertEquals(2, Rule.parsePhonemeExpr("(|())").size());
72-
assertEquals(3, Rule.parsePhonemeExpr("(|()|)").size());
73-
}
74-
7575
@Test
7676
void testSubSequenceWorks() {
7777
// AppendableCharSequence is private to Rule. We can only make it through a Phoneme.

0 commit comments

Comments
 (0)