Skip to content

Commit 1e6544e

Browse files
committed
Remove redundant keywords
1 parent 8dcf9d1 commit 1e6544e

File tree

1 file changed

+89
-89
lines changed

1 file changed

+89
-89
lines changed

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

+89-89
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected Soundex createStringEncoder() {
4141

4242
@Test
4343
public void testB650() throws EncoderException {
44-
this.checkEncodingVariations("B650", new String[]{
44+
checkEncodingVariations("B650", new String[]{
4545
"BARHAM",
4646
"BARONE",
4747
"BARRON",
@@ -86,102 +86,102 @@ public void testB650() throws EncoderException {
8686

8787
@Test
8888
public void testBadCharacters() {
89-
assertEquals("H452", this.getStringEncoder().encode("HOL>MES"));
89+
assertEquals("H452", getStringEncoder().encode("HOL>MES"));
9090

9191
}
9292

9393
@Test
9494
public void testDifference() throws EncoderException {
9595
// Edge cases
96-
assertEquals(0, this.getStringEncoder().difference(null, null));
97-
assertEquals(0, this.getStringEncoder().difference("", ""));
98-
assertEquals(0, this.getStringEncoder().difference(" ", " "));
96+
assertEquals(0, getStringEncoder().difference(null, null));
97+
assertEquals(0, getStringEncoder().difference("", ""));
98+
assertEquals(0, getStringEncoder().difference(" ", " "));
9999
// Normal cases
100-
assertEquals(4, this.getStringEncoder().difference("Smith", "Smythe"));
101-
assertEquals(2, this.getStringEncoder().difference("Ann", "Andrew"));
102-
assertEquals(1, this.getStringEncoder().difference("Margaret", "Andrew"));
103-
assertEquals(0, this.getStringEncoder().difference("Janet", "Margaret"));
100+
assertEquals(4, getStringEncoder().difference("Smith", "Smythe"));
101+
assertEquals(2, getStringEncoder().difference("Ann", "Andrew"));
102+
assertEquals(1, getStringEncoder().difference("Margaret", "Andrew"));
103+
assertEquals(0, getStringEncoder().difference("Janet", "Margaret"));
104104
// Examples from https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_de-dz_8co5.asp
105-
assertEquals(4, this.getStringEncoder().difference("Green", "Greene"));
106-
assertEquals(0, this.getStringEncoder().difference("Blotchet-Halls", "Greene"));
105+
assertEquals(4, getStringEncoder().difference("Green", "Greene"));
106+
assertEquals(0, getStringEncoder().difference("Blotchet-Halls", "Greene"));
107107
// Examples from https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_setu-sus_3o6w.asp
108-
assertEquals(4, this.getStringEncoder().difference("Smith", "Smythe"));
109-
assertEquals(4, this.getStringEncoder().difference("Smithers", "Smythers"));
110-
assertEquals(2, this.getStringEncoder().difference("Anothers", "Brothers"));
108+
assertEquals(4, getStringEncoder().difference("Smith", "Smythe"));
109+
assertEquals(4, getStringEncoder().difference("Smithers", "Smythers"));
110+
assertEquals(2, getStringEncoder().difference("Anothers", "Brothers"));
111111
}
112112

113113
@Test
114114
public void testEncodeBasic() {
115-
assertEquals("T235", this.getStringEncoder().encode("testing"));
116-
assertEquals("T000", this.getStringEncoder().encode("The"));
117-
assertEquals("Q200", this.getStringEncoder().encode("quick"));
118-
assertEquals("B650", this.getStringEncoder().encode("brown"));
119-
assertEquals("F200", this.getStringEncoder().encode("fox"));
120-
assertEquals("J513", this.getStringEncoder().encode("jumped"));
121-
assertEquals("O160", this.getStringEncoder().encode("over"));
122-
assertEquals("T000", this.getStringEncoder().encode("the"));
123-
assertEquals("L200", this.getStringEncoder().encode("lazy"));
124-
assertEquals("D200", this.getStringEncoder().encode("dogs"));
115+
assertEquals("T235", getStringEncoder().encode("testing"));
116+
assertEquals("T000", getStringEncoder().encode("The"));
117+
assertEquals("Q200", getStringEncoder().encode("quick"));
118+
assertEquals("B650", getStringEncoder().encode("brown"));
119+
assertEquals("F200", getStringEncoder().encode("fox"));
120+
assertEquals("J513", getStringEncoder().encode("jumped"));
121+
assertEquals("O160", getStringEncoder().encode("over"));
122+
assertEquals("T000", getStringEncoder().encode("the"));
123+
assertEquals("L200", getStringEncoder().encode("lazy"));
124+
assertEquals("D200", getStringEncoder().encode("dogs"));
125125
}
126126

127127
/**
128128
* Examples from http://www.bradandkathy.com/genealogy/overviewofsoundex.html
129129
*/
130130
@Test
131131
public void testEncodeBatch2() {
132-
assertEquals("A462", this.getStringEncoder().encode("Allricht"));
133-
assertEquals("E166", this.getStringEncoder().encode("Eberhard"));
134-
assertEquals("E521", this.getStringEncoder().encode("Engebrethson"));
135-
assertEquals("H512", this.getStringEncoder().encode("Heimbach"));
136-
assertEquals("H524", this.getStringEncoder().encode("Hanselmann"));
137-
assertEquals("H431", this.getStringEncoder().encode("Hildebrand"));
138-
assertEquals("K152", this.getStringEncoder().encode("Kavanagh"));
139-
assertEquals("L530", this.getStringEncoder().encode("Lind"));
140-
assertEquals("L222", this.getStringEncoder().encode("Lukaschowsky"));
141-
assertEquals("M235", this.getStringEncoder().encode("McDonnell"));
142-
assertEquals("M200", this.getStringEncoder().encode("McGee"));
143-
assertEquals("O155", this.getStringEncoder().encode("Opnian"));
144-
assertEquals("O155", this.getStringEncoder().encode("Oppenheimer"));
145-
assertEquals("R355", this.getStringEncoder().encode("Riedemanas"));
146-
assertEquals("Z300", this.getStringEncoder().encode("Zita"));
147-
assertEquals("Z325", this.getStringEncoder().encode("Zitzmeinn"));
132+
assertEquals("A462", getStringEncoder().encode("Allricht"));
133+
assertEquals("E166", getStringEncoder().encode("Eberhard"));
134+
assertEquals("E521", getStringEncoder().encode("Engebrethson"));
135+
assertEquals("H512", getStringEncoder().encode("Heimbach"));
136+
assertEquals("H524", getStringEncoder().encode("Hanselmann"));
137+
assertEquals("H431", getStringEncoder().encode("Hildebrand"));
138+
assertEquals("K152", getStringEncoder().encode("Kavanagh"));
139+
assertEquals("L530", getStringEncoder().encode("Lind"));
140+
assertEquals("L222", getStringEncoder().encode("Lukaschowsky"));
141+
assertEquals("M235", getStringEncoder().encode("McDonnell"));
142+
assertEquals("M200", getStringEncoder().encode("McGee"));
143+
assertEquals("O155", getStringEncoder().encode("Opnian"));
144+
assertEquals("O155", getStringEncoder().encode("Oppenheimer"));
145+
assertEquals("R355", getStringEncoder().encode("Riedemanas"));
146+
assertEquals("Z300", getStringEncoder().encode("Zita"));
147+
assertEquals("Z325", getStringEncoder().encode("Zitzmeinn"));
148148
}
149149

150150
/**
151151
* Examples from http://www.archives.gov/research_room/genealogy/census/soundex.html
152152
*/
153153
@Test
154154
public void testEncodeBatch3() {
155-
assertEquals("W252", this.getStringEncoder().encode("Washington"));
156-
assertEquals("L000", this.getStringEncoder().encode("Lee"));
157-
assertEquals("G362", this.getStringEncoder().encode("Gutierrez"));
158-
assertEquals("P236", this.getStringEncoder().encode("Pfister"));
159-
assertEquals("J250", this.getStringEncoder().encode("Jackson"));
160-
assertEquals("T522", this.getStringEncoder().encode("Tymczak"));
155+
assertEquals("W252", getStringEncoder().encode("Washington"));
156+
assertEquals("L000", getStringEncoder().encode("Lee"));
157+
assertEquals("G362", getStringEncoder().encode("Gutierrez"));
158+
assertEquals("P236", getStringEncoder().encode("Pfister"));
159+
assertEquals("J250", getStringEncoder().encode("Jackson"));
160+
assertEquals("T522", getStringEncoder().encode("Tymczak"));
161161
// For VanDeusen: D-250 (D, 2 for the S, 5 for the N, 0 added) is also
162162
// possible.
163-
assertEquals("V532", this.getStringEncoder().encode("VanDeusen"));
163+
assertEquals("V532", getStringEncoder().encode("VanDeusen"));
164164
}
165165

166166
/**
167167
* Examples from: http://www.myatt.demon.co.uk/sxalg.htm
168168
*/
169169
@Test
170170
public void testEncodeBatch4() {
171-
assertEquals("H452", this.getStringEncoder().encode("HOLMES"));
172-
assertEquals("A355", this.getStringEncoder().encode("ADOMOMI"));
173-
assertEquals("V536", this.getStringEncoder().encode("VONDERLEHR"));
174-
assertEquals("B400", this.getStringEncoder().encode("BALL"));
175-
assertEquals("S000", this.getStringEncoder().encode("SHAW"));
176-
assertEquals("J250", this.getStringEncoder().encode("JACKSON"));
177-
assertEquals("S545", this.getStringEncoder().encode("SCANLON"));
178-
assertEquals("S532", this.getStringEncoder().encode("SAINTJOHN"));
171+
assertEquals("H452", getStringEncoder().encode("HOLMES"));
172+
assertEquals("A355", getStringEncoder().encode("ADOMOMI"));
173+
assertEquals("V536", getStringEncoder().encode("VONDERLEHR"));
174+
assertEquals("B400", getStringEncoder().encode("BALL"));
175+
assertEquals("S000", getStringEncoder().encode("SHAW"));
176+
assertEquals("J250", getStringEncoder().encode("JACKSON"));
177+
assertEquals("S545", getStringEncoder().encode("SCANLON"));
178+
assertEquals("S532", getStringEncoder().encode("SAINTJOHN"));
179179

180180
}
181181

182182
@Test
183183
public void testEncodeIgnoreApostrophes() throws EncoderException {
184-
this.checkEncodingVariations("O165", new String[]{
184+
checkEncodingVariations("O165", new String[]{
185185
"OBrien",
186186
"'OBrien",
187187
"O'Brien",
@@ -198,7 +198,7 @@ public void testEncodeIgnoreApostrophes() throws EncoderException {
198198
* @throws EncoderException for some failure scenarios */
199199
@Test
200200
public void testEncodeIgnoreHyphens() throws EncoderException {
201-
this.checkEncodingVariations("K525", new String[]{
201+
checkEncodingVariations("K525", new String[]{
202202
"KINGSMITH",
203203
"-KINGSMITH",
204204
"K-INGSMITH",
@@ -214,7 +214,7 @@ public void testEncodeIgnoreHyphens() throws EncoderException {
214214

215215
@Test
216216
public void testEncodeIgnoreTrimmable() {
217-
assertEquals("W252", this.getStringEncoder().encode(" \t\n\r Washington \t\n\r "));
217+
assertEquals("W252", getStringEncoder().encode(" \t\n\r Washington \t\n\r "));
218218
}
219219

220220
@Test
@@ -240,10 +240,10 @@ public void testHWRuleEx1() {
240240
// http://www.archives.gov/research_room/genealogy/census/soundex.html:
241241
// Ashcraft is coded A-261 (A, 2 for the S, C ignored, 6 for the R, 1
242242
// for the F). It is not coded A-226.
243-
assertEquals("A261", this.getStringEncoder().encode("Ashcraft"));
244-
assertEquals("A261", this.getStringEncoder().encode("Ashcroft"));
245-
assertEquals("Y330", this.getStringEncoder().encode("yehudit"));
246-
assertEquals("Y330", this.getStringEncoder().encode("yhwdyt"));
243+
assertEquals("A261", getStringEncoder().encode("Ashcraft"));
244+
assertEquals("A261", getStringEncoder().encode("Ashcroft"));
245+
assertEquals("Y330", getStringEncoder().encode("yehudit"));
246+
assertEquals("Y330", getStringEncoder().encode("yhwdyt"));
247247
}
248248

249249
/**
@@ -253,8 +253,8 @@ public void testHWRuleEx1() {
253253
*/
254254
@Test
255255
public void testHWRuleEx2() {
256-
assertEquals("B312", this.getStringEncoder().encode("BOOTHDAVIS"));
257-
assertEquals("B312", this.getStringEncoder().encode("BOOTH-DAVIS"));
256+
assertEquals("B312", getStringEncoder().encode("BOOTHDAVIS"));
257+
assertEquals("B312", getStringEncoder().encode("BOOTH-DAVIS"));
258258
}
259259

260260
/**
@@ -263,10 +263,10 @@ public void testHWRuleEx2() {
263263
* @throws EncoderException for some failure scenarios */
264264
@Test
265265
public void testHWRuleEx3() throws EncoderException {
266-
assertEquals("S460", this.getStringEncoder().encode("Sgler"));
267-
assertEquals("S460", this.getStringEncoder().encode("Swhgler"));
266+
assertEquals("S460", getStringEncoder().encode("Sgler"));
267+
assertEquals("S460", getStringEncoder().encode("Swhgler"));
268268
// Also S460:
269-
this.checkEncodingVariations("S460", new String[]{
269+
checkEncodingVariations("S460", new String[]{
270270
"SAILOR",
271271
"SALYER",
272272
"SAYLOR",
@@ -291,8 +291,8 @@ public void testHWRuleEx3() throws EncoderException {
291291
*/
292292
@Test
293293
public void testMsSqlServer1() {
294-
assertEquals("S530", this.getStringEncoder().encode("Smith"));
295-
assertEquals("S530", this.getStringEncoder().encode("Smythe"));
294+
assertEquals("S530", getStringEncoder().encode("Smith"));
295+
assertEquals("S530", getStringEncoder().encode("Smythe"));
296296
}
297297

298298
/**
@@ -303,23 +303,23 @@ public void testMsSqlServer1() {
303303
* @throws EncoderException for some failure scenarios */
304304
@Test
305305
public void testMsSqlServer2() throws EncoderException {
306-
this.checkEncodingVariations("E625", new String[]{"Erickson", "Erickson", "Erikson", "Ericson", "Ericksen", "Ericsen"});
306+
checkEncodingVariations("E625", new String[]{"Erickson", "Erickson", "Erikson", "Ericson", "Ericksen", "Ericsen"});
307307
}
308308

309309
/**
310310
* Examples for MS SQLServer from https://databases.about.com/library/weekly/aa042901a.htm
311311
*/
312312
@Test
313313
public void testMsSqlServer3() {
314-
assertEquals("A500", this.getStringEncoder().encode("Ann"));
315-
assertEquals("A536", this.getStringEncoder().encode("Andrew"));
316-
assertEquals("J530", this.getStringEncoder().encode("Janet"));
317-
assertEquals("M626", this.getStringEncoder().encode("Margaret"));
318-
assertEquals("S315", this.getStringEncoder().encode("Steven"));
319-
assertEquals("M240", this.getStringEncoder().encode("Michael"));
320-
assertEquals("R163", this.getStringEncoder().encode("Robert"));
321-
assertEquals("L600", this.getStringEncoder().encode("Laura"));
322-
assertEquals("A500", this.getStringEncoder().encode("Anne"));
314+
assertEquals("A500", getStringEncoder().encode("Ann"));
315+
assertEquals("A536", getStringEncoder().encode("Andrew"));
316+
assertEquals("J530", getStringEncoder().encode("Janet"));
317+
assertEquals("M626", getStringEncoder().encode("Margaret"));
318+
assertEquals("S315", getStringEncoder().encode("Steven"));
319+
assertEquals("M240", getStringEncoder().encode("Michael"));
320+
assertEquals("R163", getStringEncoder().encode("Robert"));
321+
assertEquals("L600", getStringEncoder().encode("Laura"));
322+
assertEquals("A500", getStringEncoder().encode("Anne"));
323323
}
324324

325325
/**
@@ -383,12 +383,12 @@ public void testUsEnglishStatic() {
383383
*/
384384
@Test
385385
public void testUsMappingEWithAcute() {
386-
assertEquals("E000", this.getStringEncoder().encode("e"));
386+
assertEquals("E000", getStringEncoder().encode("e"));
387387
if (Character.isLetter('\u00e9')) { // e-acute
388388
// uppercase E-acute
389389
assertThrows(IllegalArgumentException.class, () -> getStringEncoder().encode("\u00e9"));
390390
} else {
391-
assertEquals("", this.getStringEncoder().encode("\u00e9"));
391+
assertEquals("", getStringEncoder().encode("\u00e9"));
392392
}
393393
}
394394

@@ -399,12 +399,12 @@ public void testUsMappingEWithAcute() {
399399
*/
400400
@Test
401401
public void testUsMappingOWithDiaeresis() {
402-
assertEquals("O000", this.getStringEncoder().encode("o"));
402+
assertEquals("O000", getStringEncoder().encode("o"));
403403
if (Character.isLetter('\u00f6')) { // o-umlaut
404404
// uppercase O-umlaut
405405
assertThrows(IllegalArgumentException.class, () -> getStringEncoder().encode("\u00f6"));
406406
} else {
407-
assertEquals("", this.getStringEncoder().encode("\u00f6"));
407+
assertEquals("", getStringEncoder().encode("\u00f6"));
408408
}
409409
}
410410

@@ -413,11 +413,11 @@ public void testUsMappingOWithDiaeresis() {
413413
*/
414414
@Test
415415
public void testWikipediaAmericanSoundex() {
416-
assertEquals("R163", this.getStringEncoder().encode("Robert"));
417-
assertEquals("R163", this.getStringEncoder().encode("Rupert"));
418-
assertEquals("A261", this.getStringEncoder().encode("Ashcraft"));
419-
assertEquals("A261", this.getStringEncoder().encode("Ashcroft"));
420-
assertEquals("T522", this.getStringEncoder().encode("Tymczak"));
421-
assertEquals("P236", this.getStringEncoder().encode("Pfister"));
416+
assertEquals("R163", getStringEncoder().encode("Robert"));
417+
assertEquals("R163", getStringEncoder().encode("Rupert"));
418+
assertEquals("A261", getStringEncoder().encode("Ashcraft"));
419+
assertEquals("A261", getStringEncoder().encode("Ashcroft"));
420+
assertEquals("T522", getStringEncoder().encode("Tymczak"));
421+
assertEquals("P236", getStringEncoder().encode("Pfister"));
422422
}
423423
}

0 commit comments

Comments
 (0)