You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mg...@apache.org on 2020/04/27 07:17:22 UTC
[tomcat] branch master updated: optimized code,
replace some c-style array
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new 2e2ac23 optimized code,replace some c-style array
new 4684537 Merge pull request #286 from XavierChengZW/master
2e2ac23 is described below
commit 2e2ac23601603a47e85ae3f36088be05818755af
Author: xavier <12...@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org