tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r742709 - in /tomcat/trunk/java/javax: el/ servlet/ servlet/http/ servlet/jsp/ servlet/jsp/tagext/
Date Mon, 09 Feb 2009 19:55:30 GMT
Author: markt
Date: Mon Feb  9 19:55:29 2009
New Revision: 742709

URL: http://svn.apache.org/viewvc?rev=742709&view=rev
Log:
Fix various Eclipse warnings.
Convert tabs to spaces.

Modified:
    tomcat/trunk/java/javax/el/ArrayELResolver.java
    tomcat/trunk/java/javax/el/BeanELResolver.java
    tomcat/trunk/java/javax/el/ListELResolver.java
    tomcat/trunk/java/javax/servlet/GenericServlet.java
    tomcat/trunk/java/javax/servlet/ServletInputStream.java
    tomcat/trunk/java/javax/servlet/ServletOutputStream.java
    tomcat/trunk/java/javax/servlet/SingleThreadModel.java
    tomcat/trunk/java/javax/servlet/http/HttpServlet.java
    tomcat/trunk/java/javax/servlet/http/HttpUtils.java
    tomcat/trunk/java/javax/servlet/jsp/JspContext.java
    tomcat/trunk/java/javax/servlet/jsp/JspEngineInfo.java
    tomcat/trunk/java/javax/servlet/jsp/JspException.java
    tomcat/trunk/java/javax/servlet/jsp/JspFactory.java
    tomcat/trunk/java/javax/servlet/jsp/PageContext.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/BodyTagSupport.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/JspTag.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/PageData.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/SimpleTagSupport.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/Tag.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/TagData.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/TagExtraInfo.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/TagLibraryValidator.java
    tomcat/trunk/java/javax/servlet/jsp/tagext/TagSupport.java

Modified: tomcat/trunk/java/javax/el/ArrayELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ArrayELResolver.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ArrayELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ArrayELResolver.java Mon Feb  9 19:55:29 2009
@@ -45,10 +45,9 @@
 			int idx = coerce(property);
             if (idx < 0 || idx >= Array.getLength(base)) {
                 return null;
-            } else {
-                return Array.get(base, idx);
             }
-		}
+            return Array.get(base, idx);
+        }
 
 		return null;
 	}

Modified: tomcat/trunk/java/javax/el/BeanELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanELResolver.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/BeanELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanELResolver.java Mon Feb  9 19:55:29 2009
@@ -207,9 +207,9 @@
 	}
 
     protected final static class BeanProperty {
-		private final Class type;
+		private final Class<?> type;
 
-		private final Class owner;
+		private final Class<?> owner;
 
 		private final PropertyDescriptor descriptor;
 
@@ -283,7 +283,7 @@
 		if (m == null || Modifier.isPublic(type.getModifiers())) {
 			return m;
 		}
-		Class[] inf = type.getInterfaces();
+		Class<?>[] inf = type.getInterfaces();
 		Method mp = null;
 		for (int i = 0; i < inf.length; i++) {
 			try {
@@ -293,9 +293,10 @@
 					return mp;
 				}
 			} catch (NoSuchMethodException e) {
+			    // Ignore
 			}
 		}
-		Class sup = type.getSuperclass();
+		Class<?> sup = type.getSuperclass();
 		if (sup != null) {
 			try {
 				mp = sup.getMethod(m.getName(), m.getParameterTypes());
@@ -304,6 +305,7 @@
 					return mp;
 				}
 			} catch (NoSuchMethodException e) {
+			    // Ignore
 			}
 		}
 		return null;

Modified: tomcat/trunk/java/javax/el/ListELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ListELResolver.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ListELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ListELResolver.java Mon Feb  9 19:55:29 2009
@@ -28,8 +28,8 @@
 
 	private final boolean readOnly;
 
