Skip to content

Commit

Permalink
Update release notes for #816
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 5, 2015
1 parent 6671559 commit e9fa042
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
4 changes: 4 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ Charles Allen:
`Thread.currentThread().getContextClassLoader()`
(2.5.4)

Andrew Goodale (newyankeecodeshop@github)
* Contributed #816: Allow date-only ISO strings to have no time zone
(2.5.4)

Kamil Benedykciński (Kamil-Benedykcinski@github)
* Contributed #801: Using `@JsonCreator` cause generating invalid path reference
in `JsonMappingException`
Expand Down
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Project: jackson-databind
#801: Using `@JsonCreator` cause generating invalid path reference in `JsonMappingException`
(contributed by Kamil B)
#815: Presence of PropertyNamingStrategy Makes Deserialization fail
#816: Allow date-only ISO strings to have no time zone
(contributed by Andrew G)
- Fix handling of Enums wrt JSON Schema, when 'toString()' used for serialization

2.5.3 (24-Apr-2015)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,16 @@ public static Date parse(String date, ParsePosition pos) throws ParseException {
int milliseconds = 0; // always use 0 otherwise returned date will include millis of current time

// if the value has no time component (and no time zone), we are done
if (!checkOffset(date, offset, 'T') && (date.length() <= offset)) {
boolean hasT = checkOffset(date, offset, 'T');

if (!hasT && (date.length() <= offset)) {
Calendar calendar = new GregorianCalendar(year, month - 1, day);

pos.setIndex(offset);
return calendar.getTime();
}

if (checkOffset(date, offset, 'T')) {
if (hasT) {

// extract hours, minutes, seconds and milliseconds
hour = parseInt(date, offset += 1, offset += 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,6 @@ public void testParseWithoutTime() throws ParseException {
assertEquals(dateWithoutTime, d);
}

public void testParseWithoutTimeAndTimeZoneMustFail() {
try {
ISO8601Utils.parse("2007-08-13", new ParsePosition(0));
fail();
} catch (ParseException p) {
}
try {
ISO8601Utils.parse("20070813", new ParsePosition(0));
fail();
} catch (ParseException p) {
}
try {
ISO8601Utils.parse("2007-08-13", new ParsePosition(0));
fail();
} catch (ParseException p) {
}
try {
ISO8601Utils.parse("20070813", new ParsePosition(0));
fail();
} catch (ParseException p) {
}
}


public void testParseOptional() throws java.text.ParseException {
Date d = ISO8601Utils.parse("2007-08-13T19:51Z", new ParsePosition(0));
assertEquals(dateZeroSecondAndMillis, d);
Expand Down

0 comments on commit e9fa042

Please sign in to comment.