Polishing

This commit is contained in:
Juergen Hoeller
2016-12-01 14:13:23 +01:00
parent f16d453805
commit 5fee5f39ea
14 changed files with 95 additions and 85 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@ public final class Property {
this.readMethod = readMethod;
this.writeMethod = writeMethod;
this.methodParameter = resolveMethodParameter();
this.name = (name == null ? resolveName() : name);
this.name = (name != null ? name : resolveName());
}

View File

@@ -32,6 +32,7 @@ abstract class ConversionUtils {
public static Object invokeConverter(GenericConverter converter, Object source, TypeDescriptor sourceType,
TypeDescriptor targetType) {
try {
return converter.convert(source, sourceType, targetType);
}
@@ -43,7 +44,9 @@ abstract class ConversionUtils {
}
}
public static boolean canConvertElements(TypeDescriptor sourceElementType, TypeDescriptor targetElementType, ConversionService conversionService) {
public static boolean canConvertElements(TypeDescriptor sourceElementType, TypeDescriptor targetElementType,
ConversionService conversionService) {
if (targetElementType == null) {
// yes
return true;
@@ -57,11 +60,11 @@ abstract class ConversionUtils {
return true;
}
else if (sourceElementType.getType().isAssignableFrom(targetElementType.getType())) {
// maybe;
// maybe
return true;
}
else {
// no;
// no
return false;
}
}

View File

@@ -67,8 +67,8 @@ public class GenericConversionService implements ConfigurableConversionService {
private static final GenericConverter NO_OP_CONVERTER = new NoOpConverter("NO_OP");
/**
* Used as a cache entry when no converter is available. This converter is never
* returned.
* Used as a cache entry when no converter is available.
* This converter is never returned.
*/
private static final GenericConverter NO_MATCH = new NoOpConverter("NO_MATCH");