return r;
if (reference instanceof String) { r = ImageIO.read(new File((String) reference)); } else if (reference instanceof URL) { r = ImageIO.read((URL) reference); } else { throw new IllegalArgumentException("loadJava can only be called with a URL or a filename"); }  Dimension newD = getSizeKeepRatio( new Dimension(r.getWidth(observer), r.getHeight(observer)), d, noStretch); if (newD == null) { return r; }  scaled = createResizedCopy(r, newD.width, newD.height, RenderingHints.VALUE_INTERPOLATION_BILINEAR); r.flush(); r = null;     return scaled;
	public static Image loadJava(URL url, Dimension d, boolean noStretch) {		try {			System.gc();			Log.log(Log.LEVEL_TRACE, MODULE, "Free before loading: " + Runtime.getRuntime().freeMemory());			Image r = ImageIO.read(url);			Log.log(Log.LEVEL_TRACE, MODULE, "Free after loading: " + Runtime.getRuntime().freeMemory());			r = loadJavaInternal(r, d, noStretch);			Log.log(Log.LEVEL_TRACE, MODULE, "Free after resize: " + Runtime.getRuntime().freeMemory());			System.gc();			Log.log(Log.LEVEL_TRACE, MODULE, "Free after gc: " + Runtime.getRuntime().freeMemory());			return r;		} catch (IOException e) {			Log.logException(Log.LEVEL_ERROR, MODULE, e);			return null;		} catch (Throwable e) {			Log.logException(Log.LEVEL_ERROR, MODULE, e);			return null;		}	}