Merge pull request #364 from DevFactory/release/The-diamond-operator-should-be-used-fix-1

squid:S2293 - The diamond operator should be used
This commit is contained in:
Ilkka Seppälä 2016-02-01 22:26:43 +02:00
commit f08af14555
13 changed files with 17 additions and 17 deletions

View File

@ -59,7 +59,7 @@ public class DbManager {
*/
public static void createVirtualDb() {
useMongoDB = false;
virtualDB = new HashMap<String, UserAccount>();
virtualDB = new HashMap<>();
}
/**

View File

@ -49,7 +49,7 @@ public class LruCache {
}
int capacity;
HashMap<String, Node> cache = new HashMap<String, Node>();
HashMap<String, Node> cache = new HashMap<>();
Node head = null;
Node end = null;
@ -162,7 +162,7 @@ public class LruCache {
* Returns cache data in list form.
*/
public ArrayList<UserAccount> getCacheDataInListForm() {
ArrayList<UserAccount> listOfCacheData = new ArrayList<UserAccount>();
ArrayList<UserAccount> listOfCacheData = new ArrayList<>();
Node temp = head;
while (temp != null) {
listOfCacheData.add(temp.userAccount);

View File

@ -32,7 +32,7 @@ import java.util.List;
*/
public abstract class LetterComposite {
private List<LetterComposite> children = new ArrayList<LetterComposite>();
private List<LetterComposite> children = new ArrayList<>();
public void add(LetterComposite letter) {
children.add(letter);

View File

@ -35,7 +35,7 @@ public class Messenger {
LetterComposite messageFromOrcs() {
List<Word> words = new ArrayList<Word>();
List<Word> words = new ArrayList<>();
words.add(new Word(Arrays.asList(new Letter('W'), new Letter('h'), new Letter('e'), new Letter(
'r'), new Letter('e'))));
@ -57,7 +57,7 @@ public class Messenger {
LetterComposite messageFromElves() {
List<Word> words = new ArrayList<Word>();
List<Word> words = new ArrayList<>();
words.add(new Word(Arrays.asList(new Letter('M'), new Letter('u'), new Letter('c'), new Letter(
'h'))));

View File

@ -74,7 +74,7 @@ public class App {
final Customer customer1 = new Customer(1, "Adam", "Adamson");
final Customer customer2 = new Customer(2, "Bob", "Bobson");
final Customer customer3 = new Customer(3, "Carl", "Carlson");
final List<Customer> customers = new ArrayList<Customer>();
final List<Customer> customers = new ArrayList<>();
customers.add(customer1);
customers.add(customer2);
customers.add(customer3);

View File

@ -40,7 +40,7 @@ public class CustomerDaoImplTest {
@Before
public void setUp() {
customers = new ArrayList<Customer>();
customers = new ArrayList<>();
customers.add(CUSTOMER);
impl = new CustomerDaoImpl(customers);
}

View File

@ -163,7 +163,7 @@ public class CakeBakingServiceImpl implements CakeBakingService {
CakeToppingInfo cakeToppingInfo =
new CakeToppingInfo(cake.getTopping().getId(), cake.getTopping().getName(), cake
.getTopping().getCalories());
ArrayList<CakeLayerInfo> cakeLayerInfos = new ArrayList<CakeLayerInfo>();
ArrayList<CakeLayerInfo> cakeLayerInfos = new ArrayList<>();
for (CakeLayer layer : cake.getLayers()) {
cakeLayerInfos.add(new CakeLayerInfo(layer.getId(), layer.getName(), layer.getCalories()));
}

View File

@ -33,7 +33,7 @@ public class SimpleMessageQueue implements MessageQueue {
private final BlockingQueue<Message> queue;
public SimpleMessageQueue(int bound) {
queue = new ArrayBlockingQueue<Message>(bound);
queue = new ArrayBlockingQueue<>(bound);
}
@Override

View File

@ -33,7 +33,7 @@ public class ItemQueue {
public ItemQueue() {
queue = new LinkedBlockingQueue<Item>(5);
queue = new LinkedBlockingQueue<>(5);
}
public void put(Item item) throws InterruptedException {

View File

@ -70,13 +70,13 @@ public class MagicServiceImpl implements MagicService {
@Override
public List<Wizard> findWizardsWithSpellbook(String name) {
Spellbook spellbook = spellbookDao.findByName(name);
return new ArrayList<Wizard>(spellbook.getWizards());
return new ArrayList<>(spellbook.getWizards());
}
@Override
public List<Wizard> findWizardsWithSpell(String name) {
Spell spell = spellDao.findByName(name);
Spellbook spellbook = spell.getSpellbook();
return new ArrayList<Wizard>(spellbook.getWizards());
return new ArrayList<>(spellbook.getWizards());
}
}

View File

@ -49,8 +49,8 @@ import com.iluwatar.servicelayer.wizard.Wizard;
public class Spellbook extends BaseEntity {
public Spellbook() {
spells = new HashSet<Spell>();
wizards = new HashSet<Wizard>();
spells = new HashSet<>();
wizards = new HashSet<>();
}
public Spellbook(String name) {

View File

@ -46,7 +46,7 @@ import com.iluwatar.servicelayer.spellbook.Spellbook;
public class Wizard extends BaseEntity {
public Wizard() {
spellbooks = new HashSet<Spellbook>();
spellbooks = new HashSet<>();
}
public Wizard(String name) {

View File

@ -38,7 +38,7 @@ public class ServiceCache {
private final Map<String, Service> serviceCache;
public ServiceCache() {
serviceCache = new HashMap<String, Service>();
serviceCache = new HashMap<>();
}
/**