You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/11/27 22:54:36 UTC

svn commit: r721289 - in /tomcat/trunk/java/org/apache/jasper: runtime/ servlet/ util/

Author: markt
Date: Thu Nov 27 13:54:36 2008
New Revision: 721289

URL: http://svn.apache.org/viewvc?rev=721289&view=rev
Log:
Generics changes for remainder of Jasper.

Modified:
    tomcat/trunk/java/org/apache/jasper/runtime/HttpJspBase.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java
    tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
    tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
    tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java
    tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
    tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
    tomcat/trunk/java/org/apache/jasper/util/Enumerator.java

Modified: tomcat/trunk/java/org/apache/jasper/runtime/HttpJspBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/HttpJspBase.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/HttpJspBase.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/HttpJspBase.java Thu Nov 27 13:54:36 2008
@@ -25,7 +25,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.HttpJspPage;
-import javax.servlet.jsp.JspFactory;
 
 import org.apache.jasper.compiler.Localizer;
 

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java Thu Nov 27 13:54:36 2008
@@ -106,8 +106,9 @@
 		if (this.resolver == null) {
 			CompositeELResolver r = new CompositeELResolver();
 			r.add(new ImplicitObjectELResolver());
-			for (Iterator itr = this.resolvers.iterator(); itr.hasNext();) {
-				r.add((ELResolver) itr.next());
+			for (Iterator<ELResolver> itr = this.resolvers.iterator();
+			        itr.hasNext();) {
+				r.add(itr.next());
 			}
 			r.add(new MapELResolver());
 			r.add(new ResourceBundleELResolver());

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspContextWrapper.java Thu Nov 27 13:54:36 2008
@@ -65,20 +65,21 @@
 	private transient HashMap<String, Object> pageAttributes;
 
 	// ArrayList of NESTED scripting variables
-	private ArrayList nestedVars;
+	private ArrayList<String> nestedVars;
 
 	// ArrayList of AT_BEGIN scripting variables
-	private ArrayList atBeginVars;
+	private ArrayList<String> atBeginVars;
 
 	// ArrayList of AT_END scripting variables
-	private ArrayList atEndVars;
+	private ArrayList<String> atEndVars;
 
-	private Map aliases;
+	private Map<String,String> aliases;
 
 	private HashMap<String, Object> originalNestedVars;
 
-	public JspContextWrapper(JspContext jspContext, ArrayList nestedVars,
-			ArrayList atBeginVars, ArrayList atEndVars, Map aliases) {
+	public JspContextWrapper(JspContext jspContext,
+	        ArrayList<String> nestedVars, ArrayList<String> atBeginVars,
+	        ArrayList<String> atEndVars, Map<String,String> aliases) {
 		this.invokingJspCtxt = (PageContext) jspContext;
 		this.nestedVars = nestedVars;
 		this.atBeginVars = atBeginVars;
@@ -222,7 +223,7 @@
 
 	public Enumeration<String> getAttributeNamesInScope(int scope) {
 		if (scope == PAGE_SCOPE) {
-			return new Enumerator(pageAttributes.keySet().iterator());
+			return new Enumerator<String>(pageAttributes.keySet().iterator());
 		}
 
 		return invokingJspCtxt.getAttributeNamesInScope(scope);
@@ -351,7 +352,7 @@
 	 *            variable scope (one of NESTED, AT_BEGIN, or AT_END)
 	 */
 	private void copyTagToPageScope(int scope) {
-		Iterator iter = null;
+		Iterator<String> iter = null;
 
 		switch (scope) {
 		case VariableInfo.NESTED:
@@ -372,7 +373,7 @@
 		}
 
 		while ((iter != null) && iter.hasNext()) {
-			String varName = (String) iter.next();
+			String varName = iter.next();
 			Object obj = getAttribute(varName);
 			varName = findAlias(varName);
 			if (obj != null) {
@@ -389,9 +390,9 @@
 	 */
 	private void saveNestedVariables() {
 		if (nestedVars != null) {
-			Iterator iter = nestedVars.iterator();
+			Iterator<String> iter = nestedVars.iterator();
 			while (iter.hasNext()) {
-				String varName = (String) iter.next();
+				String varName = iter.next();
 				varName = findAlias(varName);
 				Object obj = invokingJspCtxt.getAttribute(varName);
 				if (obj != null) {
@@ -406,9 +407,9 @@
 	 */
 	private void restoreNestedVariables() {
 		if (nestedVars != null) {
-			Iterator iter = nestedVars.iterator();
+			Iterator<String> iter = nestedVars.iterator();
 			while (iter.hasNext()) {
-				String varName = (String) iter.next();
+				String varName = iter.next();
 				varName = findAlias(varName);
 				Object obj = originalNestedVars.get(varName);
 				if (obj != null) {
@@ -434,7 +435,7 @@
 		if (aliases == null)
 			return varName;
 
-		String alias = (String) aliases.get(varName);
+		String alias = aliases.get(varName);
 		if (alias == null) {
 			return varName;
 		}

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java Thu Nov 27 13:54:36 2008
@@ -56,9 +56,9 @@
 
         if( Constants.IS_SECURITY_ENABLED ) {
             PrivilegedGetPageContext dp = new PrivilegedGetPageContext(
-                    (JspFactoryImpl)this, servlet, request, response, errorPageURL,
+                    this, servlet, request, response, errorPageURL,
                     needsSession, bufferSize, autoflush);
-            return (PageContext)AccessController.doPrivileged(dp);
+            return AccessController.doPrivileged(dp);
         } else {
             return internalGetPageContext(servlet, request, response,
                     errorPageURL, needsSession,
@@ -71,7 +71,7 @@
             return;
         if( Constants.IS_SECURITY_ENABLED ) {
             PrivilegedReleasePageContext dp = new PrivilegedReleasePageContext(
-                    (JspFactoryImpl)this,pc);
+                    this,pc);
             AccessController.doPrivileged(dp);
         } else {
             internalReleasePageContext(pc);
@@ -121,7 +121,8 @@
         }
     }
 
-    private class PrivilegedGetPageContext implements PrivilegedAction {
+    private class PrivilegedGetPageContext
+            implements PrivilegedAction<PageContext> {
 
         private JspFactoryImpl factory;
         private Servlet servlet;
@@ -145,13 +146,14 @@
             this.autoflush = autoflush;
         }
 
-        public Object run() {
+        public PageContext run() {
             return factory.internalGetPageContext(servlet, request, response,
                     errorPageURL, needsSession, bufferSize, autoflush);
         }
     }
 
-    private class PrivilegedReleasePageContext implements PrivilegedAction {
+    private class PrivilegedReleasePageContext
+            implements PrivilegedAction<Void> {
 
         private JspFactoryImpl factory;
         private PageContext pageContext;
@@ -162,7 +164,7 @@
             this.pageContext = pageContext;
         }
 
-        public Object run() {
+        public Void run() {
             factory.internalReleasePageContext(pageContext);
             return null;
         }

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Thu Nov 27 13:54:36 2008
@@ -61,7 +61,7 @@
         = "javax.servlet.jsp.jspException";
 
     protected static class PrivilegedIntrospectHelper
-        implements PrivilegedExceptionAction {
+        implements PrivilegedExceptionAction<Void> {
 
         private Object bean;
         private String prop;
@@ -82,7 +82,7 @@
             this.ignoreMethodNF = ignoreMethodNF;
         }
          
-        public Object run() throws JasperException {
+        public Void run() throws JasperException {
             internalIntrospecthelper(
                 bean,prop,value,request,param,ignoreMethodNF);
             return null;
@@ -175,7 +175,7 @@
             return Long.valueOf(s).longValue();
     }
 
-    public static Object coerce(String s, Class target) {
+    public static Object coerce(String s, Class<?> target) {
 
         boolean isNullOrEmpty = (s == null || s.length() == 0);
 
@@ -225,8 +225,8 @@
     }
 
    // __begin convertMethod
-    public static Object convert(String propertyName, String s, Class t,
-                                 Class propertyEditorClass) 
+    public static Object convert(String propertyName, String s, Class<?> t,
+            Class<?> propertyEditorClass) 
        throws JasperException 
     {
         try {
@@ -279,9 +279,9 @@
     public static void introspect(Object bean, ServletRequest request)
                                   throws JasperException
     {
-        Enumeration e = request.getParameterNames();
+        Enumeration<String> e = request.getParameterNames();
         while ( e.hasMoreElements() ) {
-            String name  = (String) e.nextElement();
+            String name  = e.nextElement();
             String value = request.getParameter(name);
             introspecthelper(bean, name, value, request, name, true);
         }
@@ -316,8 +316,8 @@
                                         throws JasperException
     {
         Method method = null;
-        Class type = null;
-        Class propertyEditorClass = null;
+        Class<?> type = null;
+        Class<?> propertyEditorClass = null;
         try {
             java.beans.BeanInfo info
                 = java.beans.Introspector.getBeanInfo(bean.getClass());
@@ -339,7 +339,7 @@
                         throw new JasperException(
                             Localizer.getMessage("jsp.error.beans.setproperty.noindexset"));
                     }
-                    Class t = type.getComponentType();
+                    Class<?> t = type.getComponentType();
                     String[] values = request.getParameterValues(param);
                     //XXX Please check.
                     if(values == null) return;
@@ -428,8 +428,8 @@
                                         Object bean,
                                         Method method,
                                         String[] values,
-                                        Class t,
-                                        Class propertyEditorClass)
+                                        Class<?> t,
+                                        Class<?> propertyEditorClass)
                 throws JasperException {
 
         try {
@@ -764,10 +764,10 @@
         }        
     }
     
-    public static Method getWriteMethod(Class beanClass, String prop)
+    public static Method getWriteMethod(Class<?> beanClass, String prop)
     throws JasperException {
         Method method = null;        
-        Class type = null;
+        Class<?> type = null;
         try {
             java.beans.BeanInfo info
                 = java.beans.Introspector.getBeanInfo(beanClass);
@@ -807,11 +807,11 @@
         return method;
     }
 
-    public static Method getReadMethod(Class beanClass, String prop)
+    public static Method getReadMethod(Class<?> beanClass, String prop)
             throws JasperException {
 
         Method method = null;        
-        Class type = null;
+        Class<?> type = null;
         try {
             java.beans.BeanInfo info
                 = java.beans.Introspector.getBeanInfo(beanClass);
@@ -853,12 +853,13 @@
     // PropertyEditor Support
 
     public static Object getValueFromBeanInfoPropertyEditor(
-                           Class attrClass, String attrName, String attrValue,
-                           Class propertyEditorClass) 
+                           Class<?> attrClass, String attrName, String attrValue,
+                           Class<?> propertyEditorClass) 
         throws JasperException 
     {
         try {
-            PropertyEditor pe = (PropertyEditor)propertyEditorClass.newInstance();
+            PropertyEditor pe =
+                (PropertyEditor)propertyEditorClass.newInstance();
             pe.setAsText(attrValue);
             return pe.getValue();
         } catch (Exception ex) {
@@ -870,7 +871,7 @@
     }
 
     public static Object getValueFromPropertyEditorManager(
-                     Class attrClass, String attrName, String attrValue) 
+                     Class<?> attrClass, String attrName, String attrValue) 
         throws JasperException 
     {
         try {

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java Thu Nov 27 13:54:36 2008
@@ -128,8 +128,8 @@
     
     private String getLocalizeMessage(final String message){
         if (SecurityUtil.isPackageProtectionEnabled()){
-            return (String)AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+            return AccessController.doPrivileged(new PrivilegedAction<String>(){
+                public String run(){
                     return Localizer.getMessage(message); 
                 }
             });

Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Thu Nov 27 13:54:36 2008
@@ -214,7 +214,8 @@
 		}
 
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			return AccessController.doPrivileged(new PrivilegedAction() {
+			return AccessController.doPrivileged(
+			        new PrivilegedAction<Object>() {
 				public Object run() {
 					return doGetAttribute(name);
 				}
@@ -237,7 +238,8 @@
 		}
 
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			return AccessController.doPrivileged(new PrivilegedAction() {
+			return AccessController.doPrivileged(
+			        new PrivilegedAction<Object>() {
 				public Object run() {
 					return doGetAttribute(name, scope);
 				}
@@ -279,8 +281,8 @@
 		}
 
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			AccessController.doPrivileged(new PrivilegedAction() {
-				public Object run() {
+			AccessController.doPrivileged(new PrivilegedAction<Void>() {
+				public Void run() {
 					doSetAttribute(name, attribute);
 					return null;
 				}
@@ -306,8 +308,8 @@
 		}
 
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			AccessController.doPrivileged(new PrivilegedAction() {
-				public Object run() {
+			AccessController.doPrivileged(new PrivilegedAction<Void>() {
+				public Void run() {
 					doSetAttribute(name, o, scope);
 					return null;
 				}
@@ -356,8 +358,8 @@
 					.getMessage("jsp.error.attribute.null_name"));
 		}
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			AccessController.doPrivileged(new PrivilegedAction() {
-				public Object run() {
+			AccessController.doPrivileged(new PrivilegedAction<Void>() {
+				public Void run() {
 					doRemoveAttribute(name, scope);
 					return null;
 				}
@@ -402,9 +404,9 @@
 		}
 
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			return ((Integer) AccessController
-					.doPrivileged(new PrivilegedAction() {
-						public Object run() {
+			return (AccessController
+					.doPrivileged(new PrivilegedAction<Integer>() {
+						public Integer run() {
 							return new Integer(doGetAttributeScope(name));
 						}
 					})).intValue();
@@ -433,7 +435,8 @@
 
 	public Object findAttribute(final String name) {
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			return AccessController.doPrivileged(new PrivilegedAction() {
+			return AccessController.doPrivileged(
+			        new PrivilegedAction<Object>() {
 				public Object run() {
 					if (name == null) {
 						throw new NullPointerException(Localizer
@@ -474,9 +477,9 @@
 
 	public Enumeration<String> getAttributeNamesInScope(final int scope) {
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			return (Enumeration) AccessController
-					.doPrivileged(new PrivilegedAction() {
-						public Object run() {
+			return AccessController.doPrivileged(
+			        new PrivilegedAction<Enumeration<String>>() {
+						public Enumeration<String> run() {
 							return doGetAttributeNamesInScope(scope);
 						}
 					});
@@ -485,10 +488,10 @@
 		}
 	}
 
-	private Enumeration doGetAttributeNamesInScope(int scope) {
+	private Enumeration<String> doGetAttributeNamesInScope(int scope) {
 		switch (scope) {
 		case PAGE_SCOPE:
-			return new Enumerator(attributes.keySet().iterator());
+			return new Enumerator<String>(attributes.keySet().iterator());
 
 		case REQUEST_SCOPE:
 			return request.getAttributeNames();
@@ -516,8 +519,8 @@
 		}
 
 		if (SecurityUtil.isPackageProtectionEnabled()) {
-			AccessController.doPrivileged(new PrivilegedAction() {
-				public Object run() {
+			AccessController.doPrivileged(new PrivilegedAction<Void>() {
+				public Void run() {
 					doRemoveAttribute(name);
 					return null;
 				}
@@ -616,8 +619,9 @@
 			throws ServletException, IOException {
 		if (SecurityUtil.isPackageProtectionEnabled()) {
 			try {
-				AccessController.doPrivileged(new PrivilegedExceptionAction() {
-					public Object run() throws Exception {
+				AccessController.doPrivileged(
+				        new PrivilegedExceptionAction<Void>() {
+					public Void run() throws Exception {
 						doInclude(relativeUrlPath, flush);
 						return null;
 					}
@@ -649,8 +653,9 @@
 			IOException {
 		if (SecurityUtil.isPackageProtectionEnabled()) {
 			try {
-				AccessController.doPrivileged(new PrivilegedExceptionAction() {
-					public Object run() throws Exception {
+				AccessController.doPrivileged(
+				        new PrivilegedExceptionAction<Void>() {
+					public Void run() throws Exception {
 						doForward(relativeUrlPath);
 						return null;
 					}
@@ -763,8 +768,9 @@
 
 		if (SecurityUtil.isPackageProtectionEnabled()) {
 			try {
-				AccessController.doPrivileged(new PrivilegedExceptionAction() {
-					public Object run() throws Exception {
+				AccessController.doPrivileged(
+				        new PrivilegedExceptionAction<Void>() {
+					public Void run() throws Exception {
 						doHandlePageException(t);
 						return null;
 					}
@@ -893,7 +899,7 @@
 	 * @return The result of the evaluation
 	 */
 	public static Object proprietaryEvaluate(final String expression,
-			final Class expectedType, final PageContext pageContext,
+			final Class<?> expectedType, final PageContext pageContext,
 			final ProtectedFunctionMapper functionMap, final boolean escape)
 			throws ELException {
 		Object retValue;
@@ -901,7 +907,7 @@
 		if (SecurityUtil.isPackageProtectionEnabled()) {
 			try {
 				retValue = AccessController
-						.doPrivileged(new PrivilegedExceptionAction() {
+						.doPrivileged(new PrivilegedExceptionAction<Object>() {
 
 							public Object run() throws Exception {
                                 ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();

Modified: tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java Thu Nov 27 13:54:36 2008
@@ -37,9 +37,9 @@
     private int maxSize;
 
     // For cleanup
-    private Vector perThreadDataVector;
+    private Vector<PerThreadData> perThreadDataVector;
 
-    private ThreadLocal perThread;
+    private ThreadLocal<PerThreadData> perThread;
 
     private static class PerThreadData {
         Tag handlers[];
@@ -51,7 +51,7 @@
      */
     public PerThreadTagHandlerPool() {
         super();
-        perThreadDataVector = new Vector();
+        perThreadDataVector = new Vector<PerThreadData>();
     }
 
     protected void init(ServletConfig config) {
@@ -64,8 +64,8 @@
             }
         }
 
-        perThread = new ThreadLocal() {
-            protected Object initialValue() {
+        perThread = new ThreadLocal<PerThreadData>() {
+            protected PerThreadData initialValue() {
                 PerThreadData ptd = new PerThreadData();
                 ptd.handlers = new Tag[maxSize];
                 ptd.current = -1;
@@ -85,13 +85,13 @@
      *
      * @throws JspException if a tag handler cannot be instantiated
      */
-    public Tag get(Class handlerClass) throws JspException {
-        PerThreadData ptd = (PerThreadData)perThread.get();
+    public Tag get(Class<? extends Tag> handlerClass) throws JspException {
+        PerThreadData ptd = perThread.get();
         if(ptd.current >=0 ) {
             return ptd.handlers[ptd.current--];
         } else {
 	    try {
-		return (Tag) handlerClass.newInstance();
+		return handlerClass.newInstance();
 	    } catch (Exception e) {
 		throw new JspException(e.getMessage(), e);
 	    }
@@ -106,7 +106,7 @@
      * @param handler Tag handler to add to this tag handler pool
      */
     public void reuse(Tag handler) {
-        PerThreadData ptd=(PerThreadData)perThread.get();
+        PerThreadData ptd = perThread.get();
 	if (ptd.current < (ptd.handlers.length - 1)) {
 	    ptd.handlers[++ptd.current] = handler;
         } else {
@@ -118,9 +118,9 @@
      * Calls the release() method of all tag handlers in this tag handler pool.
      */
     public void release() {        
-        Enumeration enumeration = perThreadDataVector.elements();
+        Enumeration<PerThreadData> enumeration = perThreadDataVector.elements();
         while (enumeration.hasMoreElements()) {
-	    PerThreadData ptd = (PerThreadData)enumeration.nextElement();
+	    PerThreadData ptd = enumeration.nextElement();
             if (ptd.handlers != null) {
                 for (int i=ptd.current; i>=0; i--) {
                     if (ptd.handlers[i] != null) {

Modified: tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java Thu Nov 27 13:54:36 2008
@@ -40,7 +40,7 @@
     /**
      * Maps "prefix:name" to java.lang.Method objects.
      */
-    private HashMap fnmap = null;
+    private HashMap<String,Method> fnmap = null;
 
     /**
      * If there is only one function in the map, this is the Method for it.
@@ -64,16 +64,16 @@
     public static ProtectedFunctionMapper getInstance() {
         ProtectedFunctionMapper funcMapper;
         if (SecurityUtil.isPackageProtectionEnabled()) {
-            funcMapper = (ProtectedFunctionMapper) AccessController
-                    .doPrivileged(new PrivilegedAction() {
-                        public Object run() {
+            funcMapper = AccessController.doPrivileged(
+                    new PrivilegedAction<ProtectedFunctionMapper>() {
+                        public ProtectedFunctionMapper run() {
                             return new ProtectedFunctionMapper();
                         }
                     });
         } else {
             funcMapper = new ProtectedFunctionMapper();
         }
-        funcMapper.fnmap = new java.util.HashMap();
+        funcMapper.fnmap = new HashMap<String,Method>();
         return funcMapper;
     }
 
@@ -92,15 +92,14 @@
      * @throws RuntimeException
      *             if no method with the given signature could be found.
      */
-    public void mapFunction(String fnQName, final Class c,
-            final String methodName, final Class[] args) {
+    public void mapFunction(String fnQName, final Class<?> c,
+            final String methodName, final Class<?>[] args) {
         java.lang.reflect.Method method;
         if (SecurityUtil.isPackageProtectionEnabled()) {
             try {
-                method = (java.lang.reflect.Method) AccessController
-                        .doPrivileged(new PrivilegedExceptionAction() {
-
-                            public Object run() throws Exception {
+                method = AccessController.doPrivileged(
+                        new PrivilegedExceptionAction<Method>() {
+                            public Method run() throws Exception {
                                 return c.getDeclaredMethod(methodName, args);
                             }
                         });
@@ -139,22 +138,21 @@
      *             if no method with the given signature could be found.
      */
     public static ProtectedFunctionMapper getMapForFunction(String fnQName,
-            final Class c, final String methodName, final Class[] args) {
+            final Class<?> c, final String methodName, final Class<?>[] args) {
         java.lang.reflect.Method method;
         ProtectedFunctionMapper funcMapper;
         if (SecurityUtil.isPackageProtectionEnabled()) {
-            funcMapper = (ProtectedFunctionMapper) AccessController
-                    .doPrivileged(new PrivilegedAction() {
-                        public Object run() {
+            funcMapper = AccessController.doPrivileged(
+                    new PrivilegedAction<ProtectedFunctionMapper>() {
+                        public ProtectedFunctionMapper run() {
                             return new ProtectedFunctionMapper();
                         }
                     });
 
             try {
-                method = (java.lang.reflect.Method) AccessController
-                        .doPrivileged(new PrivilegedExceptionAction() {
-
-                            public Object run() throws Exception {
+                method = AccessController.doPrivileged(
+                        new PrivilegedExceptionAction<Method>() {
+                            public Method run() throws Exception {
                                 return c.getDeclaredMethod(methodName, args);
                             }
                         });
@@ -189,7 +187,7 @@
      */
     public Method resolveFunction(String prefix, String localName) {
         if (this.fnmap != null) {
-            return (Method) this.fnmap.get(prefix + ":" + localName);
+            return this.fnmap.get(prefix + ":" + localName);
         }
         return theMethod;
     }

Modified: tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java Thu Nov 27 13:54:36 2008
@@ -50,7 +50,7 @@
         String tpClassName=getOption( config, OPTION_TAGPOOL, null);
         if( tpClassName != null ) {
             try {
-                Class c=Class.forName( tpClassName );
+                Class<?> c=Class.forName( tpClassName );
                 result=(TagHandlerPool)c.newInstance();
             } catch (Exception e) {
                 e.printStackTrace();
@@ -110,7 +110,7 @@
      *
      * @throws JspException if a tag handler cannot be instantiated
      */
-    public Tag get(Class handlerClass) throws JspException {
+    public Tag get(Class<? extends Tag> handlerClass) throws JspException {
     	Tag handler;
         synchronized( this ) {
             if (current >= 0) {
@@ -125,7 +125,7 @@
         	if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
         		return (Tag) instanceManager.newInstance(handlerClass.getName(), handlerClass.getClassLoader());
         	} else {
-                Tag instance = (Tag) handlerClass.newInstance();
+                Tag instance = handlerClass.newInstance();
                 instanceManager.newInstance(instance);
                 return instance;
         	}

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java Thu Nov 27 13:54:36 2008
@@ -61,7 +61,7 @@
      *
      * @exception ClassNotFoundException if the class was not found
      */
-    public Class loadClass(String name) throws ClassNotFoundException {
+    public Class<?> loadClass(String name) throws ClassNotFoundException {
 
         return (loadClass(name, false));
     }
@@ -91,10 +91,10 @@
      *                                     
      * @exception ClassNotFoundException if the class was not found
      */                                    
-    public Class loadClass(final String name, boolean resolve)
+    public Class<?> loadClass(final String name, boolean resolve)
         throws ClassNotFoundException {
 
-        Class clazz = null;                
+        Class<?> clazz = null;                
                                            
         // (0) Check our previously loaded class cache
         clazz = findLoadedClass(name);     

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Thu Nov 27 13:54:36 2008
@@ -51,7 +51,7 @@
     /**
      * Servlet context attributes.
      */
-    protected Hashtable myAttributes;
+    protected Hashtable<String,Object> myAttributes;
 
 
     /**
@@ -77,7 +77,7 @@
      */
     public JspCServletContext(PrintWriter aLogWriter, URL aResourceBaseURL) {
 
-        myAttributes = new Hashtable();
+        myAttributes = new Hashtable<String,Object>();
         myLogWriter = aLogWriter;
         myResourceBaseURL = aResourceBaseURL;
 
@@ -102,7 +102,7 @@
     /**
      * Return an enumeration of context attribute names.
      */
-    public Enumeration getAttributeNames() {
+    public Enumeration<String> getAttributeNames() {
 
         return (myAttributes.keys());
 
@@ -147,9 +147,9 @@
      * Return an enumeration of the names of context initialization
      * parameters.
      */
-    public Enumeration getInitParameterNames() {
+    public Enumeration<String> getInitParameterNames() {
 
-        return (new Vector().elements());
+        return (new Vector<String>().elements());
 
     }
 
@@ -289,9 +289,9 @@
      *
      * @param path Context-relative base path
      */
-    public Set getResourcePaths(String path) {
+    public Set<String> getResourcePaths(String path) {
 
-        Set thePaths = new HashSet();
+        Set<String> thePaths = new HashSet<String>();
         if (!path.endsWith("/"))
             path += "/";
         String basePath = getRealPath(path);
@@ -352,9 +352,9 @@
      *
      * @deprecated This method has been deprecated with no replacement
      */
-    public Enumeration getServletNames() {
+    public Enumeration<String> getServletNames() {
 
-        return (new Vector().elements());
+        return (new Vector<String>().elements());
 
     }
 
@@ -364,9 +364,9 @@
      *
      * @deprecated This method has been deprecated with no replacement
      */
-    public Enumeration getServlets() {
+    public Enumeration<String> getServlets() {
 
-        return (new Vector().elements());
+        return (new Vector<String>().elements());
 
     }
 

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java Thu Nov 27 13:54:36 2008
@@ -85,9 +85,12 @@
             try {
                 ClassLoader loader = Thread.currentThread()
                         .getContextClassLoader();
-                Class engineOptionsClass = loader.loadClass(engineOptionsName);
-                Class[] ctorSig = { ServletConfig.class, ServletContext.class };
-                Constructor ctor = engineOptionsClass.getConstructor(ctorSig);
+                Class<?> engineOptionsClass =
+                    loader.loadClass(engineOptionsName);
+                Class<?>[] ctorSig =
+                    { ServletConfig.class, ServletContext.class };
+                Constructor<?> ctor =
+                    engineOptionsClass.getConstructor(ctorSig);
                 Object[] args = { config, context };
                 options = (Options) ctor.newInstance(args);
             } catch (Throwable e) {
@@ -255,9 +258,9 @@
             log.debug("\t      RequestURI: " + request.getRequestURI());
             log.debug("\t     QueryString: " + request.getQueryString());
             log.debug("\t  Request Params: ");
-            Enumeration e = request.getParameterNames();
+            Enumeration<String> e = request.getParameterNames();
             while (e.hasMoreElements()) {
-                String name = (String) e.nextElement();
+                String name = e.nextElement();
                 log.debug("\t\t " + name + " = " 
                           + request.getParameter(name));
             }

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java Thu Nov 27 13:54:36 2008
@@ -69,7 +69,7 @@
 
     private Servlet theServlet;
     private String jspUri;
-    private Class tagHandlerClass;
+    private Class<?> tagHandlerClass;
     private JspCompilationContext ctxt;
     private long available = 0L;
     private ServletConfig config;
@@ -198,7 +198,7 @@
     /**
      * Compile (if needed) and load a tag file
      */
-    public Class loadTagFile() throws JasperException {
+    public Class<?> loadTagFile() throws JasperException {
 
         try {
             if (ctxt.isRemoved()) {
@@ -232,7 +232,7 @@
      * (skeleton) with no dependencies on other other tag files is
      * generated and compiled.
      */
-    public Class loadTagFilePrototype() throws JasperException {
+    public Class<?> loadTagFilePrototype() throws JasperException {
 
         ctxt.setPrototypeMode(true);
         try {
@@ -258,7 +258,7 @@
                 target = getServlet();
             }
             if (target != null && target instanceof JspSourceDependent) {
-                return ((java.util.List) ((JspSourceDependent) target).getDependants());
+                return ((JspSourceDependent) target).getDependants();
             }
         } catch (Throwable ex) {
         }

Modified: tomcat/trunk/java/org/apache/jasper/util/Enumerator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/util/Enumerator.java?rev=721289&r1=721288&r2=721289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/util/Enumerator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/util/Enumerator.java Thu Nov 27 13:54:36 2008
@@ -38,7 +38,7 @@
  * @version $Revision$ $Date$
  */
 
-public final class Enumerator implements Enumeration {
+public final class Enumerator<T> implements Enumeration<T> {
 
 
     // ----------------------------------------------------------- Constructors
@@ -49,7 +49,7 @@
      *
      * @param collection Collection whose values should be enumerated
      */
-    public Enumerator(Collection collection) {
+    public Enumerator(Collection<T> collection) {
 
         this(collection.iterator());
 
@@ -62,7 +62,7 @@
      * @param collection Collection whose values should be enumerated
      * @param clone true to clone iterator
      */
-    public Enumerator(Collection collection, boolean clone) {
+    public Enumerator(Collection<T> collection, boolean clone) {
 
         this(collection.iterator(), clone);
 
@@ -75,7 +75,7 @@
      *
      * @param iterator Iterator to be wrapped
      */
-    public Enumerator(Iterator iterator) {
+    public Enumerator(Iterator<T> iterator) {
 
         super();
         this.iterator = iterator;
@@ -90,13 +90,13 @@
      * @param iterator Iterator to be wrapped
      * @param clone true to clone iterator
      */
-    public Enumerator(Iterator iterator, boolean clone) {
+    public Enumerator(Iterator<T> iterator, boolean clone) {
 
         super();
         if (!clone) {
             this.iterator = iterator;
         } else {
-            List list = new ArrayList();
+            List<T> list = new ArrayList<T>();
             while (iterator.hasNext()) {
                 list.add(iterator.next());
             }
@@ -111,7 +111,7 @@
      *
      * @param map Map whose values should be enumerated
      */
-    public Enumerator(Map map) {
+    public Enumerator(Map<?,T> map) {
 
         this(map.values().iterator());
 
@@ -124,7 +124,7 @@
      * @param map Map whose values should be enumerated
      * @param clone true to clone iterator
      */
-    public Enumerator(Map map, boolean clone) {
+    public Enumerator(Map<?,T> map, boolean clone) {
 
         this(map.values().iterator(), clone);
 
@@ -138,7 +138,7 @@
      * The <code>Iterator</code> over which the <code>Enumeration</code>
      * represented by this class actually operates.
      */
-    private Iterator iterator = null;
+    private Iterator<T> iterator = null;
 
 
     // --------------------------------------------------------- Public Methods
@@ -166,7 +166,7 @@
      *
      * @exception NoSuchElementException if no more elements exist
      */
-    public Object nextElement() throws NoSuchElementException {
+    public T nextElement() throws NoSuchElementException {
 
         return (iterator.next());
 



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