src/share/classes/sun/applet/AppletViewer.java
Print this page
@@ -33,11 +33,10 @@
import javax.print.attribute.*;
import java.applet.*;
import java.net.URL;
import java.net.MalformedURLException;
import java.net.SocketPermission;
-import sun.misc.Ref;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import sun.awt.SunToolkit;
@@ -388,26 +387,22 @@
*/
public Image getImage(URL url) {
return getCachedImage(url);
}
- static Image getCachedImage(URL url) {
- // System.getSecurityManager().checkConnection(url.getHost(), url.getPort());
- return (Image)getCachedImageRef(url).get();
- }
-
/**
- * Get an image ref.
+ * Get an image.
*/
- static Ref getCachedImageRef(URL url) {
+ static Image getCachedImage(URL url) {
+ // System.getSecurityManager().checkConnection(url.getHost(), url.getPort());
synchronized (imageRefs) {
AppletImageRef ref = (AppletImageRef)imageRefs.get(url);
if (ref == null) {
ref = new AppletImageRef(url);
imageRefs.put(url, ref);
}
- return ref;
+ return ref.get();
}
}
/**
* Flush the image cache.