Skip to content

Commit

Permalink
Deprecated old date/time classes
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed May 17, 2019
1 parent 1b69aeb commit 1a0f26a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Expand Up @@ -49,7 +49,10 @@
*
* @author Dave Nault dnault@laszlosystems.com
* @see #getInstance(String)
*
* @deprecated adoption of the new date/time API means formatting is now supported via {@link java.time.format.DateTimeFormatter}
*/
@Deprecated
public final class CalendarDateFormatFactory {
private static final Logger LOG = LoggerFactory.getLogger(CalendarDateFormatFactory.class);

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/fortuna/ical4j/model/TimeZone.java
Expand Up @@ -51,7 +51,10 @@
* definition.
*
* @author Ben Fortuna
*
* @deprecated with the introduction of the new date/time API the older API is now deprecated.
*/
@Deprecated
public class TimeZone extends java.util.TimeZone {

private static final long serialVersionUID = -5620979316746547234L;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/fortuna/ical4j/util/Dates.java
Expand Up @@ -49,7 +49,10 @@
* Implements a collection of utility methods relevant to date processing.
*
* @author Ben Fortuna
*
* @deprecated Utility class for old date/time API no longer required
*/
@Deprecated
public final class Dates {

/**
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/fortuna/ical4j/util/FixedUidGenerator.java
Expand Up @@ -36,6 +36,7 @@

import java.net.SocketException;
import java.time.Instant;
import java.util.concurrent.TimeUnit;

/**
* $Id$
Expand Down Expand Up @@ -96,8 +97,8 @@ private static TemporalAdapter<Instant> uniqueTimestamp() {
if (currentMillis < lastMillis) {
currentMillis = lastMillis;
}
if (currentMillis - lastMillis < Dates.MILLIS_PER_SECOND) {
currentMillis += Dates.MILLIS_PER_SECOND;
if (currentMillis - lastMillis < TimeUnit.SECONDS.toMillis(1)) {
currentMillis += TimeUnit.SECONDS.toMillis(1);
}
lastMillis = currentMillis;
}
Expand Down

0 comments on commit 1a0f26a

Please sign in to comment.