From aa7fcb543159ccfc4e83fcdfa6ccaf2da3afec6d Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 28 Nov 2011 18:38:26 +0000 Subject: [PATCH] polishing --- .../beans/factory/support/BeanDefinitionReaderUtils.java | 1 + .../org/springframework/core/convert/TypeDescriptor.java | 5 +++-- .../java/org/springframework/expression/TypedValue.java | 9 ++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java index 804378b1b1..1d80a290cf 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java @@ -168,6 +168,7 @@ public class BeanDefinitionReaderUtils { public static String registerWithGeneratedName( AbstractBeanDefinition definition, BeanDefinitionRegistry registry) throws BeanDefinitionStoreException { + String generatedName = generateBeanName(definition, registry, false); registry.registerBeanDefinition(generatedName, definition); return generatedName; diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java b/org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java index 12a4b02e54..e2c32922b9 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java @@ -27,6 +27,7 @@ import org.springframework.util.ObjectUtils; /** * Context about a type to convert from or to. + * * @author Keith Donald * @author Andy Clement * @author Juergen Hoeller @@ -203,7 +204,7 @@ public class TypeDescriptor { * @return the type descriptor */ 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() */ public Class getType() { - return type; + return this.type; } /** diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/TypedValue.java b/org.springframework.expression/src/main/java/org/springframework/expression/TypedValue.java index a6b8d20958..bf85bd72f3 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/TypedValue.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/TypedValue.java @@ -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"); * 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); + private final Object value; private TypeDescriptor typeDescriptor; + /** * Create a TypedValue for a simple object. The type descriptor is inferred * from the object, so no generic information is preserved. @@ -42,8 +44,7 @@ public class TypedValue { */ public TypedValue(Object value) { this.value = value; - // initialized when/if requested - this.typeDescriptor = null; + this.typeDescriptor = null; // initialized when/if requested } /** @@ -56,6 +57,7 @@ public class TypedValue { this.typeDescriptor = typeDescriptor; } + public Object getValue() { return this.value; } @@ -67,6 +69,7 @@ public class TypedValue { return this.typeDescriptor; } + @Override public String toString() { StringBuilder str = new StringBuilder();