Object content = this.url.getContent();
ImageProducer producer;
try {
producer = (ImageProducer) content;
}
catch (ClassCastException e) {
throw new IOException("Unexpected type " + content.getClass());
}
if (producer == null) theImage = null;
else {
theImage = this.createImage(producer);
int width = theImage.getWidth(this);
int height = theImage.getHeight(this);
if (width > 0 && height > 0) this.setSize(width, height);
}