opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/ByteSequence.java
@@ -263,7 +263,7 @@ * Returns the Base64 encoded string representation of this byte string. * * @return The Base64 encoded string representation of this byte string. * @see ByteString#valueOfBase64String(String) * @see ByteString#valueOfBase64(String) */ String toBase64String(); opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/ByteString.java
@@ -154,7 +154,7 @@ * content. * @see #toBase64String() */ public static ByteString valueOfBase64String(final String s) { public static ByteString valueOfBase64(final String s) { return Base64.decode(s); } opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFReader.java
@@ -257,7 +257,7 @@ } try { value = ByteString.valueOfBase64String(ldifLine.substring(pos)); value = ByteString.valueOfBase64(ldifLine.substring(pos)); } catch (final LocalizedIllegalArgumentException e) { // The value did not have a valid base64-encoding. final LocalizableMessage message = @@ -607,7 +607,7 @@ final String base64DN = ldifLine.substring(pos); try { dnString = ByteString.valueOfBase64String(base64DN).toString(); dnString = ByteString.valueOfBase64(base64DN).toString(); } catch (final LocalizedIllegalArgumentException e) { // The value did not have a valid base64-encoding. final LocalizableMessage message = @@ -662,7 +662,7 @@ } try { pair.value = ByteString.valueOfBase64String(ldifLine.substring(pos)).toString(); pair.value = ByteString.valueOfBase64(ldifLine.substring(pos)).toString(); } catch (final LocalizedIllegalArgumentException e) { pair.key = null; return ldifLine; opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/ByteStringTestCase.java
@@ -54,9 +54,9 @@ return new Object[][] { { ByteString.empty(), new byte[0] }, { ByteString.valueOfBase64String("AAA="), new byte[] { 0x00, 0x00 }}, { ByteString.valueOfBase64String("AAAA"), new byte[] { 0x00, 0x00, 0x00 }}, { ByteString.valueOfBase64String("AAAAAA=="), new byte[] { 0x00, 0x00, 0x00, 0x00 }}, { ByteString.valueOfBase64("AAA="), new byte[] { 0x00, 0x00 }}, { ByteString.valueOfBase64("AAAA"), new byte[] { 0x00, 0x00, 0x00 }}, { ByteString.valueOfBase64("AAAAAA=="), new byte[] { 0x00, 0x00, 0x00, 0x00 }}, { ByteString.valueOf(1), new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 } }, { ByteString.valueOf(Integer.MAX_VALUE), @@ -230,13 +230,13 @@ expectedExceptions = { LocalizedIllegalArgumentException.class }) public void testValueOfBase64ThrowsLIAE(final String invalidBase64) throws Exception { Assert.fail("Expected exception but got result: " + Arrays.toString(new ByteString[] { ByteString.valueOfBase64String(invalidBase64) })); + Arrays.toString(new ByteString[] { ByteString.valueOfBase64(invalidBase64) })); } @Test(dataProvider = "validBase64Data") public void testValueOfBase64(final String hexData, final String encodedData) throws Exception { final byte[] data = DatatypeConverter.parseHexBinary(hexData); final byte[] decodedData = ByteString.valueOfBase64String(encodedData).toByteArray(); final byte[] decodedData = ByteString.valueOfBase64(encodedData).toByteArray(); Assert.assertEquals(decodedData, data); } } opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPCompare.java
@@ -297,7 +297,7 @@ if (nextChar == ':') { final String base64 = remainder.substring(1, remainder.length()); try { attributeVal = ByteString.valueOfBase64String(base64); attributeVal = ByteString.valueOfBase64(base64); } catch (final LocalizedIllegalArgumentException e) { println(INFO_COMPARE_CANNOT_BASE64_DECODE_ASSERTION_VALUE.get()); return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();