In my GWT client-side code, I have a class as follow
public class SomeClass {
private Map<Integer, Serializable> mId2ContentMap;
private Map<Integer, Timestamp> mId2Timestamp;
public SomeClass() {
mId2ContentMap = Collections.synchronizedMap(new HashMap<Integer, Serializable>());
mId2Timestamp = Collections.synchronizedMap(new HashMap<Integer, Timestamp>());
}
}
When I try to run my GWT web application, I got two errors saying that
The method synchronizedMap(HashMap<Integer,Serializable>) is undefined for the type Collections
The method synchronizedMap(HashMap<Integer,Timestamp>) is undefined for the type Collections
After googled for a while, I only found one post which is remotely relevant to the errors I encountered. That post mentioned that GWT doesn't support reflective calls. But I don't think that Collections.synchronizedMap()
is a reflective call. Correct me if I'm wrong here.
So any suggestion?