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

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

commit b47fb6af157169e0278d1fbb8fe6d998ee0356b6
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 +-
 java/org/apache/tomcat/util/json/JSONParser.java         |  4 ++--
 java/org/apache/tomcat/util/json/JSONParser.jj           |  4 ++--
 4 files changed, 13 insertions(+), 13 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();
diff --git a/java/org/apache/tomcat/util/json/JSONParser.java 
b/java/org/apache/tomcat/util/json/JSONParser.java
index 6ae58fa..10e483f 100644
--- a/java/org/apache/tomcat/util/json/JSONParser.java
+++ b/java/org/apache/tomcat/util/json/JSONParser.java
@@ -329,7 +329,7 @@ b = Boolean.FALSE;
     case NUMBER_DECIMAL:{
       t = jj_consume_token(NUMBER_DECIMAL);
 if (nativeNumbers) {
-                {if ("" != null) return new Long(t.image);}
+                {if ("" != null) return Long.valueOf(t.image);}
             } else {
                 {if ("" != null) return new java.math.BigDecimal(t.image);}
             }
@@ -338,7 +338,7 @@ if (nativeNumbers) {
     case NUMBER_INTEGER:{
       t = jj_consume_token(NUMBER_INTEGER);
 if (nativeNumbers) {
-                {if ("" != null) return new Double(t.image);}
+                {if ("" != null) return Double.valueOf(t.image);}
             } else {
                 {if ("" != null) return new 
java.math.BigInteger(substringBefore(t.image, '.'));}
             }
diff --git a/java/org/apache/tomcat/util/json/JSONParser.jj 
b/java/org/apache/tomcat/util/json/JSONParser.jj
index b00633b..ce04438 100644
--- a/java/org/apache/tomcat/util/json/JSONParser.jj
+++ b/java/org/apache/tomcat/util/json/JSONParser.jj
@@ -324,7 +324,7 @@ Number number(): {
         t = <NUMBER_DECIMAL>
         {
             if (nativeNumbers) {
-                return new Long(t.image);
+                return Long.valueOf(t.image);
             } else {
                 return new java.math.BigDecimal(t.image);
             }
@@ -333,7 +333,7 @@ Number number(): {
         t = <NUMBER_INTEGER>
         {
             if (nativeNumbers) {
-                return new Double(t.image);
+                return Double.valueOf(t.image);
             } else {
                 return new java.math.BigInteger(substringBefore(t.image, '.'));
             }


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

Reply via email to