Skip to content

Commit 48f86f1

Browse files
committed
Checkstyle fixes, harmonised javadoc for param and throws tags.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1378748 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4541fb8 commit 48f86f1

3 files changed

Lines changed: 46 additions & 50 deletions

File tree

src/main/java/org/apache/commons/codec/net/QCodec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
* The instance field {@link #encodeBlanks} is mutable {@link #setEncodeBlanks(boolean)}
4242
* but is not volatile, and accesses are not synchronised.
4343
* If an instance of the class is shared between threads, the caller needs to ensure that suitable synchronisation
44-
* is used to ensure safe publication of the value between threads, and must not invoke {@link #setEncodeBlanks(boolean)}
45-
* after initial setup.
44+
* is used to ensure safe publication of the value between threads, and must not invoke
45+
* {@link #setEncodeBlanks(boolean)} after initial setup.
4646
*
4747
* @see <a href="http://www.ietf.org/rfc/rfc1522.txt">MIME (Multipurpose Internet Mail Extensions) Part Two: Message
4848
* Header Extensions for Non-ASCII Text</a>

src/main/java/org/apache/commons/codec/net/QuotedPrintableCodec.java

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,9 @@ private static final void encodeQuotedPrintable(int b, ByteArrayOutputStream buf
137137

138138
/**
139139
* Encodes an array of bytes into an array of quoted-printable 7-bit characters. Unsafe characters are escaped.
140-
*
141140
* <p>
142141
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
143142
* RFC 1521 and is suitable for encoding binary data and unformatted text.
144-
* </p>
145143
*
146144
* @param printable
147145
* bitset of characters deemed quoted-printable
@@ -174,11 +172,9 @@ public static final byte[] encodeQuotedPrintable(BitSet printable, byte[] bytes)
174172
/**
175173
* Decodes an array quoted-printable characters into an array of original bytes. Escaped characters are converted
176174
* back to their original representation.
177-
*
178175
* <p>
179176
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
180177
* RFC 1521.
181-
* </p>
182178
*
183179
* @param bytes
184180
* array of quoted-printable characters
@@ -210,11 +206,9 @@ public static final byte[] decodeQuotedPrintable(byte[] bytes) throws DecoderExc
210206

211207
/**
212208
* Encodes an array of bytes into an array of quoted-printable 7-bit characters. Unsafe characters are escaped.
213-
*
214209
* <p>
215210
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
216211
* RFC 1521 and is suitable for encoding binary data and unformatted text.
217-
* </p>
218212
*
219213
* @param bytes
220214
* array of bytes to be encoded
@@ -228,11 +222,9 @@ public byte[] encode(byte[] bytes) {
228222
/**
229223
* Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted
230224
* back to their original representation.
231-
*
232225
* <p>
233226
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
234227
* RFC 1521.
235-
* </p>
236228
*
237229
* @param bytes
238230
* array of quoted-printable characters
@@ -247,11 +239,9 @@ public byte[] decode(byte[] bytes) throws DecoderException {
247239

248240
/**
249241
* Encodes a string into its quoted-printable form using the default string charset. Unsafe characters are escaped.
250-
*
251242
* <p>
252243
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
253244
* RFC 1521 and is suitable for encoding binary data.
254-
* </p>
255245
*
256246
* @param str
257247
* string to convert to quoted-printable form
@@ -332,8 +322,8 @@ public String decode(String str) throws DecoderException {
332322
* string to convert to a quoted-printable form
333323
* @return quoted-printable object
334324
* @throws EncoderException
335-
* Thrown if quoted-printable encoding is not applicable to objects of this type or if encoding is
336-
* unsuccessful
325+
* Thrown if quoted-printable encoding is not applicable to objects of this type or if
326+
* encoding is unsuccessful
337327
*/
338328
@Override
339329
public Object encode(Object obj) throws EncoderException {
@@ -351,15 +341,15 @@ public Object encode(Object obj) throws EncoderException {
351341
}
352342

353343
/**
354-
* Decodes a quoted-printable object into its original form. Escaped characters are converted back to their original
355-
* representation.
344+
* Decodes a quoted-printable object into its original form. Escaped characters are converted back to their
345+
* original representation.
356346
*
357347
* @param obj
358348
* quoted-printable object to convert into its original form
359349
* @return original object
360350
* @throws DecoderException
361-
* Thrown if the argument is not a <code>String</code> or <code>byte[]</code>. Thrown if a failure condition is
362-
* encountered during the decode process.
351+
* Thrown if the argument is not a <code>String</code> or <code>byte[]</code>.
352+
* Thrown if a failure condition is encountered during the decode process.
363353
*/
364354
@Override
365355
public Object decode(Object obj) throws DecoderException {
@@ -397,11 +387,9 @@ public String getDefaultCharset() {
397387

398388
/**
399389
* Encodes a string into its quoted-printable form using the specified charset. Unsafe characters are escaped.
400-
*
401390
* <p>
402391
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
403392
* RFC 1521 and is suitable for encoding binary data and unformatted text.
404-
* </p>
405393
*
406394
* @param str
407395
* string to convert to quoted-printable form
@@ -419,11 +407,9 @@ public String encode(String str, Charset charset) {
419407

420408
/**
421409
* Encodes a string into its quoted-printable form using the specified charset. Unsafe characters are escaped.
422-
*
423410
* <p>
424411
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
425412
* RFC 1521 and is suitable for encoding binary data and unformatted text.
426-
* </p>
427413
*
428414
* @param str
429415
* string to convert to quoted-printable form

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

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ public URLCodec(String charset) {
113113
* Encodes an array of bytes into an array of URL safe 7-bit characters. Unsafe characters are escaped.
114114
*
115115
* @param urlsafe
116-
* bitset of characters deemed URL safe
116+
* bitset of characters deemed URL safe
117117
* @param bytes
118-
* array of bytes to convert to URL safe characters
118+
* array of bytes to convert to URL safe characters
119119
* @return array of bytes containing URL safe characters
120120
*/
121121
public static final byte[] encodeUrl(BitSet urlsafe, byte[] bytes) {
@@ -153,9 +153,11 @@ public static final byte[] encodeUrl(BitSet urlsafe, byte[] bytes) {
153153
* original bytes. Escaped characters are converted back to their
154154
* original representation.
155155
*
156-
* @param bytes array of URL safe characters
156+
* @param bytes
157+
* array of URL safe characters
157158
* @return array of original bytes
158-
* @throws DecoderException Thrown if URL decoding is unsuccessful
159+
* @throws DecoderException
160+
* Thrown if URL decoding is unsuccessful
159161
*/
160162
public static final byte[] decodeUrl(byte[] bytes) throws DecoderException {
161163
if (bytes == null) {
@@ -185,7 +187,8 @@ public static final byte[] decodeUrl(byte[] bytes) throws DecoderException {
185187
* Encodes an array of bytes into an array of URL safe 7-bit
186188
* characters. Unsafe characters are escaped.
187189
*
188-
* @param bytes array of bytes to convert to URL safe characters
190+
* @param bytes
191+
* array of bytes to convert to URL safe characters
189192
* @return array of bytes containing URL safe characters
190193
*/
191194
@Override
@@ -199,9 +202,11 @@ public byte[] encode(byte[] bytes) {
199202
* original bytes. Escaped characters are converted back to their
200203
* original representation.
201204
*
202-
* @param bytes array of URL safe characters
205+
* @param bytes
206+
* array of URL safe characters
203207
* @return array of original bytes
204-
* @throws DecoderException Thrown if URL decoding is unsuccessful
208+
* @throws DecoderException
209+
* Thrown if URL decoding is unsuccessful
205210
*/
206211
@Override
207212
public byte[] decode(byte[] bytes) throws DecoderException {
@@ -212,12 +217,12 @@ public byte[] decode(byte[] bytes) throws DecoderException {
212217
* Encodes a string into its URL safe form using the specified string charset. Unsafe characters are escaped.
213218
*
214219
* @param str
215-
* string to convert to a URL safe form
220+
* string to convert to a URL safe form
216221
* @param charset
217-
* the charset for str
222+
* the charset for str
218223
* @return URL safe string
219224
* @throws UnsupportedEncodingException
220-
* Thrown if charset is not supported
225+
* Thrown if charset is not supported
221226
*/
222227
public String encode(String str, String charset) throws UnsupportedEncodingException {
223228
if (str == null) {
@@ -230,9 +235,11 @@ public String encode(String str, String charset) throws UnsupportedEncodingExcep
230235
* Encodes a string into its URL safe form using the default string
231236
* charset. Unsafe characters are escaped.
232237
*
233-
* @param str string to convert to a URL safe form
238+
* @param str
239+
* string to convert to a URL safe form
234240
* @return URL safe string
235-
* @throws EncoderException Thrown if URL encoding is unsuccessful
241+
* @throws EncoderException
242+
* Thrown if URL encoding is unsuccessful
236243
*
237244
* @see #getDefaultCharset()
238245
*/
@@ -254,12 +261,15 @@ public String encode(String str) throws EncoderException {
254261
* specified encoding. Escaped characters are converted back
255262
* to their original representation.
256263
*
257-
* @param str URL safe string to convert into its original form
258-
* @param charset the original string charset
264+
* @param str
265+
* URL safe string to convert into its original form
266+
* @param charset
267+
* the original string charset
259268
* @return original string
260-
* @throws DecoderException Thrown if URL decoding is unsuccessful
261-
* @throws UnsupportedEncodingException Thrown if charset is not
262-
* supported
269+
* @throws DecoderException
270+
* Thrown if URL decoding is unsuccessful
271+
* @throws UnsupportedEncodingException
272+
* Thrown if charset is not supported
263273
*/
264274
public String decode(String str, String charset) throws DecoderException, UnsupportedEncodingException {
265275
if (str == null) {
@@ -273,10 +283,11 @@ public String decode(String str, String charset) throws DecoderException, Unsupp
273283
* string charset. Escaped characters are converted back to their
274284
* original representation.
275285
*
276-
* @param str URL safe string to convert into its original form
286+
* @param str
287+
* URL safe string to convert into its original form
277288
* @return original string
278-
* @throws DecoderException Thrown if URL decoding is unsuccessful
279-
*
289+
* @throws DecoderException
290+
* Thrown if URL decoding is unsuccessful
280291
* @see #getDefaultCharset()
281292
*/
282293
@Override
@@ -292,14 +303,13 @@ public String decode(String str) throws DecoderException {
292303
}
293304

294305
/**
295-
* Encodes an object into its URL safe form. Unsafe characters are
296-
* escaped.
306+
* Encodes an object into its URL safe form. Unsafe characters are escaped.
297307
*
298-
* @param obj string to convert to a URL safe form
308+
* @param obj
309+
* string to convert to a URL safe form
299310
* @return URL safe object
300-
* @throws EncoderException Thrown if URL encoding is not
301-
* applicable to objects of this type or
302-
* if encoding is unsuccessful
311+
* @throws EncoderException
312+
* Thrown if URL encoding is not applicable to objects of this type or if encoding is unsuccessful
303313
*/
304314
@Override
305315
public Object encode(Object obj) throws EncoderException {
@@ -324,8 +334,8 @@ public Object encode(Object obj) throws EncoderException {
324334
* URL safe object to convert into its original form
325335
* @return original object
326336
* @throws DecoderException
327-
* Thrown if the argument is not a <code>String</code> or <code>byte[]</code>. Thrown if a failure condition is
328-
* encountered during the decode process.
337+
* Thrown if the argument is not a <code>String</code> or <code>byte[]</code>.
338+
* Thrown if a failure condition is encountered during the decode process.
329339
*/
330340
@Override
331341
public Object decode(Object obj) throws DecoderException {

0 commit comments

Comments
 (0)