diff --git a/jdk/src/share/classes/java/net/ContentHandler.java b/jdk/src/share/classes/java/net/ContentHandler.java index 319e6199bf7..87d578b0c99 100644 --- a/jdk/src/share/classes/java/net/ContentHandler.java +++ b/jdk/src/share/classes/java/net/ContentHandler.java @@ -96,7 +96,7 @@ abstract public class ContentHandler { * @exception IOException if an I/O error occurs while reading the object. * @since 1.3 */ - public Object getContent(URLConnection urlc, Class[] classes) throws IOException { + public Object getContent(URLConnection urlc, Class[] classes) throws IOException { Object obj = getContent(urlc); for (int i = 0; i < classes.length; i++) { diff --git a/jdk/src/share/classes/sun/net/www/content/image/gif.java b/jdk/src/share/classes/sun/net/www/content/image/gif.java index adba0c16d5b..a1c9a44b7e6 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/gif.java +++ b/jdk/src/share/classes/sun/net/www/content/image/gif.java @@ -37,15 +37,16 @@ public class gif extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws IOException { - for (int i = 0; i < classes.length; i++) { - if (classes[i].isAssignableFrom(URLImageSource.class)) { + public Object getContent(URLConnection urlc, Class[] classes) throws IOException { + Class[] cls = classes; + for (int i = 0; i < cls.length; i++) { + if (cls[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); - } - if (classes[i].isAssignableFrom(Image.class)) { - Toolkit tk = Toolkit.getDefaultToolkit(); - return tk.createImage(new URLImageSource(urlc)); - } + } + if (cls[i].isAssignableFrom(Image.class)) { + Toolkit tk = Toolkit.getDefaultToolkit(); + return tk.createImage(new URLImageSource(urlc)); + } } return null; } diff --git a/jdk/src/share/classes/sun/net/www/content/image/jpeg.java b/jdk/src/share/classes/sun/net/www/content/image/jpeg.java index 8076954caeb..c884c0578f0 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/jpeg.java +++ b/jdk/src/share/classes/sun/net/www/content/image/jpeg.java @@ -36,15 +36,16 @@ public class jpeg extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws IOException { - for (int i = 0; i < classes.length; i++) { - if (classes[i].isAssignableFrom(URLImageSource.class)) { + public Object getContent(URLConnection urlc, Class[] classes) throws IOException { + Class[] cls = classes; + for (int i = 0; i < cls.length; i++) { + if (cls[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); - } - if (classes[i].isAssignableFrom(Image.class)) { - Toolkit tk = Toolkit.getDefaultToolkit(); - return tk.createImage(new URLImageSource(urlc)); - } + } + if (cls[i].isAssignableFrom(Image.class)) { + Toolkit tk = Toolkit.getDefaultToolkit(); + return tk.createImage(new URLImageSource(urlc)); + } } return null; } diff --git a/jdk/src/share/classes/sun/net/www/content/image/png.java b/jdk/src/share/classes/sun/net/www/content/image/png.java index 88026de1e25..790d9e60d05 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/png.java +++ b/jdk/src/share/classes/sun/net/www/content/image/png.java @@ -36,15 +36,16 @@ public class png extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws IOException { - for (int i = 0; i < classes.length; i++) { - if (classes[i].isAssignableFrom(URLImageSource.class)) { + public Object getContent(URLConnection urlc, Class[] classes) throws IOException { + Class[] cls = classes; + for (int i = 0; i < cls.length; i++) { + if (cls[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); - } - if (classes[i].isAssignableFrom(Image.class)) { - Toolkit tk = Toolkit.getDefaultToolkit(); - return tk.createImage(new URLImageSource(urlc)); - } + } + if (cls[i].isAssignableFrom(Image.class)) { + Toolkit tk = Toolkit.getDefaultToolkit(); + return tk.createImage(new URLImageSource(urlc)); + } } return null; } diff --git a/jdk/src/share/classes/sun/net/www/content/image/x_xbitmap.java b/jdk/src/share/classes/sun/net/www/content/image/x_xbitmap.java index 10e724622db..b8263751426 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/x_xbitmap.java +++ b/jdk/src/share/classes/sun/net/www/content/image/x_xbitmap.java @@ -35,15 +35,16 @@ public class x_xbitmap extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { - for (int i = 0; i < classes.length; i++) { - if (classes[i].isAssignableFrom(URLImageSource.class)) { + public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { + Class[] cls = classes; + for (int i = 0; i < cls.length; i++) { + if (cls[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); - } - if (classes[i].isAssignableFrom(Image.class)) { - Toolkit tk = Toolkit.getDefaultToolkit(); - return tk.createImage(new URLImageSource(urlc)); - } + } + if (cls[i].isAssignableFrom(Image.class)) { + Toolkit tk = Toolkit.getDefaultToolkit(); + return tk.createImage(new URLImageSource(urlc)); + } } return null; } diff --git a/jdk/src/share/classes/sun/net/www/content/image/x_xpixmap.java b/jdk/src/share/classes/sun/net/www/content/image/x_xpixmap.java index 3b3ed4006a2..e67206ec82a 100644 --- a/jdk/src/share/classes/sun/net/www/content/image/x_xpixmap.java +++ b/jdk/src/share/classes/sun/net/www/content/image/x_xpixmap.java @@ -35,15 +35,16 @@ public class x_xpixmap extends ContentHandler { return new URLImageSource(urlc); } - public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { - for (int i = 0; i < classes.length; i++) { - if (classes[i].isAssignableFrom(URLImageSource.class)) { + public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { + Class[] cls = classes; + for (int i = 0; i < cls.length; i++) { + if (cls[i].isAssignableFrom(URLImageSource.class)) { return new URLImageSource(urlc); - } - if (classes[i].isAssignableFrom(Image.class)) { - Toolkit tk = Toolkit.getDefaultToolkit(); - return tk.createImage(new URLImageSource(urlc)); - } + } + if (cls[i].isAssignableFrom(Image.class)) { + Toolkit tk = Toolkit.getDefaultToolkit(); + return tk.createImage(new URLImageSource(urlc)); + } } return null; }