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

DateTimeFormat ISO.DATE_TIME javadoc contains misleading default note #26134

Closed
norbertspiess opened this issue Nov 23, 2020 · 1 comment
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Milestone

Comments

@norbertspiess
Copy link

Affects: 5.2.10.RELEASE

Maybe I'm missing something, but I think the JavaDoc on the @DateTimeFormat is out of date / not correct.

The DateTimeFormat.ISO#DATE_TIME JavaDoc states, that the DATE_TIME is the default used, when no iso value is specified:

/**
 * The most common ISO DateTime Format {@code yyyy-MM-dd'T'HH:mm:ss.SSSXXX},
 * e.g. "2000-10-31T01:30:00.000-05:00".
 * <p>This is the default if no annotation value is specified.
 */
 DATE_TIME

However, when looking at the DateTimeFormat#iso() implementation, it's as follows:

/**
 * The ISO pattern to use to format the field.
 * <p>The possible ISO patterns are defined in the {@link ISO} enum.
 * <p>Defaults to {@link ISO#NONE}, indicating this attribute should be ignored.
 * Set this attribute when you wish to format your field in accordance with an ISO format.
 */
ISO iso() default ISO.NONE;

So there clearly is a mismatch. Is it just an outdated JavaDoc issue?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 23, 2020
@jhoeller jhoeller self-assigned this Nov 23, 2020
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 23, 2020
@jhoeller jhoeller added this to the 5.3.2 milestone Nov 23, 2020
@jhoeller
Copy link
Contributor

Good catch, the actual default is dependent on the formatter backend (JSR-310 vs Joda-Time vs java.util.Date infrastructure), so that javadoc comment on the DATE_TIME constant is misleading; I'll remove it right away.

@jhoeller jhoeller changed the title DateTimeFormat ISO values - JavaDoc information out of date?! DateTimeFormat ISO.DATE_TIME javadoc makes misleading default claim Nov 23, 2020
@jhoeller jhoeller changed the title DateTimeFormat ISO.DATE_TIME javadoc makes misleading default claim DateTimeFormat ISO.DATE_TIME javadoc contains misleading default note Nov 23, 2020
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.2.x labels Nov 23, 2020
jhoeller added a commit that referenced this issue Nov 26, 2020
jhoeller added a commit that referenced this issue Nov 26, 2020
jhoeller added a commit that referenced this issue Nov 26, 2020
jhoeller added a commit that referenced this issue Nov 26, 2020
zx20110729 pushed a commit to zx20110729/spring-framework that referenced this issue Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

3 participants