Skip to content

DateTimeFormat ISO.DATE_TIME javadoc contains misleading default note #26134

@nspiess

Description

@nspiess

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?

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions