提交 b1963e4a 编写于 作者: C chegar

7125055: ContentHandler.getContent API changed in error

Reviewed-by: alanb
上级 2cb4a1ed
......@@ -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++) {
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册