src/share/classes/sun/applet/AppletImageRef.java
Print this page
rev 10175 : 8042872: Fix raw and unchecked warnings in sun.applet
Reviewed-by:
*** 63,84 ****
/**
* Flushes the cached object. Forces the next invocation of get() to
* invoke reconstitute().
*/
public synchronized void flush() {
! SoftReference s = soft;
if (s != null) s.clear();
soft = null;
}
/**
* Sets the thing to the specified object.
* @param thing the specified object
*/
! public synchronized void setThing(Object thing) {
flush();
! soft = new SoftReference(thing);
}
/**
* Checks to see what object is being pointed at by this Ref and returns it.
*/
--- 63,84 ----
/**
* Flushes the cached object. Forces the next invocation of get() to
* invoke reconstitute().
*/
public synchronized void flush() {
! SoftReference<Image> s = soft;
if (s != null) s.clear();
soft = null;
}
/**
* Sets the thing to the specified object.
* @param thing the specified object
*/
! public synchronized void setThing(Image thing) {
flush();
! soft = new SoftReference<>(thing);
}
/**
* Checks to see what object is being pointed at by this Ref and returns it.
*/