13/75: 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)
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 84fa2a13c050c8c275786c79481f1749ce3d0859 Author: servantie <servantie.c@gmail.com> Date: Mon May 23 17:20:24 2016 +0200 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) --- src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java | 10 ++++++---- .../java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index af83918..4887bc0 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 JsonObject taskToJSONFormat(TimerTask task, boolean withAnnotations) { + public static String taskToJSONFormat(TimerTask task, boolean withAnnotations) { Date startDate = task.getCreationDate(); Date endDate = new Date(); - JsonObject resultingJSON = taskToJSONFormat(task, startDate, endDate, withAnnotations); + String 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 JsonObject taskToJSONFormat(TimerTask task, Date startDate, Date endDate, boolean withAnnotations) { + public static String 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,6 +395,8 @@ public class TimerTaskHelper { responseJSON.addProperty("startDate", startPeriodDate.toString()); responseJSON.addProperty("endDate", endPeriodDate.toString()); responseJSON.add("periods", periodArray ); - return responseJSON; + String response = responseJSON.toString(); + + return response; } } 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 73936b4..20e18f9 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 JsonObject updateJson; + protected String updateJson; /** task to update */ protected TimerTask task; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm