master
Juergen Hoeller 11 years ago
parent 960ba379ca
commit 2c2ed7edd3
  1. 8
      spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java
  2. 8
      spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java

@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
@ -109,7 +109,7 @@ public class TypedStringValue implements BeanMetadataElement {
/**
* Return the type to convert to.
*/
public Class getTargetType() {
public Class<?> getTargetType() {
Object targetTypeValue = this.targetType;
if (!(targetTypeValue instanceof Class)) {
throw new IllegalStateException("Typed String value does not carry a resolved target type");
@ -153,11 +153,11 @@ public class TypedStringValue implements BeanMetadataElement {
* @return the resolved type to convert to
* @throws ClassNotFoundException if the type cannot be resolved
*/
public Class resolveTargetType(ClassLoader classLoader) throws ClassNotFoundException {
public Class<?> resolveTargetType(ClassLoader classLoader) throws ClassNotFoundException {
if (this.targetType == null) {
return null;
}
Class resolvedClass = ClassUtils.forName(getTargetTypeName(), classLoader);
Class<?> resolvedClass = ClassUtils.forName(getTargetTypeName(), classLoader);
this.targetType = resolvedClass;
return resolvedClass;
}

@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
@ -128,7 +128,7 @@ class BeanDefinitionValueResolver {
else if (value instanceof ManagedArray) {
// May need to resolve contained runtime references.
ManagedArray array = (ManagedArray) value;
Class elementType = array.resolvedElementType;
Class<?> elementType = array.resolvedElementType;
if (elementType == null) {
String elementTypeName = array.getElementTypeName();
if (StringUtils.hasText(elementTypeName)) {
@ -271,7 +271,7 @@ class BeanDefinitionValueResolver {
Object innerBean = this.beanFactory.createBean(actualInnerBeanName, mbd, null);
this.beanFactory.registerContainedBean(actualInnerBeanName, this.beanName);
if (innerBean instanceof FactoryBean) {
boolean synthetic = (mbd != null && mbd.isSynthetic());
boolean synthetic = mbd.isSynthetic();
return this.beanFactory.getObjectFromFactoryBean((FactoryBean) innerBean, actualInnerBeanName, !synthetic);
}
else {
@ -335,7 +335,7 @@ class BeanDefinitionValueResolver {
/**
* For each element in the managed array, resolve reference if necessary.
*/
private Object resolveManagedArray(Object argName, List<?> ml, Class elementType) {
private Object resolveManagedArray(Object argName, List<?> ml, Class<?> elementType) {
Object resolved = Array.newInstance(elementType, ml.size());
for (int i = 0; i < ml.size(); i++) {
Array.set(resolved, i,

Loading…
Cancel
Save