jdk/src/share/classes/sun/awt/image/SurfaceManager.java
Print this page
@@ -86,11 +86,11 @@
public static void setManager(Image img, SurfaceManager mgr) {
imgaccessor.setSurfaceManager(img, mgr);
}
- private ConcurrentHashMap cacheMap;
+ private ConcurrentHashMap<Object,Object> cacheMap;
/**
* Return an arbitrary cached object for an arbitrary cache key.
* Other objects can use this mechanism to store cached data about
* the source image that will let them save time when using or
@@ -121,11 +121,11 @@
*/
public void setCacheData(Object key, Object value) {
if (cacheMap == null) {
synchronized (this) {
if (cacheMap == null) {
- cacheMap = new ConcurrentHashMap(2);
+ cacheMap = new ConcurrentHashMap<>(2);
}
}
}
cacheMap.put(key, value);
}
@@ -243,11 +243,11 @@
flush(false);
}
synchronized void flush(boolean deaccelerate) {
if (cacheMap != null) {
- Iterator i = cacheMap.values().iterator();
+ Iterator<Object> i = cacheMap.values().iterator();
while (i.hasNext()) {
Object o = i.next();
if (o instanceof FlushableCacheData) {
if (((FlushableCacheData) o).flush(deaccelerate)) {
i.remove();