polishing

This commit is contained in:
Juergen Hoeller 2010-10-11 21:15:26 +00:00
parent b062de1133
commit 0ef971b82b
3 changed files with 17 additions and 16 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2009 the original author or authors. * Copyright 2002-2010 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -19,13 +19,21 @@ package org.springframework.core.convert;
import org.springframework.core.NestedRuntimeException; import org.springframework.core.NestedRuntimeException;
/** /**
* Base class for exceptions thrown by the convert system. * Base class for exceptions thrown by the conversion system.
* *
* @author Keith Donald * @author Keith Donald
* @since 3.0 * @since 3.0
*/ */
public abstract class ConversionException extends NestedRuntimeException { public abstract class ConversionException extends NestedRuntimeException {
/**
* Construct a new conversion exception.
* @param message the exception message
*/
public ConversionException(String message) {
super(message);
}
/** /**
* Construct a new conversion exception. * Construct a new conversion exception.
* @param message the exception message * @param message the exception message
@ -35,12 +43,4 @@ public abstract class ConversionException extends NestedRuntimeException {
super(message, cause); super(message, cause);
} }
/**
* Construct a new conversion exception.
* @param message the exception message
*/
public ConversionException(String message) {
super(message);
}
} }

View File

@ -29,6 +29,7 @@ public final class ConverterNotFoundException extends ConversionException {
private final TypeDescriptor targetType; private final TypeDescriptor targetType;
/** /**
* Creates a new conversion executor not found exception. * Creates a new conversion executor not found exception.
* @param sourceType the source type requested to convert from * @param sourceType the source type requested to convert from
@ -42,6 +43,7 @@ public final class ConverterNotFoundException extends ConversionException {
this.targetType = targetType; this.targetType = targetType;
} }
/** /**
* Returns the source type that was requested to convert from. * Returns the source type that was requested to convert from.
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2010 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -40,8 +40,8 @@ public abstract class FileSystemUtils {
if (root.isDirectory()) { if (root.isDirectory()) {
File[] children = root.listFiles(); File[] children = root.listFiles();
if (children != null) { if (children != null) {
for (int i = 0; i < children.length; i++) { for (File child : children) {
deleteRecursively(children[i]); deleteRecursively(child);
} }
} }
} }
@ -77,9 +77,8 @@ public abstract class FileSystemUtils {
if (entries == null) { if (entries == null) {
throw new IOException("Could not list files in directory: " + src); throw new IOException("Could not list files in directory: " + src);
} }
for (int i = 0; i < entries.length; i++) { for (File entry : entries) {
File file = entries[i]; doCopyRecursively(entry, new File(dest, entry.getName()));
doCopyRecursively(file, new File(dest, file.getName()));
} }
} }
else if (src.isFile()) { else if (src.isFile()) {