Cosmetic changes
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 6 Feb 2010 21:56:30 +0000 (21:56 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 6 Feb 2010 21:56:30 +0000 (21:56 +0000)
 - fix eclipse warnings
 - tabs to spaces

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@907317 13f79535-47bb-0310-9956-ffa450edef68

24 files changed:
webapps/examples/WEB-INF/classes/CookieExample.java
webapps/examples/WEB-INF/classes/HelloWorldExample.java
webapps/examples/WEB-INF/classes/RequestHeaderExample.java
webapps/examples/WEB-INF/classes/RequestInfoExample.java
webapps/examples/WEB-INF/classes/RequestParamExample.java
webapps/examples/WEB-INF/classes/SessionExample.java
webapps/examples/WEB-INF/classes/async/Async0.java
webapps/examples/WEB-INF/classes/async/Async1.java
webapps/examples/WEB-INF/classes/async/Async2.java
webapps/examples/WEB-INF/classes/async/Async3.java
webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java
webapps/examples/WEB-INF/classes/async/Stockticker.java
webapps/examples/WEB-INF/classes/chat/ChatServlet.java
webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java
webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
webapps/examples/WEB-INF/classes/examples/ExampleTagBase.java
webapps/examples/WEB-INF/classes/examples/FooTag.java
webapps/examples/WEB-INF/classes/examples/LogTag.java
webapps/examples/WEB-INF/classes/examples/ShowSource.java
webapps/examples/WEB-INF/classes/examples/ValuesTag.java
webapps/examples/WEB-INF/classes/filters/ExampleFilter.java
webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java
webapps/examples/WEB-INF/classes/jsp2/examples/ValuesBean.java
webapps/examples/WEB-INF/classes/servletToJsp.java

index 37320a9..b3a6e71 100644 (file)
@@ -33,6 +33,8 @@ import util.HTMLFilter;
 
 public class CookieExample extends HttpServlet {
 
+    private static final long serialVersionUID = 1L;
+
     ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
     
     @Override
index 74fbb1d..be8cb06 100644 (file)
@@ -31,6 +31,7 @@ import javax.servlet.http.*;
 
 public class HelloWorldExample extends HttpServlet {
 
+    private static final long serialVersionUID = 1L;
 
     @Override
     public void doGet(HttpServletRequest request,
index 756e207..ca204fa 100644 (file)
@@ -33,6 +33,8 @@ import util.HTMLFilter;
 
 public class RequestHeaderExample extends HttpServlet {
 
+    private static final long serialVersionUID = 1L;
+
     ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
     
     @Override
index a0fcb84..efc2159 100644 (file)
@@ -33,6 +33,7 @@ import util.HTMLFilter;
 
 public class RequestInfoExample extends HttpServlet {
 
+    private static final long serialVersionUID = 1L;
 
     ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
 
index 218b4b0..c98ae5e 100644 (file)
@@ -33,6 +33,7 @@ import util.HTMLFilter;
 
 public class RequestParamExample extends HttpServlet {
 
+    private static final long serialVersionUID = 1L;
 
     ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
     
index f988e6d..5acc50f 100644 (file)
@@ -33,6 +33,8 @@ import util.HTMLFilter;
 
 public class SessionExample extends HttpServlet {
 
+    private static final long serialVersionUID = 1L;
+
     ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
     
     @Override
index af5133f..5a5af97 100644 (file)
@@ -28,9 +28,10 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
 public class Async0 extends HttpServlet {
+
+    private static final long serialVersionUID = 1L;
+
     private static final Log log = LogFactory.getLog(Async0.class);
-    public Async0() {
-    }
 
     @Override
     protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
index 6d589fb..907e1d4 100644 (file)
@@ -28,9 +28,10 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
 public class Async1 extends HttpServlet {
+
+    private static final long serialVersionUID = 1L;
+
     private static final Log log = LogFactory.getLog(Async1.class);
-    public Async1() {
-    }
 
     @Override
     protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
index 83a3f40..bb39ff1 100644 (file)
@@ -28,9 +28,10 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
 public class Async2 extends HttpServlet {
+
+    private static final long serialVersionUID = 1L;
+
     private static final Log log = LogFactory.getLog(Async2.class);
-    public Async2() {
-    }
 
     @Override
     protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
index 164033b..f7bff30 100644 (file)
@@ -24,13 +24,9 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.juli.logging.Log;
-import org.apache.juli.logging.LogFactory;
-
 public class Async3 extends HttpServlet {
-    private static final Log log = LogFactory.getLog(Async3.class);
-    public Async3() {
-    }
+
+    private static final long serialVersionUID = 1L;
 
     @Override
     protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
index fbec89e..fd5ce9b 100644 (file)
@@ -36,6 +36,8 @@ import async.Stockticker.TickListener;
 
 public class AsyncStockServlet extends HttpServlet implements TickListener, AsyncListener{
 
+    private static final long serialVersionUID = 1L;
+
     public static final String POLL = "POLL";
     public static final String LONG_POLL = "LONG-POLL";
     public static final String STREAM = "STREAM";
@@ -98,7 +100,7 @@ public class AsyncStockServlet extends HttpServlet implements TickListener, Asyn
             writer.flush();
             response.flushBuffer();
         }catch (IOException x) {
-            try {actx.complete();}catch (Exception ignore){}
+            try {actx.complete();}catch (Exception ignore){/* Ignore */}
         }
     }
 
index 96206c1..b99fe4b 100644 (file)
@@ -83,14 +83,11 @@ public class Stockticker implements Runnable {
                             l.tick(stock);
                         }
                         
-//                        System.out.println("Stock: " + stock.getSymbol()
-//                                + " Price: " + stock.getValueAsString()
-//                                + " Change: " + stock.getLastChangeAsString());
                     }
                     Thread.sleep(850);
                 }
             } catch (InterruptedException ix) {
-
+                // Ignore
             } catch (Exception x) {
                 x.printStackTrace();
             }
index 8e24cbf..15f025a 100644 (file)
@@ -39,6 +39,8 @@ import javax.servlet.http.HttpServletResponse;
 public class ChatServlet
     extends HttpServlet implements CometProcessor {
 
+    private static final long serialVersionUID = 1L;
+
     protected ArrayList<HttpServletResponse> connections = 
         new ArrayList<HttpServletResponse>();
     protected MessageSender messageSender = null;
index 72617be..078eb77 100644 (file)
@@ -30,6 +30,8 @@ import javax.servlet.http.*;
 
 public class CompressionFilterTestServlet extends HttpServlet {
 
+    private static final long serialVersionUID = 1L;
+
     @Override
     public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
index 05c019f..2e98cf0 100644 (file)
@@ -140,11 +140,12 @@ public class CompressionServletResponseWrapper extends HttpServletResponseWrappe
             System.out.println("createOutputStream gets called");
         }
 
-        CompressionResponseStream stream = new CompressionResponseStream(origResponse);
-        stream.setDebugLevel(debug);
-        stream.setBuffer(threshold);
+        CompressionResponseStream compressedStream =
+            new CompressionResponseStream(origResponse);
+        compressedStream.setDebugLevel(debug);
+        compressedStream.setBuffer(threshold);
 
-        return stream;
+        return compressedStream;
 
     }
 
index 23eb192..cea926d 100644 (file)
@@ -21,6 +21,8 @@ import javax.servlet.jsp.tagext.*;
 
 public abstract class ExampleTagBase extends BodyTagSupport {
 
+    private static final long serialVersionUID = 1L;
+
     @Override
     public void setParent(Tag parent) {
         this.parent = parent;
index 8e8dc72..fba2bc6 100644 (file)
@@ -26,9 +26,10 @@ import java.io.IOException;
  * <foo att1="..." att2="...." att3="...." />
  */
 
-public class FooTag 
-    extends ExampleTagBase 
-{
+public class FooTag extends ExampleTagBase {
+
+    private static final long serialVersionUID = 1L;
+
     private String atts[] = new String[3];
     int i = 0;
     
index 04ebd09..9bc4789 100644 (file)
@@ -24,9 +24,10 @@ import java.io.IOException;
 /**
  * Log the contents of the body. Could be used to handle errors etc. 
  */
-public class LogTag 
-    extends ExampleTagBase
-{
+public class LogTag extends ExampleTagBase {
+
+    private static final long serialVersionUID = 1L;
+
     boolean toBrowser = false;
     
     public void setToBrowser(String value) {
index a700d11..d3144ce 100644 (file)
@@ -25,9 +25,10 @@ import java.io.*;
 /**
  * Display the sources of the JSP file.
  */
-public class ShowSource
-    extends TagSupport
-{
+public class ShowSource extends TagSupport {
+
+    private static final long serialVersionUID = 1L;
+
     String jspFile;
     
     public void setJspFile(String jspFile) {
index 5e9f70b..869c34a 100644 (file)
@@ -25,6 +25,9 @@ import java.io.*;
  * Accept and display a value.
  */
 public class ValuesTag extends TagSupport {
+
+    private static final long serialVersionUID = 1L;
+
     // Using "-1" as the default value,
     // in the assumption that it won't be used as the value.
     // Cannot use null here, because null is an important case
@@ -50,6 +53,7 @@ public class ValuesTag extends TagSupport {
         this.doubleValue = doubleValue;
     }
 
+    @Override
     public int doEndTag() throws JspException {
         JspWriter out = pageContext.getOut();
 
index 01b32ff..eb5a528 100644 (file)
@@ -90,19 +90,19 @@ public final class ExampleFilter implements Filter {
      */
     public void doFilter(ServletRequest request, ServletResponse response,
                          FilterChain chain)
-       throws IOException, ServletException {
+        throws IOException, ServletException {
 
-       // Store ourselves as a request attribute (if requested)
-       if (attribute != null)
-           request.setAttribute(attribute, this);
+        // Store ourselves as a request attribute (if requested)
+        if (attribute != null)
+            request.setAttribute(attribute, this);
 
-       // Time and log the subsequent processing
-       long startTime = System.currentTimeMillis();
+        // Time and log the subsequent processing
+        long startTime = System.currentTimeMillis();
         chain.doFilter(request, response);
-       long stopTime = System.currentTimeMillis();
-       filterConfig.getServletContext().log
-           (this.toString() + ": " + (stopTime - startTime) +
-            " milliseconds");
+        long stopTime = System.currentTimeMillis();
+        filterConfig.getServletContext().log
+            (this.toString() + ": " + (stopTime - startTime) +
+             " milliseconds");
 
     }
 
@@ -110,12 +110,12 @@ public final class ExampleFilter implements Filter {
     /**
      * Place this filter into service.
      *
-     * @param filterConfig The filter configuration object
+     * @param fConfig The filter configuration object
      */
-    public void init(FilterConfig filterConfig) throws ServletException {
+    public void init(FilterConfig fConfig) throws ServletException {
 
-       this.filterConfig = filterConfig;
-        this.attribute = filterConfig.getInitParameter("attribute");
+        this.filterConfig = fConfig;
+        this.attribute = fConfig.getInitParameter("attribute");
 
     }
 
@@ -126,12 +126,12 @@ public final class ExampleFilter implements Filter {
     @Override
     public String toString() {
 
-       if (filterConfig == null)
-           return ("TimingFilter()");
-       StringBuilder sb = new StringBuilder("TimingFilter(");
-       sb.append(filterConfig);
-       sb.append(")");
-       return (sb.toString());
+        if (filterConfig == null)
+            return ("TimingFilter()");
+        StringBuilder sb = new StringBuilder("TimingFilter(");
+        sb.append(filterConfig);
+        sb.append(")");
+        return (sb.toString());
 
     }
 
index 0f8e40e..ce6ff03 100644 (file)
@@ -113,9 +113,9 @@ public class SetCharacterEncodingFilter implements Filter {
 
         // Conditionally select and set the character encoding to be used
         if (ignore || (request.getCharacterEncoding() == null)) {
-            String encoding = selectEncoding(request);
-            if (encoding != null)
-                request.setCharacterEncoding(encoding);
+            String characterEncoding = selectEncoding(request);
+            if (characterEncoding != null)
+                request.setCharacterEncoding(characterEncoding);
         }
 
         // Pass control on to the next filter
@@ -127,13 +127,13 @@ public class SetCharacterEncodingFilter implements Filter {
     /**
      * Place this filter into service.
      *
-     * @param filterConfig The filter configuration object
+     * @param fConfig The filter configuration object
      */
-    public void init(FilterConfig filterConfig) throws ServletException {
+    public void init(FilterConfig fConfig) throws ServletException {
 
-        this.filterConfig = filterConfig;
-        this.encoding = filterConfig.getInitParameter("encoding");
-        String value = filterConfig.getInitParameter("ignore");
+        this.filterConfig = fConfig;
+        this.encoding = fConfig.getInitParameter("encoding");
+        String value = fConfig.getInitParameter("ignore");
         if (value == null)
             this.ignore = true;
         else if (value.equalsIgnoreCase("true"))
index 718888e..6b481fc 100644 (file)
@@ -26,9 +26,6 @@ public class ValuesBean {
     private double doubleValue;
     private long longValue;
 
-    public ValuesBean() {
-    }
-
     public String getString() {
         return this.string;
     }
index c67d599..ffc2737 100644 (file)
@@ -18,6 +18,8 @@ import javax.servlet.http.*;
 
 public class servletToJsp extends HttpServlet {
 
+    private static final long serialVersionUID = 1L;
+
     @Override
     public void doGet (HttpServletRequest request,
                       HttpServletResponse response) {