Skip to content

Commit 598c411

Browse files
committed
Fix Javadoc nits.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/codec/trunk@130260 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8d09b4e commit 598c411

7 files changed

Lines changed: 28 additions & 29 deletions

File tree

src/java/org/apache/commons/codec/StringEncoderComparator.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@
6363
* String are comparable, and this comparator allows
6464
* you to configure it with an instance of a class
6565
* which implements the StringEncoder. This comparator
66-
* is used to sort Strings by an encoding shceme such
66+
* is used to sort Strings by an encoding scheme such
6767
* as Soundex, Metaphone, etc. This class can come in
6868
* handy if one need to sort Strings by an encoded
6969
* form of a name such as Soundex.
7070
*
7171
* @author Tim O'Brien
7272
* @author Gary Gregory
73-
* @version $Id: StringEncoderComparator.java,v 1.9 2003/11/13 06:50:35 ggregory Exp $
73+
* @version $Id: StringEncoderComparator.java,v 1.10 2003/11/24 00:11:56 ggregory Exp $
7474
*/
7575
public class StringEncoderComparator implements Comparator {
7676

@@ -87,10 +87,11 @@ public StringEncoderComparator() {
8787
}
8888

8989
/**
90-
* Constructs a new instance with the given soundex algorithm.
90+
* Constructs a new instance with the given algorithm.
91+
* @param stringEncoder the StringEncoder used for comparisons.
9192
*/
92-
public StringEncoderComparator(StringEncoder en) {
93-
this.stringEncoder = en;
93+
public StringEncoderComparator(StringEncoder stringEncoder) {
94+
this.stringEncoder = stringEncoder;
9495
}
9596

9697
/**
@@ -101,6 +102,9 @@ public StringEncoderComparator(StringEncoder en) {
101102
*
102103
* If an {@link EncoderException} is encountered, return <code>0</code>.
103104
*
105+
* @param o1 the object to compare
106+
* @param o2 the object to compare to
107+
* @return the Comparable.compareTo() return code or 0 if an encoding error was caught.
104108
* @see Comparable
105109
*/
106110
public int compare(Object o1, Object o2) {

src/java/org/apache/commons/codec/binary/Base64.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
7474
* @author Tim O'Brien
7575
* @since 1.0-dev
76-
* @version $Id: Base64.java,v 1.13 2003/11/06 16:32:30 ggregory Exp $
76+
* @version $Id: Base64.java,v 1.14 2003/11/24 00:11:56 ggregory Exp $
7777
*/
7878
public class Base64 implements BinaryEncoder, BinaryDecoder {
7979

@@ -258,8 +258,6 @@ public Object decode(Object pObject) throws DecoderException {
258258
*
259259
* @param pArray A byte array containing Base64 character data
260260
* @return a byte array containing binary data
261-
* @throws DecoderException if there is an Decoder specific exception
262-
* during the decoding process
263261
*/
264262
public byte[] decode(byte[] pArray) {
265263
byte[] result;
@@ -569,8 +567,6 @@ public Object encode(Object pObject) throws EncoderException {
569567
*
570568
* @param pArray a byte array containing binary data
571569
* @return A byte array containing only Base64 character data
572-
* @throws EncoderException if there is an Encoder specific exception
573-
* during the encoding process
574570
*/
575571
public byte[] encode(byte[] pArray) {
576572
return (encodeBase64(pArray, false));

src/java/org/apache/commons/codec/digest/DigestUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public class DigestUtils {
7575
/**
7676
* Returns a MessageDigest for the given <code>algorithm</code>.
7777
*
78+
* @param algorithm The MessageDigest algorithm name.
7879
* @return An MD5 digest instance.
7980
* @throws RuntimeException when a {@link java.security.NoSuchAlgorithmException} is caught,
8081
*/

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
*
7474
* @author <a href="mailto:ben@walstrum.com">Benjamin Walstrum</a>
7575
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
76-
* @version $Id: DoubleMetaphone.java,v 1.14 2003/11/07 23:12:54 ggregory Exp $
76+
* @version $Id: DoubleMetaphone.java,v 1.15 2003/11/24 00:11:56 ggregory Exp $
7777
*/
7878
public class DoubleMetaphone implements StringEncoder {
7979

@@ -252,11 +252,9 @@ public Object encode(Object obj) throws EncoderException {
252252
*
253253
* @param value String to encode
254254
* @return An encoded String
255-
* @throws EncoderException thrown if there is an exception during
256-
* the encoding process.
257255
*/
258256
public String encode(String value) {
259-
return (doubleMetaphone(value));
257+
return doubleMetaphone(value);
260258
}
261259

262260
/**

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
* @author bayard@generationjava.com
7373
* @author Tim O'Brien
7474
* @author Gary Gregory
75-
* @version $Id: Metaphone.java,v 1.10 2003/11/07 23:12:54 ggregory Exp $
75+
* @version $Id: Metaphone.java,v 1.11 2003/11/24 00:11:56 ggregory Exp $
7676
*/
7777
public class Metaphone implements StringEncoder {
7878

@@ -373,11 +373,9 @@ public Object encode(Object pObject) throws EncoderException {
373373
*
374374
* @param pString String object to encode
375375
* @return The metaphone code corresponding to the String supplied
376-
* @throws EncoderException thrown if a Metaphone specific exception
377-
* is encountered.
378376
*/
379377
public String encode(String pString) {
380-
return (metaphone(pString));
378+
return metaphone(pString);
381379
}
382380

383381
/**

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
*
6969
* @author Tim O'Brien
7070
* @author ggregory@seagullsw.com
71-
* @version $Id: RefinedSoundex.java,v 1.11 2003/11/07 22:39:30 ggregory Exp $
71+
* @version $Id: RefinedSoundex.java,v 1.12 2003/11/24 00:11:56 ggregory Exp $
7272
*/
7373
public class RefinedSoundex implements StringEncoder {
7474

@@ -154,11 +154,9 @@ public String soundex(String str) {
154154
*
155155
* @param pString A String object to encode
156156
* @return A Soundex code corresponding to the String supplied
157-
* @throws EncoderException throws exception if there is an
158-
* encoding-specific problem
159157
*/
160158
public String encode(String pString) {
161-
return (soundex(pString));
159+
return soundex(pString);
162160
}
163161

164162
/**

src/java/org/apache/commons/codec/net/URLCodec.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
* @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
8888
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
8989
* @since 1.2
90-
* @version $Id: URLCodec.java,v 1.10 2003/11/08 01:52:25 ggregory Exp $
90+
* @version $Id: URLCodec.java,v 1.11 2003/11/24 00:11:56 ggregory Exp $
9191
*/
9292

9393
public class URLCodec
@@ -137,6 +137,8 @@ public URLCodec() {
137137

138138
/**
139139
* Constructor which allows for the selection of an Encoding
140+
*
141+
* @param encoding the String encoding to use.
140142
*/
141143
public URLCodec(String encoding) {
142144
super();
@@ -249,20 +251,21 @@ public byte[] decode(byte[] pArray) throws DecoderException {
249251

250252
/**
251253
* Encodes a string into its URL safe form using the specified
252-
* character set. Unsafe characters are escaped.
254+
* encoding. Unsafe characters are escaped.
253255
*
254256
* @param pString string to convert to a URL safe form
257+
* @param encoding the encoding for pString
255258
* @return URL safe string
256259
* @throws UnsupportedEncodingException Thrown if charset is not
257260
* supported
258261
*/
259-
public String encode(String pString, String charset)
262+
public String encode(String pString, String encoding)
260263
throws UnsupportedEncodingException
261264
{
262265
if (pString == null) {
263266
return null;
264267
}
265-
return new String(encode(pString.getBytes(charset)), this.getEncoding());
268+
return new String(encode(pString.getBytes(encoding)), this.getEncoding());
266269
}
267270

268271

@@ -288,22 +291,23 @@ public String encode(String pString) throws EncoderException {
288291

289292
/**
290293
* Decodes a URL safe string into its original form using the
291-
* specified character set. Escaped characters are converted back
294+
* specified encoding. Escaped characters are converted back
292295
* to their original representation.
293296
*
294297
* @param pString URL safe string to convert into its original form
298+
* @param encoding the original string encoding
295299
* @return original string
296300
* @throws DecoderException Thrown if URL decoding is unsuccessful
297301
* @throws UnsupportedEncodingException Thrown if charset is not
298302
* supported
299303
*/
300-
public String decode(String pString, String charset)
304+
public String decode(String pString, String encoding)
301305
throws DecoderException, UnsupportedEncodingException
302306
{
303307
if (pString == null) {
304308
return null;
305309
}
306-
return new String(decode(pString.getBytes(this.getEncoding())), charset);
310+
return new String(decode(pString.getBytes(this.getEncoding())), encoding);
307311
}
308312

309313

0 commit comments

Comments
 (0)