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 2020/04/23 21:13:20 UTC

[tomcat] 02/06: Generics fixes for JSPs

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 3c4c1a048147baa032ab8ec409dbbe573c59b7fb
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Apr 23 21:02:10 2020 +0100

    Generics fixes for JSPs
---
 test/webapp/WEB-INF/tags/bug49297.tag            | 2 +-
 test/webapp/bug49nnn/bug49297MultipleImport1.jsp | 2 +-
 test/webapp/bug49nnn/bug49297MultipleImport2.jsp | 2 +-
 webapps/examples/jsp/tagplugin/foreach.jsp       | 2 +-
 webapps/manager/WEB-INF/jsp/sessionDetail.jsp    | 4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/webapp/WEB-INF/tags/bug49297.tag b/test/webapp/WEB-INF/tags/bug49297.tag
index f3fc275..940d968 100644
--- a/test/webapp/WEB-INF/tags/bug49297.tag
+++ b/test/webapp/WEB-INF/tags/bug49297.tag
@@ -16,6 +16,6 @@
 --%><%@ tag import="java.util.List" import="java.util.ArrayList"%><%@
 tag body-content="empty" %><%
     // Make sure the imports above do work
-    List<String> l = new ArrayList<String>();
+    List<String> l = new ArrayList<>();
     l.add("OK");
     %><p><%=l.get(0)%></p>
\ No newline at end of file
diff --git a/test/webapp/bug49nnn/bug49297MultipleImport1.jsp b/test/webapp/bug49nnn/bug49297MultipleImport1.jsp
index 63c102b..01fa614 100644
--- a/test/webapp/bug49nnn/bug49297MultipleImport1.jsp
+++ b/test/webapp/bug49nnn/bug49297MultipleImport1.jsp
@@ -20,7 +20,7 @@
   <body>
     <%
     // Make sure the imports above do work
-    List<String> l = new ArrayList<String>();
+    List<String> l = new ArrayList<>();
     l.add("OK");
     %>
     <p><%=l.get(0)%></p>
diff --git a/test/webapp/bug49nnn/bug49297MultipleImport2.jsp b/test/webapp/bug49nnn/bug49297MultipleImport2.jsp
index 28629a4..33b0dbd 100644
--- a/test/webapp/bug49nnn/bug49297MultipleImport2.jsp
+++ b/test/webapp/bug49nnn/bug49297MultipleImport2.jsp
@@ -21,7 +21,7 @@
   <body>
     <%
     // Make sure the imports above do work
-    List<String> l = new ArrayList<String>();
+    List<String> l = new ArrayList<>();
     l.add("OK");
     %>
     <p><%=l.get(0)%></p>
diff --git a/webapps/examples/jsp/tagplugin/foreach.jsp b/webapps/examples/jsp/tagplugin/foreach.jsp
index 81621cc..4803506 100644
--- a/webapps/examples/jsp/tagplugin/foreach.jsp
+++ b/webapps/examples/jsp/tagplugin/foreach.jsp
@@ -39,7 +39,7 @@
         ${item}
     </c:forEach>
 
-    <% Vector v = new Vector();
+    <% Vector<String> v = new Vector<>();
         v.add("One"); v.add("Two"); v.add("Three"); v.add("Four");
 
         pageContext.setAttribute("vector", v);
diff --git a/webapps/manager/WEB-INF/jsp/sessionDetail.jsp b/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
index 3771fe3..b2482e1 100644
--- a/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
+++ b/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
@@ -119,7 +119,7 @@
 
    <table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">
    <% int nAttributes = 0;
-      Enumeration attributeNamesEnumeration = currentHttpSession.getAttributeNames();
+      Enumeration<String> attributeNamesEnumeration = currentHttpSession.getAttributeNames();
       while (attributeNamesEnumeration.hasMoreElements()) {
           attributeNamesEnumeration.nextElement();
           ++nAttributes;
@@ -143,7 +143,7 @@
        <tbody>
    <% attributeNamesEnumeration = currentHttpSession.getAttributeNames();
       while (attributeNamesEnumeration.hasMoreElements()) {
-          String attributeName = (String) attributeNamesEnumeration.nextElement();
+          String attributeName = attributeNamesEnumeration.nextElement();
    %>
            <tr>
                <td align="center">


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