-	private final static Class UNMODIFIABLE = Collections.unmodifiableList(
-			new ArrayList()).getClass();
+	private final static Class<? extends List> UNMODIFIABLE =
+	    Collections.unmodifiableList(new ArrayList<Object>()).getClass();
 
 	public ListELResolver() {
 		this.readOnly = false;
@@ -47,7 +47,7 @@
 
 		if (base instanceof List) {
 			context.setPropertyResolved(true);
-			List list = (List) base;
+			List<Object> list = (List<Object>) base;
 			int idx = coerce(property);
 			if (idx < 0 || idx >= list.size()) {
 				return null;
@@ -66,7 +66,7 @@
 
 		if (base instanceof List) {
 			context.setPropertyResolved(true);
-			List list = (List) base;
+			List<Object> list = (List<Object>) base;
 			int idx = coerce(property);
 			if (idx < 0 || idx >= list.size()) {
 				return null;
@@ -88,7 +88,7 @@
 
 		if (base instanceof List) {
 			context.setPropertyResolved(true);
-			List list = (List) base;
+			List<Object> list = (List<Object>) base;
 
 			if (this.readOnly) {
 				throw new PropertyNotWritableException(message(context,
@@ -115,7 +115,7 @@
 
 		if (base instanceof List) {
 			context.setPropertyResolved(true);
-			List list = (List) base;
+			List<Object> list = (List<Object>) base;
 			int idx = coerce(property);
 			if (idx < 0 || idx >= list.size()) {
 				throw new PropertyNotFoundException(

Modified: tomcat/trunk/java/javax/servlet/GenericServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/GenericServlet.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/GenericServlet.java (original)
+++ tomcat/trunk/java/javax/servlet/GenericServlet.java Mon Feb  9 19:55:29 2009
@@ -62,8 +62,9 @@
      * is done by one of the <code>init</code> methods.
      *
      */
-
-    public GenericServlet() { }
+    public GenericServlet() {
+        // NOOP
+    }
     
     
     
@@ -75,6 +76,7 @@
      */
 
     public void destroy() {
+        // NOOP by default
     }
     
     
@@ -234,7 +236,7 @@
      */
     
     public void init() throws ServletException {
-
+        // NOOP by default
     }
     
 

Modified: tomcat/trunk/java/javax/servlet/ServletInputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletInputStream.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletInputStream.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletInputStream.java Mon Feb  9 19:55:29 2009
@@ -51,8 +51,9 @@
      * Does nothing, because this is an abstract class.
      *
      */
-
-    protected ServletInputStream() { }
+    protected ServletInputStream() {
+        // NOOP
+    }
 
   
   

Modified: tomcat/trunk/java/javax/servlet/ServletOutputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletOutputStream.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletOutputStream.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletOutputStream.java Mon Feb  9 19:55:29 2009
@@ -53,8 +53,9 @@
      * Does nothing, because this is an abstract class.
      *
      */
-
-    protected ServletOutputStream() { }
+    protected ServletOutputStream() {
+        // NOOP
+    }
 
 
     /**

Modified: tomcat/trunk/java/javax/servlet/SingleThreadModel.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/SingleThreadModel.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/SingleThreadModel.java (original)
+++ tomcat/trunk/java/javax/servlet/SingleThreadModel.java Mon Feb  9 19:55:29 2009
@@ -46,4 +46,5 @@
  */
 
 public interface SingleThreadModel {
+    // No methods
 }

Modified: tomcat/trunk/java/javax/servlet/http/HttpServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServlet.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServlet.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServlet.java Mon Feb  9 19:55:29 2009
@@ -73,8 +73,7 @@
  * @author  Various
  * @version $Version$
  */
-public abstract class HttpServlet extends GenericServlet
-    implements java.io.Serializable {
+public abstract class HttpServlet extends GenericServlet {
 
     private static final String METHOD_DELETE = "DELETE";
     private static final String METHOD_HEAD = "HEAD";
@@ -96,7 +95,9 @@
     /**
      * Does nothing, because this is an abstract class.
      */
-    public HttpServlet() { }
+    public HttpServlet() {
+        // NOOP
+    }
     
     
     /**
@@ -783,7 +784,9 @@
     private int                contentLength = 0;
 
     // file private
-    NoBodyOutputStream() {}
+    NoBodyOutputStream() {
+        // NOOP
+    }
 
     // file private
     int getContentLength() {

Modified: tomcat/trunk/java/javax/servlet/http/HttpUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpUtils.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpUtils.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpUtils.java Mon Feb  9 19:55:29 2009
@@ -24,10 +24,10 @@
 import java.io.IOException;
 
 /**
- * @deprecated		As of Java(tm) Servlet API 2.3. 
- *			These methods were only useful
- *			with the default encoding and have been moved
- *			to the request interfaces.
+ * @deprecated            As of Java(tm) Servlet API 2.3. 
+ *                        These methods were only useful
+ *                        with the default encoding and have been moved
+ *                        to the request interfaces.
  *
 */
 
@@ -35,22 +35,19 @@
 public class HttpUtils {
 
     private static final String LSTRING_FILE =
-	"javax.servlet.http.LocalStrings";
+        "javax.servlet.http.LocalStrings";
     private static ResourceBundle lStrings =
-	ResourceBundle.getBundle(LSTRING_FILE);
+        ResourceBundle.getBundle(LSTRING_FILE);
         
     
-    
     /**
      * Constructs an empty <code>HttpUtils</code> object.
      *
      */
+    public HttpUtils() {
+        // NOOP
+    }
 
-    public HttpUtils() {}
-    
-    
-    
-    
 
     /**
      *
@@ -74,54 +71,51 @@
      * sent in hexadecimal notation (like <i>%xx</i>) are
      * converted to ASCII characters.
      *
-     * @param s		a string containing the query to be parsed
+     * @param s                a string containing the query to be parsed
      *
-     * @return		a <code>HashTable</code> object built
-     * 			from the parsed key-value pairs
+     * @return                a <code>HashTable</code> object built
+     *                         from the parsed key-value pairs
      *
-     * @exception IllegalArgumentException	if the query string 
-     *						is invalid
+     * @exception IllegalArgumentException        if the query string 
+     *                                                is invalid
      *
      */
-
     static public Hashtable<String,String[]> parseQueryString(String s) {
 
-	String valArray[] = null;
-	
-	if (s == null) {
-	    throw new IllegalArgumentException();
-	}
-	Hashtable<String,String[]> ht = new Hashtable<String,String[]>();
-	StringBuffer sb = new StringBuffer();
-	StringTokenizer st = new StringTokenizer(s, "&");
-	while (st.hasMoreTokens()) {
-	    String pair = st.nextToken();
-	    int pos = pair.indexOf('=');
-	    if (pos == -1) {
-		// XXX
-		// should give more detail about the illegal argument
-		throw new IllegalArgumentException();
-	    }
-	    String key = parseName(pair.substring(0, pos), sb);
-	    String val = parseName(pair.substring(pos+1, pair.length()), sb);
-	    if (ht.containsKey(key)) {
-		String oldVals[] = ht.get(key);
-		valArray = new String[oldVals.length + 1];
-		for (int i = 0; i < oldVals.length; i++) 
-		    valArray[i] = oldVals[i];
-		valArray[oldVals.length] = val;
-	    } else {
-		valArray = new String[1];
-		valArray[0] = val;
-	    }
-	    ht.put(key, valArray);
-	}
-	return ht;
+        String valArray[] = null;
+        
+        if (s == null) {
+            throw new IllegalArgumentException();
+        }
+        Hashtable<String,String[]> ht = new Hashtable<String,String[]>();
+        StringBuffer sb = new StringBuffer();
+        StringTokenizer st = new StringTokenizer(s, "&");
+        while (st.hasMoreTokens()) {
+            String pair = st.nextToken();
+            int pos = pair.indexOf('=');
+            if (pos == -1) {
+                // XXX
+                // should give more detail about the illegal argument
+                throw new IllegalArgumentException();
+            }
+            String key = parseName(pair.substring(0, pos), sb);
+            String val = parseName(pair.substring(pos+1, pair.length()), sb);
+            if (ht.containsKey(key)) {
+                String oldVals[] = ht.get(key);
+                valArray = new String[oldVals.length + 1];
+                for (int i = 0; i < oldVals.length; i++) 
+                    valArray[i] = oldVals[i];
+                valArray[oldVals.length] = val;
+            } else {
+                valArray = new String[1];
+                valArray[0] = val;
+            }
+            ht.put(key, valArray);
+        }
+        return ht;
     }
 
 
-
-
     /**
      *
      * Parses data from an HTML form that the client sends to 
@@ -143,66 +137,58 @@
      *
      *
      *
-     * @param len	an integer specifying the length,
-     *			in characters, of the 
-     *			<code>ServletInputStream</code>
-     *			object that is also passed to this
-     *			method
-     *
-     * @param in	the <code>ServletInputStream</code>
-     *			object that contains the data sent
-     *			from the client
+     * @param len        an integer specifying the length,
+     *                        in characters, of the 
+     *                        <code>ServletInputStream</code>
+     *                        object that is also passed to this
+     *                        method
+     *
+     * @param in        the <code>ServletInputStream</code>
+     *                        object that contains the data sent
+     *                        from the client
      * 
-     * @return		a <code>HashTable</code> object built
-     *			from the parsed key-value pairs
+     * @return                a <code>HashTable</code> object built
+     *                        from the parsed key-value pairs
      *
      *
-     * @exception IllegalArgumentException	if the data
-     *			sent by the POST method is invalid
+     * @exception IllegalArgumentException        if the data
+     *                        sent by the POST method is invalid
      *
      */
-     
-
     static public Hashtable<String,String[]> parsePostData(int len, 
-					  ServletInputStream in)
-    {
-	// XXX
-	// should a length of 0 be an IllegalArgumentException
-	
-    // cheap hack to return an empty hash
-	if (len <=0) 
-	    return new Hashtable<String,String[]>();
-
-
-	if (in == null) {
-	    throw new IllegalArgumentException();
-	}
-	
-	//
-	// Make sure we read the entire POSTed body.
-	//
+                                          ServletInputStream in) {
+        // XXX
+        // should a length of 0 be an IllegalArgumentException
+        
+        // cheap hack to return an empty hash
+        if (len <=0) 
+            return new Hashtable<String,String[]>();
+
+        if (in == null) {
+            throw new IllegalArgumentException();
+        }
+        
+        // Make sure we read the entire POSTed body.
         byte[] postedBytes = new byte [len];
         try {
             int offset = 0;
        
-	    do {
-		int inputLen = in.read (postedBytes, offset, len - offset);
-		if (inputLen <= 0) {
-		    String msg = lStrings.getString("err.io.short_read");
-		    throw new IllegalArgumentException (msg);
-		}
-		offset += inputLen;
-	    } while ((len - offset) > 0);
-
-	} catch (IOException e) {
-	    throw new IllegalArgumentException(e.getMessage());
-	}
+            do {
+                int inputLen = in.read (postedBytes, offset, len - offset);
+                if (inputLen <= 0) {
+                    String msg = lStrings.getString("err.io.short_read");
+                    throw new IllegalArgumentException (msg);
+                }
+                offset += inputLen;
+            } while ((len - offset) > 0);
+
+        } catch (IOException e) {
+            throw new IllegalArgumentException(e.getMessage());
+        }
 
         // XXX we shouldn't assume that the only kind of POST body
         // is FORM data encoded using ASCII or ISO Latin/1 ... or
         // that the body should always be treated as FORM data.
-        //
-
         try {
             String postedBody = new String(postedBytes, 0, len, "8859_1");
             return parseQueryString(postedBody);
@@ -214,48 +200,43 @@
     }
 
 
-
-
     /*
      * Parse a name in the query string.
      */
-
     static private String parseName(String s, StringBuffer sb) {
-	sb.setLength(0);
-	for (int i = 0; i < s.length(); i++) {
-	    char c = s.charAt(i); 
-	    switch (c) {
-	    case '+':
-		sb.append(' ');
-		break;
-	    case '%':
-		try {
-		    sb.append((char) Integer.parseInt(s.substring(i+1, i+3), 
-						      16));
-		    i += 2;
-		} catch (NumberFormatException e) {
-		    // XXX
-		    // need to be more specific about illegal arg
-		    throw new IllegalArgumentException();
-		} catch (StringIndexOutOfBoundsException e) {
-		    String rest  = s.substring(i);
-		    sb.append(rest);
-		    if (rest.length()==2)
-			i++;
-		}
-		
-		break;
-	    default:
-		sb.append(c);
-		break;
-	    }
-	}
-	return sb.toString();
+        sb.setLength(0);
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i); 
+            switch (c) {
+            case '+':
+                sb.append(' ');
+                break;
+            case '%':
+                try {
+                    sb.append((char) Integer.parseInt(s.substring(i+1, i+3), 
+                                                      16));
+                    i += 2;
+                } catch (NumberFormatException e) {
+                    // XXX
+                    // need to be more specific about illegal arg
+                    throw new IllegalArgumentException();
+                } catch (StringIndexOutOfBoundsException e) {
+                    String rest  = s.substring(i);
+                    sb.append(rest);
+                    if (rest.length()==2)
+                        i++;
+                }
+                
+                break;
+            default:
+                sb.append(c);
+                break;
+            }
+        }
+        return sb.toString();
     }
 
 
-
-
     /**
      *
      * Reconstructs the URL the client used to make the request,
@@ -271,37 +252,30 @@
      * <p>This method is useful for creating redirect messages
      * and for reporting errors.
      *
-     * @param req	a <code>HttpServletRequest</code> object
-     *			containing the client's request
+     * @param req        a <code>HttpServletRequest</code> object
+     *                        containing the client's request
      * 
-     * @return		a <code>StringBuffer</code> object containing
-     *			the reconstructed URL
+     * @return                a <code>StringBuffer</code> object containing
+     *                        the reconstructed URL
      *
      */
-
     public static StringBuffer getRequestURL (HttpServletRequest req) {
-	StringBuffer url = new StringBuffer ();
-	String scheme = req.getScheme ();
-	int port = req.getServerPort ();
-	String urlPath = req.getRequestURI();
-	
-	//String		servletPath = req.getServletPath ();
-	//String		pathInfo = req.getPathInfo ();
-
-	url.append (scheme);		// http, https
-	url.append ("://");
-	url.append (req.getServerName ());
-	if ((scheme.equals ("http") && port != 80)
-		|| (scheme.equals ("https") && port != 443)) {
-	    url.append (':');
-	    url.append (req.getServerPort ());
-	}
-	//if (servletPath != null)
-	//    url.append (servletPath);
-	//if (pathInfo != null)
-	//    url.append (pathInfo);
-	url.append(urlPath);
-	return url;
+        StringBuffer url = new StringBuffer ();
+        String scheme = req.getScheme ();
+        int port = req.getServerPort ();
+        String urlPath = req.getRequestURI();
+        
+        url.append (scheme);                // http, https
+        url.append ("://");
+        url.append (req.getServerName ());
+        if ((scheme.equals ("http") && port != 80)
+                || (scheme.equals ("https") && port != 443)) {
+            url.append (':');
+            url.append (req.getServerPort ());
+        }
+
+        url.append(urlPath);
+        return url;
     }
 }
 

Modified: tomcat/trunk/java/javax/servlet/jsp/JspContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/JspContext.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/JspContext.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/JspContext.java Mon Feb  9 19:55:29 2009
@@ -76,6 +76,7 @@
      * typically implicit.)
      */
     public JspContext() {
+        // NOOP by default
     }
     
     /** 

Modified: tomcat/trunk/java/javax/servlet/jsp/JspEngineInfo.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/JspEngineInfo.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/JspEngineInfo.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/JspEngineInfo.java Mon Feb  9 19:55:29 2009
@@ -28,6 +28,7 @@
      * typically implicit.)
      */
     public JspEngineInfo() {
+        // NOOP by default
     }
     
     /**

Modified: tomcat/trunk/java/javax/servlet/jsp/JspException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/JspException.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/JspException.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/JspException.java Mon Feb  9 19:55:29 2009
@@ -28,6 +28,7 @@
      * Construct a JspException.
      */
     public JspException() {
+        // NOOP
     }
 
 

Modified: tomcat/trunk/java/javax/servlet/jsp/JspFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/JspFactory.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/JspFactory.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/JspFactory.java Mon Feb  9 19:55:29 2009
@@ -50,6 +50,7 @@
      * typically implicit.)
      */
     public JspFactory() {
+        // NOOP by default
     }
 
     /**

Modified: tomcat/trunk/java/javax/servlet/jsp/PageContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/PageContext.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/PageContext.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/PageContext.java Mon Feb  9 19:55:29 2009
@@ -100,6 +100,7 @@
      * typically implicit.)
      */
     public PageContext() {
+        // NOOP by default
     }
     
     /**

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/BodyTagSupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/BodyTagSupport.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/BodyTagSupport.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/BodyTagSupport.java Mon Feb  9 19:55:29 2009
@@ -100,6 +100,7 @@
      */
 
     public void doInitBody() throws JspException {
+        // NOOP by default
     }
 
 

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/JspTag.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/JspTag.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/JspTag.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/JspTag.java Mon Feb  9 19:55:29 2009
@@ -23,4 +23,5 @@
  * @since 2.0
  */
 public interface JspTag {
+    // No methods even through there are some common methods
 }

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/PageData.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/PageData.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/PageData.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/PageData.java Mon Feb  9 19:55:29 2009
@@ -36,6 +36,7 @@
      * typically implicit.)
      */
     public PageData() {
+        // NOOP by default
     }
     
     /**

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/SimpleTagSupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/SimpleTagSupport.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/SimpleTagSupport.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/SimpleTagSupport.java Mon Feb  9 19:55:29 2009
@@ -31,9 +31,7 @@
  *
  * @since 2.0
  */
-public class SimpleTagSupport 
-    implements SimpleTag
-{
+public class SimpleTagSupport implements SimpleTag {
     /** Reference to the enclosing tag. */
     private JspTag parentTag;
     
@@ -48,6 +46,7 @@
      * typically implicit.)
      */
     public SimpleTagSupport() {
+        // NOOP by default
     }
     
     /** 
@@ -66,9 +65,8 @@
      *     an error writing to the output stream
      * @see SimpleTag#doTag()
      */ 
-    public void doTag() 
-        throws JspException, IOException
-    {
+    public void doTag() throws JspException, IOException {
+        // NOOP by default
     }
     
     /**
@@ -176,38 +174,38 @@
      * or is an instance of the class specified
      */
     public static final JspTag findAncestorWithClass(
-	JspTag from, Class<?> klass) 
+        JspTag from, Class<?> klass) 
     {
-	boolean isInterface = false;
+        boolean isInterface = false;
 
-	if (from == null || klass == null
-	        || (!JspTag.class.isAssignableFrom(klass)
-		    && !(isInterface = klass.isInterface()))) {
-	    return null;
-	}
-
-	for (;;) {
-	    JspTag parent = null;
-	    if( from instanceof SimpleTag ) {
-		parent = ((SimpleTag)from).getParent();
-	    }
-	    else if( from instanceof Tag ) {
-		parent = ((Tag)from).getParent();
-	    }
-	    if (parent == null) {
-		return null;
-	    }
-
-	    if (parent instanceof TagAdapter) {
-		parent = ((TagAdapter) parent).getAdaptee();
-	    }
-
-	    if ((isInterface && klass.isInstance(parent))
-		    || klass.isAssignableFrom(parent.getClass())) {
-		return parent;
-	    }
+        if (from == null || klass == null
+                || (!JspTag.class.isAssignableFrom(klass)
+                    && !(isInterface = klass.isInterface()))) {
+            return null;
+        }
+
+        for (;;) {
+            JspTag parent = null;
+            if( from instanceof SimpleTag ) {
+                parent = ((SimpleTag)from).getParent();
+            }
+            else if( from instanceof Tag ) {
+                parent = ((Tag)from).getParent();
+            }
+            if (parent == null) {
+                return null;
+            }
+
+            if (parent instanceof TagAdapter) {
+                parent = ((TagAdapter) parent).getAdaptee();
+            }
+
+            if ((isInterface && klass.isInstance(parent))
+                    || klass.isAssignableFrom(parent.getClass())) {
+                return parent;
+            }
 
-	    from = parent;
-	}
+            from = parent;
+        }
     }    
 }

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/Tag.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/Tag.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/Tag.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/Tag.java Mon Feb  9 19:55:29 2009
@@ -162,12 +162,12 @@
      * The current version of the specification only provides one formal
      * way of indicating the observable type of a tag handler: its
      * tag handler implementation class, described in the tag-class
-     * subelement of the tag element.  This is extended in an
+     * sub-element of the tag element.  This is extended in an
      * informal manner by allowing the tag library author to
-     * indicate in the description subelement an observable type.
-     * The type should be a subtype of the tag handler implementation
+     * indicate in the description sub-element an observable type.
+     * The type should be a sub-type of the tag handler implementation
      * class or void.
-     * This addititional constraint can be exploited by a
+     * This additional constraint can be exploited by a
      * specialized container that knows about that specific tag library,
      * as in the case of the JSP standard tag library.
      *

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/TagData.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/TagData.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/TagData.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/TagData.java Mon Feb  9 19:55:29 2009
@@ -55,17 +55,17 @@
      * @param atts the static attribute and values.  May be null.
      */
     public TagData(Object[] atts[]) {
-	if (atts == null) {
-	    attributes = new Hashtable<String, Object>();
-	} else {
-	    attributes = new Hashtable<String, Object>(atts.length);
-	}
-
-	if (atts != null) {
-	    for (int i = 0; i < atts.length; i++) {
-		attributes.put((String) atts[i][0], atts[i][1]);
-	    }
-	}
+        if (atts == null) {
+            attributes = new Hashtable<String, Object>();
+        } else {
+            attributes = new Hashtable<String, Object>(atts.length);
+        }
+
+        if (atts != null) {
+            for (int i = 0; i < atts.length; i++) {
+                attributes.put((String) atts[i][0], atts[i][1]);
+            }
+        }
     }
 
     /**
@@ -88,7 +88,7 @@
      */
 
     public String getId() {
-	return getAttributeString(TagAttributeInfo.ID);
+        return getAttributeString(TagAttributeInfo.ID);
     }
 
     /**
@@ -108,7 +108,7 @@
      */
 
     public Object getAttribute(String attName) {
-	return attributes.get(attName);
+        return attributes.get(attName);
     }
 
     /**
@@ -118,8 +118,8 @@
      * @param value the value.
      */
     public void setAttribute(String attName,
-			     Object value) {
-	attributes.put(attName, value);
+                             Object value) {
+        attributes.put(attName, value);
     }
 
     /**
@@ -131,12 +131,11 @@
      */
 
     public String getAttributeString(String attName) {
-	Object o = attributes.get(attName);
-	if (o == null) {
-	    return null;
-	} else {
-	    return (String) o;
-	}	
+        Object o = attributes.get(attName);
+        if (o == null) {
+            return null;
+        }
+        return (String) o;
     }
 
     /**
@@ -150,5 +149,5 @@
 
     // private data
 
-    private Hashtable<String, Object> attributes;	// the tagname/value map
+    private Hashtable<String, Object> attributes;        // the tagname/value map
 }

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/TagExtraInfo.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/TagExtraInfo.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/TagExtraInfo.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/TagExtraInfo.java Mon Feb  9 19:55:29 2009
@@ -59,6 +59,7 @@
      * typically implicit.)
      */
     public TagExtraInfo() {
+        // NOOP by default
     }
     
     /**
@@ -71,7 +72,7 @@
      *         if no scripting variables are to be defined.
      */
     public VariableInfo[] getVariableInfo(TagData data) {
-	return ZERO_VARIABLE_INFO;
+        return ZERO_VARIABLE_INFO;
     }
 
     /**
@@ -86,7 +87,7 @@
      */
 
     public boolean isValid(TagData data) {
-	return true;
+        return true;
     }
 
     /**
@@ -107,14 +108,14 @@
      * @since 2.0
      */
     public ValidationMessage[] validate( TagData data ) {
-	ValidationMessage[] result = null;
+        ValidationMessage[] result = null;
 
-	if( !isValid( data ) ) {
-	    result = new ValidationMessage[] {
-		new ValidationMessage( data.getId(), "isValid() == false" ) };
-	}
+        if( !isValid( data ) ) {
+            result = new ValidationMessage[] {
+                new ValidationMessage( data.getId(), "isValid() == false" ) };
+        }
 
-	return result;
+        return result;
     }
 
     /**
@@ -123,7 +124,7 @@
      * @param tagInfo The TagInfo this instance is extending
      */
     public final void setTagInfo(TagInfo tagInfo) {
-	this.tagInfo = tagInfo;
+        this.tagInfo = tagInfo;
     }
 
     /**
@@ -132,7 +133,7 @@
      * @return the taginfo instance this instance is extending
      */
     public final TagInfo getTagInfo() {
-	return tagInfo;
+        return tagInfo;
     }
     
     // private data

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/TagLibraryValidator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/TagLibraryValidator.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/TagLibraryValidator.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/TagLibraryValidator.java Mon Feb  9 19:55:29
2009
@@ -87,6 +87,7 @@
      * typically implicit.)
      */
     public TagLibraryValidator() {
+        // NOOP by default
     }
     
     /**
@@ -96,7 +97,7 @@
      * @param map A Map describing the init parameters
      */
     public void setInitParameters(Map<String, Object> map) {
-	initParameters = map;
+        initParameters = map;
     }
 
 
@@ -107,7 +108,7 @@
      * @return The init parameters as an immutable map.
      */
     public Map<String, Object> getInitParameters() {
-	return initParameters;
+        return initParameters;
     }
 
     /**
@@ -126,16 +127,15 @@
      * of ValidationMessages otherwise.
      */
     public ValidationMessage[] validate(String prefix, String uri, 
-        PageData page) 
-    {
-	return null;
+        PageData page) {
+        return null;
     }
 
     /**
      * Release any data kept by this instance for validation purposes.
      */
     public void release() {
-	initParameters = null;
+        initParameters = null;
     }
 
     // Private data

Modified: tomcat/trunk/java/javax/servlet/jsp/tagext/TagSupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/tagext/TagSupport.java?rev=742709&r1=742708&r2=742709&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/tagext/TagSupport.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/tagext/TagSupport.java Mon Feb  9 19:55:29 2009
@@ -36,7 +36,6 @@
  * <p> Many tag handlers will extend TagSupport and only redefine a
  * few methods. 
  */
-
 public class TagSupport implements IterationTag, Serializable {
 
     /**
@@ -72,30 +71,29 @@
      * @return the nearest ancestor that implements the interface
      * or is an instance of the class specified
      */
-
     public static final Tag findAncestorWithClass(Tag from, Class<?> klass) {
-	boolean isInterface = false;
+        boolean isInterface = false;
 
-	if (from == null ||
-	    klass == null ||
-	    (!Tag.class.isAssignableFrom(klass) &&
-	     !(isInterface = klass.isInterface()))) {
-	    return null;
-	}
-
-	for (;;) {
-	    Tag tag = from.getParent();
-
-	    if (tag == null) {
-		return null;
-	    }
-
-	    if ((isInterface && klass.isInstance(tag)) ||
-	        klass.isAssignableFrom(tag.getClass()))
-		return tag;
-	    else
-		from = tag;
-	}
+        if (from == null ||
+            klass == null ||
+            (!Tag.class.isAssignableFrom(klass) &&
+             !(isInterface = klass.isInterface()))) {
+            return null;
+        }
+
+        for (;;) {
+            Tag tag = from.getParent();
+
+            if (tag == null) {
+                return null;
+            }
+
+            if ((isInterface && klass.isInstance(tag)) ||
+                klass.isAssignableFrom(tag.getClass())) {
+                return tag;
+            }
+            from = tag;
+        }
     }
 
     /**
@@ -106,8 +104,9 @@
      * This constructor is called by the code generated by the JSP
      * translator.
      */
-
-    public TagSupport() { }
+    public TagSupport() {
+        // NOOP by default
+    }
 
     /**
      * Default processing of the start tag, returning SKIP_BODY.
@@ -117,7 +116,6 @@
      *
      * @see Tag#doStartTag()
      */
- 
     public int doStartTag() throws JspException {
         return SKIP_BODY;
     }
@@ -130,9 +128,8 @@
      *
      * @see Tag#doEndTag()
      */
-
     public int doEndTag() throws JspException {
-	return EVAL_PAGE;
+        return EVAL_PAGE;
     }
 
 
@@ -144,9 +141,8 @@
      *
      * @see IterationTag#doAfterBody()
      */
-    
     public int doAfterBody() throws JspException {
-	return SKIP_BODY;
+        return SKIP_BODY;
     }
 
     // Actions related to body evaluation
@@ -157,14 +153,13 @@
      *
      * @see Tag#release()
      */
-
     public void release() {
-	parent = null;
-	id = null;
-	if( values != null ) {
-	    values.clear();
-	}
-	values = null;
+        parent = null;
+        id = null;
+        if( values != null ) {
+            values.clear();
+        }
+        values = null;
     }
 
     /**
@@ -173,9 +168,8 @@
      * @param t The parent Tag.
      * @see Tag#setParent(Tag)
      */
-
     public void setParent(Tag t) {
-	parent = t;
+        parent = t;
     }
 
     /**
@@ -184,9 +178,8 @@
      *
      * @return the parent tag instance or null
      */
-
     public Tag getParent() {
-	return parent;
+        return parent;
     }
 
     /**
@@ -194,9 +187,8 @@
      *
      * @param id The String for the id.
      */
-
     public void setId(String id) {
-	this.id = id;
+        this.id = id;
     }
 
     /**
@@ -204,9 +196,8 @@
      *
      * @return the value of the id attribute, or null
      */
-    
     public String getId() {
-	return id;
+        return id;
     }
 
     /**
@@ -215,9 +206,8 @@
      * @param pageContext The PageContext.
      * @see Tag#setPageContext
      */
-
     public void setPageContext(PageContext pageContext) {
-	this.pageContext = pageContext;
+        this.pageContext = pageContext;
     }
 
     /**
@@ -226,12 +216,11 @@
      * @param k The key String.
      * @param o The value to associate.
      */
-
     public void setValue(String k, Object o) {
-	if (values == null) {
-	    values = new Hashtable<String, Object>();
-	}
-	values.put(k, o);
+        if (values == null) {
+            values = new Hashtable<String, Object>();
+        }
+        values.put(k, o);
     }
 
     /**
@@ -240,13 +229,11 @@
      * @param k The string key.
      * @return The value associated with the key, or null.
      */
-
     public Object getValue(String k) {
-	if (values == null) {
-	    return null;
-	} else {
-	    return values.get(k);
-	}
+        if (values == null) {
+            return null;
+        }
+        return values.get(k);
     }
 
     /**
@@ -254,11 +241,10 @@
      *
      * @param k The string key.
      */
-
     public void removeValue(String k) {
-	if (values != null) {
-	    values.remove(k);
-	}
+        if (values != null) {
+            values.remove(k);
+        }
     }
 
     /**
@@ -267,12 +253,11 @@
      * @return An enumeration of all the keys for the values set,
      *     or null or an empty Enumeration if no values have been set.
      */
-
     public Enumeration<String> getValues() {
-	if (values == null) {
-	    return null;
-	}
-	return values.keys();
+        if (values == null) {
+            return null;
+        }
+        return values.keys();
     }
 
     // private fields
@@ -282,7 +267,7 @@
     /**
      * The value of the id attribute of this tag; or null.
      */
-    protected String	  id;
+    protected String      id;
 
     // protected fields
 



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


Mime
View raw message