aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2012-12-03 15:46:18 (EST)
committerBernd Hufmann2012-12-04 07:48:47 (EST)
commit8a5fc63355132622f0d8e8afd94e4e8859ad2cd6 (patch)
treec52f72f1314da4e6bc7efa5e2950148826f7db51
parent4cc8a75319de3cf7ad59a690a7f1b3eb078ddde2 (diff)
downloadorg.eclipse.linuxtools-8a5fc63355132622f0d8e8afd94e4e8859ad2cd6.zip
org.eclipse.linuxtools-8a5fc63355132622f0d8e8afd94e4e8859ad2cd6.tar.gz
org.eclipse.linuxtools-8a5fc63355132622f0d8e8afd94e4e8859ad2cd6.tar.bz2
Add synchronization to TmfTimestampFormat
SimpleDateFormat is not synchronized. Therefore users of that class have to ensure synchronization. Change-Id: Icbf51e3df816bf40747827a46245981043cec3ef Reviewed-on: https://git.eclipse.org/r/9012 Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> IP-Clean: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Hudson CI
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java
index 5cc0bae..a8bf8a8 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java
@@ -345,7 +345,7 @@ public class TmfTimestampFormat extends SimpleDateFormat {
* @param value the timestamp value to format (in ns)
* @return the formatted timestamp
*/
- public String format(long value) {
+ public synchronized String format(long value) {
// Split the timestamp value into its sub-components
long sec = value / 1000000000; // seconds
@@ -414,7 +414,7 @@ public class TmfTimestampFormat extends SimpleDateFormat {
* @return the parsed value
* @throws ParseException if the string has an invalid format
*/
- public long parseValue(final String string, final long ref) throws ParseException {
+ public synchronized long parseValue(final String string, final long ref) throws ParseException {
// Trivial case
if (string == null || string.length() == 0) {