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 e068db82dc6fc337cea7c94173d6dae125c0c0af Author: servantie <servantie.c@gmail.com> Date: Tue Jun 7 16:31:23 2016 +0200 removed a useless toString(), removed unused imports --- src/main/java/org/chorem/jtimer/JTimerConfig.java | 2 +- .../chorem/jtimer/io/TimerTaskSynchronizer.java | 31 +++++++++++++--------- .../jtimer/ui/report/TimerTaskUpdaterView.java | 1 - 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/JTimerConfig.java b/src/main/java/org/chorem/jtimer/JTimerConfig.java index 5e41240..9ea5497 100644 --- a/src/main/java/org/chorem/jtimer/JTimerConfig.java +++ b/src/main/java/org/chorem/jtimer/JTimerConfig.java @@ -300,7 +300,7 @@ public class JTimerConfig { IO_SYNC_CLASS("jtimer.io.synchronizer.class", "org.chorem.jtimer.io.TimerTaskSynchronizer"), IO_SYNC_AUTOSYNCDELAY("jtimer.io.synchronizer.autosyncdelay", "10"), - IO_SYNC_TIMEZONE("jtimer.io.synchronizer.timezone", "+0600"), + IO_SYNC_TIMEZONE("jtimer.io.synchronizer.timezone", "+0100"), UI_IDLE_TIME("jtimer.ui.idletime", "300"), UI_SHOW_CLOSED("jtimer.ui.showclosed", "false"), diff --git a/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java b/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java index 2099d68..425c1f4 100644 --- a/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java +++ b/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java @@ -3,7 +3,6 @@ package org.chorem.jtimer.io; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.jtimer.data.DataEventListener; -import org.chorem.jtimer.data.TimerCore; import org.chorem.jtimer.entities.TimerProject; import org.chorem.jtimer.entities.TimerTask; import org.chorem.jtimer.entities.TimerTaskHelper; @@ -12,7 +11,6 @@ import java.io.*; import java.net.*; import java.time.LocalDateTime; import java.util.*; -import java.util.Timer; /** * @@ -148,7 +146,7 @@ public class TimerTaskSynchronizer implements DataEventListener { } byte[] postDataBytes = new byte[0]; try { - postDataBytes = updateJsonString.toString().getBytes("UTF-8"); + postDataBytes = updateJsonString.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } @@ -203,8 +201,8 @@ public class TimerTaskSynchronizer implements DataEventListener { //when a task is modified, add it to the to sync list (if it isn't already there) if(!tasksToSync.contains(task) && (!tasksToSync.isEmpty())) { //add it only if the URL is not empty - if (!(task.getSynchronisingURL().isEmpty())) { - if(!(task.getSynchronisingURL().equals(null))) { + if (task.getSynchronisingURL() != null) { + if (task.getSynchronisingURL().isEmpty()){ tasksToSync.add(task); } } @@ -269,11 +267,14 @@ public class TimerTaskSynchronizer implements DataEventListener { */ @Override public void stopTask(TimerTask task) { - if(!tasksToSync.contains(task)) { + if (!tasksToSync.contains(task)) { //add it only if the URL is not empty - if (!(task.getSynchronisingURL().isEmpty())) { - tasksToSync.add(task); - } } + if (task.getSynchronisingURL() != null) { + if (task.getSynchronisingURL().isEmpty()) { + tasksToSync.add(task); + } + } + } } @Override @@ -288,11 +289,15 @@ public class TimerTaskSynchronizer implements DataEventListener { */ @Override public void modifyTaskURL(TimerTask task, String newURL) { - if(!tasksToSync.contains(task)) { + if (!tasksToSync.contains(task)) { + //add it only if the URL is not empty //add it only if the URL is not empty - if (!(task.getSynchronisingURL().isEmpty())) { - tasksToSync.add(task); - } } + if (task.getSynchronisingURL() != null) { + if (task.getSynchronisingURL().isEmpty()) { + tasksToSync.add(task); + } + } + } } @Override 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 076bb88..8c980a2 100644 --- a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java +++ b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java @@ -41,7 +41,6 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.*; import java.io.IOException; -import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.*; import java.text.DateFormat; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.