< prev index next >

src/share/classes/sun/net/httpserver/Request.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

@@ -23,17 +23,15 @@
  * questions.
  */
 
 package sun.net.httpserver;
 
-import java.util.*;
+import java.net.SocketTimeoutException;
 import java.nio.*;
-import java.net.*;
 import java.io.*;
 import java.nio.channels.*;
 import com.sun.net.httpserver.*;
-import com.sun.net.httpserver.spi.*;
 
 /**
  */
 class Request {
 

@@ -45,11 +43,10 @@
     private SocketChannel chan;
     private InputStream is;
     private OutputStream os;
 
     Request (InputStream rawInputStream, OutputStream rawout) throws IOException {
-        this.chan = chan;
         is = rawInputStream;
         os = rawout;
         do {
             startLine = readLine();
             if (startLine == null) {

@@ -119,11 +116,11 @@
     public String requestLine () {
         return startLine;
     }
 
     Headers hdrs = null;
-
+    @SuppressWarnings("fallthrough")
     Headers headers () throws IOException {
         if (hdrs != null) {
             return hdrs;
         }
         hdrs = new Headers();

@@ -137,10 +134,11 @@
             boolean inKey = firstc > ' ';
             s[len++] = (char) firstc;
     parseloop:{
                 while ((c = is.read()) >= 0) {
                     switch (c) {
+                      /*fallthrough*/
                       case ':':
                         if (inKey && len > 0)
                             keyend = len;
                         inKey = false;
                         break;
< prev index next >