src/share/classes/sun/applet/AppletViewer.java
Print this page
*** 33,43 ****
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;
--- 33,42 ----
*** 388,413 ****
*/
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.
*/
! static Ref getCachedImageRef(URL url) {
synchronized (imageRefs) {
AppletImageRef ref = (AppletImageRef)imageRefs.get(url);
if (ref == null) {
ref = new AppletImageRef(url);
imageRefs.put(url, ref);
}
! return ref;
}
}
/**
* Flush the image cache.
--- 387,408 ----
*/
public Image getImage(URL url) {
return getCachedImage(url);
}
/**
! * Get an image.
*/
! 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.get();
}
}
/**
* Flush the image cache.