fixed sonar bugs

This commit is contained in:
jomu
2015-02-21 13:23:03 +00:00
parent 61938a6081
commit 3444384013
2 changed files with 18 additions and 14 deletions

View File

@ -1,7 +1,6 @@
package de.muehlencord.shared.sharepoint.api;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.Date;
/**
@ -18,7 +17,13 @@ public class SPHelper {
if (d == null) {
return "";
}
return dateOnlyFormat.format(d);
String result;
synchronized (dateOnlyFormat) {
result = dateOnlyFormat.format(d);
}
return result;
}
/* -- Format for DateTime Field -- */
@ -26,8 +31,12 @@ public class SPHelper {
if (d == null) {
return "";
}
return dateTimeFormat.format(d);
String result;
synchronized (dateTimeFormat) {
result = dateTimeFormat.format(d);
}
return result;
}
}