polishing

This commit is contained in:
Juergen Hoeller 2011-11-28 18:38:26 +00:00
parent 81e9f6cc2c
commit aa7fcb5431
3 changed files with 10 additions and 5 deletions

View File

@ -168,6 +168,7 @@ public class BeanDefinitionReaderUtils {
public static String registerWithGeneratedName( public static String registerWithGeneratedName(
AbstractBeanDefinition definition, BeanDefinitionRegistry registry) AbstractBeanDefinition definition, BeanDefinitionRegistry registry)
throws BeanDefinitionStoreException { throws BeanDefinitionStoreException {
String generatedName = generateBeanName(definition, registry, false); String generatedName = generateBeanName(definition, registry, false);
registry.registerBeanDefinition(generatedName, definition); registry.registerBeanDefinition(generatedName, definition);
return generatedName; return generatedName;

View File

@ -27,6 +27,7 @@ import org.springframework.util.ObjectUtils;
/** /**
* Context about a type to convert from or to. * Context about a type to convert from or to.
*
* @author Keith Donald * @author Keith Donald
* @author Andy Clement * @author Andy Clement
* @author Juergen Hoeller * @author Juergen Hoeller
@ -203,7 +204,7 @@ public class TypeDescriptor {
* @return the type descriptor * @return the type descriptor
*/ */
public static TypeDescriptor forObject(Object source) { public static TypeDescriptor forObject(Object source) {
return source != null ? valueOf(source.getClass()) : null; return (source != null ? valueOf(source.getClass()) : null);
} }
/** /**
@ -214,7 +215,7 @@ public class TypeDescriptor {
* @see #getObjectType() * @see #getObjectType()
*/ */
public Class<?> getType() { public Class<?> getType() {
return type; return this.type;
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2010 the original author or authors. * Copyright 2002-2011 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.
@ -31,10 +31,12 @@ public class TypedValue {
public static final TypedValue NULL = new TypedValue(null); public static final TypedValue NULL = new TypedValue(null);
private final Object value; private final Object value;
private TypeDescriptor typeDescriptor; private TypeDescriptor typeDescriptor;
/** /**
* Create a TypedValue for a simple object. The type descriptor is inferred * Create a TypedValue for a simple object. The type descriptor is inferred
* from the object, so no generic information is preserved. * from the object, so no generic information is preserved.
@ -42,8 +44,7 @@ public class TypedValue {
*/ */
public TypedValue(Object value) { public TypedValue(Object value) {
this.value = value; this.value = value;
// initialized when/if requested this.typeDescriptor = null; // initialized when/if requested
this.typeDescriptor = null;
} }
/** /**
@ -56,6 +57,7 @@ public class TypedValue {
this.typeDescriptor = typeDescriptor; this.typeDescriptor = typeDescriptor;
} }
public Object getValue() { public Object getValue() {
return this.value; return this.value;
} }
@ -67,6 +69,7 @@ public class TypedValue {
return this.typeDescriptor; return this.typeDescriptor;
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder str = new StringBuilder(); StringBuilder str = new StringBuilder();