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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 73f8d72  optimized code,replace some c-style array
73f8d72 is described below

commit 73f8d729970373d95b0828cda7b5ad9700c2ea16
Author: xavier <1217353...@qq.com>
AuthorDate: Sun Apr 26 12:19:44 2020 +0800

    optimized code,replace some c-style array
---
 .../tomcat/jdbc/naming/GenericNamingResourcesFactory.java      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
index 7d0276a..f2e54d3 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
@@ -90,13 +90,13 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
         String setter = "set" + capitalize(name);
 
         try {
-            Method methods[] = o.getClass().getMethods();
+            Method[] methods = o.getClass().getMethods();
             Method setPropertyMethodVoid = null;
             Method setPropertyMethodBool = null;
 
             // First, the ideal case - a setFoo( String ) method
             for (int i = 0; i < methods.length; i++) {
-                Class<?> paramT[] = methods[i].getParameterTypes();
+                Class<?>[] paramT = methods[i].getParameterTypes();
                 if (setter.equals(methods[i].getName()) && paramT.length == 1
                         && "java.lang.String".equals(paramT[0].getName())) {
 
@@ -113,7 +113,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
                     // match - find the type and invoke it
                     Class<?> paramType = methods[i].getParameterTypes()[0];
-                    Object params[] = new Object[1];
+                    Object[] params = new Object[1];
 
                     // Try a setFoo ( int )
                     if ("java.lang.Integer".equals(paramType.getName())
@@ -174,7 +174,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
             // Ok, no setXXX found, try a setProperty("name", "value")
             if (setPropertyMethodBool != null || setPropertyMethodVoid != 
null) {
-                Object params[] = new Object[2];
+                Object[] params = new Object[2];
                 params[0] = name;
                 params[1] = value;
                 if (setPropertyMethodBool != null) {
@@ -225,7 +225,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
         if (name == null || name.length() == 0) {
             return name;
         }
-        char chars[] = name.toCharArray();
+        char[] chars = name.toCharArray();
         chars[0] = Character.toUpperCase(chars[0]);
         return new String(chars);
     }


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

Reply via email to