uniVocity / univocity-parsers

uniVocity-parsers is a suite of extremely fast and reliable parsers for Java. It provides a consistent interface for handling different file formats, and a solid framework for the development of new parsers.
917 stars 252 forks source link

2 toDate methods in com.univocity.parsers.conversions.Conversions causing compile error #503

Open dan-s1 opened 2 years ago

dan-s1 commented 2 years ago

When attempting to use com.univocity.parsers.conversions.Conversions toDate method to perform conversions on a record

parser.getRecordMetadata().convertFields(Conversions.toDate(someDateObj, "yyyy-MM-dd'T'HH:mm:ss")).set("someField")

I got a compile error in Intellij and when trying to build with Maven that this method was ambiguous since another method matched. Message in Intellij was: "Ambiguous method call. Both toDate(Date, String...) in Conversions and toDate(Date, String, String...) in Conversions match."

I assume the other method Intellij and Maven are complaining about is com.univocity.parsers.conversions.Conversions toDate method with signature: public static DateConversion toDate(Date dateIfNull, String stringIfNull, String... dateFormats)