Skip to content

GenericTypeResolver does not properly handle array parameter types [SPR-6977] #11642

@spring-projects-issues

Description

@spring-projects-issues

Christian Dupuis opened SPR-6977 and commented

The following short test problem fails with Spring 3.0.1:

import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.core.GenericTypeResolver;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.config.SortedResourcesFactoryBean;

public class GenericTypeResolverTest {

	@Test
	public void testArrayResolution() {
		Class clazz = GenericTypeResolver.resolveTypeArgument(SortedResourcesFactoryBean.class, FactoryBean.class);
		assertTrue(clazz.isArray());
		assertTrue(clazz.getComponentType().equals(Resource.class));
	}

}


Affects: 3.0.1

Referenced from: commits 4c4f19e, 145dcfd

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions