Skip to content

Commit e9fa042

Browse files
committed
Update release notes for #816
1 parent 6671559 commit e9fa042

File tree

4 files changed

+10
-26
lines changed

4 files changed

+10
-26
lines changed

release-notes/CREDITS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ Charles Allen:
250250
`Thread.currentThread().getContextClassLoader()`
251251
(2.5.4)
252252

253+
Andrew Goodale (newyankeecodeshop@github)
254+
* Contributed #816: Allow date-only ISO strings to have no time zone
255+
(2.5.4)
256+
253257
Kamil Benedykciński (Kamil-Benedykcinski@github)
254258
* Contributed #801: Using `@JsonCreator` cause generating invalid path reference
255259
in `JsonMappingException`

release-notes/VERSION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Project: jackson-databind
2121
#801: Using `@JsonCreator` cause generating invalid path reference in `JsonMappingException`
2222
(contributed by Kamil B)
2323
#815: Presence of PropertyNamingStrategy Makes Deserialization fail
24+
#816: Allow date-only ISO strings to have no time zone
25+
(contributed by Andrew G)
2426
- Fix handling of Enums wrt JSON Schema, when 'toString()' used for serialization
2527

2628
2.5.3 (24-Apr-2015)

src/main/java/com/fasterxml/jackson/databind/util/ISO8601Utils.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,16 @@ public static Date parse(String date, ParsePosition pos) throws ParseException {
154154
int milliseconds = 0; // always use 0 otherwise returned date will include millis of current time
155155

156156
// if the value has no time component (and no time zone), we are done
157-
if (!checkOffset(date, offset, 'T') && (date.length() <= offset)) {
157+
boolean hasT = checkOffset(date, offset, 'T');
158+
159+
if (!hasT && (date.length() <= offset)) {
158160
Calendar calendar = new GregorianCalendar(year, month - 1, day);
159161

160162
pos.setIndex(offset);
161163
return calendar.getTime();
162164
}
163165

164-
if (checkOffset(date, offset, 'T')) {
166+
if (hasT) {
165167

166168
// extract hours, minutes, seconds and milliseconds
167169
hour = parseInt(date, offset += 1, offset += 2);

src/test/java/com/fasterxml/jackson/databind/util/ISO8601UtilsTest.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,30 +116,6 @@ public void testParseWithoutTime() throws ParseException {
116116
assertEquals(dateWithoutTime, d);
117117
}
118118

119-
public void testParseWithoutTimeAndTimeZoneMustFail() {
120-
try {
121-
ISO8601Utils.parse("2007-08-13", new ParsePosition(0));
122-
fail();
123-
} catch (ParseException p) {
124-
}
125-
try {
126-
ISO8601Utils.parse("20070813", new ParsePosition(0));
127-
fail();
128-
} catch (ParseException p) {
129-
}
130-
try {
131-
ISO8601Utils.parse("2007-08-13", new ParsePosition(0));
132-
fail();
133-
} catch (ParseException p) {
134-
}
135-
try {
136-
ISO8601Utils.parse("20070813", new ParsePosition(0));
137-
fail();
138-
} catch (ParseException p) {
139-
}
140-
}
141-
142-
143119
public void testParseOptional() throws java.text.ParseException {
144120
Date d = ISO8601Utils.parse("2007-08-13T19:51Z", new ParsePosition(0));
145121
assertEquals(dateZeroSecondAndMillis, d);

0 commit comments

Comments
 (0)