Author: ggregory Date: Tue Jul 28 00:06:19 2009 New Revision: 798339 URL: http://svn.apache.org/viewvc?rev=798339&view=rev Log: We could make the constructor private but there does not seem to be a point to jumping through extra code hoops to restrict instantiation right now.
Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/StringUtilsTest.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java?rev=798339&r1=798338&r2=798339&view=diff ============================================================================== --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java Tue Jul 28 00:06:19 2009 @@ -270,7 +270,4 @@ return StringUtils.newString(bytes, CharEncoding.UTF_8); } - private StringUtils() { - // noop, cannot instantiate. Can always relax later. - } } Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/StringUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/StringUtilsTest.java?rev=798339&r1=798338&r2=798339&view=diff ============================================================================== --- commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/StringUtilsTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/StringUtilsTest.java Tue Jul 28 00:06:19 2009 @@ -32,6 +32,7 @@ private static byte[] BYTES_FIXTURE; private static final String STRING_FIXTURE = "ABC"; + { try { BYTES_FIXTURE = "abc".getBytes("US-ASCII"); @@ -40,6 +41,14 @@ } } + /** + * We could make the constructor private but there does not seem to be a point to jumping through extra code hoops + * to restrict instantiation right now. + */ + public void testConstructor() { + new StringUtils(); + } + public void testGetBytesIso8859_1() throws UnsupportedEncodingException { String charsetName = "ISO-8859-1"; testGetSupportedBytes(charsetName); @@ -165,5 +174,4 @@ String actual = StringUtils.newStringUtf8(BYTES_FIXTURE); Assert.assertEquals(expected, actual); } - }