< prev index next >
src/share/classes/sun/net/TransferProtocolClient.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 +1,7 @@
/*
- * Copyright (c) 1994, 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -23,14 +23,12 @@
* questions.
*/
package sun.net;
-import java.lang.StringIndexOutOfBoundsException;
import java.io.*;
import java.util.Vector;
-import sun.net.NetworkClient;
/**
* This class implements that basic intefaces of transfer protocols.
* It is used by subclasses implementing specific protocols.
*
@@ -42,11 +40,11 @@
public class TransferProtocolClient extends NetworkClient {
static final boolean debug = false;
/** Array of strings (usually 1 entry) for the last reply
from the server. */
- protected Vector serverResponse = new Vector(1);
+ protected Vector<String> serverResponse = new Vector<String>(1);
/** code for last reply */
protected int lastReplyCode;
@@ -121,15 +119,15 @@
}
}
/** converts the server response into a string. */
public String getResponseString() {
- return (String) serverResponse.elementAt(0);
+ return serverResponse.elementAt(0);
}
/** Returns all server response strings. */
- public Vector getResponseStrings() {
+ public Vector<String> getResponseStrings() {
return serverResponse;
}
/** standard constructor to host <i>host</i>, port <i>port</i>. */
public TransferProtocolClient(String host, int port) throws IOException {
< prev index next >