Commit f2ce027f authored by bitcoinj-sv's avatar bitcoinj-sv

fixed java version incompatibilities

parent 6637f05a
......@@ -55,7 +55,7 @@ public class Utils {
public static final byte[] BITCOIN_SIGNED_MESSAGE_HEADER_BYTES = BITCOIN_SIGNED_MESSAGE_HEADER.getBytes(Charsets.UTF_8);
// zero length arrays are immutable so we can save some object allocation by reusing the same instance.
public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
private static final Joiner SPACE_JOINER = Joiner.on(" ");
public static final Joiner SPACE_JOINER = Joiner.on(" ");
private static BlockingQueue<Boolean> mockSleepQueue;
......
......@@ -538,7 +538,7 @@ public class DeterministicKeyChain implements EncryptableKeyChain {
// and calculate the full lookahead zone there, so network requests will always use the right amount.
List<DeterministicKey> lookahead = maybeLookAhead(parentKey, index, 0, 0);
basicKeyChain.importKeys(lookahead);
List<DeterministicKey> keys = new ArrayList<>(numberOfKeys);
List<DeterministicKey> keys = new ArrayList<DeterministicKey>(numberOfKeys);
for (int i = 0; i < numberOfKeys; i++) {
ImmutableList<ChildNumber> path = HDUtils.append(parentKey.getPath(), new ChildNumber(index - numberOfKeys + i, false));
DeterministicKey k = hierarchy.get(path, false, false);
......@@ -1219,12 +1219,12 @@ public class DeterministicKeyChain implements EncryptableKeyChain {
final int needed = issued + lookaheadSize + lookaheadThreshold - numChildren;
if (needed <= lookaheadThreshold)
return new ArrayList<>();
return new ArrayList<DeterministicKey>();
log.info("{} keys needed for {} = {} issued + {} lookahead size + {} lookahead threshold - {} num children",
needed, parent.getPathAsString(), issued, lookaheadSize, lookaheadThreshold, numChildren);
List<DeterministicKey> result = new ArrayList<>(needed);
List<DeterministicKey> result = new ArrayList<DeterministicKey>(needed);
final Stopwatch watch = Stopwatch.createStarted();
int nextChild = numChildren;
for (int i = 0; i < needed; i++) {
......@@ -1285,7 +1285,7 @@ public class DeterministicKeyChain implements EncryptableKeyChain {
List<ECKey> keys = basicKeyChain.getKeys();
if (!includeLookahead) {
int treeSize = internalParentKey.getPath().size();
List<ECKey> issuedKeys = new LinkedList<>();
List<ECKey> issuedKeys = new LinkedList<ECKey>();
for (ECKey key : keys) {
DeterministicKey detkey = (DeterministicKey) key;
DeterministicKey parent = detkey.getParent();
......@@ -1304,7 +1304,7 @@ public class DeterministicKeyChain implements EncryptableKeyChain {
* Returns only the external keys that have been issued by this chain, lookahead not included.
*/
public List<ECKey> getIssuedReceiveKeys() {
final List<ECKey> keys = new ArrayList<>(getKeys(false, false));
final List<ECKey> keys = new ArrayList<ECKey>(getKeys(false, false));
for (Iterator<ECKey> i = keys.iterator(); i.hasNext();) {
DeterministicKey parent = ((DeterministicKey) i.next()).getParent();
if (parent == null || !externalParentKey.equals(parent))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment