1919
2020import org .eclipse .jgit .lib .AnyObjectId ;
2121import org .eclipse .jgit .revwalk .RevTag ;
22- import org .joda .time .DateTime ;
23- import org .joda .time .format .DateTimeFormat ;
22+ import java .time .Instant ;
2423
2524public class DatedRevTag {
2625
2726 public final AnyObjectId id ;
2827 public final String tagName ;
29- public final DateTime date ;
28+ public final Instant date ;
3029
3130 public DatedRevTag (RevTag tag ) {
32- this (tag .getId (), tag .getTagName (), (tag .getTaggerIdent () != null ) ? new DateTime ( tag .getTaggerIdent ().getWhen ()) : DateTime .now (). minusYears ( 1900 ));
31+ this (tag .getId (), tag .getTagName (), (tag .getTaggerIdent () != null ) ? tag .getTaggerIdent ().getWhen (). toInstant ( ) : Instant .now ());
3332 }
3433
3534 public DatedRevTag (AnyObjectId id , String tagName ) {
36- this (id , tagName , DateTime .now (). minusYears ( 2000 ));
35+ this (id , tagName , Instant .now ());
3736 }
3837
39- public DatedRevTag (AnyObjectId id , String tagName , DateTime date ) {
38+ public DatedRevTag (AnyObjectId id , String tagName , Instant date ) {
4039 this .id = id ;
4140 this .tagName = tagName ;
4241 this .date = date ;
@@ -47,7 +46,7 @@ public String toString() {
4746 return "DatedRevTag{" +
4847 "id=" + id .name () +
4948 ", tagName='" + tagName + '\'' +
50- ", date=" + DateTimeFormat . longDateTime (). print ( date ) +
49+ ", date=" + date +
5150 '}' ;
5251 }
5352}
0 commit comments