Skip to content

Commit 8cbdc11

Browse files
committed
Better comment, fix spelling, Javadoc
Remove redundant keyword
1 parent 733e35e commit 8cbdc11

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ public void append(final String primary, final String alternate) {
105105
* @param value The value to append.
106106
*/
107107
public void appendAlternate(final char value) {
108-
if (this.alternate.length() < this.maxLength) {
109-
this.alternate.append(value);
108+
if (alternate.length() < maxLength) {
109+
alternate.append(value);
110110
}
111111
}
112112

@@ -116,11 +116,11 @@ public void appendAlternate(final char value) {
116116
* @param value The value to append.
117117
*/
118118
public void appendAlternate(final String value) {
119-
final int addChars = this.maxLength - this.alternate.length();
119+
final int addChars = maxLength - alternate.length();
120120
if (value.length() <= addChars) {
121-
this.alternate.append(value);
121+
alternate.append(value);
122122
} else {
123-
this.alternate.append(value, 0, addChars);
123+
alternate.append(value, 0, addChars);
124124
}
125125
}
126126

@@ -130,8 +130,8 @@ public void appendAlternate(final String value) {
130130
* @param value The value to append.
131131
*/
132132
public void appendPrimary(final char value) {
133-
if (this.primary.length() < this.maxLength) {
134-
this.primary.append(value);
133+
if (primary.length() < maxLength) {
134+
primary.append(value);
135135
}
136136
}
137137

@@ -141,11 +141,11 @@ public void appendPrimary(final char value) {
141141
* @param value The value to append.
142142
*/
143143
public void appendPrimary(final String value) {
144-
final int addChars = this.maxLength - this.primary.length();
144+
final int addChars = maxLength - primary.length();
145145
if (value.length() <= addChars) {
146-
this.primary.append(value);
146+
primary.append(value);
147147
} else {
148-
this.primary.append(value, 0, addChars);
148+
primary.append(value, 0, addChars);
149149
}
150150
}
151151

@@ -155,7 +155,7 @@ public void appendPrimary(final String value) {
155155
* @return the alternate string.
156156
*/
157157
public String getAlternate() {
158-
return this.alternate.toString();
158+
return alternate.toString();
159159
}
160160

161161
/**
@@ -164,7 +164,7 @@ public String getAlternate() {
164164
* @return the primary string.
165165
*/
166166
public String getPrimary() {
167-
return this.primary.toString();
167+
return primary.toString();
168168
}
169169

170170
/**
@@ -173,7 +173,7 @@ public String getPrimary() {
173173
* @return whether this result is complete.
174174
*/
175175
public boolean isComplete() {
176-
return this.primary.length() >= this.maxLength && this.alternate.length() >= this.maxLength;
176+
return primary.length() >= maxLength && alternate.length() >= maxLength;
177177
}
178178
}
179179

@@ -367,7 +367,7 @@ public String doubleMetaphone(String value, final boolean alternate) {
367367
index = charAt(value, index + 1) == 'B' ? index + 2 : index + 1;
368368
break;
369369
case '\u00C7':
370-
// A C with a Cedilla
370+
// C with a Cedilla
371371
result.append('S');
372372
index++;
373373
break;
@@ -406,7 +406,7 @@ public String doubleMetaphone(String value, final boolean alternate) {
406406
index = charAt(value, index + 1) == 'N' ? index + 2 : index + 1;
407407
break;
408408
case '\u00D1':
409-
// N with a tilde (spanish ene)
409+
// N with a tilde (Spanish ene)
410410
result.append('N');
411411
index++;
412412
break;
@@ -481,7 +481,7 @@ public String encode(final String value) {
481481
* @return the maxCodeLen.
482482
*/
483483
public int getMaxCodeLen() {
484-
return this.maxCodeLen;
484+
return maxCodeLen;
485485
}
486486

487487
/**
@@ -1030,7 +1030,7 @@ private boolean isSilentStart(final String value) {
10301030

10311031
/**
10321032
* Tests whether or not a value is of slavo-germanic origin. A value is
1033-
* of slavo-germanic origin if it contains any of 'W', 'K', 'CZ', or 'WITZ'.
1033+
* of Slavo-Germanic origin if it contains any of 'W', 'K', 'CZ', or 'WITZ'.
10341034
*/
10351035
private boolean isSlavoGermanic(final String value) {
10361036
return value.indexOf('W') > -1 || value.indexOf('K') > -1 ||

0 commit comments

Comments
 (0)