diff --git a/core/src/main/java/com/google/bitcoin/core/Peer.java b/core/src/main/java/com/google/bitcoin/core/Peer.java
index 8725f93a..68e44c31 100644
--- a/core/src/main/java/com/google/bitcoin/core/Peer.java
+++ b/core/src/main/java/com/google/bitcoin/core/Peer.java
@@ -664,9 +664,9 @@ public class Peer extends PeerSocketHandler {
log.info("{}: Downloading dependencies of {}", getAddress(), tx.getHashAsString());
final LinkedList results = new LinkedList();
// future will be invoked when the entire dependency tree has been walked and the results compiled.
- final ListenableFuture future = downloadDependenciesInternal(tx, new Object(), results);
+ final ListenableFuture
*/
+ @SuppressWarnings("unchecked")
+ // The warning 'unchecked call to write(MessageType)' being suppressed here comes from the build()
+ // formally returning MessageLite-derived class that cannot be statically guaranteed to be the same MessageType
+ // that is used in connectionChannel.
protected final synchronized void closeChannel() {
if (connectionChannel == null)
throw new IllegalStateException("Channel is not fully initialized/has already been closed");
-
connectionChannel.write(Protos.TwoWayChannelMessage.newBuilder()
.setType(Protos.TwoWayChannelMessage.MessageType.CLOSE)
.build());
diff --git a/core/src/main/java/com/google/bitcoin/store/PostgresFullPrunedBlockStore.java b/core/src/main/java/com/google/bitcoin/store/PostgresFullPrunedBlockStore.java
index 9aa511fe..2a872198 100644
--- a/core/src/main/java/com/google/bitcoin/store/PostgresFullPrunedBlockStore.java
+++ b/core/src/main/java/com/google/bitcoin/store/PostgresFullPrunedBlockStore.java
@@ -765,7 +765,7 @@ public class PostgresFullPrunedBlockStore implements FullPrunedBlockStore {
// Calculate the toAddress (if any)
String dbAddress = "";
int type = 0;
- Script outputScript = null;
+ Script outputScript = null;
try
{
outputScript = new Script(out.getScriptBytes());
diff --git a/core/src/test/java/com/google/bitcoin/core/WalletTest.java b/core/src/test/java/com/google/bitcoin/core/WalletTest.java
index 12a25e7d..0d757340 100644
--- a/core/src/test/java/com/google/bitcoin/core/WalletTest.java
+++ b/core/src/test/java/com/google/bitcoin/core/WalletTest.java
@@ -335,6 +335,8 @@ public class WalletTest extends TestWithWallet {
assertTrue(depthFuture.isDone());
}
+ @SuppressWarnings("deprecation")
+ // Having a test for deprecated method getFromAddress() is no evil so we suppress the warning here.
private void basicSanityChecks(Wallet wallet, Transaction t, Address fromAddress, Address destination) throws VerificationException {
assertEquals("Wrong number of tx inputs", 1, t.getInputs().size());
assertEquals(fromAddress, t.getInputs().get(0).getScriptSig().getFromAddress(params));
@@ -389,6 +391,8 @@ public class WalletTest extends TestWithWallet {
}
@Test
+ @SuppressWarnings("deprecation")
+ // Having a test for deprecated method getFromAddress() is no evil so we suppress the warning here.
public void customTransactionSpending() throws Exception {
// We'll set up a wallet that receives a coin, then sends a coin of lesser value and keeps the change.
BigInteger v1 = Utils.toNanoCoins(3, 0);
diff --git a/examples/src/main/java/com/google/bitcoin/examples/PrintPeers.java b/examples/src/main/java/com/google/bitcoin/examples/PrintPeers.java
index 6e7b5875..d4600f88 100644
--- a/examples/src/main/java/com/google/bitcoin/examples/PrintPeers.java
+++ b/examples/src/main/java/com/google/bitcoin/examples/PrintPeers.java
@@ -82,7 +82,7 @@ public class PrintPeers {
for (final InetAddress addr : addrs) {
InetSocketAddress address = new InetSocketAddress(addr, params.getPort());
final Peer peer = new Peer(params, new VersionMessage(params, 0), null, new PeerAddress(address));
- final SettableFuture future = SettableFuture.create();
+ final SettableFuture future = SettableFuture.create();
// Once the connection has completed version handshaking ...
peer.addEventListener(new AbstractPeerEventListener() {
public void onPeerConnected(Peer p, int peerCount) {