--- old/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java Tue Feb 21 21:28:06 2012 +++ new/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java Tue Feb 21 21:28:04 2012 @@ -33,6 +33,7 @@ * in a client's request. */ class CGIClientException extends Exception { + private static final long serialVersionUID = 8147981687059865216L; public CGIClientException(String s) { super(s); @@ -44,6 +45,8 @@ */ class CGIServerException extends Exception { + private static final long serialVersionUID = 6928425456704527017L; + public CGIServerException(String s) { super(s); } @@ -111,9 +114,9 @@ }; /* construct table mapping command strings to handlers */ - private static Hashtable commandLookup; + private static Hashtable commandLookup; static { - commandLookup = new Hashtable(); + commandLookup = new Hashtable<>(); for (int i = 0; i < commands.length; ++ i) commandLookup.put(commands[i].getName(), commands[i]); } @@ -140,7 +143,7 @@ param = QueryString.substring(delim + 1); } CGICommandHandler handler = - (CGICommandHandler) commandLookup.get(command); + commandLookup.get(command); if (handler != null) try { handler.execute(param); @@ -200,7 +203,7 @@ /** * "forward" command: Forward request body to local port on the server, - * and send reponse back to client. + * and send response back to client. */ final class CGIForwardCommand implements CGICommandHandler { @@ -207,6 +210,11 @@ public String getName() { return "forward"; } + + @SuppressWarnings("deprecation") + private String getLine (DataInputStream socketIn) throws IOException { + return socketIn.readLine(); + } public void execute(String param) throws CGIClientException, CGIServerException { @@ -276,7 +284,7 @@ int responseContentLength = -1; do { try { - line = socketIn.readLine(); + line = getLine(socketIn); } catch (IOException e) { throw new CGIServerException("error reading from server"); } @@ -285,8 +293,9 @@ "unexpected EOF reading server response"); if (line.toLowerCase().startsWith(key)) { - if (contentLengthFound) - ; // what would we want to do in this case?? + if (contentLengthFound){ + // what would we want to do in this case?? + } responseContentLength = Integer.parseInt(line.substring(key.length()).trim()); contentLengthFound = true;