Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
a1bb0e65
Commit
a1bb0e65
authored
Jan 06, 2018
by
Greg Messner
Browse files
Removed unnecessary synchronization on toString().
parent
0ab14a67
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/utils/ISO8601.java
View file @
a1bb0e65
...
...
@@ -21,7 +21,7 @@ public class ISO8601 {
public
static
final
String
OUTPUT_MSEC_PATTERN
=
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
;
public
static
final
String
UTC_PATTERN
=
"yyyy-MM-dd HH:mm:ss 'UTC'"
;
// Set up ThreadLocal storage to save a thread local SimpleDateFormat keyed with the format string
f
// Set up ThreadLocal storage to save a thread local SimpleDateFormat keyed with the format string
private
static
final
class
SafeDateFormatter
{
private
static
final
ThreadLocal
<
Map
<
String
,
SimpleDateFormat
>>
safeFormats
=
new
ThreadLocal
<
Map
<
String
,
SimpleDateFormat
>>()
{
...
...
@@ -89,7 +89,7 @@ public class ISO8601 {
* @param withMsec flag indicating whether to include milliseconds
* @return a ISO8601 formatted string for the provided Date instance, or null if date is null
*/
public
static
synchronized
String
toString
(
Date
date
,
boolean
withMsec
)
{
public
static
String
toString
(
Date
date
,
boolean
withMsec
)
{
if
(
date
==
null
)
{
return
(
null
);
...
...
@@ -107,7 +107,7 @@ public class ISO8601 {
* @param date the Date instance to get the ISO8601 formatted string for
* @return a ISO8601 formatted string for the provided Date instance, or null if date is null
*/
public
static
synchronized
String
toString
(
Date
date
)
{
public
static
String
toString
(
Date
date
)
{
return
(
toString
(
date
,
true
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment