Browse Source

removed unused method; polishing

pull/23217/head
Keith Donald 15 years ago
parent
commit
541cf2de80
  1. 11
      org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java
  2. 4
      org.springframework.core/src/main/java/org/springframework/core/convert/support/CollectionToMapConverter.java

11
org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java

@ -26,7 +26,6 @@ import org.springframework.core.GenericCollectionTypeResolver; @@ -26,7 +26,6 @@ import org.springframework.core.GenericCollectionTypeResolver;
import org.springframework.core.MethodParameter;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;
/**
* Context about a type to convert to.
@ -136,7 +135,7 @@ public class TypeDescriptor { @@ -136,7 +135,7 @@ public class TypeDescriptor {
/**
* Determine the declared (non-generic) type of the wrapped parameter/field.
* @return the declared type
* @return the declared type, or null if this is {@link TypeDescriptor#NULL}.
*/
public Class<?> getType() {
if (this.type != null) {
@ -162,14 +161,6 @@ public class TypeDescriptor { @@ -162,14 +161,6 @@ public class TypeDescriptor {
return (type != null ? ClassUtils.resolvePrimitiveIfNecessary(type) : type);
}
/**
* Does the underyling declared type equal the type provided?
* @param type the type to test against
*/
public boolean typeEquals(Class<?> type) {
return ObjectUtils.nullSafeEquals(getType(), type);
}
/**
* Returns the name of this type: the fully qualified class name.
*/

4
org.springframework.core/src/main/java/org/springframework/core/convert/support/CollectionToMapConverter.java

@ -77,7 +77,7 @@ final class CollectionToMapConverter implements ConditionalGenericConverter { @@ -77,7 +77,7 @@ final class CollectionToMapConverter implements ConditionalGenericConverter {
}
if (keysCompatible && valuesCompatible) {
Map target = CollectionFactory.createMap(targetType.getType(), sourceCollection.size());
if (sourceElementType.typeEquals(String.class)) {
if (String.class.equals(sourceElementType.getType())) {
for (Object element : sourceCollection) {
String[] property = parseProperty((String) element);
target.put(property[0], property[1]);
@ -94,7 +94,7 @@ final class CollectionToMapConverter implements ConditionalGenericConverter { @@ -94,7 +94,7 @@ final class CollectionToMapConverter implements ConditionalGenericConverter {
Map target = CollectionFactory.createMap(targetType.getType(), sourceCollection.size());
MapEntryConverter converter = new MapEntryConverter(sourceElementType, sourceElementType, targetKeyType,
targetValueType, keysCompatible, valuesCompatible, conversionService);
if (sourceElementType.typeEquals(String.class)) {
if (String.class.equals(sourceElementType.getType())) {
for (Object element : sourceCollection) {
String[] property = parseProperty((String) element);
Object targetKey = converter.convertKey(property[0]);

Loading…
Cancel
Save