提交 b34e68a7 编写于 作者: A ayanamist

Fix ConcurrentModificationException

上级 432236e9
......@@ -43,7 +43,7 @@ public class ListDataCollectorImpl implements DataCollector {
return datas;
}
public void resetData() {
public synchronized void resetData() {
datas.clear();
unlockIncrement();
}
......@@ -67,7 +67,7 @@ public class ListDataCollectorImpl implements DataCollector {
return Collections.frequency(datas, data) == 1;
}
public Collection<Object> getAllDataWithoutDuplicate() {
public synchronized Collection<Object> getAllDataWithoutDuplicate() {
return new HashSet<Object>(datas);
}
......@@ -81,7 +81,7 @@ public class ListDataCollectorImpl implements DataCollector {
return res;
}
public void removeData(Object data) {
public synchronized void removeData(Object data) {
datas.remove(data);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册