Fix typos

This commit is contained in:
Pierre Grimaud
2020-04-29 19:36:34 +02:00
parent fda7d00747
commit f9a40599fb
11 changed files with 20 additions and 20 deletions

View File

@ -513,11 +513,11 @@ public class MainUtil {
}
try (FileInputStream fIn = new FileInputStream(sourceFile); FileChannel source = fIn.getChannel();
FileOutputStream fOut = new FileOutputStream(destFile); FileChannel destination = fOut.getChannel()) {
long transfered = 0;
long transferred = 0;
long bytes = source.size();
while (transfered < bytes) {
transfered += destination.transferFrom(source, 0, source.size());
destination.position(transfered);
while (transferred < bytes) {
transferred += destination.transferFrom(source, 0, source.size());
destination.position(transferred);
}
}
return destFile;

View File

@ -131,13 +131,13 @@ public class ReflectionUtils {
}
}
public static <T> T callConstructor(Constructor<T> constructor, Object... paramaters) {
public static <T> T callConstructor(Constructor<T> constructor, Object... parameters) {
if (constructor == null) {
throw new RuntimeException("No such constructor");
}
constructor.setAccessible(true);
try {
return constructor.newInstance(paramaters);
return constructor.newInstance(parameters);
} catch (InvocationTargetException ex) {
throw new RuntimeException(ex.getCause());
} catch (Exception ex) {

View File

@ -37,7 +37,7 @@ public class ReflectionUtils9 {
// 3. build new enum
T newValue = (T) makeEnum(enumType, // The target enum class
enumName, // THE NEW ENUM INSTANCE TO BE DYNAMICALLY ADDED
values.size()); // can be used to pass values to the enum constuctor
values.size()); // can be used to pass values to the enum constructor
// 4. add new value
values.add(newValue);