changeset 4885:5aeefe0e5d8c

7125055: ContentHandler.getContent API changed in error Reviewed-by: alanb
author chegar
date Sun, 01 Jan 2012 09:24:00 +0000
parents 3a7ea63302f8
children 8952a5f494f9
files src/share/classes/java/net/ContentHandler.java src/share/classes/sun/net/www/content/image/gif.java src/share/classes/sun/net/www/content/image/jpeg.java src/share/classes/sun/net/www/content/image/png.java src/share/classes/sun/net/www/content/image/x_xbitmap.java src/share/classes/sun/net/www/content/image/x_xpixmap.java
diffstat 6 files changed, 46 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/net/ContentHandler.java	Thu Dec 29 16:39:51 2011 -0800
+++ b/src/share/classes/java/net/ContentHandler.java	Sun Jan 01 09:24:00 2012 +0000
@@ -96,7 +96,7 @@
      * @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++) {
--- a/src/share/classes/sun/net/www/content/image/gif.java	Thu Dec 29 16:39:51 2011 -0800
+++ b/src/share/classes/sun/net/www/content/image/gif.java	Sun Jan 01 09:24:00 2012 +0000
@@ -37,15 +37,16 @@
         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;
     }
--- a/src/share/classes/sun/net/www/content/image/jpeg.java	Thu Dec 29 16:39:51 2011 -0800
+++ b/src/share/classes/sun/net/www/content/image/jpeg.java	Sun Jan 01 09:24:00 2012 +0000
@@ -36,15 +36,16 @@
         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;
     }
--- a/src/share/classes/sun/net/www/content/image/png.java	Thu Dec 29 16:39:51 2011 -0800
+++ b/src/share/classes/sun/net/www/content/image/png.java	Sun Jan 01 09:24:00 2012 +0000
@@ -36,15 +36,16 @@
         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;
     }
--- a/src/share/classes/sun/net/www/content/image/x_xbitmap.java	Thu Dec 29 16:39:51 2011 -0800
+++ b/src/share/classes/sun/net/www/content/image/x_xbitmap.java	Sun Jan 01 09:24:00 2012 +0000
@@ -35,15 +35,16 @@
         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;
     }
--- a/src/share/classes/sun/net/www/content/image/x_xpixmap.java	Thu Dec 29 16:39:51 2011 -0800
+++ b/src/share/classes/sun/net/www/content/image/x_xpixmap.java	Sun Jan 01 09:24:00 2012 +0000
@@ -35,15 +35,16 @@
         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;
     }