@@ -278,7 +278,7 @@ protected DirectoryWalker() {
278278 * @param depthLimit controls how <i>deep</i> the hierarchy is
279279 * navigated to (less than 0 means unlimited)
280280 */
281- protected DirectoryWalker (FileFilter filter , int depthLimit ) {
281+ protected DirectoryWalker (final FileFilter filter , final int depthLimit ) {
282282 this .filter = filter ;
283283 this .depthLimit = depthLimit ;
284284 }
@@ -297,7 +297,7 @@ protected DirectoryWalker(FileFilter filter, int depthLimit) {
297297 * @param depthLimit controls how <i>deep</i> the hierarchy is
298298 * navigated to (less than 0 means unlimited)
299299 */
300- protected DirectoryWalker (IOFileFilter directoryFilter , IOFileFilter fileFilter , int depthLimit ) {
300+ protected DirectoryWalker (IOFileFilter directoryFilter , IOFileFilter fileFilter , final int depthLimit ) {
301301 if (directoryFilter == null && fileFilter == null ) {
302302 this .filter = null ;
303303 } else {
@@ -326,15 +326,15 @@ protected DirectoryWalker(IOFileFilter directoryFilter, IOFileFilter fileFilter,
326326 * @throws NullPointerException if the start directory is null
327327 * @throws IOException if an I/O Error occurs
328328 */
329- protected final void walk (File startDirectory , Collection <T > results ) throws IOException {
329+ protected final void walk (final File startDirectory , final Collection <T > results ) throws IOException {
330330 if (startDirectory == null ) {
331331 throw new NullPointerException ("Start Directory is null" );
332332 }
333333 try {
334334 handleStart (startDirectory , results );
335335 walk (startDirectory , 0 , results );
336336 handleEnd (results );
337- } catch (CancelException cancel ) {
337+ } catch (final CancelException cancel ) {
338338 handleCancelled (startDirectory , results , cancel );
339339 }
340340 }
@@ -347,19 +347,19 @@ protected final void walk(File startDirectory, Collection<T> results) throws IOE
347347 * @param results the collection of result objects, may be updated
348348 * @throws IOException if an I/O Error occurs
349349 */
350- private void walk (File directory , int depth , Collection <T > results ) throws IOException {
350+ private void walk (final File directory , final int depth , final Collection <T > results ) throws IOException {
351351 checkIfCancelled (directory , depth , results );
352352 if (handleDirectory (directory , depth , results )) {
353353 handleDirectoryStart (directory , depth , results );
354- int childDepth = depth + 1 ;
354+ final int childDepth = depth + 1 ;
355355 if (depthLimit < 0 || childDepth <= depthLimit ) {
356356 checkIfCancelled (directory , depth , results );
357357 File [] childFiles = filter == null ? directory .listFiles () : directory .listFiles (filter );
358358 childFiles = filterDirectoryContents (directory , depth , childFiles );
359359 if (childFiles == null ) {
360360 handleRestricted (directory , childDepth , results );
361361 } else {
362- for (File childFile : childFiles ) {
362+ for (final File childFile : childFiles ) {
363363 if (childFile .isDirectory ()) {
364364 walk (childFile , childDepth , results );
365365 } else {
@@ -390,7 +390,7 @@ private void walk(File directory, int depth, Collection<T> results) throws IOExc
390390 * @param results the collection of result objects, may be updated
391391 * @throws IOException if an I/O Error occurs
392392 */
393- protected final void checkIfCancelled (File file , int depth , Collection <T > results ) throws IOException {
393+ protected final void checkIfCancelled (final File file , final int depth , final Collection <T > results ) throws IOException {
394394 if (handleIsCancelled (file , depth , results )) {
395395 throw new CancelException (file , depth );
396396 }
@@ -432,7 +432,7 @@ protected final void checkIfCancelled(File file, int depth, Collection<T> result
432432 * @throws IOException if an I/O Error occurs
433433 */
434434 protected boolean handleIsCancelled (
435- File file , int depth , Collection <T > results ) throws IOException {
435+ final File file , final int depth , final Collection <T > results ) throws IOException {
436436 // do nothing - overridable by subclass
437437 return false ; // not cancelled
438438 }
@@ -450,8 +450,8 @@ protected boolean handleIsCancelled(
450450 * containing details at the point of cancellation.
451451 * @throws IOException if an I/O Error occurs
452452 */
453- protected void handleCancelled (File startDirectory , Collection <T > results ,
454- CancelException cancel ) throws IOException {
453+ protected void handleCancelled (final File startDirectory , final Collection <T > results ,
454+ final CancelException cancel ) throws IOException {
455455 // re-throw exception - overridable by subclass
456456 throw cancel ;
457457 }
@@ -466,7 +466,7 @@ protected void handleCancelled(File startDirectory, Collection<T> results,
466466 * @param results the collection of result objects, may be updated
467467 * @throws IOException if an I/O Error occurs
468468 */
469- protected void handleStart (File startDirectory , Collection <T > results ) throws IOException {
469+ protected void handleStart (final File startDirectory , final Collection <T > results ) throws IOException {
470470 // do nothing - overridable by subclass
471471 }
472472
@@ -485,7 +485,7 @@ protected void handleStart(File startDirectory, Collection<T> results) throws IO
485485 * @return true to process this directory, false to skip this directory
486486 * @throws IOException if an I/O Error occurs
487487 */
488- protected boolean handleDirectory (File directory , int depth , Collection <T > results ) throws IOException {
488+ protected boolean handleDirectory (final File directory , final int depth , final Collection <T > results ) throws IOException {
489489 // do nothing - overridable by subclass
490490 return true ; // process directory
491491 }
@@ -500,7 +500,7 @@ protected boolean handleDirectory(File directory, int depth, Collection<T> resul
500500 * @param results the collection of result objects, may be updated
501501 * @throws IOException if an I/O Error occurs
502502 */
503- protected void handleDirectoryStart (File directory , int depth , Collection <T > results ) throws IOException {
503+ protected void handleDirectoryStart (final File directory , final int depth , final Collection <T > results ) throws IOException {
504504 // do nothing - overridable by subclass
505505 }
506506
@@ -516,7 +516,7 @@ protected void handleDirectoryStart(File directory, int depth, Collection<T> res
516516 * @throws IOException if an I/O Error occurs
517517 * @since 2.0
518518 */
519- protected File [] filterDirectoryContents (File directory , int depth , File [] files ) throws IOException {
519+ protected File [] filterDirectoryContents (final File directory , final int depth , final File [] files ) throws IOException {
520520 return files ;
521521 }
522522
@@ -530,7 +530,7 @@ protected File[] filterDirectoryContents(File directory, int depth, File[] files
530530 * @param results the collection of result objects, may be updated
531531 * @throws IOException if an I/O Error occurs
532532 */
533- protected void handleFile (File file , int depth , Collection <T > results ) throws IOException {
533+ protected void handleFile (final File file , final int depth , final Collection <T > results ) throws IOException {
534534 // do nothing - overridable by subclass
535535 }
536536
@@ -544,7 +544,7 @@ protected void handleFile(File file, int depth, Collection<T> results) throws IO
544544 * @param results the collection of result objects, may be updated
545545 * @throws IOException if an I/O Error occurs
546546 */
547- protected void handleRestricted (File directory , int depth , Collection <T > results ) throws IOException {
547+ protected void handleRestricted (final File directory , final int depth , final Collection <T > results ) throws IOException {
548548 // do nothing - overridable by subclass
549549 }
550550
@@ -558,7 +558,7 @@ protected void handleRestricted(File directory, int depth, Collection<T> results
558558 * @param results the collection of result objects, may be updated
559559 * @throws IOException if an I/O Error occurs
560560 */
561- protected void handleDirectoryEnd (File directory , int depth , Collection <T > results ) throws IOException {
561+ protected void handleDirectoryEnd (final File directory , final int depth , final Collection <T > results ) throws IOException {
562562 // do nothing - overridable by subclass
563563 }
564564
@@ -570,7 +570,7 @@ protected void handleDirectoryEnd(File directory, int depth, Collection<T> resul
570570 * @param results the collection of result objects, may be updated
571571 * @throws IOException if an I/O Error occurs
572572 */
573- protected void handleEnd (Collection <T > results ) throws IOException {
573+ protected void handleEnd (final Collection <T > results ) throws IOException {
574574 // do nothing - overridable by subclass
575575 }
576576
@@ -596,7 +596,7 @@ public static class CancelException extends IOException {
596596 * @param file the file when the operation was cancelled, may be null
597597 * @param depth the depth when the operation was cancelled, may be null
598598 */
599- public CancelException (File file , int depth ) {
599+ public CancelException (final File file , final int depth ) {
600600 this ("Operation Cancelled" , file , depth );
601601 }
602602
@@ -609,7 +609,7 @@ public CancelException(File file, int depth) {
609609 * @param file the file when the operation was cancelled
610610 * @param depth the depth when the operation was cancelled
611611 */
612- public CancelException (String message , File file , int depth ) {
612+ public CancelException (final String message , final File file , final int depth ) {
613613 super (message );
614614 this .file = file ;
615615 this .depth = depth ;
0 commit comments