branch feature/sync updated (2ec9c11 -> 1a9ed28)
This is an automated email from the git hooks/post-receive script. New change to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git from 2ec9c11 changed the return of taskToJSONFormat back to String (to avoid having several toString() in the TimerTaskUpdaterView, when it can be done once in the method) new 1a9ed28 removed a duplicated try/catch in the sendUpdate() method The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 1a9ed2829c0f135b3164d9f0111f30c2b69cb06c Author: servantie <servantie.c@gmail.com> Date: Mon May 23 17:36:50 2016 +0200 removed a duplicated try/catch in the sendUpdate() method Summary of changes: src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java | 9 ++++----- .../java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java | 8 +------- 2 files changed, 5 insertions(+), 12 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit 1a9ed2829c0f135b3164d9f0111f30c2b69cb06c Author: servantie <servantie.c@gmail.com> Date: Mon May 23 17:36:50 2016 +0200 removed a duplicated try/catch in the sendUpdate() method --- src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java | 9 ++++----- .../java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java | 8 +------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index e6fe4c2..b786a34 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -341,10 +341,10 @@ public class TimerTaskHelper { * @param task the task to make a JSON from * @return result the string in JSON */ - public static String taskToJSONFormat(TimerTask task, boolean withAnnotations) { + public static JsonObject taskToJSONFormat(TimerTask task, boolean withAnnotations) { Date startDate = task.getCreationDate(); Date endDate = new Date(); - String resultingJSON = taskToJSONFormat(task, startDate, endDate, withAnnotations); + JsonObject resultingJSON = taskToJSONFormat(task, startDate, endDate, withAnnotations); return resultingJSON; } @@ -360,7 +360,7 @@ public class TimerTaskHelper { * @param withAnnotations true if annotations included * @return result the string in JSON */ - public static String taskToJSONFormat(TimerTask task, Date startDate, Date endDate, boolean withAnnotations) { + public static JsonObject taskToJSONFormat(TimerTask task, Date startDate, Date endDate, boolean withAnnotations) { JsonObject responseJSON = new JsonObject(); LocalDate startPeriodDate = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate endPeriodDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); @@ -395,8 +395,7 @@ public class TimerTaskHelper { responseJSON.addProperty("startDate", startPeriodDate.toString()); responseJSON.addProperty("endDate", endPeriodDate.toString()); responseJSON.add("periods", periodArray ); - String response = responseJSON.toString(); - return response; + return responseJSON; } } diff --git a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java index 20e18f9..df85ba6 100644 --- a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java +++ b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java @@ -74,7 +74,7 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener /** update output view*/ protected JTextArea updateArea; - protected String updateJson; + protected JsonObject updateJson; /** task to update */ protected TimerTask task; @@ -393,12 +393,6 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener e.printStackTrace(); } - try { - query = String.format("json=%s", URLEncoder.encode(updateJson.toString(), charset)); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - URLConnection connection = null; try { connection = new URL("http://"+ syncURl).openConnection(); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm