From commits-return-62150-archive-asf-public=cust-asf.ponee.io@commons.apache.org Sun Apr 29 21:40:58 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4E45D180675 for ; Sun, 29 Apr 2018 21:40:58 +0200 (CEST) Received: (qmail 60376 invoked by uid 500); 29 Apr 2018 19:40:53 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 60128 invoked by uid 99); 29 Apr 2018 19:40:53 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Apr 2018 19:40:53 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id B44BC80957; Sun, 29 Apr 2018 19:40:51 +0000 (UTC) Date: Sun, 29 Apr 2018 19:41:00 +0000 To: "commits@commons.apache.org" Subject: [commons-weaver] 09/13: small cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: mbenson@apache.org In-Reply-To: <152503085145.17201.13381864361808707111@gitbox.apache.org> References: <152503085145.17201.13381864361808707111@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: commons-weaver X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 1c6c4e3dc4666dfa3ad86feefb197f8df34c7ade X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180429194051.B44BC80957@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. mbenson pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-weaver.git commit 1c6c4e3dc4666dfa3ad86feefb197f8df34c7ade Author: Matt Benson AuthorDate: Fri Apr 20 11:32:34 2018 -0500 small cleanups --- .../java/org/apache/commons/weaver/normalizer/Normalizer.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java b/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java index d0be3dd..67b1c40 100644 --- a/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java +++ b/modules/normalizer/src/main/java/org/apache/commons/weaver/normalizer/Normalizer.java @@ -21,7 +21,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.lang.annotation.ElementType; import java.lang.annotation.Target; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.MessageFormat; @@ -35,7 +35,6 @@ import java.util.stream.Stream; import javax.activation.DataSource; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.CharEncoding; import org.apache.commons.lang3.Conversion; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.mutable.MutableBoolean; @@ -291,7 +290,6 @@ public class Normalizer { public static final String CONFIG_TARGET_PACKAGE = CONFIG_WEAVER + "targetPackage"; private static final int ASM_VERSION = Opcodes.ASM5; - private static final Charset UTF8 = Charset.forName(CharEncoding.UTF_8); private final WeaveEnvironment env; @@ -491,8 +489,8 @@ public class Normalizer { } catch (final NoSuchAlgorithmException e) { throw new RuntimeException(e); } - md5.update(key.getLeft().getBytes(UTF8)); - md5.update(key.getRight().getBytes(UTF8)); + md5.update(key.getLeft().getBytes(StandardCharsets.UTF_8)); + md5.update(key.getRight().getBytes(StandardCharsets.UTF_8)); final long digest = Conversion.byteArrayToLong(md5.digest(), 0, 0L, 0, Long.SIZE / Byte.SIZE); @@ -525,7 +523,6 @@ public class Normalizer { public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { if (INIT.equals(name)) { - final Method staticCtor = new Method(INIT, key.getRight()); final Type[] argumentTypes = staticCtor.getArgumentTypes(); final Type[] exceptionTypes = toObjectTypes(exceptions); @@ -551,7 +548,7 @@ public class Normalizer { */ { final Method instanceCtor = - new Method(INIT, Type.VOID_TYPE, ArrayUtils.add(argumentTypes, 0, OBJECT_TYPE)); + new Method(INIT, Type.VOID_TYPE, ArrayUtils.insert(0, argumentTypes, OBJECT_TYPE)); final GeneratorAdapter mgen = new GeneratorAdapter(Opcodes.ACC_PUBLIC, instanceCtor, signature, exceptionTypes, writeClass); -- To stop receiving notification emails like this one, please contact mbenson@apache.org.