aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2012-12-03 15:46:18 (EST)
committerBernd Hufmann2012-12-04 07:32:43 (EST)
commitb6cb8c39b4facd2c1fee2945385d9ddf826b49bb (patch)
treea95e182983b986d57e241ce8105b50b11f5ec7ed
parenta7f53918cbad25a67ba7e0f8620eef0037dd3338 (diff)
downloadorg.eclipse.linuxtools-b6cb8c39b4facd2c1fee2945385d9ddf826b49bb.zip
org.eclipse.linuxtools-b6cb8c39b4facd2c1fee2945385d9ddf826b49bb.tar.gz
org.eclipse.linuxtools-b6cb8c39b4facd2c1fee2945385d9ddf826b49bb.tar.bz2
Add synchronization to TmfTimestampFormatrefs/changes/12/9012/2
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) {