Skip to content

Commit 64b5ec2

Browse files
author
Stephen Colebourne
committed
Fix checkstyle errors
bug 38145, from Niall Pemberton git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@369075 13f79535-47bb-0310-9956-ffa450edef68
1 parent 71a72d8 commit 64b5ec2

6 files changed

Lines changed: 61 additions & 22 deletions

File tree

checkstyle.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ limitations under the License.
3131
<module name="NeedBraces"/>
3232
<module name="RedundantThrows">
3333
<property name="allowUnchecked" value="true"/>
34+
<property name="allowSubclasses" value="true"/>
3435
</module>
3536
<module name="LineLength">
3637
<property name="max" value="120"/>

src/java/org/apache/commons/io/HexDump.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002,2004-2005 The Apache Software Foundation.
2+
* Copyright 2002,2004-2006 The Apache Software Foundation.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,9 +42,9 @@ public HexDump() {
4242
/**
4343
* Dump an array of bytes to an OutputStream.
4444
*
45-
* @param data the byte array to be dumped
46-
* @param offset its offset, whatever that might mean
47-
* @param stream the OutputStream to which the data is to be
45+
* @param data the byte array to be dumped
46+
* @param offset its offset, whatever that might mean
47+
* @param stream the OutputStream to which the data is to be
4848
* written
4949
* @param index initial index into the byte array
5050
*
@@ -118,6 +118,12 @@ public static void dump(byte[] data, long offset,
118118
28, 24, 20, 16, 12, 8, 4, 0
119119
};
120120

121+
/**
122+
* Dump a long value into a StringBuffer.
123+
*
124+
* @param value the long value to be dumped
125+
* @return StringBuffer containing the dumped value.
126+
*/
121127
private static StringBuffer dump(long value) {
122128
_lbuffer.setLength(0);
123129
for (int j = 0; j < 8; j++) {
@@ -127,11 +133,18 @@ private static StringBuffer dump(long value) {
127133
return _lbuffer;
128134
}
129135

136+
/**
137+
* Dump a byte value into a StringBuffer.
138+
*
139+
* @param value the byte value to be dumped
140+
* @return StringBuffer containing the dumped value.
141+
*/
130142
private static StringBuffer dump(byte value) {
131143
_cbuffer.setLength(0);
132144
for (int j = 0; j < 2; j++) {
133145
_cbuffer.append(_hexcodes[(value >> _shifts[j + 6]) & 15]);
134146
}
135147
return _cbuffer;
136148
}
149+
137150
}

src/java/org/apache/commons/io/filefilter/AgeFileFilter.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class AgeFileFilter extends AbstractFileFilter {
5050
/**
5151
* Constructs a new age file filter for files older than a certain cutoff.
5252
*
53-
* @param age the threshold age of the files
53+
* @param cutoff the threshold age of the files
5454
*/
5555
public AgeFileFilter(long cutoff) {
5656
this(cutoff, true);
@@ -60,7 +60,7 @@ public AgeFileFilter(long cutoff) {
6060
* Constructs a new age file filter for files on any one side
6161
* of a certain cutoff.
6262
*
63-
* @param age the threshold age of the files
63+
* @param cutoff the threshold age of the files
6464
* @param acceptOlder if true, older files are accepted, else newer ones
6565
*/
6666
public AgeFileFilter(long cutoff, boolean acceptOlder) {
@@ -72,7 +72,7 @@ public AgeFileFilter(long cutoff, boolean acceptOlder) {
7272
* Constructs a new age file filter for files older than a certain
7373
* cutoff date.
7474
*
75-
* @param age the threshold age of the files
75+
* @param cutoffDate the threshold age of the files
7676
*/
7777
public AgeFileFilter(Date cutoffDate) {
7878
this(cutoffDate, true);
@@ -82,7 +82,7 @@ public AgeFileFilter(Date cutoffDate) {
8282
* Constructs a new age file filter for files on any one side
8383
* of a certain cutoff date.
8484
*
85-
* @param age the threshold age of the files
85+
* @param cutoffDate the threshold age of the files
8686
* @param acceptOlder if true, older files are accepted, else newer ones
8787
*/
8888
public AgeFileFilter(Date cutoffDate, boolean acceptOlder) {
@@ -93,7 +93,8 @@ public AgeFileFilter(Date cutoffDate, boolean acceptOlder) {
9393
* Constructs a new age file filter for files older than a certain
9494
* File (whose last modification time will be used as reference).
9595
*
96-
* @param age the threshold age of the files
96+
* @param cutoffReference the file whose last modification
97+
* time is usesd as the threshold age of the files
9798
*/
9899
public AgeFileFilter(File cutoffReference) {
99100
this(cutoffReference, true);
@@ -104,7 +105,8 @@ public AgeFileFilter(File cutoffReference) {
104105
* of a certain File (whose last modification time will be used as
105106
* reference).
106107
*
107-
* @param age the threshold age of the files
108+
* @param cutoffReference the file whose last modification
109+
* time is usesd as the threshold age of the files
108110
* @param acceptOlder if true, older files are accepted, else newer ones
109111
*/
110112
public AgeFileFilter(File cutoffReference, boolean acceptOlder) {

src/java/org/apache/commons/io/filefilter/FileFilterUtils.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public static IOFileFilter ageFileFilter(long cutoff, boolean acceptOlder) {
237237
* Returns a filter that returns true if the file was last modified after
238238
* the specified cutoff date.
239239
*
240-
* @param cutoff the time threshold
240+
* @param cutoffDate the time threshold
241241
* @return an appropriately configured age file filter
242242
* @since Commons IO 1.2
243243
*/
@@ -248,7 +248,7 @@ public static IOFileFilter ageFileFilter(Date cutoffDate) {
248248
/**
249249
* Returns a filter that filters files based on a cutoff date.
250250
*
251-
* @param cutoff the time threshold
251+
* @param cutoffDate the time threshold
252252
* @param acceptOlder if true, older files get accepted, if false, newer
253253
* @return an appropriately configured age file filter
254254
* @since Commons IO 1.2
@@ -261,7 +261,8 @@ public static IOFileFilter ageFileFilter(Date cutoffDate, boolean acceptOlder) {
261261
* Returns a filter that returns true if the file was last modified after
262262
* the specified reference file.
263263
*
264-
* @param cutoff the time threshold
264+
* @param cutoffReference the file whose last modification
265+
* time is usesd as the threshold age of the files
265266
* @return an appropriately configured age file filter
266267
* @since Commons IO 1.2
267268
*/
@@ -272,7 +273,8 @@ public static IOFileFilter ageFileFilter(File cutoffReference) {
272273
/**
273274
* Returns a filter that filters files based on a cutoff reference file.
274275
*
275-
* @param cutoff the time threshold
276+
* @param cutoffReference the file whose last modification
277+
* time is usesd as the threshold age of the files
276278
* @param acceptOlder if true, older files get accepted, if false, newer
277279
* @return an appropriately configured age file filter
278280
* @since Commons IO 1.2
@@ -285,7 +287,7 @@ public static IOFileFilter ageFileFilter(File cutoffReference, boolean acceptOld
285287
/**
286288
* Returns a filter that returns true if the file is bigger than a certain size.
287289
*
288-
* @param long the file size threshold
290+
* @param threshold the file size threshold
289291
* @return an appropriately configured SizeFileFilter
290292
* @since Commons IO 1.2
291293
*/
@@ -296,7 +298,7 @@ public static IOFileFilter sizeFileFilter(long threshold) {
296298
/**
297299
* Returns a filter that filters based on file size.
298300
*
299-
* @param long the file size threshold
301+
* @param threshold the file size threshold
300302
* @param acceptLarger if true, larger files get accepted, if false, smaller
301303
* @return an appropriately configured SizeFileFilter
302304
* @since Commons IO 1.2

src/java/org/apache/commons/io/input/ClassLoaderObjectInputStream.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2001-2005 The Apache Software Foundation.
2+
* Copyright 2001-2006 The Apache Software Foundation.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,7 +51,15 @@ public ClassLoaderObjectInputStream(
5151
this.classLoader = classLoader;
5252
}
5353

54-
/** @inheritDoc */
54+
/**
55+
* Resolve a class specified by the descriptor using the
56+
* specified ClassLoader or the super ClassLoader.
57+
*
58+
* @param objectStreamClass descriptor of the class
59+
* @return the Class object described by the ObjectStreamClass
60+
* @throws IOException in case of an I/O error
61+
* @throws ClassNotFoundException if the Class cannot be found
62+
*/
5563
protected Class resolveClass(ObjectStreamClass objectStreamClass)
5664
throws IOException, ClassNotFoundException {
5765

src/java/org/apache/commons/io/output/ByteArrayOutputStream.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2003,2004 The Apache Software Foundation.
2+
* Copyright 2003-2006 The Apache Software Foundation.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -64,8 +64,8 @@ public ByteArrayOutputStream() {
6464
* Creates a new byte array output stream, with a buffer capacity of
6565
* the specified size, in bytes.
6666
*
67-
* @param size the initial size.
68-
* @exception IllegalArgumentException if size is negative.
67+
* @param size the initial size
68+
* @throws IllegalArgumentException if size is negative
6969
*/
7070
public ByteArrayOutputStream(int size) {
7171
if (size < 0) {
@@ -75,10 +75,23 @@ public ByteArrayOutputStream(int size) {
7575
needNewBuffer(size);
7676
}
7777

78+
/**
79+
* Return the appropriate <code>byte[]</code> buffer
80+
* specified by index.
81+
*
82+
* @param index the index of the buffer required
83+
* @return the buffer
84+
*/
7885
private byte[] getBuffer(int index) {
7986
return (byte[])buffers.get(index);
8087
}
8188

89+
/**
90+
* Makes a new buffer available either by allocating
91+
* a new one or re-cycling an existing one.
92+
*
93+
* @param newcount the size of the buffer if one is created
94+
*/
8295
private void needNewBuffer(int newcount) {
8396
if (currentBufferIndex < buffers.size() - 1) {
8497
//Recycling old buffer
@@ -168,7 +181,7 @@ public synchronized void reset() {
168181
currentBufferIndex = 0;
169182
currentBuffer = getBuffer(currentBufferIndex);
170183
}
171-
184+
172185
/**
173186
* @see java.io.ByteArrayOutputStream#writeTo(OutputStream)
174187
*/

0 commit comments

Comments
 (0)