diff --git a/base/src/test/java/org/bitcoinj/base/internal/TimeUtilsTest.java b/base/src/test/java/org/bitcoinj/base/internal/TimeUtilsTest.java index b26cf4778..be762836b 100644 --- a/base/src/test/java/org/bitcoinj/base/internal/TimeUtilsTest.java +++ b/base/src/test/java/org/bitcoinj/base/internal/TimeUtilsTest.java @@ -24,7 +24,6 @@ import org.junit.Test; import java.time.Duration; import java.time.Instant; import java.time.format.DateTimeFormatter; -import java.util.Date; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/core/src/main/java/org/bitcoinj/core/AbstractBlockChain.java b/core/src/main/java/org/bitcoinj/core/AbstractBlockChain.java index 84c731ba6..ed1ace649 100644 --- a/core/src/main/java/org/bitcoinj/core/AbstractBlockChain.java +++ b/core/src/main/java/org/bitcoinj/core/AbstractBlockChain.java @@ -42,7 +42,6 @@ import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.Arrays; import java.util.Collections; -import java.util.Date; import java.util.EnumSet; import java.util.HashSet; import java.util.Iterator; @@ -1066,12 +1065,6 @@ public abstract class AbstractBlockChain { } } - /** @deprecated use {@link #estimateBlockTimeInstant(int)} */ - @Deprecated - public Date estimateBlockTime(int height) { - return Date.from(estimateBlockTimeInstant(height)); - } - /** * Returns a future that completes when the block chain has reached the given height. Yields the * {@link StoredBlock} of the block that reaches that height first. The future completes on a peer thread. diff --git a/core/src/main/java/org/bitcoinj/core/Block.java b/core/src/main/java/org/bitcoinj/core/Block.java index df2092810..3cacdd0fc 100644 --- a/core/src/main/java/org/bitcoinj/core/Block.java +++ b/core/src/main/java/org/bitcoinj/core/Block.java @@ -48,7 +48,6 @@ import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Collections; -import java.util.Date; import java.util.EnumSet; import java.util.List; import java.util.Locale; @@ -739,15 +738,6 @@ public class Block extends BaseMessage { return time.getEpochSecond(); } - /** - * Returns the time at which the block was solved and broadcast, according to the clock of the solving node. - * @deprecated use {@link #time()} - */ - @Deprecated - public Date getTime() { - return Date.from(time()); - } - // For testing only void setTime(Instant time) { unCacheHeader(); diff --git a/core/src/main/java/org/bitcoinj/core/Transaction.java b/core/src/main/java/org/bitcoinj/core/Transaction.java index 4b6beb596..588d85bbf 100644 --- a/core/src/main/java/org/bitcoinj/core/Transaction.java +++ b/core/src/main/java/org/bitcoinj/core/Transaction.java @@ -59,7 +59,6 @@ import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; @@ -569,12 +568,6 @@ public class Transaction extends BaseMessage { return Optional.ofNullable(updateTime); } - /** @deprecated use {@link #updateTime()} */ - @Deprecated - public Date getUpdateTime() { - return Date.from(updateTime().orElse(Instant.EPOCH)); - } - /** * Sets the update time of this transaction. * @param updateTime update time @@ -590,15 +583,6 @@ public class Transaction extends BaseMessage { this.updateTime = null; } - /** @deprecated use {@link #setUpdateTime(Instant)} or {@link #clearUpdateTime()} */ - @Deprecated - public void setUpdateTime(Date updateTime) { - if (updateTime != null && updateTime.getTime() > 0) - setUpdateTime(updateTime.toInstant()); - else - clearUpdateTime(); - } - /** * These constants are a part of a scriptSig signature on the inputs. They define the details of how a * transaction can be redeemed, specifically, they control how the hash of the transaction is calculated. @@ -1737,12 +1721,6 @@ public class Transaction extends BaseMessage { ((TimeLock) locktime).timestamp(); } - /** @deprecated use {@link #estimateUnlockTime(AbstractBlockChain)} */ - @Deprecated - public Date estimateLockTime(AbstractBlockChain chain) { - return Date.from(estimateUnlockTime(chain)); - } - /** * Returns the purpose for which this transaction was created. See the javadoc for {@link Purpose} for more * information on the point of this field and what it can be. diff --git a/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java b/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java index e393731cf..666c2446b 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java @@ -30,7 +30,6 @@ import org.bitcoinj.wallet.Wallet; import javax.annotation.Nullable; import java.time.Instant; import java.util.Collections; -import java.util.Date; import java.util.HashSet; import java.util.Locale; import java.util.Objects; @@ -347,13 +346,6 @@ public class TransactionConfidence { return Optional.ofNullable(lastBroadcastTime); } - /** @deprecated use {@link #getLastBroadcastTime()} */ - @Deprecated - @Nullable - public Date getLastBroadcastedAt() { - return lastBroadcastTime != null ? Date.from(lastBroadcastTime) : null; - } - /** * Set the time the transaction was last announced to us. * @param lastBroadcastTime time the transaction was last announced to us @@ -362,12 +354,6 @@ public class TransactionConfidence { this.lastBroadcastTime = Objects.requireNonNull(lastBroadcastTime); } - /** @deprecated use {@link #setLastBroadcastTime(Instant)} */ - @Deprecated - public void setLastBroadcastedAt(Date lastBroadcastedAt) { - setLastBroadcastTime(lastBroadcastedAt.toInstant()); - } - @Override public synchronized String toString() { StringBuilder builder = new StringBuilder(); diff --git a/core/src/main/java/org/bitcoinj/core/listeners/DownloadProgressTracker.java b/core/src/main/java/org/bitcoinj/core/listeners/DownloadProgressTracker.java index 22fc8dda5..aada98851 100644 --- a/core/src/main/java/org/bitcoinj/core/listeners/DownloadProgressTracker.java +++ b/core/src/main/java/org/bitcoinj/core/listeners/DownloadProgressTracker.java @@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory; import javax.annotation.Nullable; import java.time.Instant; -import java.util.Date; import java.util.Locale; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; diff --git a/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java b/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java index 6a6e44592..2993e3937 100644 --- a/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java +++ b/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java @@ -45,7 +45,6 @@ import java.net.URL; import java.security.KeyStoreException; import java.time.Instant; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.Optional; import java.util.concurrent.CompletableFuture; @@ -261,12 +260,6 @@ public class PaymentSession { return Instant.ofEpochSecond(paymentDetails.getTime()); } - /** @deprecated use {@link #time()} */ - @Deprecated - public Date getDate() { - return Date.from(time()); - } - /** * Returns the expires time of the payment request, or empty if none. */ @@ -277,15 +270,6 @@ public class PaymentSession { return Optional.empty(); } - /** @deprecated use {@link #expires()} */ - @Nullable - @Deprecated - public Date getExpires() { - return expires() - .map(Date::from) - .orElse(null); - } - /** * This should always be called before attempting to call sendPayment. */ diff --git a/core/src/main/java/org/bitcoinj/utils/BriefLogFormatter.java b/core/src/main/java/org/bitcoinj/utils/BriefLogFormatter.java index a898fff09..0e126a143 100644 --- a/core/src/main/java/org/bitcoinj/utils/BriefLogFormatter.java +++ b/core/src/main/java/org/bitcoinj/utils/BriefLogFormatter.java @@ -24,7 +24,6 @@ import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; -import java.util.Date; import java.util.logging.Formatter; import java.util.logging.Handler; import java.util.logging.Level; diff --git a/core/src/main/java/org/bitcoinj/wallet/Wallet.java b/core/src/main/java/org/bitcoinj/wallet/Wallet.java index c676f816a..de3a03009 100644 --- a/core/src/main/java/org/bitcoinj/wallet/Wallet.java +++ b/core/src/main/java/org/bitcoinj/wallet/Wallet.java @@ -118,7 +118,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; -import java.util.Date; import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; @@ -3885,13 +3884,6 @@ public class Wallet extends BaseTaggableObject return lastBlockSeenTime().map(Instant::getEpochSecond).orElse((long) 0); } - /** @deprecated use {@link #lastBlockSeenTime()} */ - @Deprecated - @Nullable - public Date getLastBlockSeenTime() { - return lastBlockSeenTime().map(Date::from).orElse(null); - } - /** * Returns the height of the last seen best-chain block. Can be 0 if a wallet is brand new or -1 if the wallet * is old and doesn't have that data. @@ -5684,15 +5676,6 @@ public class Wallet extends BaseTaggableObject setKeyRotationTime(Instant.ofEpochSecond(timeSecs)); } - /** @deprecated use {@link #setKeyRotationTime(Instant)} */ - @Deprecated - public void setKeyRotationTime(@Nullable Date time) { - if (time == null) - setKeyRotationTime((Instant) null); - else - setKeyRotationTime(Instant.ofEpochMilli(time.getTime())); - } - /** * Returns the key rotation time, or empty if unconfigured. See {@link #setKeyRotationTime(Instant)} for a description * of the field. @@ -5701,16 +5684,6 @@ public class Wallet extends BaseTaggableObject return Optional.ofNullable(vKeyRotationTime); } - /** @deprecated use {@link #keyRotationTime()} */ - @Deprecated - public @Nullable Date getKeyRotationTime() { - Instant keyRotationTime = vKeyRotationTime; - if (keyRotationTime != null) - return Date.from(keyRotationTime); - else - return null; - } - /** Returns whether the keys creation time is before the key rotation time, if one was set. */ public boolean isKeyRotating(ECKey key) { Instant keyRotationTime = vKeyRotationTime; diff --git a/core/src/main/java/org/bitcoinj/wallet/WalletFiles.java b/core/src/main/java/org/bitcoinj/wallet/WalletFiles.java index 085c56891..97e51bc92 100644 --- a/core/src/main/java/org/bitcoinj/wallet/WalletFiles.java +++ b/core/src/main/java/org/bitcoinj/wallet/WalletFiles.java @@ -30,7 +30,6 @@ import java.io.IOException; import java.sql.Time; import java.time.Duration; import java.time.Instant; -import java.util.Date; import java.util.Objects; import java.util.concurrent.Callable; import java.util.concurrent.ScheduledThreadPoolExecutor; diff --git a/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java b/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java index aa93be675..a2623adba 100644 --- a/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java +++ b/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java @@ -60,7 +60,6 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.time.Instant; import java.util.ArrayList; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Locale; diff --git a/core/src/test/java/org/bitcoinj/core/TransactionTest.java b/core/src/test/java/org/bitcoinj/core/TransactionTest.java index 34ef19cdc..a25eba414 100644 --- a/core/src/test/java/org/bitcoinj/core/TransactionTest.java +++ b/core/src/test/java/org/bitcoinj/core/TransactionTest.java @@ -47,7 +47,6 @@ import java.nio.ByteBuffer; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.Calendar; -import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.SortedSet; diff --git a/core/src/test/java/org/bitcoinj/protocols/payments/PaymentSessionTest.java b/core/src/test/java/org/bitcoinj/protocols/payments/PaymentSessionTest.java index 9f952c310..55ad43a2e 100644 --- a/core/src/test/java/org/bitcoinj/protocols/payments/PaymentSessionTest.java +++ b/core/src/test/java/org/bitcoinj/protocols/payments/PaymentSessionTest.java @@ -44,7 +44,6 @@ import java.net.URL; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.ArrayList; -import java.util.Date; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; diff --git a/core/src/test/java/org/bitcoinj/wallet/BasicKeyChainTest.java b/core/src/test/java/org/bitcoinj/wallet/BasicKeyChainTest.java index 64bcbf130..2d196a063 100644 --- a/core/src/test/java/org/bitcoinj/wallet/BasicKeyChainTest.java +++ b/core/src/test/java/org/bitcoinj/wallet/BasicKeyChainTest.java @@ -35,7 +35,6 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Date; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean;