Skip to content

Commit 7d91ab7

Browse files
committed
Fix Checktyle warnings.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1072734 13f79535-47bb-0310-9956-ffa450edef68
1 parent 82a0383 commit 7d91ab7

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

src/java/org/apache/commons/codec/language/ColognePhonetic.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,32 +327,28 @@ public String colognePhonetic(String text) {
327327
code = '-';
328328
} else if (chr == 'B' || (chr == 'P' && nextChar != 'H')) {
329329
code = '1';
330-
} else if ((chr == 'D' || chr == 'T')
331-
&& !arrayContains(new char[] { 'S', 'C', 'Z' }, nextChar)) {
330+
} else if ((chr == 'D' || chr == 'T') && !arrayContains(new char[] { 'S', 'C', 'Z' }, nextChar)) {
332331
code = '2';
333332
} else if (arrayContains(new char[] { 'W', 'F', 'P', 'V' }, chr)) {
334333
code = '3';
335334
} else if (arrayContains(new char[] { 'G', 'K', 'Q' }, chr)) {
336335
code = '4';
337-
} else if (chr == 'X'
338-
&& !arrayContains(new char[] { 'C', 'K', 'Q' }, lastChar)) {
336+
} else if (chr == 'X' && !arrayContains(new char[] { 'C', 'K', 'Q' }, lastChar)) {
339337
code = '4';
340338
right.addLeft('S');
341339
rightLength++;
342340
} else if (chr == 'S' || chr == 'Z') {
343341
code = '8';
344342
} else if (chr == 'C') {
345343
if (lastCode == '/') {
346-
if (arrayContains(new char[] { 'A', 'H', 'L', 'O', 'R',
347-
'U', 'K', 'X', 'Q' }, nextChar)) {
344+
if (arrayContains(new char[] { 'A', 'H', 'L', 'O', 'R', 'U', 'K', 'X', 'Q' }, nextChar)) {
348345
code = '4';
349346
} else {
350347
code = '8';
351348
}
352349
} else {
353-
if (arrayContains(new char[] { 'S', 'Z' }, lastChar)
354-
|| !arrayContains(new char[] { 'A', 'H', 'O', 'U',
355-
'K', 'Q', 'X' }, nextChar)) {
350+
if (arrayContains(new char[] { 'S', 'Z' }, lastChar) ||
351+
!arrayContains(new char[] { 'A', 'H', 'O', 'U', 'K', 'Q', 'X' }, nextChar)) {
356352
code = '8';
357353
} else {
358354
code = '4';
@@ -370,9 +366,7 @@ public String colognePhonetic(String text) {
370366
code = chr;
371367
}
372368

373-
if (code != '-'
374-
&& (lastCode != code && (code != '0' || lastCode == '/')
375-
|| code < '0' || code > '8')) {
369+
if (code != '-' && (lastCode != code && (code != '0' || lastCode == '/') || code < '0' || code > '8')) {
376370
left.addRight(code);
377371
}
378372

@@ -385,10 +379,8 @@ public String colognePhonetic(String text) {
385379
public Object encode(Object object) throws EncoderException {
386380
if (!(object instanceof String)) {
387381
throw new EncoderException(
388-
"This method’s parameter was expected to be of the type "
389-
+ String.class.getName()
390-
+ ". But actually it was of the type "
391-
+ object.getClass().getName() + ".");
382+
"This method’s parameter was expected to be of the type " + String.class.getName() +
383+
". But actually it was of the type " + object.getClass().getName() + ".");
392384
}
393385
return encode((String) object);
394386
}

0 commit comments

Comments
 (0)