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

TypeConverterDelegate falls back to deprecated Date constructor when first converter failed [SPR-9865] #14498

Closed
spring-projects-issues opened this issue Oct 7, 2012 · 2 comments
Assignees
Labels
type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 7, 2012

James Roper opened SPR-9865 and commented

I've just upgraded from Spring 3.0.7 to Spring 3.1.2. I have a test that ensures that when I try to bind String data to a date field in a bean using a particular date format, and I provide a date in the wrong format, it should produce an error. This test started failing when I upgraded to Spring 3.1.2, because it seems to have introduced functionality where if the first converter fails, TypeConverterDelegate falls back to using a constructor that accepts an argument of the initial type for the destination type. This is probably a good feature in most cases, except in the case of java.util.Date, where that constructor has been deprecated since Java 1.1, is locale dependent, and probably should never ever be used in any circumstance.


Affects: 3.1.2

Referenced from: commits ff7dcec, 9862fbf

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 11, 2012

Juergen Hoeller commented

Good point. We're not falling back to that String constructor algorithm if a corresponding ConversionService attempt failed before anymore. We're only doing so now if no other converter/editor has been registered, as a last resort (just like in 3.0.x).

Juergen

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 11, 2012

James Roper commented

Thanks!

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

No branches or pull requests

2 participants