public void consumeResponse(OmwListResponse<T> response) {
synchronized (response.getResultList()) { // XXX this isn't synchronized safely
for (T t : response.getResultList()) {
if (!cacheList.contains(t)) {
cacheList.add(t);
}
}
}
}
情况是我不希望任何人在此方法完成之前有机会response.getResultList()或cacheList 。我该如何正确地做到这一点?