diff options
author | Shigeru Chiba <chibash@users.noreply.github.com> | 2022-05-13 02:45:42 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 02:45:42 +0900 |
commit | 8fc31b8ea3eaadd4f8e80fa06208cbf19e991b3c (patch) | |
tree | c678631763bf4862e26845edb0ddbdb0b5f11002 /src/main/javassist/util/proxy | |
parent | df3f4b7641d39558465a17514bffce657f2a27da (diff) | |
parent | 0827c539b765d73c952bb56454f7dd3faf2b0879 (diff) | |
download | javassist-8fc31b8ea3eaadd4f8e80fa06208cbf19e991b3c.tar.gz javassist-8fc31b8ea3eaadd4f8e80fa06208cbf19e991b3c.zip |
Merge pull request #382 from tim-hoffman/PR_RemoveStringBuffer
Replace StringBuffer with StringBuilder, other minor String optimizations
Diffstat (limited to 'src/main/javassist/util/proxy')
-rw-r--r-- | src/main/javassist/util/proxy/ProxyFactory.java | 6 | ||||
-rw-r--r-- | src/main/javassist/util/proxy/RuntimeSupport.java | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/main/javassist/util/proxy/ProxyFactory.java b/src/main/javassist/util/proxy/ProxyFactory.java index 7d88e07a..2a20b2ca 100644 --- a/src/main/javassist/util/proxy/ProxyFactory.java +++ b/src/main/javassist/util/proxy/ProxyFactory.java @@ -576,14 +576,14 @@ public class ProxyFactory { public String getKey(Class<?> superClass, Class<?>[] interfaces, byte[] signature, boolean useWriteReplace) { - StringBuffer sbuf = new StringBuffer(); + StringBuilder sbuf = new StringBuilder(); if (superClass != null){ sbuf.append(superClass.getName()); } - sbuf.append(":"); + sbuf.append(':'); for (int i = 0; i < interfaces.length; i++) { sbuf.append(interfaces[i].getName()); - sbuf.append(":"); + sbuf.append(':'); } for (int i = 0; i < signature.length; i++) { byte b = signature[i]; diff --git a/src/main/javassist/util/proxy/RuntimeSupport.java b/src/main/javassist/util/proxy/RuntimeSupport.java index 0bd0cce9..9eb1c49e 100644 --- a/src/main/javassist/util/proxy/RuntimeSupport.java +++ b/src/main/javassist/util/proxy/RuntimeSupport.java @@ -198,7 +198,7 @@ public class RuntimeSupport { * @param retType return type. */ public static String makeDescriptor(Class<?>[] params, Class<?> retType) { - StringBuffer sbuf = new StringBuffer(); + StringBuilder sbuf = new StringBuilder(); sbuf.append('('); for (int i = 0; i < params.length; i++) makeDesc(sbuf, params[i]); @@ -217,12 +217,12 @@ public class RuntimeSupport { * @param retType return type. */ public static String makeDescriptor(String params, Class<?> retType) { - StringBuffer sbuf = new StringBuffer(params); + StringBuilder sbuf = new StringBuilder(params); makeDesc(sbuf, retType); return sbuf.toString(); } - private static void makeDesc(StringBuffer sbuf, Class<?> type) { + private static void makeDesc(StringBuilder sbuf, Class<?> type) { if (type.isArray()) { sbuf.append('['); makeDesc(sbuf, type.getComponentType()); |