Skip to content

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

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions