7125055: ContentHandler.getContent API changed in error

Reviewed-by: alanb
This commit is contained in:
Chris Hegarty 2012-01-01 09:24:00 +00:00
parent 79235d3197
commit 1d37e604b0
6 changed files with 46 additions and 41 deletions

View File

@ -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++) {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}