fixed sonar bugs
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user