< prev index next >
src/share/classes/sun/net/www/content/image/x_xpixmap.java
Print this page
rev 1564 : 7090158: Networking Libraries don't build with javac -Werror
7125055: ContentHandler.getContent API changed in error
Summary: Minor changes to networking java files to remove warnings
Reviewed-by: chegar, weijun, hawtin, alanb
Contributed-by: kurchi.subhra.hazra@oracle.com, sasha_bu@hotmail.com
*** 1,7 ****
/*
! * Copyright (c) 1994, 1999, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 34,48 ****
public Object getContent(URLConnection urlc) throws java.io.IOException {
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)) {
return new URLImageSource(urlc);
}
! if (classes[i].isAssignableFrom(Image.class)) {
Toolkit tk = Toolkit.getDefaultToolkit();
return tk.createImage(new URLImageSource(urlc));
}
}
return null;
--- 34,49 ----
public Object getContent(URLConnection urlc) throws java.io.IOException {
return new URLImageSource(urlc);
}
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 (cls[i].isAssignableFrom(Image.class)) {
Toolkit tk = Toolkit.getDefaultToolkit();
return tk.createImage(new URLImageSource(urlc));
}
}
return null;
< prev index next >