Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenericConversionService ignores converters for arrays [SPR-7462] #12120

Closed
spring-projects-issues opened this issue Aug 13, 2010 · 5 comments
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Dave Syer opened SPR-7462 and commented

GenericConversionService ignores converters for arrays: if you add a converter for an array type it is ignored at runtime. The conversion service instead tries to be clever and looks for a converter for the element type in the array. It might find one, but even if it does, it would be the wrong default choice of converter because there is an exact match between the target type and an existing converter.


Affects: 3.0 GA

1 votes, 2 watchers

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Dave, what exactly failed for you there? I added unit tests for a Converter<String[], Integer[]> and a Converter<String, Integer[]> - and both work for me... against the latest Spring 3.0.4 snapshot at least.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

I tried Resource[] and a custom Service[] interface. Try something non-primitive?

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I tried a custom Converter<String[], Resource[]> - works for me as well. I'm afraid you'll have to provide a failing test case against the latest 3.0.4 snapshot...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Dave, any luck in reproducing this in a unit test against the latest 3.0.4 snapshot?

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

This was a problem in an older 3.x (up to 3.0.1). Seems OK with 3.0.4 (and I thin with 3.0.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants