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>.