From e0914986c41d6feb574a2db381ec7f358cb63219 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Mon, 16 Mar 2009 02:08:49 +0000 Subject: [PATCH] Byte.valueOf() is definitely faster than new Byte() git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@754805 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/commons/lang/math/NumberUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/commons/lang/math/NumberUtils.java b/src/java/org/apache/commons/lang/math/NumberUtils.java index 6d508ad40..555c008c3 100644 --- a/src/java/org/apache/commons/lang/math/NumberUtils.java +++ b/src/java/org/apache/commons/lang/math/NumberUtils.java @@ -56,11 +56,11 @@ public class NumberUtils { /** Reusable Short constant for minus one. */ public static final Short SHORT_MINUS_ONE = new Short((short) -1); /** Reusable Byte constant for zero. */ - public static final Byte BYTE_ZERO = new Byte((byte) 0); + public static final Byte BYTE_ZERO = Byte.valueOf((byte) 0); /** Reusable Byte constant for one. */ - public static final Byte BYTE_ONE = new Byte((byte) 1); + public static final Byte BYTE_ONE = Byte.valueOf((byte) 1); /** Reusable Byte constant for minus one. */ - public static final Byte BYTE_MINUS_ONE = new Byte((byte) -1); + public static final Byte BYTE_MINUS_ONE = Byte.valueOf((byte) -1); /** Reusable Double constant for zero. */ public static final Double DOUBLE_ZERO = new Double(0.0d); /** Reusable Double constant for one. */