Skip to content
Snippets Groups Projects
Commit ee8a4149 authored by Ivan Frade's avatar Ivan Frade
Browse files

PersonIdent: Preserve the timezone when copying with new time

The PersonIdent(PersonIdent,Date) constructor must create a copy with
the same author/email/timezone but different time.  When we changed
the implementation to the new Instant/ZoneId version, we forgot to
pass the timezone. This made fail some tests downstream.

Pass the timezone when constructing the copy.

Change-Id: Iaa979e6dbaa3c55d4c4d2040068ab8b03163cd4e
parent f072d2ec
No related branches found
No related tags found
No related merge requests found
...@@ -240,7 +240,8 @@ public PersonIdent(PersonIdent pi, Instant when, ZoneId tz) { ...@@ -240,7 +240,8 @@ public PersonIdent(PersonIdent pi, Instant when, ZoneId tz) {
*/ */
@Deprecated(since = "7.1") @Deprecated(since = "7.1")
public PersonIdent(PersonIdent pi, Date aWhen) { public PersonIdent(PersonIdent pi, Date aWhen) {
this(pi.getName(), pi.getEmailAddress(), aWhen.toInstant()); this(pi.getName(), pi.getEmailAddress(), aWhen.toInstant(),
pi.tzOffset);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment