Skip to content

Commit

Permalink
Access to WeakHashMap must be synchronized
Browse files Browse the repository at this point in the history
...if a thread might be changing the map.
  • Loading branch information
ztravis committed Aug 2, 2016
1 parent 9605fb6 commit b887f01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/fortuna/ical4j/model/DateTime.java
Expand Up @@ -529,7 +529,7 @@ private DateFormatCache(DateFormat dateFormat) {
this.templateFormat = dateFormat;
}

public DateFormat get() {
public synchronized DateFormat get() {
DateFormat dateFormat = threadMap.get(Thread.currentThread());
if (dateFormat == null) {
dateFormat = (DateFormat) templateFormat.clone();
Expand Down

0 comments on commit b887f01

Please sign in to comment.