Re: [Jtimer-devel] [Jtimer-commits] 74/75: changed LocalDateTime type for last sync to Date, used YAML to save sync info
Le 07/07/2016 17:48, chorem.org scm a écrit :
+ Yaml yaml = new Yaml(); + for (Object obj : yaml.loadAll(parseIn)) { + if (obj instanceof SyncInfo) { + task.addSyncInfo((SyncInfo) obj); }
Tu pourrais supprimer le 'instanceof', tu ne devrais pas avoir autre chose dans ce fichier. Limite c'est: List<SyncInfo> infos = (List<SyncInfo>)yaml.loadAll(parseIn);
+!!org.chorem.jtimer.entities.SyncInfo { + isActiveSync: true, + isWithAnnotations: false, + lastSync: !!timestamp '1970-01-01T00:00:00Z', + syncURL: 'http://localhost:3000' +}
C'est étrange comme forme de yaml, surtout le bloc avec {}. Tu pourrais aussi faire en sorte de ne surtout pas avoir le "org.chorem.jtimer.entities.SyncInfo" dans le fichier (ça empêche le refactoring). Et le "!!timestamp" qui ne semble pas très standard non plus. http://yaml.org/type/timestamp.html Merci.
participants (1)
-
Eric Chatellier