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

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

commit bf3f7731649c30b37ca9089bd737c83b0b6ae638
Author: Emmanuel Bourg <ebo...@apache.org>
AuthorDate: Tue Dec 1 22:35:49 2020 +0100

    Use the valueOf() method of the primitive wrapper classes instead of the 
deprecated constructors (to be removed as part of JEP 390)
---
 java/org/apache/jasper/tagplugins/jstl/core/ForEach.java | 16 ++++++++--------
 java/org/apache/jasper/tagplugins/jstl/core/If.java      |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java 
b/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
index 0fa6da6..f60b346 100644
--- a/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
+++ b/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
@@ -230,7 +230,7 @@ public final class ForEach implements TagPlugin {
                 "    public boolean hasNext() {\n" +
                 "      return index < a.length;}\n" +
                 "    public Object next() {\n" +
-                "      return new Boolean(a[index++]);}\n" +
+                "      return Boolean.valueOf(a[index++]);}\n" +
                 "    public void remove() {}\n" +
                 "  });\n" +
                 "}"
@@ -244,7 +244,7 @@ public final class ForEach implements TagPlugin {
                 "    public boolean hasNext() {\n" +
                 "      return index < a.length;}\n" +
                 "    public Object next() {\n" +
-                "      return new Byte(a[index++]);}\n" +
+                "      return Byte.valueOf(a[index++]);}\n" +
                 "    public void remove() {}\n" +
                 "  });\n" +
                 "}"
@@ -258,7 +258,7 @@ public final class ForEach implements TagPlugin {
                 "    public boolean hasNext() {\n" +
                 "      return index < a.length;}\n" +
                 "    public Object next() {\n" +
-                "      return new Character(a[index++]);}\n" +
+                "      return Character.valueOf(a[index++]);}\n" +
                 "    public void remove() {}\n" +
                 "  });\n" +
                 "}"
@@ -272,7 +272,7 @@ public final class ForEach implements TagPlugin {
                 "    public boolean hasNext() {\n" +
                 "      return index < a.length;}\n" +
                 "    public Object next() {\n" +
-                "      return new Short(a[index++]);}\n" +
+                "      return Short.valueOf(a[index++]);}\n" +
                 "    public void remove() {}\n" +
                 "  });\n" +
                 "}"
@@ -286,7 +286,7 @@ public final class ForEach implements TagPlugin {
                 "    public boolean hasNext() {\n" +
                 "      return index < a.length;}\n" +
                 "    public Object next() {\n" +
-                "      return new Integer(a[index++]);}\n" +
+                "      return Integer.valueOf(a[index++]);}\n" +
                 "    public void remove() {}\n" +
                 "  });\n" +
                 "}"
@@ -300,7 +300,7 @@ public final class ForEach implements TagPlugin {
                 "    public boolean hasNext() {\n" +
                 "      return index < a.length;}\n" +
                 "    public Object next() {\n" +
-                "      return new Long(a[index++]);}\n" +
+                "      return Long.valueOf(a[index++]);}\n" +
                 "    public void remove() {}\n" +
                 "  });\n" +
                 "}"
@@ -314,7 +314,7 @@ public final class ForEach implements TagPlugin {
                 "    public boolean hasNext() {\n" +
                 "      return index < a.length;}\n" +
                 "    public Object next() {\n" +
-                "      return new Float(a[index++]);}\n" +
+                "      return Float.valueOf(a[index++]);}\n" +
                 "    public void remove() {}\n" +
                 "  });\n" +
                 "}"
@@ -328,7 +328,7 @@ public final class ForEach implements TagPlugin {
                 "    public boolean hasNext() {\n" +
                 "      return index < a.length;}\n" +
                 "    public Object next() {\n" +
-                "      return new Double(a[index++]);}\n" +
+                "      return Double.valueOf(a[index++]);}\n" +
                 "    public void remove() {}\n" +
                 "  });\n" +
                 "}"
diff --git a/java/org/apache/jasper/tagplugins/jstl/core/If.java 
b/java/org/apache/jasper/tagplugins/jstl/core/If.java
index 62d64e3..15d7e06 100644
--- a/java/org/apache/jasper/tagplugins/jstl/core/If.java
+++ b/java/org/apache/jasper/tagplugins/jstl/core/If.java
@@ -43,7 +43,7 @@ public final class If implements TagPlugin {
             }
             ctxt.generateJavaSource("_jspx_page_context.setAttribute(");
             ctxt.generateAttribute("var");
-            ctxt.generateJavaSource(", new Boolean(" + condV + ")," + scope + 
");");
+            ctxt.generateJavaSource(", Boolean.valueOf(" + condV + ")," + 
scope + ");");
         }
         ctxt.generateJavaSource("if (" + condV + "){");
         ctxt.generateBody();


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

Reply via email to