tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r657429 - in /tomcat/trunk/webapps/examples: WEB-INF/classes/cal/ WEB-INF/classes/colors/ WEB-INF/classes/compressionFilters/ WEB-INF/classes/jsp2/examples/simpletag/ jsp/colors/
Date Sat, 17 May 2008 18:52:23 GMT
Author: markt
Date: Sat May 17 11:52:23 2008
New Revision: 657429

URL: http://svn.apache.org/viewvc?rev=657429&view=rev
Log:
Fix some Eclipse warnings in the examples webapp.

Modified:
    tomcat/trunk/webapps/examples/WEB-INF/classes/cal/Entries.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/cal/TableBean.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/colors/ColorGameBean.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.java
    tomcat/trunk/webapps/examples/jsp/colors/colrs.jsp

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/cal/Entries.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/cal/Entries.java?rev=657429&r1=657428&r2=657429&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/cal/Entries.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/cal/Entries.java Sat May 17 11:52:23 2008
@@ -21,14 +21,14 @@
 
 public class Entries {
 
-  private Hashtable entries;
+  private Hashtable<String, Entry> entries;
   private static final String[] time = {"8am", "9am", "10am", "11am", "12pm", 
 					"1pm", "2pm", "3pm", "4pm", "5pm", "6pm",
 					"7pm", "8pm" };
   public static final int rows = 12;
 
   public Entries () {   
-   entries = new Hashtable (rows);
+   entries = new Hashtable<String, Entry> (rows);
    for (int i=0; i < rows; i++) {
      entries.put (time[i], new Entry(time[i]));
    }
@@ -39,7 +39,7 @@
   }
 
   public Entry getEntry (int index) {
-    return (Entry)this.entries.get(time[index]);
+    return this.entries.get(time[index]);
   }
 
   public int getIndex (String tm) {
@@ -52,7 +52,7 @@
     int index = getIndex (tm);
     if (index >= 0) {
       String descr = request.getParameter ("description");
-      ((Entry)entries.get(time[index])).setDescription (descr);
+      entries.get(time[index]).setDescription (descr);
     }
   }
 

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/cal/TableBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/cal/TableBean.java?rev=657429&r1=657428&r2=657429&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/cal/TableBean.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/cal/TableBean.java Sat May 17 11:52:23 2008
@@ -21,7 +21,7 @@
 
 public class TableBean {
 
-  Hashtable table;
+  Hashtable<String, Entries> table;
   JspCalendar JspCal;
   Entries entries;
   String date;
@@ -30,7 +30,7 @@
   boolean processError = false;
 
   public TableBean () {
-    this.table = new Hashtable (10);
+    this.table = new Hashtable<String, Entries> (10);
     this.JspCal = new JspCalendar ();
     this.date = JspCal.getCurrentDate ();
   }
@@ -77,7 +77,7 @@
     else if (dateR.equalsIgnoreCase("next")) date = JspCal.getNextDate ();
     else if (dateR.equalsIgnoreCase("prev")) date = JspCal.getPrevDate ();
 
-    entries = (Entries) table.get (date);
+    entries = table.get (date);
     if (entries == null) {
       entries = new Entries ();
       table.put (date, entries);

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/colors/ColorGameBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/colors/ColorGameBean.java?rev=657429&r1=657428&r2=657429&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/colors/ColorGameBean.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/colors/ColorGameBean.java Sat May 17 11:52:23
2008
@@ -16,8 +16,6 @@
 */
 package colors;
 
-import javax.servlet.http.*;
-
 public class ColorGameBean {
 
     private String background = "yellow";
@@ -29,7 +27,7 @@
 	private int intval = 0;
     private boolean tookHints = false;
 
-    public void processRequest(HttpServletRequest request) {
+    public void processRequest() {
 
 	// background = "yellow";
 	// foreground = "red";

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java?rev=657429&r1=657428&r2=657429&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
(original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
Sat May 17 11:52:23 2008
@@ -146,7 +146,7 @@
             }
 
             // Are we allowed to compress ?
-            String s = (String) ((HttpServletRequest)request).getParameter("gzip");
+            String s = ((HttpServletRequest)request).getParameter("gzip");
             if ("false".equals(s)) {
                 if (debug > 0) {
                     System.out.println("got parameter gzip=false --> don't compress, just
chain filter");

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java?rev=657429&r1=657428&r2=657429&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java
(original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java
Sat May 17 11:52:23 2008
@@ -36,7 +36,7 @@
         ServletOutputStream out = response.getOutputStream();
         response.setContentType("text/plain");
 
-        Enumeration e = ((HttpServletRequest)request).getHeaders("Accept-Encoding");
+        Enumeration e = request.getHeaders("Accept-Encoding");
         while (e.hasMoreElements()) {
             String name = (String)e.nextElement();
             out.println(name);

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.java?rev=657429&r1=657428&r2=657429&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.java
(original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.java
Sat May 17 11:52:23 2008
@@ -32,13 +32,13 @@
     extends SimpleTagSupport
     implements DynamicAttributes
 {
-    private ArrayList keys = new ArrayList();
-    private ArrayList values = new ArrayList();
+    private ArrayList<String> keys = new ArrayList<String>();
+    private ArrayList<Object> values = new ArrayList<Object>();
 
     public void doTag() throws JspException, IOException {
 	JspWriter out = getJspContext().getOut();
 	for( int i = 0; i < keys.size(); i++ ) {
-	    String key = (String)keys.get( i );
+	    String key = keys.get( i );
 	    Object value = values.get( i );
 	    out.println( "<li>" + key + " = " + value + "</li>" );
         }

Modified: tomcat/trunk/webapps/examples/jsp/colors/colrs.jsp
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/jsp/colors/colrs.jsp?rev=657429&r1=657428&r2=657429&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/jsp/colors/colrs.jsp (original)
+++ tomcat/trunk/webapps/examples/jsp/colors/colrs.jsp Sat May 17 11:52:23 2008
@@ -20,7 +20,7 @@
 <jsp:setProperty name="cb" property="*" />
 
 <%
-	cb.processRequest(request);
+	cb.processRequest();
 %>
 
 <body bgcolor=<%= cb.getColor1() %>>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message