Commit 4d04cf46 authored by Mathieu Gicquel's avatar Mathieu Gicquel
Browse files

Smell - Use diamond operator

parent e83e1785
......@@ -43,8 +43,8 @@ public abstract class AbstractProject extends AbstractServerObject implements IP
this.setTrash(false);
this.setArchived(false);
this.setLastModificationDate(new Date());
this.tasksList = new ArrayList<ITask>();
this.setContacts(new ArrayList<IContact>());
this.tasksList = new ArrayList<>();
this.setContacts(new ArrayList<>());
this.setProgress(Progress.TODO);
}
......
......@@ -58,10 +58,10 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
this.setEndingDate(new Date());
this.setTrash(false);
this.setLastModificationDate(new Date());
this.setTagsList(new ArrayList<ITag>());
this.setURLsList(new ArrayList<String>());
this.setPreviousTask(new ArrayList<ITask>());
this.setContacts(new ArrayList<IContact>());
this.setTagsList(new ArrayList<>());
this.setURLsList(new ArrayList<>());
this.setPreviousTask(new ArrayList<>());
this.setContacts(new ArrayList<>());
}
/**
......
......@@ -5,7 +5,7 @@ import java.util.ArrayList;
public class ChampComboBox {
public static ArrayList<String> getAvancements() {
ArrayList<String> avancements = new ArrayList<String>();
ArrayList<String> avancements = new ArrayList<>();
avancements.add("A faire");
avancements.add("En attente");
avancements.add("Delegue");
......
......@@ -19,7 +19,7 @@ public class ServerData {
@SuppressWarnings("deprecation")
public static List<Stock> getStocks() {
List<Stock> stocks = new ArrayList<Stock>();
List<Stock> stocks = new ArrayList<>();
stocks.add(new Stock("45",0,"GTD", "Projet", "Chriss", new Date("01-SEP-2009")));
stocks.add(new Stock("47",1,"Jouer de la musique", "Idee", "Stef", new Date("05-SEP-2009")));
......@@ -30,7 +30,7 @@ public class ServerData {
@SuppressWarnings("deprecation")
public static List<Idee> getIdee() {
List<Idee> stocks = new ArrayList<Idee>();
List<Idee> stocks = new ArrayList<>();
stocks.add(new Idee("0",0,"Jouer de la musique", "Prendre ma guitare, la brancher et jouer avec.", "Stef", new Date("05-SEP-2010")));
stocks.add(new Idee("0",0,"Jouer de la musique", "Prendre ma guitare, la brancher et jouer avec.", "Stef", new Date("05-OCT-2010")));
stocks.add(new Idee("0",0,"Jouer de la musique", "Prendre ma guitare, la brancher et jouer avec.", "Stef", new Date("05-SEP-2010")));
......@@ -52,7 +52,7 @@ public class ServerData {
@SuppressWarnings("deprecation")
public static List<Tache> getTache() {
List<Tache> stocks = new ArrayList<Tache>();
List<Tache> stocks = new ArrayList<>();
stocks.add(new Tache("0",0,"Ecrire un concerto", "Home", "Alex", new Date("11-NOV-2010"),4,"A faire"));
stocks.add(new Tache("0",0,"Ecrire un concerto", "Home", "Alex", new Date("11-OCT-2010"),4,"A faire"));
stocks.add(new Tache("0",0,"Ecrire un concerto", "Home", "Alex", new Date("11-AUG-2010"),4,"A faire"));
......@@ -85,7 +85,7 @@ public class ServerData {
@SuppressWarnings("deprecation")
public static List<Projet> getProjet() {
List<Projet> stocks = new ArrayList<Projet>();
List<Projet> stocks = new ArrayList<>();
stocks.add(new Projet("0",0,"GTD", "Work", "Benjamin", new Date("01-SEP-2010"),"Termine"));
stocks.add(new Projet("0",0,"GTD", "Work", "Chriss", new Date("01-OCT-2010"),"Termine"));
stocks.add(new Projet("0",0,"GTD", "Work", "Chriss", new Date("01-NOV-2010"),"Termine"));
......@@ -113,7 +113,7 @@ public class ServerData {
}
public static ListStore<TypeChamp> getTypeChamp() {
ListStore<TypeChamp> stocks = new ListStore<TypeChamp>();
ListStore<TypeChamp> stocks = new ListStore<>();
stocks.add(new TypeChamp("Tous"));
stocks.add(new TypeChamp("Idee"));
......@@ -123,7 +123,7 @@ public class ServerData {
}
public static List<TypeChamp> getTacheChamp() {
List<TypeChamp> stocks = new ArrayList<TypeChamp>();
List<TypeChamp> stocks = new ArrayList<>();
stocks.add(new TypeChamp("Tous"));
stocks.add(new TypeChamp("Nom"));
......@@ -140,7 +140,7 @@ public class ServerData {
}
public static ListStore<TypeChamp> getIdeeChamp() {
ListStore<TypeChamp> stocks = new ListStore<TypeChamp>();
ListStore<TypeChamp> stocks = new ListStore<>();
stocks.add(new TypeChamp("Tous"));
stocks.add(new TypeChamp("Nom"));
......@@ -149,7 +149,7 @@ public class ServerData {
}
public static ListStore<TypeChamp> getProjetChamp() {
ListStore<TypeChamp> stocks = new ListStore<TypeChamp>();
ListStore<TypeChamp> stocks = new ListStore<>();
stocks.add(new TypeChamp("Tous"));
stocks.add(new TypeChamp("Nom"));
......@@ -160,7 +160,7 @@ public class ServerData {
}
public static List<PieChartData> getUserStats() {
List<PieChartData> slices = new ArrayList<PieChartData>();
List<PieChartData> slices = new ArrayList<>();
slices.add(new PieChartData(200, "Stef","Stef"));
slices.add(new PieChartData(100, "Alex", "Alex"));
slices.add(new PieChartData(150, "Chriss", "Chriss"));
......@@ -169,7 +169,7 @@ public class ServerData {
}
public static List<Integer> getIdeeStats() {
List<Integer> list = new ArrayList<Integer>();
List<Integer> list = new ArrayList<>();
for (int t = 0; t < 12; t++) {
list.add((t+1)*2);
......@@ -179,7 +179,7 @@ public class ServerData {
}
public static List<Integer> getTacheStats() {
List<Integer> list = new ArrayList<Integer>();
List<Integer> list = new ArrayList<>();
for (int t = 0; t < 12; t++) {
list.add((t+1)*4);
......@@ -189,7 +189,7 @@ public class ServerData {
}
public static List<Integer> getProjetStats() {
List<Integer> list = new ArrayList<Integer>();
List<Integer> list = new ArrayList<>();
for (int t = 0; t < 12; t++) {
list.add((t+1)*3+9);
......
......@@ -52,12 +52,12 @@ public class ConnexionErrorPage extends LayoutContainer {
HTML error = new HTML("<p style='color:red;'>Identifiant ou mot de passe incorrect</p>");
simple.add(error);
final TextField<String> firstName = new TextField<String>();
final TextField<String> firstName = new TextField<>();
firstName.setFieldLabel("Login");
firstName.setAllowBlank(false);
simple.add(firstName, formData);
final TextField<String> password = new TextField<String>();
final TextField<String> password = new TextField<>();
password.setFieldLabel("Mot de passe");
password.setPassword(true);
password.setAllowBlank(false);
......
......@@ -46,12 +46,12 @@ public class ConnexionPage extends LayoutContainer {
simple.setFrame(true);
simple.setWidth(350);
final TextField<String> firstName = new TextField<String>();
final TextField<String> firstName = new TextField<>();
firstName.setFieldLabel("Login");
firstName.setAllowBlank(false);
simple.add(firstName, formData);
final TextField<String> password = new TextField<String>();
final TextField<String> password = new TextField<>();
password.setFieldLabel("Mot de passe");
password.setPassword(true);
password.setAllowBlank(false);
......
......@@ -51,7 +51,7 @@ public class GeneralHistoriquePage implements IPageIHM {
private List<Stock> data;
private ListStore<Stock> store = new ListStore<Stock>();
private ListStore<Stock> store = new ListStore<>();
private SaveDataServiceAsync saveDataService = GWT
.create(SaveDataService.class);
......@@ -78,7 +78,7 @@ public class GeneralHistoriquePage implements IPageIHM {
cp.add(textBox);
//ComboBox pour choisir idee, tache ou projet
final ComboBox<TypeChamp> combo = new ComboBox<TypeChamp>();
final ComboBox<TypeChamp> combo = new ComboBox<>();
combo.setValue(new TypeChamp("Tous"));
combo.setDisplayField("name");
......@@ -170,14 +170,14 @@ public class GeneralHistoriquePage implements IPageIHM {
*/
private Grid<Stock> createGrid() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
List<ColumnConfig> configs = new ArrayList<>();
ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Nom");
column.setWidth(200);
TextField<String> text = new TextField<String>();
TextField<String> text = new TextField<>();
text.setAllowBlank(false);
column.setEditor(new CellEditor(text));
configs.add(column);
......@@ -193,7 +193,7 @@ public class GeneralHistoriquePage implements IPageIHM {
column.setHeader("Créateur");
column.setWidth(150);
text = new TextField<String>();
text = new TextField<>();
text.setAllowBlank(false);
column.setEditor(new CellEditor(text));
configs.add(column);
......@@ -211,7 +211,7 @@ public class GeneralHistoriquePage implements IPageIHM {
ColumnModel cm = new ColumnModel(configs);
RowEditor<Stock> re = new RowEditor<Stock>();
RowEditor<Stock> re = new RowEditor<>();
re.addListener(Events.AfterEdit, new Listener<RowEditorEvent>() {
public void handleEvent(RowEditorEvent be) {
......@@ -274,7 +274,7 @@ public class GeneralHistoriquePage implements IPageIHM {
}
});
Grid<Stock> g = new Grid<Stock>(store, cm);
Grid<Stock> g = new Grid<>(store, cm);
g.addPlugin(re);
g.setAutoExpandColumn("name");
g.setBorders(true);
......
......@@ -64,7 +64,7 @@ public class IdeeHistoriquePage implements IPageIHM {
//ComboBox pour choisir idee, tache ou projet
final ComboBox<TypeChamp> combo = new ComboBox<TypeChamp>();
final ComboBox<TypeChamp> combo = new ComboBox<>();
combo.setEmptyText("Selectionnez un type...");
combo.setDisplayField("name");
combo.setWidth(100);
......@@ -155,14 +155,14 @@ public class IdeeHistoriquePage implements IPageIHM {
*/
private Grid<Idee> createGrid() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
List<ColumnConfig> configs = new ArrayList<>();
ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Nom");
column.setWidth(200);
TextField<String> text = new TextField<String>();
TextField<String> text = new TextField<>();
text.setAllowBlank(false);
column.setEditor(new CellEditor(text));
configs.add(column);
......@@ -172,7 +172,7 @@ public class IdeeHistoriquePage implements IPageIHM {
column.setHeader("Description");
column.setWidth(200);
text = new TextField<String>();
text = new TextField<>();
text.setAllowBlank(false);
column.setEditor(new CellEditor(text));
configs.add(column);
......@@ -182,7 +182,7 @@ public class IdeeHistoriquePage implements IPageIHM {
column.setHeader("Créateur");
column.setWidth(75);
text = new TextField<String>();
text = new TextField<>();
text.setAllowBlank(false);
column.setEditor(new CellEditor(text));
configs.add(column);
......@@ -196,13 +196,13 @@ public class IdeeHistoriquePage implements IPageIHM {
column.setEditor(new CellEditor(dateField));
configs.add(column);
ListStore<Idee> store = new ListStore<Idee>();
ListStore<Idee> store = new ListStore<>();
store.add(data);
ColumnModel cm = new ColumnModel(configs);
RowEditor<Stock> re = new RowEditor<Stock>();
Grid<Idee> g = new Grid<Idee>(store, cm);
RowEditor<Stock> re = new RowEditor<>();
Grid<Idee> g = new Grid<>(store, cm);
g.addPlugin(re);
g.setAutoExpandColumn("name");
g.setBorders(true);
......
......@@ -68,7 +68,7 @@ private static boolean rafrachir = false;
//ComboBox pour choisir idee, tache ou projet
final ComboBox<TypeChamp> combo = new ComboBox<TypeChamp>();
final ComboBox<TypeChamp> combo = new ComboBox<>();
combo.setEmptyText("Selectionnez un type...");
combo.setDisplayField("name");
combo.setWidth(100);
......@@ -160,7 +160,7 @@ private static boolean rafrachir = false;
@SuppressWarnings("unchecked")
private Grid<Projet> createGrid() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
List<ColumnConfig> configs = new ArrayList<>();
ColumnConfig column = new ColumnConfig();
column.setId("name");
......@@ -206,7 +206,7 @@ private static boolean rafrachir = false;
column.setHeader("Avancement");
column.setWidth(100);
final SimpleComboBox<String> combo = new SimpleComboBox<String>();
final SimpleComboBox<String> combo = new SimpleComboBox<>();
combo.setForceSelection(true);
combo.setTriggerAction(TriggerAction.ALL);
for (String avancement : ChampComboBox.getAvancements()) {
......@@ -234,13 +234,13 @@ private static boolean rafrachir = false;
column.setEditor(editor);
configs.add(column);
ListStore<Projet> store = new ListStore<Projet>();
ListStore<Projet> store = new ListStore<>();
store.add(data);
ColumnModel cm = new ColumnModel(configs);
RowEditor<Stock> re = new RowEditor<Stock>();
Grid<Projet> g = new Grid<Projet>(store, cm);
RowEditor<Stock> re = new RowEditor<>();
Grid<Projet> g = new Grid<>(store, cm);
g.addPlugin(re);
g.setAutoExpandColumn("name");
g.setBorders(true);
......
......@@ -66,11 +66,11 @@ public class TacheHistoriquePage implements IPageIHM {
textBox.setWidth("200px");
cp.add(textBox);
ListStore<TypeChamp> states = new ListStore<TypeChamp>();
ListStore<TypeChamp> states = new ListStore<>();
states.add(ServerData.getTacheChamp());
//ComboBox pour choisir idee, tache ou projet
final ComboBox<TypeChamp> combo = new ComboBox<TypeChamp>();
final ComboBox<TypeChamp> combo = new ComboBox<>();
combo.setValue(new TypeChamp("Tous"));
combo.setDisplayField("name");
......@@ -162,7 +162,7 @@ public class TacheHistoriquePage implements IPageIHM {
@SuppressWarnings("unchecked")
private Grid<Tache> createGrid() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
List<ColumnConfig> configs = new ArrayList<>();
ColumnConfig column = new ColumnConfig();
column.setId("name");
......@@ -216,7 +216,7 @@ public class TacheHistoriquePage implements IPageIHM {
column.setHeader("Avancement");
column.setWidth(100);
final SimpleComboBox<String> combo = new SimpleComboBox<String>();
final SimpleComboBox<String> combo = new SimpleComboBox<>();
combo.setForceSelection(true);
combo.setTriggerAction(TriggerAction.ALL);
for (String avancement : ChampComboBox.getAvancements()) {
......@@ -245,13 +245,13 @@ public class TacheHistoriquePage implements IPageIHM {
configs.add(column);
ListStore<Tache> store = new ListStore<Tache>();
ListStore<Tache> store = new ListStore<>();
store.add(data);
ColumnModel cm = new ColumnModel(configs);
RowEditor<Stock> re = new RowEditor<Stock>();
Grid<Tache> g = new Grid<Tache>(store, cm);
RowEditor<Stock> re = new RowEditor<>();
Grid<Tache> g = new Grid<>(store, cm);
g.addPlugin(re);
g.setAutoExpandColumn("name");
g.setBorders(true);
......
......@@ -73,10 +73,10 @@ public abstract class AbstractProjet extends AbstractObjetServeur implements IPr
this.dansLaPoubelle = false;
this.dansArchive = false;
this.dateDeDerniereModification = new Date();
this.listeDesTaches = new ArrayList<ITache>();
this.listeDesParticipants = new ArrayList<IParticipant>();
this.listeDesSousProjets = new ArrayList<IProjet>();
this.contacts = new ArrayList<IContact>();
this.listeDesTaches = new ArrayList<>();
this.listeDesParticipants = new ArrayList<>();
this.listeDesSousProjets = new ArrayList<>();
this.contacts = new ArrayList<>();
this.avancement = Avancement.AFAIRE;
}
......
......@@ -117,10 +117,10 @@ public abstract class AbstractTache extends AbstractObjetServeur implements ITac
this.dateFin = new Date();
this.dansLaPoubelle = false;
this.dateDeDerniereModification = new Date();
this.listeDesTags = new ArrayList<ITag>();
this.listeDesURLs = new ArrayList<String>();
this.tachesAnterieures = new ArrayList<ITache>();
this.contacts = new ArrayList<IContact>();
this.listeDesTags = new ArrayList<>();
this.listeDesURLs = new ArrayList<>();
this.tachesAnterieures = new ArrayList<>();
this.contacts = new ArrayList<>();
}
/**
......
......@@ -162,7 +162,7 @@ public final class Project extends AbstractProject {
*/
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private Set<Project> getListeDesSousProjets() {
Set<Project> listeElem = new HashSet<Project>();
Set<Project> listeElem = new HashSet<>();
for (IProject iElem : super.getSubprojectsList()) {
listeElem.add((Project) iElem);
}
......@@ -180,7 +180,7 @@ public final class Project extends AbstractProject {
@ManyToMany(fetch = FetchType.EAGER)
private Set<Participant> getListeDesParticipants() {
Set<Participant> listeElem = new HashSet<Participant>();
Set<Participant> listeElem = new HashSet<>();
for (IParticipant iElem : super.getParticipantsList()) {
listeElem.add((Participant) iElem);
}
......@@ -198,7 +198,7 @@ public final class Project extends AbstractProject {
@OneToMany(mappedBy = "projetConteneur", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private Set<Task> getListeDesTaches() {
Set<Task> listeElem = new HashSet<Task>();
Set<Task> listeElem = new HashSet<>();
for (ITask iElem : super.getTasksList()) {
listeElem.add((Task) iElem);
}
......@@ -215,7 +215,7 @@ public final class Project extends AbstractProject {
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private Set<Contact> getContact() {
Set<Contact> listeElem = new HashSet<Contact>();
Set<Contact> listeElem = new HashSet<>();
for (IContact iElem : super.getContacts()) {
listeElem.add((Contact) iElem);
}
......
......@@ -185,7 +185,7 @@ public final class Task extends AbstractTask {
*/
@ManyToMany(fetch = FetchType.EAGER)
private Set<Task> getTachesAnterieures() {
HashSet<Task> listeElem = new HashSet<Task>();
HashSet<Task> listeElem = new HashSet<>();
for(ITask iElem : getPreviousTask()){
listeElem.add((Task)iElem);
}
......@@ -201,7 +201,7 @@ public final class Task extends AbstractTask {
@ManyToMany(fetch = FetchType.EAGER)
private Set<Tag> getListeDesTags() {
HashSet<Tag> listeElem = new HashSet<Tag>();
HashSet<Tag> listeElem = new HashSet<>();
for(ITag iElem : super.getTagsList()){
listeElem.add((Tag)iElem);
}
......@@ -218,7 +218,7 @@ public final class Task extends AbstractTask {
@OneToMany(fetch = FetchType.EAGER)
private Set<Contact> getContact() {
HashSet<Contact> listeElem = new HashSet<Contact>();
HashSet<Contact> listeElem = new HashSet<>();
for(IContact iElem : super.getContacts()){
listeElem.add((Contact)iElem);
}
......
Supports Markdown
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