ical4j / ical4j

A Java library for parsing and building iCalendar data models
https://www.ical4j.org
BSD 3-Clause "New" or "Revised" License
752 stars 200 forks source link

UidGenerator is now abstract? #234

Closed alex3kov closed 6 years ago

alex3kov commented 6 years ago

My code stopped working after updating ical4j to 2.2.0 (it's Scala, but I'm sure you get the point):

val uidGen = new UidGenerator(new InetAddressHostInfo(java.net.InetAddress.getLocalHost), scala.util.Random.nextPrintableChar.toString)
trait UidGenerator is abstract; cannot be instantiated
[error] val uidGen = new UidGenerator(new InetAddressHostInfo(java.net.InetAddress.getLocalHost), scala.util.Random.nextPrintableChar.toString)

But in online Javadoc it's not abstract. Is this just an issue of outdated documentation or am I missing something?

benfortuna commented 6 years ago

Yes the documentation was out of date. I've updated it now:

http://ical4j.github.io/docs/ical4j/api/2.2.0/net/fortuna/ical4j/util/FixedUidGenerator.html

The reason for the change was to provide an alternate implementation:

http://ical4j.github.io/docs/ical4j/api/2.2.0/net/fortuna/ical4j/util/RandomUidGenerator.html

alex3kov commented 6 years ago

That was fast :) Thanks, I'll use RandomUidGenerator, it's even simpler.