Replace explicit types with <> syntax

This commit is contained in:
Chris Beams 2014-12-27 02:38:54 +01:00
parent 0425862cd4
commit 18b0f6f52c
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73
14 changed files with 19 additions and 20 deletions

View File

@ -26,7 +26,7 @@ public class Account {
private byte[] address;
private Set<Transaction> pendingTransactions =
Collections.synchronizedSet(new HashSet<Transaction>());
Collections.synchronizedSet(new HashSet<>());
@Autowired
WorldManager worldManager;

View File

@ -76,12 +76,12 @@ public class Block {
this.transactionsList = transactionsList;
if (this.transactionsList == null) {
this.transactionsList = new CopyOnWriteArrayList<Transaction>();
this.transactionsList = new CopyOnWriteArrayList<>();
}
this.uncleList = uncleList;
if (this.uncleList == null) {
this.uncleList = new CopyOnWriteArrayList<BlockHeader>();
this.uncleList = new CopyOnWriteArrayList<>();
}
this.parsed = true;

View File

@ -29,7 +29,7 @@ public class TransactionReceipt {
private byte[] postTxState = EMPTY_BYTE_ARRAY;
private byte[] cumulativeGas = EMPTY_BYTE_ARRAY;
private Bloom bloomFilter = new Bloom();
private List<LogInfo> logInfoList = new ArrayList<LogInfo>();
private List<LogInfo> logInfoList = new ArrayList<>();
/* Tx Receipt in encoded form */
private byte[] rlpEncoded;

View File

@ -217,8 +217,8 @@ public class ContractDetails {
ContractDetails contractDetails = new ContractDetails();
contractDetails.setCode(this.getCode());
contractDetails.setStorage(new ArrayList<DataWord>(this.storageKeys),
new ArrayList<DataWord>(this.storageValues));
contractDetails.setStorage(new ArrayList<>(this.storageKeys),
new ArrayList<>(this.storageValues));
return contractDetails;
}

View File

@ -3,7 +3,6 @@ package org.ethereum.manager;
import org.ethereum.core.Block;
import org.ethereum.core.Genesis;
import org.ethereum.core.Transaction;
import org.ethereum.core.TransactionReceipt;
import org.ethereum.core.Wallet;
import org.ethereum.crypto.HashUtil;
import org.ethereum.db.BlockStore;
@ -71,7 +70,7 @@ public class WorldManager {
@Autowired
private AdminInfo adminInfo;
private final Set<Transaction> pendingTransactions = Collections.synchronizedSet(new HashSet<Transaction>());
private final Set<Transaction> pendingTransactions = Collections.synchronizedSet(new HashSet<>());
@Autowired
private EthereumListener listener;
@ -171,7 +170,7 @@ public class WorldManager {
repository.addBalance(Hex.decode(address), Genesis.PREMINE_AMOUNT);
}
blockStore.saveBlock(Genesis.getInstance(), new ArrayList<TransactionReceipt>());
blockStore.saveBlock(Genesis.getInstance(), new ArrayList<>());
blockchain.setBestBlock(Genesis.getInstance());
blockchain.setTotalDifficulty(BigInteger.ZERO);

View File

@ -26,7 +26,7 @@ public class TransactionsMessage extends EthMessage {
public TransactionsMessage(Transaction transaction) {
transactions = new HashSet<Transaction>();
transactions = new HashSet<>();
transactions.add(transaction);
parsed = true;
}

View File

@ -38,7 +38,7 @@ public class PeerDiscovery {
private static final Logger logger = LoggerFactory.getLogger("peerdiscovery");
private final Set<PeerInfo> peers = Collections.synchronizedSet(new HashSet<PeerInfo>());
private final Set<PeerInfo> peers = Collections.synchronizedSet(new HashSet<>());
private PeerMonitorThread monitor;
private ThreadFactory threadFactory;
@ -61,7 +61,7 @@ public class PeerDiscovery {
// creating the ThreadPoolExecutor
executorPool = new ThreadPoolExecutor(CONFIG.peerDiscoveryWorkers(),
CONFIG.peerDiscoveryWorkers(), 10, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(
CONFIG.peerDiscoveryWorkers(), 10, TimeUnit.SECONDS, new ArrayBlockingQueue<>(
1000), threadFactory, rejectionHandler);
// start the monitoring thread

View File

@ -32,7 +32,7 @@ public class ChannelManager {
private static final Logger logger = LoggerFactory.getLogger("net");
Timer inactivesCollector = new Timer("inactivesCollector");
List<Channel> channels = Collections.synchronizedList(new ArrayList<Channel>());
List<Channel> channels = Collections.synchronizedList(new ArrayList<>());
Map<ByteArrayWrapper, Block> blockCache = new HashMap<>();

View File

@ -19,7 +19,7 @@ import java.util.List;
public class LogInfo {
byte[] address = new byte[]{};
List<DataWord> topics = new ArrayList<DataWord>();
List<DataWord> topics = new ArrayList<>();
byte[] data = new byte[]{};
/* Log info in encoded form */
@ -47,7 +47,7 @@ public class LogInfo {
public LogInfo(byte[] address, List<DataWord> topics, byte[] data) {
this.address = (address != null) ? address : new byte[]{};
this.topics = (topics != null) ? topics : new ArrayList<DataWord>();
this.topics = (topics != null) ? topics : new ArrayList<>();
this.data = (data != null) ? data : new byte[]{};
}

View File

@ -816,7 +816,7 @@ public class VM {
int nTopics = op.val() - OpCode.LOG0.val();
List<DataWord> topics = new ArrayList<DataWord>();
List<DataWord> topics = new ArrayList<>();
for (int i = 0; i < nTopics; ++i) {
DataWord topic = stack.pop();
topics.add(topic);

View File

@ -298,7 +298,7 @@ public class ByteUtilTest {
ByteUtil.setBit(data, 25, 1);
ByteUtil.setBit(data, 2, 1);
List<Integer> found = new ArrayList<Integer>();
List<Integer> found = new ArrayList<>();
for (int i = 0; i < (data.length * 8); i++) {
int res = ByteUtil.getBit(data, i);
if (res == 1)

View File

@ -38,7 +38,7 @@ public class AccountsListWindow extends JFrame {
tblAccountsDataTable = new JTable();
adapter = new AccountsDataAdapter(new ArrayList<DataClass>());
adapter = new AccountsDataAdapter(new ArrayList<>());
tblAccountsDataTable.setModel(adapter);
JScrollPane scrollPane = new JScrollPane(tblAccountsDataTable);

View File

@ -108,7 +108,7 @@ public class BlockChainTable extends JFrame implements ActionListener {
this.toolBar = toolBar;
addCloseAction();
foundBlocks = new ArrayList<Long>();
foundBlocks = new ArrayList<>();
painter = new DefaultHighlighter.DefaultHighlightPainter(HILIT_COLOR);
setTitle("Block Chain Table");

View File

@ -45,7 +45,7 @@ public class ProgramPlayDialog extends JPanel implements ActionListener,
public ProgramPlayDialog(byte[] code, ProgramInvoke programInvoke) {
pi = programInvoke;
outputList = new ArrayList<String>();
outputList = new ArrayList<>();
VM vm = new VM();
Program program = new Program(code, programInvoke);