This is an automated email from the git hooks/post-receive script. New commit to branch sync-timebundle in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit 4f4d88d6a56ddfe475085a38966d3458256d073b Author: Eric Chatellier <chatellier@codelutin.com> Date: Thu Apr 5 12:50:55 2018 +0200 Update libs. Fix code style. --- pom.xml | 26 +++++++++++----------- src/main/java/org/chorem/jtimer/JTimer.java | 4 +--- .../chorem/jtimer/entities/TimerTaskHelper.java | 11 +++------ .../plugins/timebundle/RemoteSynchronizer.java | 8 +++---- .../jtimer/plugins/timebundle/SyncIOSaver.java | 5 ++--- .../jtimer/ui/resources/HelpFrame.properties | 2 +- .../jtimer/ui/resources/HelpFrame_fr.properties | 4 ++-- .../jtimer/io/GTimerIncrementalSaverTest.java | 2 +- 8 files changed, 27 insertions(+), 35 deletions(-) diff --git a/pom.xml b/pom.xml index 867be8b..1be3b44 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-config</artifactId> - <version>3.2</version> + <version>3.4</version> <scope>compile</scope> <exclusions> <exclusion> @@ -170,56 +170,56 @@ <dependency> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> - <version>4.3.0</version> + <version>4.5.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> - <version>1.7.24</version> + <version>1.7.25</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> - <version>1.2.1</version> + <version>1.2.3</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> - <version>2.3.25-incubating</version> + <version>2.3.28</version> </dependency> <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> - <version>1.18</version> + <version>1.20</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> - <version>2.8.0</version> + <version>2.8.2</version> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> - <version>20160810</version> + <version>20180130</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <version>3.5</version> + <version>3.7</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>2.5</version> + <version>2.6</version> </dependency> <!-- tests dependencies --> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <version>6.11</version> + <version>6.14.2</version> <scope>test</scope> <exclusions> <exclusion> @@ -380,7 +380,7 @@ <plugin> <groupId>com.akathist.maven.plugins.launch4j</groupId> <artifactId>launch4j-maven-plugin</artifactId> - <version>1.7.15</version> + <version>1.7.21</version> <executions> <execution> <id>launch4j</id> @@ -406,7 +406,7 @@ <productVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.0</productVersion> <txtProductVersion>${project.version}</txtProductVersion> <companyName>${project.organization.name}</companyName> - <copyright>${project.inceptionYear} - 2016 ${project.organization.name}</copyright> + <copyright>${project.inceptionYear} - 2018 ${project.organization.name}</copyright> <internalName>jtimer</internalName> <originalFilename>jtimer.exe</originalFilename> </versionInfo> diff --git a/src/main/java/org/chorem/jtimer/JTimer.java b/src/main/java/org/chorem/jtimer/JTimer.java index b2eb5ab..f0a3eea 100644 --- a/src/main/java/org/chorem/jtimer/JTimer.java +++ b/src/main/java/org/chorem/jtimer/JTimer.java @@ -185,9 +185,7 @@ public class JTimer extends SingleFrameApplication implements // native init Optional<SystemInfo> systemInfo = SystemInfoFactory.getSystemInfo(); - if (systemInfo.isPresent()) { - systemInfo.get().systemInit(); - } + systemInfo.ifPresent(SystemInfo::systemInit); // fix start in iconified mode ctxt.getSessionStorage().putProperty(JFrame.class, new WindowProperty2()); diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index d782c1a..f4405d4 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -74,7 +74,7 @@ public class TimerTaskHelper { * @return {@code tasks} */ public static List<TimerTask> sortTask(List<TimerTask> tasks) { - Collections.sort(tasks, timerTaskComparator); + tasks.sort(timerTaskComparator); return tasks; } @@ -275,13 +275,8 @@ public class TimerTaskHelper { Calendar endCal = (Calendar) beginCal.clone(); endCal.add(Calendar.DAY_OF_YEAR, 1); - for (Iterator<Date> iterator = task.getAllDaysAnnotations().keySet().iterator(); iterator.hasNext(); ) { - Date day = iterator.next(); - if (day.compareTo(beginCal.getTime()) >= 0 - && day.compareTo(endCal.getTime()) < 0) { - iterator.remove(); - } - } + task.getAllDaysAnnotations().keySet().removeIf(day -> day.compareTo(beginCal.getTime()) >= 0 + && day.compareTo(endCal.getTime()) < 0); } /** diff --git a/src/main/java/org/chorem/jtimer/plugins/timebundle/RemoteSynchronizer.java b/src/main/java/org/chorem/jtimer/plugins/timebundle/RemoteSynchronizer.java index cf9102d..c813b0a 100644 --- a/src/main/java/org/chorem/jtimer/plugins/timebundle/RemoteSynchronizer.java +++ b/src/main/java/org/chorem/jtimer/plugins/timebundle/RemoteSynchronizer.java @@ -237,11 +237,11 @@ public class RemoteSynchronizer { } protected void addTaskTime(JSONArray periodArray, TimerTask timerTask) { - timerTask.getAllDaysAndTimes().entrySet().forEach(dateLongEntry -> { + timerTask.getAllDaysAndTimes().forEach((key, value) -> { JSONObject period = new JSONObject(); - period.put("id", String.valueOf(timerTask.getNumber()) + DateFormatUtils.format(dateLongEntry.getKey(), DATE_MIDNIGHT_PATTERN)); - period.put("startDate", DateFormatUtils.format(dateLongEntry.getKey(), DATE_MIDNIGHT_PATTERN)); - period.put("duration", dateLongEntry.getValue() / 1000L); + period.put("id", String.valueOf(timerTask.getNumber()) + DateFormatUtils.format(key, DATE_MIDNIGHT_PATTERN)); + period.put("startDate", DateFormatUtils.format(key, DATE_MIDNIGHT_PATTERN)); + period.put("duration", value / 1000L); periodArray.put(period); }); timerTask.getSubTasks().forEach(subTask -> addTaskTime(periodArray, subTask)); diff --git a/src/main/java/org/chorem/jtimer/plugins/timebundle/SyncIOSaver.java b/src/main/java/org/chorem/jtimer/plugins/timebundle/SyncIOSaver.java index 716d566..d920608 100644 --- a/src/main/java/org/chorem/jtimer/plugins/timebundle/SyncIOSaver.java +++ b/src/main/java/org/chorem/jtimer/plugins/timebundle/SyncIOSaver.java @@ -176,10 +176,9 @@ public class SyncIOSaver { timerTaskByNumber.put(-1, project); // FIXME HACK // match remote and sync - remoteTaskById.entrySet().forEach(entry -> { - RemoteTask value = entry.getValue(); + remoteTaskById.forEach((key, value) -> { String uuid = value.getUuid(); - String syncList = (String)props.get(uuid); + String syncList = (String) props.get(uuid); if (syncList != null) { Set<TimerTask> syncTasks = Arrays.stream(syncList.split("\\s*,\\s*")) .map(Integer::valueOf) diff --git a/src/main/resources/org/chorem/jtimer/ui/resources/HelpFrame.properties b/src/main/resources/org/chorem/jtimer/ui/resources/HelpFrame.properties index 4ce159f..3ee3f51 100644 --- a/src/main/resources/org/chorem/jtimer/ui/resources/HelpFrame.properties +++ b/src/main/resources/org/chorem/jtimer/ui/resources/HelpFrame.properties @@ -25,7 +25,7 @@ aboutIcon = jtimer-logo-orange.jpg # About i18n aboutTitle = About ${Application.title} aboutHtmlTitle = About ${Application.title} -aboutHtml = <html><b>${Application.title} - ${Application.version}</b><br /><br />Copyright 2007 - 2017, Code Lutin.<br /><br /><a href=\"${project.url}\">${project.url}</a><br /><br />Please, report any bug you can found.<html> +aboutHtml = <html><b>${Application.title} - ${Application.version}</b><br /><br />Copyright 2007 - 2018, Code Lutin.<br /><br /><a href=\"${project.url}\">${project.url}</a><br /><br />Please, report any bug you can found.<html> aboutLicenseTitle = License aboutLicense = You can modify and redistribute the program under the conditions of the GNU General Public License (version 2 or later). A copy of the GPL is in the file "LICENSE.txt" provided with ${Application.title}. All rights reserved. No guarantees are provided for use of this program. diff --git a/src/main/resources/org/chorem/jtimer/ui/resources/HelpFrame_fr.properties b/src/main/resources/org/chorem/jtimer/ui/resources/HelpFrame_fr.properties index f266d4f..2737ec3 100644 --- a/src/main/resources/org/chorem/jtimer/ui/resources/HelpFrame_fr.properties +++ b/src/main/resources/org/chorem/jtimer/ui/resources/HelpFrame_fr.properties @@ -2,7 +2,7 @@ # #%L # jTimer # %% -# Copyright (C) 2007 - 2017 CodeLutin +# Copyright (C) 2007 - 2018 CodeLutin # %% # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as @@ -22,7 +22,7 @@ # About i18n aboutTitle = \u00C0 propos de ${Application.title} aboutHtmlTitle = \u00C0 propos de ${Application.title} -aboutHtml = <html><b>${Application.title} - ${Application.version}</b><br /><br />Copyright 2007 - 2017, Code Lutin.<br /><br /><a href=\"${project.url}\">${project.url}</a><br /><br />Merci de rapporter les bugs de ${Application.title}.<html> +aboutHtml = <html><b>${Application.title} - ${Application.version}</b><br /><br />Copyright 2007 - 2018, Code Lutin.<br /><br /><a href=\"${project.url}\">${project.url}</a><br /><br />Merci de rapporter les bugs de ${Application.title}.<html> aboutLicenseTitle = Licence aboutLicense = Vous pouvez modifier et redistribuer ce programme sous les conditions \u00E9nonc\u00E9es par la licence GNU GPL (version 2 ou ult\u00E9rieure). Une copie de la licence GPL est dans le fichier \u00AB\u00A0LICENSE.txt\u00A0\u00BB fourni avec ${Application.title}. Tous droits r\u00E9serv\u00E9s. Aucune garantie n'est fournie pour l'utilisation de ce programme. diff --git a/src/test/java/org/chorem/jtimer/io/GTimerIncrementalSaverTest.java b/src/test/java/org/chorem/jtimer/io/GTimerIncrementalSaverTest.java index a964a1d..f0f308a 100644 --- a/src/test/java/org/chorem/jtimer/io/GTimerIncrementalSaverTest.java +++ b/src/test/java/org/chorem/jtimer/io/GTimerIncrementalSaverTest.java @@ -179,7 +179,7 @@ public class GTimerIncrementalSaverTest extends AbstractJTimerTest { Assert.assertEquals("Add service layer", task.getName()); // not done by this method // Assert.assertEquals(1, task.getNumber()); - Assert.assertEquals(false, task.isClosed()); + Assert.assertFalse(task.isClosed()); // not done by this method //Assert.assertEquals(parentProject, task.getParent()); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.