From 4baece95779dd46a3a59d59d1b7aa5958cf6117d Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 05 Nov 2015 12:25:29 +0000
Subject: [PATCH] OPENDJ-1802 Make ByteString methods more intentional

---
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java                               |    2 
 opendj-server-legacy/src/main/java/org/opends/server/core/AddOperationBasis.java                                            |    2 
 opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV1ControlTestCase.java                             |   24 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/PlainSASLMechanismHandlerTestCase.java                      |   46 
 opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java                                         |   32 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/Base64PasswordStorageScheme.java                            |    4 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java                         |    6 
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java                        |    4 
 opendj-server-legacy/src/test/java/org/opends/server/schema/BitStringSyntaxTest.java                                        |    2 
 opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java          |    2 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java                                     |   44 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java                        |   62 
 opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java                                                     |    2 
 opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java                          |    4 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java            |   90 +-
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java                                          |    2 
 opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java                       |    4 
 opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java                                      |   28 
 opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java                                             |    2 
 opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java                                  |    8 
 opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java                                              |   12 
 opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java                                            |   20 
 opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java                                     |    4 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java                      |    2 
 opendj-server-legacy/src/test/java/org/opends/server/schema/AuthPasswordEqualityMatchingRuleTest.java                       |    8 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java               |   32 
 opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetTestCase.java                           |    4 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/MD5PasswordStorageScheme.java                               |    4 
 opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java                                     |   84 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java                            |    2 
 opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java                                           |    8 
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java                                     |    2 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareRequestProtocolOp.java                       |    4 
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java                             |    2 
 opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java                       |    2 
 opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java                                      |   80 
 opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java                                                   |    2 
 opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternDN.java                                |    8 
 opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/OnDiskMergeImporterTest.java                        |    6 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteRequestProtocolOp.java                        |    4 
 opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java                                            |    4 
 opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java                                   |    8 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java                          |    8 
 opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestBackendImpl.java                                      |   12 
 opendj-server-legacy/src/dsml/org/opends/dsml/protocol/ByteStringUtility.java                                               |    4 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java                |    2 
 opendj-server-legacy/src/main/java/org/opends/server/core/SearchOperationBasis.java                                         |    4 
 opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java                            |   22 
 opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java                                 |    4 
 opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java                                                  |    6 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java                                |    2 
 opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java                   |    4 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProviderTestCase.java      |    8 
 opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java                                    |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java                       |   24 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java             |   52 
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ValueInfoTest.java                                  |    8 
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java                      |    3 
 opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java                                          |   14 
 opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java                                            |    8 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java                  |    2 
 opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPManagedObject.java                                  |    2 
 opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyDNOperation.java                                           |   10 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java                    |    2 
 opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PersistentServerState.java                          |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/PKCS5S2PasswordStorageScheme.java                           |    6 
 opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java                                            |    4 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java                           |    8 
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java                                 |    4 
 opendj-server-legacy/src/main/java/org/opends/server/util/ServerConstants.java                                              |    6 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA384PasswordStorageScheme.java                      |    6 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/CryptPasswordStorageScheme.java                             |    8 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/HasSubordinatesVirtualAttributeProviderTestCase.java        |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java                   |    8 
 opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java                                                |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java                           |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/StructuralObjectClassVirtualAttributeProviderTestCase.java  |    8 
 opendj-server-legacy/src/main/java/org/opends/server/config/IntegerConfigAttribute.java                                     |    6 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java            |    2 
 opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java                                      |    8 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java                        |    2 
 opendj-server-legacy/src/main/java/org/opends/server/core/ModifyDNOperationBasis.java                                       |    6 
 opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalUserData.java                       |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SHA1PasswordStorageScheme.java                              |    4 
 opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java                                            |    6 
 opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeSyntaxTest.java                                        |    2 
 opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java                                      |   12 
 opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java                                        |  106 +-
 opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java                        |    4 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/PlainSASLMechanismHandler.java                              |    2 
 opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java                                        |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandlerTestCase.java                    |    8 
 opendj-server-legacy/src/test/java/org/opends/server/schema/EqualityMatchingRuleTest.java                                   |    6 
 opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java                                            |   10 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java                |    4 
 opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java                                          |    8 
 opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java                                                   |    4 
 opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java                                     |   50 
 opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyOperation.java                                             |    2 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java                                     |   50 
 opendj-server-legacy/src/main/java/org/opends/server/controls/ProxiedAuthV1Control.java                                     |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java                          |   48 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java                          |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA256PasswordStorageScheme.java                      |    6 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java                        |    4 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java                   |   14 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA1PasswordStorageScheme.java                        |    6 
 opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java                                                |    2 
 opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/DN2URI.java                                               |    2 
 opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java                              |    4 
 opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java                                               |   12 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/AnonymousSASLMechanismHandlerTestCase.java                  |    2 
 opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java                                    |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java                             |   16 
 opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java                                           |    4 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA512PasswordStorageScheme.java                      |    6 
 opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyDNMsg.java                                  |    6 
 opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV2ControlTestCase.java                             |   48 
 opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java                                              |    6 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java                               |    4 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNRequestProtocolOp.java                      |   12 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java              |    2 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java                       |    2 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java                           |    4 
 opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java                                   |    2 
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java                       |    2 
 opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java                       |   46 
 opendj-server-legacy/src/main/java/org/opends/server/core/DeleteOperationBasis.java                                         |    2 
 opendj-server-legacy/src/main/java/org/opends/server/crypto/GetSymmetricKeyExtendedOperation.java                           |    4 
 opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java                            |   92 +-
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java                             |    4 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java                     |    2 
 opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java                                |    4 
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendStat.java                                    |    2 
 opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java                  |    2 
 opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java                                                  |    2 
 opendj-server-legacy/src/main/java/org/opends/server/admin/ACIPropertyDefinition.java                                       |    2 
 opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java                                      |    4 
 opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java                                           |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/NumSubordinatesVirtualAttributeProviderTestCase.java        |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/ClearPasswordStorageScheme.java                             |    2 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java                       |    2 
 opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java                                    |   16 
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java                                          |    2 
 opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyMsg.java                                    |    4 
 opendj-server-legacy/src/main/java/org/opends/server/schema/UserPasswordEqualityMatchingRule.java                           |    4 
 opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java                                        |    2 
 opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java                                        |    2 
 opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java                                                 |    2 
 opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java                           |  116 +-
 opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/ControlsTestCase.java                               |    2 
 opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/DefaultIndexTest.java                               |   12 
 opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java                                        |    2 
 opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java                                              |    4 
 opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java                                          |    8 
 opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java                                                   |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/DigestMD5SASLMechanismHandlerTestCase.java                  |    4 
 opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLDeleteOperation.java                                             |    4 
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryID.java                                        |    2 
 opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java                                                     |    6 
 opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiAuthenticator.java                                    |    4 
 opendj-server-legacy/src/main/java/org/opends/server/config/StringConfigAttribute.java                                      |    4 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/WhoAmIExtendedOperation.java                                |    2 
 opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java                                                     |    4 
 opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java                                      |   44 
 opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java                                                      |    4 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java                        |    4 
 opendj-server-legacy/src/main/java/org/opends/server/core/ModifyOperationBasis.java                                         |    2 
 opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java                                                   |    4 
 opendj-server-legacy/src/test/java/org/opends/server/core/RejectUnauthReqTests.java                                         |   12 
 opendj-server-legacy/src/main/java/org/opends/server/core/BindOperationBasis.java                                           |    2 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java                                |    8 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java             |   12 
 opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java                                       |   24 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java                                      |    4 
 opendj-server-legacy/src/test/java/org/opends/server/core/IdleTimeLimitTestCase.java                                        |    8 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java                        |   22 
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java                                     |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/MemberVirtualAttributeProvider.java                         |    2 
 opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java                        |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/TripleDESPasswordStorageScheme.java                         |    4 
 opendj-server-legacy/src/test/java/org/opends/server/core/SubentryPasswordPolicyTestCase.java                               |    6 
 opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java                                                      |    4 
 opendj-server-legacy/src/main/java/org/opends/server/util/BSDMD5Crypt.java                                                  |    4 
 opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java                                                  |   10 
 opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java                                                  |    2 
 opendj-server-legacy/src/test/java/org/opends/server/schema/UserPasswordEqualityMatchingRuleTest.java                       |   10 
 opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java                            |   26 
 opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciList.java                                  |    4 
 opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyFactory.java                                        |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedMD5PasswordStorageScheme.java                         |    6 
 opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java                                      |    6 
 opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java                                         |   10 
 opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java                                     |   44 
 opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Adapters.java                                      |   20 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/BlowfishPasswordStorageScheme.java                          |    4 
 opendj-server-legacy/src/main/java/org/opends/server/config/IntegerWithUnitConfigAttribute.java                             |    2 
 opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java                                |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java               |    6 
 opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AddMsg.java                                       |    2 
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Count.java                                       |    2 
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalMultipleTest.java                     |    8 
 opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java                                                       |    4 
 opendj-server-legacy/src/main/java/org/opends/server/protocols/http/SdkConnectionAdapter.java                               |   10 
 opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java                                           |   14 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/RC4PasswordStorageScheme.java                               |    4 
 opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java                                        |  150 +-
 opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java                |   16 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/AESPasswordStorageScheme.java                               |    4 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/SaltedMD5PasswordStorageSchemeTestCase.java                 |    6 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryUUIDVirtualAttributeProviderTestCase.java              |   10 
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java                                |    2 
 opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java                                 |    2 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/PBKDF2PasswordStorageScheme.java                            |    6 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java              |   12 
 opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java                                                      |   12 
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java                               |    4 
 opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/EntryContainer.java                                       |   14 
 opendj-server-legacy/src/test/java/org/opends/server/schema/CertificateSyntaxTest.java                                      |    4 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/UserDefinedVirtualAttributeProviderTestCase.java            |   18 
 opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java                     |   44 
 opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java                                                     |    4 
 opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java                        |    2 
 opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/EntryIDSetTest.java                                 |    4 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/GoverningStructureRuleVirtualAttributeProviderTestCase.java |    8 
 opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolUtils.java                                               |    4 
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java                      |    4 
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalSingleTest.java                       |    2 
 opendj-server-legacy/src/test/java/org/opends/server/tasks/DisconnectClientTaskTestCase.java                                |    8 
 opendj-server-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeSyntax.java                                      |    2 
 opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java                                        |    2 
 opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java              |    4 
 opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java                                 |   42 
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AbstractTree.java                                   |    2 
 234 files changed, 1,307 insertions(+), 1,306 deletions(-)

diff --git a/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPManagedObject.java b/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPManagedObject.java
index 19fd253..c9352c5 100644
--- a/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPManagedObject.java
+++ b/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPManagedObject.java
@@ -228,7 +228,7 @@
     private void addObjectClassesToEntry(List<String> objectClasses, Entry entry) {
         for (String objectClass : objectClasses) {
             Attribute attr = new LinkedAttribute("objectClass");
-            attr.add(ByteString.valueOf(objectClass));
+            attr.add(ByteString.valueOfUtf8(objectClass));
             entry.addAttribute(attr);
         }
     }
diff --git a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/ByteStringUtility.java b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/ByteStringUtility.java
index a38c917..321c81e 100644
--- a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/ByteStringUtility.java
+++ b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/ByteStringUtility.java
@@ -55,7 +55,7 @@
     {
       if (obj instanceof String)
       {
-        bs = ByteString.valueOf((String)obj);
+        bs = ByteString.valueOfUtf8((String)obj);
       }
       else if (obj instanceof byte [])
       {
@@ -86,7 +86,7 @@
       else if (obj instanceof Element)
       {
         Element element = (Element) obj;
-        bs = ByteString.valueOf(element.getTextContent());
+        bs = ByteString.valueOfUtf8(element.getTextContent());
       }
     }
     return bs;
diff --git a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java
index ac4a7af..e5db843 100644
--- a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java
+++ b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java
@@ -90,7 +90,7 @@
     LDAPResult addResponse = objFactory.createLDAPResult();
     addResponse.setRequestID(addRequest.getRequestID());
 
-    ByteString dnStr = ByteString.valueOf(addRequest.getDn());
+    ByteString dnStr = ByteString.valueOfUtf8(addRequest.getDn());
     ArrayList<RawAttribute> attributes = new ArrayList<>();
 
     List<DsmlAttr> addList = addRequest.getAttr();
diff --git a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java
index 20de860..7971a87 100644
--- a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java
+++ b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2008 Sun Microsystems, Inc.
- *      Portions Copyright 2012-2014 ForgeRock AS.
+ *      Portions Copyright 2012-2015 ForgeRock AS.
  */
 package org.opends.dsml.protocol;
 
@@ -92,7 +92,7 @@
     String attrName = attrValAssertion.getName();
     Object assertion = attrValAssertion.getValue();
     ByteString attrValue = ByteStringUtility.convertValue(assertion);
-    ByteString dnStr = ByteString.valueOf(compareRequest.getDn());
+    ByteString dnStr = ByteString.valueOfUtf8(compareRequest.getDn());
 
     // Create and send the LDAP compare request to the server.
     ProtocolOp op = new CompareRequestProtocolOp(dnStr, attrName, attrValue);
diff --git a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLDeleteOperation.java b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLDeleteOperation.java
index 6cf21a5..f5ace2a 100644
--- a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLDeleteOperation.java
+++ b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLDeleteOperation.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2008 Sun Microsystems, Inc.
- *      Portions Copyright 2012-2014 ForgeRock AS.
+ *      Portions Copyright 2012-2015 ForgeRock AS.
  */
 package org.opends.dsml.protocol;
 
@@ -93,7 +93,7 @@
     delResponse.setRequestID(deleteRequest.getRequestID());
 
     // Create and send the LDAP delete request to the server.
-    ByteString dnStr = ByteString.valueOf(deleteRequest.getDn());
+    ByteString dnStr = ByteString.valueOfUtf8(deleteRequest.getDn());
     ProtocolOp op = new DeleteRequestProtocolOp(dnStr);
     LDAPMessage msg = new LDAPMessage(DSMLServlet.nextMessageID(), op,
         controls);
diff --git a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyDNOperation.java b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyDNOperation.java
index d5d3972..c26ca15 100644
--- a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyDNOperation.java
+++ b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyDNOperation.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2008 Sun Microsystems, Inc.
- *      Portions Copyright 2012-2014 ForgeRock AS.
+ *      Portions Copyright 2012-2015 ForgeRock AS.
  */
 package org.opends.dsml.protocol;
 
@@ -87,20 +87,20 @@
   {
     LDAPResult modDNResponse = objFactory.createLDAPResult();
     modDNResponse.setRequestID(modifyDNRequest.getRequestID());
-    ByteString dnStr = ByteString.valueOf(modifyDNRequest.getDn());
+    ByteString dnStr = ByteString.valueOfUtf8(modifyDNRequest.getDn());
     ProtocolOp op = null;
 
     if (modifyDNRequest.getNewSuperior() != null)
     {
       op = new ModifyDNRequestProtocolOp(dnStr, ByteString
-          .valueOf(modifyDNRequest.getNewrdn()), modifyDNRequest
-          .isDeleteoldrdn(), ByteString.valueOf(modifyDNRequest
+          .valueOfUtf8(modifyDNRequest.getNewrdn()), modifyDNRequest
+          .isDeleteoldrdn(), ByteString.valueOfUtf8(modifyDNRequest
           .getNewSuperior()));
     }
     else
     {
       op = new ModifyDNRequestProtocolOp(dnStr, ByteString
-          .valueOf(modifyDNRequest.getNewrdn()), modifyDNRequest
+          .valueOfUtf8(modifyDNRequest.getNewrdn()), modifyDNRequest
           .isDeleteoldrdn());
     }
 
diff --git a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyOperation.java b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyOperation.java
index d1f99c5..180c95d 100644
--- a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyOperation.java
+++ b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLModifyOperation.java
@@ -123,7 +123,7 @@
 
     }
 
-    ByteString dnStr = ByteString.valueOf(modifyRequest.getDn());
+    ByteString dnStr = ByteString.valueOfUtf8(modifyRequest.getDn());
 
     // Create and send the LDAP request to the server.
     ProtocolOp op = new ModifyRequestProtocolOp(dnStr, modifications);
diff --git a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java
index 0efbb3b..0019351 100644
--- a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java
+++ b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java
@@ -532,7 +532,7 @@
     }
 
     SearchRequestProtocolOp protocolOp = new SearchRequestProtocolOp(ByteString
-        .valueOf(searchRequest.getDn()), scope, derefPolicy,
+        .valueOfUtf8(searchRequest.getDn()), scope, derefPolicy,
         (int) searchRequest.getSizeLimit(), (int) searchRequest.getTimeLimit(),
         searchRequest.isTypesOnly(), filter, attributes);
     try
diff --git a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java
index 6f3d7fb..197ad11 100644
--- a/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java
+++ b/opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java
@@ -255,7 +255,7 @@
     attributes.add(SchemaConstants.NO_ATTRIBUTES);
     ArrayList<org.opends.server.types.Control> controls = new ArrayList<>(1);
     org.opends.server.types.Control proxyAuthzControl =
-        new ProxiedAuthV2Control(true, ByteString.valueOf(authorizationID));
+        new ProxiedAuthV2Control(true, ByteString.valueOfUtf8(authorizationID));
     controls.add(proxyAuthzControl);
 
     try
diff --git a/opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Adapters.java b/opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Adapters.java
index 2e27c61..4429c7b 100644
--- a/opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Adapters.java
+++ b/opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Adapters.java
@@ -21,7 +21,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2013-2014 ForgeRock AS.
+ *      Copyright 2013-2015 ForgeRock AS.
  */
 package org.forgerock.opendj.adapter.server3x;
 
@@ -238,10 +238,10 @@
             @Override
             public Result modifyDN(final ModifyDNRequest request) throws LdapException {
                 final ModifyDNOperation modifyDNOperation =
-                        icc.processModifyDN(valueOf(request.getName()),
-                                valueOf(request.getNewRDN()),
+                        icc.processModifyDN(valueOfObject(request.getName()),
+                                valueOfObject(request.getNewRDN()),
                                 request.isDeleteOldRDN(),
-                                request.getNewSuperior() != null ? valueOf(request.getNewSuperior()) : null,
+                                request.getNewSuperior() != null ? valueOfObject(request.getNewSuperior()) : null,
                                 to(request.getControls()));
                 return getResponseResult(modifyDNOperation);
             }
@@ -249,7 +249,7 @@
             @Override
             public Result modify(final ModifyRequest request) throws LdapException {
                 final ModifyOperation modifyOperation =
-                        icc.processModify(valueOf(request.getName()), toRawModifications(request
+                        icc.processModify(valueOfObject(request.getName()), toRawModifications(request
                                 .getModifications()), to(request.getControls()));
                 return getResponseResult(modifyOperation);
             }
@@ -300,14 +300,14 @@
             @Override
             public Result delete(final DeleteRequest request) throws LdapException {
                 final DeleteOperation deleteOperation =
-                        icc.processDelete(valueOf(request.getName()), to(request.getControls()));
+                        icc.processDelete(valueOfObject(request.getName()), to(request.getControls()));
                 return getResponseResult(deleteOperation);
             }
 
             @Override
             public CompareResult compare(final CompareRequest request) throws LdapException {
                 final CompareOperation compareOperation =
-                        icc.processCompare(valueOf(request.getName()),
+                        icc.processCompare(valueOfObject(request.getName()),
                                 request.getAttributeDescription().toString(),
                                 request.getAssertionValue(), to(request.getControls()));
 
@@ -325,7 +325,7 @@
                 BindOperation bindOperation = null;
                 if (request instanceof SimpleBindRequest) {
                     bindOperation =
-                            icc.processSimpleBind(valueOf(request.getName()),
+                            icc.processSimpleBind(valueOfUtf8(request.getName()),
                                     ByteString.wrap(((SimpleBindRequest) request).getPassword()),
                                     to(request.getControls()));
                 } else if (request instanceof SASLBindRequest) {
@@ -340,7 +340,7 @@
                         final GenericBindRequest genericBindRequest = bindClient.nextBindRequest();
                         bindOperation =
                                 icc.processSASLBind(
-                                        valueOf(request.getName()),
+                                        valueOfUtf8(request.getName()),
                                         ((SASLBindRequest) request).getSASLMechanism(),
                                         getCredentials(genericBindRequest.getAuthenticationValue()),
                                         to(request.getControls()));
@@ -369,7 +369,7 @@
             @Override
             public Result add(final AddRequest request) throws LdapException {
                 final AddOperation addOperation =
-                        icc.processAdd(valueOf(request.getName()), to(request
+                        icc.processAdd(valueOfObject(request.getName()), to(request
                                 .getAllAttributes()), to(request.getControls()));
                 return getResponseResult(addOperation);
             }
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
index 257e965..032f63b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
@@ -331,7 +331,7 @@
           }
           else
           {
-            bs = ByteString.valueOf(value.toString());
+            bs = ByteString.valueOfUtf8(value.toString());
           }
           builder.add(bs);
         }
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java
index 092bf2a..4deba27 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java
@@ -674,13 +674,13 @@
   {
     if (value instanceof String)
     {
-      return ByteString.valueOf((String) value);
+      return ByteString.valueOfUtf8((String) value);
     }
     else if (value instanceof byte[])
     {
       return ByteString.wrap((byte[]) value);
     }
-    return ByteString.valueOf(String.valueOf(value));
+    return ByteString.valueOfUtf8(String.valueOf(value));
   }
 
   /**
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java
index dfde7f7..5789b7a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java
@@ -773,7 +773,8 @@
         // Try this alternative:
         AttributeType attrType =
             getInfo().getServerDescriptor().getSchema().getAttributeType(attr.toString().toLowerCase());
-        return new LDAPFilter(SearchFilter.createEqualityFilter(attrType, ByteString.valueOf(filterText))).toString();
+        ByteString filterBytes = ByteString.valueOfUtf8(filterText);
+        return new LDAPFilter(SearchFilter.createEqualityFilter(attrType, filterBytes)).toString();
       }
     }
     else
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
index fe18fc1..7e87a13 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
@@ -706,7 +706,7 @@
           }
           else
           {
-            bs = ByteString.valueOf(value.toString());
+            bs = ByteString.valueOfUtf8(value.toString());
           }
           builder.add(bs);
         }
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
index e69013c..352a696 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -1520,7 +1520,7 @@
                 AttributeType attr = rdn.getAttributeType(i);
                 attributeTypes.add(attr);
                 attributeNames.add(rdn.getAttributeName(i));
-                attributeValues.add(ByteString.valueOf(firstNonEmpty));
+                attributeValues.add(ByteString.valueOfUtf8(firstNonEmpty));
               }
             }
           }
@@ -1559,7 +1559,7 @@
                   {
                     attributeTypes.add(attr);
                     attributeNames.add(attrName);
-                    attributeValues.add(ByteString.valueOf((String) o));
+                    attributeValues.add(ByteString.valueOfUtf8((String) o));
                   }
                   break;
                 }
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java
index 5c32e1f..ff58a28 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java
@@ -302,7 +302,7 @@
                 AttributeType attr = rdn.getAttributeType(i);
                 attributeTypes.add(attr);
                 attributeNames.add(rdn.getAttributeName(i));
-                attributeValues.add(ByteString.valueOf(firstNonEmpty));
+                attributeValues.add(ByteString.valueOfUtf8(firstNonEmpty));
               }
             }
           }
@@ -341,7 +341,7 @@
                 {
                   attributeTypes.add(attr);
                   attributeNames.add(attrName);
-                  attributeValues.add(ByteString.valueOf((String) o));
+                  attributeValues.add(ByteString.valueOfUtf8((String) o));
                 }
                 break;
               }
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
index c5ae8b6..100f31d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
@@ -1492,7 +1492,7 @@
   public static String getRDNString(String attrName, String attrValue)
   {
     AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
-    RDN rdn = new RDN(attrType, attrName, ByteString.valueOf(attrValue));
+    RDN rdn = new RDN(attrType, attrName, ByteString.valueOfUtf8(attrValue));
     return rdn.toString();
   }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/admin/ACIPropertyDefinition.java b/opendj-server-legacy/src/main/java/org/opends/server/admin/ACIPropertyDefinition.java
index 5dd9a6a..c0b70e3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/admin/ACIPropertyDefinition.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/admin/ACIPropertyDefinition.java
@@ -110,7 +110,7 @@
     ifNull(value);
 
     try {
-      return Aci.decode(ByteString.valueOf(value), DN.NULL_DN);
+      return Aci.decode(ByteString.valueOfUtf8(value), DN.NULL_DN);
     } catch (AciException e) {
       // TODO: it would be nice to throw the cause.
       throw PropertyException.illegalPropertyValueException(this, value);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java b/opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java
index d0fdb04..6e783a2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java
@@ -151,7 +151,7 @@
       // Now add the single RDN representing the named instance.
       String type = profile.getRelationChildRDNType(r);
       AttributeType atype = DirectoryServer.getAttributeTypeOrDefault(type.toLowerCase());
-      ByteString avalue = ByteString.valueOf(name);
+      ByteString avalue = ByteString.valueOfUtf8(name);
       dn = dn.child(RDN.create(atype, avalue));
     }
 
@@ -168,7 +168,7 @@
       // Now add the single RDN representing the instance.
       String type = profile.getRelationChildRDNType(r);
       AttributeType atype = DirectoryServer.getAttributeTypeOrDefault(type.toLowerCase());
-      ByteString avalue = ByteString.valueOf(d.getName());
+      ByteString avalue = ByteString.valueOfUtf8(d.getName());
       dn = dn.child(RDN.create(atype, avalue));
     }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java
index 9b7ad78..a557322 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java
@@ -375,13 +375,13 @@
       //Write right is more complicated. Create a dummy value and set that as
       //the attribute's value. Call the special writeRightsString method, rather
       //than rightsString.
-      ByteString val= ByteString.valueOf("dum###Val");
+      ByteString val= ByteString.valueOfUtf8("dum###Val");
       container.setCurrentAttributeValue(val);
       evalInfo.append(attributeLevelWriteRights(container, handler, skipCheck));
       addAttrLevelRightsInfo(container, mask, a, retEntry, "write");
       evalInfo.append(',');
       //Perform both selfwrite_add and selfwrite_delete and append results.
-      ByteString val1 = ByteString.valueOf(container.getClientDN().toString());
+      ByteString val1 = ByteString.valueOfUtf8(container.getClientDN().toString());
       if(!specificAttr)
       {
         container.setCurrentAttributeType(dnAttributeType);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciList.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciList.java
index 6aa535a..e248604 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciList.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciList.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2008-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2013-2014 ForgeRock AS
+ *      Portions Copyright 2013-2015 ForgeRock AS
  */
 package org.opends.server.authorization.dseecompat;
 
@@ -435,7 +435,7 @@
           for(Aci aci : hashEntry.getValue()) {
             try {
                Aci newAci =
-                 Aci.decode(ByteString.valueOf(aci.toString()), relocateDN);
+                 Aci.decode(ByteString.valueOfUtf8(aci.toString()), relocateDN);
                acis.add(newAci);
             } catch (AciException ex) {
               //This should never happen since only a copy of the
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternDN.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternDN.java
index 539f0c4..682369d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternDN.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternDN.java
@@ -1233,7 +1233,7 @@
         }
       }
 
-      attributeValues.add(ByteString.valueOf(valueString));
+      attributeValues.add(ByteString.valueOfUtf8(valueString));
       return pos;
     }
 
@@ -1252,7 +1252,7 @@
       else if (c == '*')
       {
         escaped = false;
-        attributeValues.add(ByteString.valueOf(valueString));
+        attributeValues.add(ByteString.valueOfUtf8(valueString));
       }
       else
       {
@@ -1350,7 +1350,7 @@
             throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
                                          message);
           }
-          attributeValues.add(ByteString.valueOf(valueString));
+          attributeValues.add(ByteString.valueOfUtf8(valueString));
           valueString = new StringBuilder();
           hexChars = new StringBuilder();
         }
@@ -1383,7 +1383,7 @@
       }
 
 
-      attributeValues.add(ByteString.valueOf(valueString));
+      attributeValues.add(ByteString.valueOfUtf8(valueString));
       return pos;
     }
   }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java
index 85d4020..5ed8c7f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java
@@ -206,7 +206,7 @@
         InternalSearchOperation op = getRootConnection().processSearch(request);
         LinkedList<SearchResultEntry> result = op.getSearchEntries();
         if (!result.isEmpty()) {
-            ByteString val= ByteString.valueOf(attrVal);
+            ByteString val= ByteString.valueOfUtf8(attrVal);
             SearchResultEntry resultEntry = result.getFirst();
             if(resultEntry.hasValue(attrType, null, val)) {
                 Entry e=evalCtx.getResourceEntry();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java
index 870bc98..d755361 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java
@@ -542,7 +542,7 @@
     userAttrs.put(t, asList(t, v));
 
     t = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_BACKEND_DN);
-    userAttrs.put(t, asList(t, ByteString.valueOf(backupDirectory.getConfigEntryDN().toString())));
+    userAttrs.put(t, asList(t, ByteString.valueOfUtf8(backupDirectory.getConfigEntryDN().toString())));
 
     Entry e = new Entry(entryDN, ocMap, userAttrs, opAttrs);
     e.processVirtualAttributes();
@@ -631,7 +631,7 @@
     if (backupDate != null) {
       t = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DATE);
       userAttrs.put(t,
-          asList(t, ByteString.valueOf(GeneralizedTimeSyntax.format(backupDate))));
+          asList(t, ByteString.valueOfUtf8(GeneralizedTimeSyntax.format(backupDate))));
     }
 
     putBoolean(userAttrs, ATTR_BACKUP_COMPRESSED, backupInfo.isCompressed());
@@ -660,7 +660,7 @@
     if (properties != null && !properties.isEmpty()) {
       for (Map.Entry<String, String> e : properties.entrySet()) {
         t = DirectoryServer.getAttributeTypeOrDefault(toLowerCase(e.getKey()));
-        userAttrs.put(t, asList(t, ByteString.valueOf(e.getValue())));
+        userAttrs.put(t, asList(t, ByteString.valueOfUtf8(e.getValue())));
       }
     }
 
@@ -988,7 +988,7 @@
   public static DN makeChildDN(DN parentDN, AttributeType rdnAttrType,
                                String rdnStringValue)
   {
-    ByteString attrValue = ByteString.valueOf(rdnStringValue);
+    ByteString attrValue = ByteString.valueOfUtf8(rdnStringValue);
     return parentDN.child(RDN.create(rdnAttrType, attrValue));
   }
 }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
index 4e4a2b0..90f288c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
@@ -250,8 +250,8 @@
     cfg.getBaseDN().toArray(newBaseDNs);
     this.baseDNs = newBaseDNs;
 
-    creatorsName  = ByteString.valueOf(newBaseDNs[0].toString());
-    modifiersName = ByteString.valueOf(newBaseDNs[0].toString());
+    creatorsName  = ByteString.valueOfUtf8(newBaseDNs[0].toString());
+    modifiersName = ByteString.valueOfUtf8(newBaseDNs[0].toString());
 
     long createTime = DirectoryServer.getSchema().getOldestModificationTime();
     createTimestamp =
@@ -1152,7 +1152,7 @@
       authzDN = DN.rootDN();
     }
 
-    modifiersName = ByteString.valueOf(authzDN.toString());
+    modifiersName = ByteString.valueOfUtf8(authzDN.toString());
     modifyTimestamp = GeneralizedTimeSyntax.createGeneralizedTimeValue(
                            System.currentTimeMillis());
   }
@@ -2870,7 +2870,7 @@
     {
       if (schemaFile.equals(getSchemaFile(ldapSyntax)))
       {
-        values.add(ByteString.valueOf(ldapSyntax.toString()));
+        values.add(ByteString.valueOfUtf8(ldapSyntax.toString()));
       }
     }
 
@@ -2934,7 +2934,7 @@
       {
         if (schemaFile.equals(getSchemaFile(nf)))
         {
-          values.add(ByteString.valueOf(nf.toString()));
+          values.add(ByteString.valueOfUtf8(nf.toString()));
         }
       }
     }
@@ -2955,7 +2955,7 @@
     {
       if (schemaFile.equals(getSchemaFile(dcr)))
       {
-        values.add(ByteString.valueOf(dcr.toString()));
+        values.add(ByteString.valueOfUtf8(dcr.toString()));
       }
     }
 
@@ -2997,7 +2997,7 @@
     {
       if (schemaFile.equals(getSchemaFile(mru)))
       {
-        values.add(ByteString.valueOf(mru.toString()));
+        values.add(ByteString.valueOfUtf8(mru.toString()));
       }
     }
 
@@ -3077,7 +3077,7 @@
                               addedTypes, depth+1);
     }
 
-    values.add(ByteString.valueOf(attributeType.toString()));
+    values.add(ByteString.valueOfUtf8(attributeType.toString()));
     addedTypes.add(attributeType);
   }
 
@@ -3127,7 +3127,7 @@
                                    addedClasses, depth+1);
       }
     }
-    values.add(ByteString.valueOf(objectClass.toString()));
+    values.add(ByteString.valueOfUtf8(objectClass.toString()));
     addedClasses.add(objectClass);
   }
 
@@ -3177,7 +3177,7 @@
       }
     }
 
-    values.add(ByteString.valueOf(ditStructureRule.toString()));
+    values.add(ByteString.valueOfUtf8(ditStructureRule.toString()));
     addedDSRs.add(ditStructureRule);
   }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java
index 330f185..1c3173b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java
@@ -1013,7 +1013,7 @@
   public static DN makeChildDN(DN parentDN, AttributeType rdnAttrType,
                                String rdnStringValue)
   {
-    ByteString attrValue = ByteString.valueOf(rdnStringValue);
+    ByteString attrValue = ByteString.valueOfUtf8(rdnStringValue);
     return parentDN.child(RDN.create(rdnAttrType, attrValue));
   }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/DN2URI.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/DN2URI.java
index 93e3659..b9faca0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/DN2URI.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/DN2URI.java
@@ -153,7 +153,7 @@
 
   private Pair<String, DN> decodeURIAndDN(byte[] data) throws DirectoryException {
     try {
-      final ByteSequenceReader reader = ByteString.valueOf(data).asReader();
+      final ByteSequenceReader reader = ByteString.valueOfBytes(data).asReader();
       final String labeledURI = reader.readStringUtf8(getNextStringLength(reader));
       // skip the string separator
       reader.skip(1);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/EntryContainer.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/EntryContainer.java
index ae5b276..9672c64 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/EntryContainer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/EntryContainer.java
@@ -1771,7 +1771,7 @@
     indexRemoveEntry(indexBuffer, entry, leafID);
 
     // Remove the id2c and id2s records for this entry.
-    final ByteString leafIDKeyBytes = ByteString.valueOf(leafID.longValue());
+    final ByteString leafIDKeyBytes = ByteString.valueOfLong(leafID.longValue());
     id2children.delete(indexBuffer, leafIDKeyBytes);
     id2subtree.delete(indexBuffer, leafIDKeyBytes);
 
@@ -1787,7 +1787,7 @@
         throw new JebException(ERR_MISSING_DN2ID_RECORD.get(parentDN));
       }
 
-      ByteString parentIDBytes = ByteString.valueOf(parentID.longValue());
+      ByteString parentIDBytes = ByteString.valueOfLong(parentID.longValue());
       // Remove from id2children.
       if (isParent)
       {
@@ -2286,7 +2286,7 @@
            dn = getParentWithinBase(dn))
       {
         EntryID parentID = dn2id.get(txn, dn, LockMode.DEFAULT);
-        ByteString parentIDKeyBytes = ByteString.valueOf(parentID.longValue());
+        ByteString parentIDKeyBytes = ByteString.valueOfLong(parentID.longValue());
         if(isParent)
         {
           id2children.insertID(buffer, parentIDKeyBytes, newID);
@@ -2331,7 +2331,7 @@
       for (DN dn = oldSuperiorDN; dn != null; dn = getParentWithinBase(dn))
       {
         EntryID parentID = dn2id.get(txn, dn, LockMode.DEFAULT);
-        ByteString parentIDKeyBytes = ByteString.valueOf(parentID.longValue());
+        ByteString parentIDKeyBytes = ByteString.valueOfLong(parentID.longValue());
         if(isParent)
         {
           id2children.removeID(buffer, parentIDKeyBytes, oldID);
@@ -2345,7 +2345,7 @@
     {
       // All the subordinates will be renumbered so we have to rebuild
       // id2c and id2s with the new ID.
-      ByteString oldIDKeyBytes = ByteString.valueOf(oldID.longValue());
+      ByteString oldIDKeyBytes = ByteString.valueOfLong(oldID.longValue());
       id2children.delete(buffer, oldIDKeyBytes);
       id2subtree.delete(buffer, oldIDKeyBytes);
 
@@ -2436,7 +2436,7 @@
       for (DN dn = oldSuperiorDN; dn != null; dn = getParentWithinBase(dn))
       {
         EntryID parentID = dn2id.get(txn, dn, LockMode.DEFAULT);
-        ByteString parentIDKeyBytes = ByteString.valueOf(parentID.longValue());
+        ByteString parentIDKeyBytes = ByteString.valueOfLong(parentID.longValue());
         id2subtree.removeID(buffer, parentIDKeyBytes, oldID);
       }
     }
@@ -2445,7 +2445,7 @@
     {
       // All the subordinates will be renumbered so we have to rebuild
       // id2c and id2s with the new ID.
-      ByteString oldIDKeyBytes = ByteString.valueOf(oldID.longValue());
+      ByteString oldIDKeyBytes = ByteString.valueOfLong(oldID.longValue());
       id2children.delete(buffer, oldIDKeyBytes);
       id2subtree.delete(buffer, oldIDKeyBytes);
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java
index 85db87b..80873fa 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java
@@ -198,8 +198,8 @@
         return -1;
       }
 
-      final ByteString val1 = ByteString.valueOf(b1Bytes);
-      final ByteString val2 = ByteString.valueOf(b2Bytes);
+      final ByteString val1 = ByteString.valueOfBytes(b1Bytes);
+      final ByteString val2 = ByteString.valueOfBytes(b2Bytes);
       final int result = ascending[j] ? val1.compareTo(val2) : val2.compareTo(val1);
       if(result != 0)
       {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
index ca2dd15..d6c6876 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
@@ -588,7 +588,7 @@
         ex = getNewExchange(treeName, true);
         // Work around a problem with forced shutdown right after tree creation.
         // Tree operations are not part of the journal, so force a couple operations to be able to recover.
-        ByteString dummyKey = ByteString.valueOf(DUMMY_RECORD);
+        ByteString dummyKey = ByteString.valueOfUtf8(DUMMY_RECORD);
         put(treeName, dummyKey, ByteString.empty());
         delete(treeName, dummyKey);
       }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AbstractTree.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AbstractTree.java
index 60855cf..08b561b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AbstractTree.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AbstractTree.java
@@ -104,7 +104,7 @@
   @Override
   public ByteString generateKey(String key)
   {
-    return ByteString.valueOf(key.getBytes());
+    return ByteString.valueOfUtf8(key);
   }
 }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
index 826bf9a..2889d44 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
@@ -201,7 +201,7 @@
       try
       {
         SortedSet<ByteString> keys = new TreeSet<>();
-        indexer.createKeys(Schema.getDefaultSchema(), ByteString.valueOf(key.getBytes()), keys);
+        indexer.createKeys(Schema.getDefaultSchema(), ByteString.valueOfUtf8(key), keys);
         return keys.first();
       }
       catch (DecodeException e)
@@ -212,7 +212,7 @@
   }
 
   /** The key bytes used for the presence index as a {@link ByteString}. */
-  static final ByteString PRESENCE_KEY = ByteString.valueOf("+");
+  static final ByteString PRESENCE_KEY = ByteString.valueOfUtf8("+");
 
   /** A special indexer for generating presence indexes. */
   private static final Indexer PRESENCE_INDEXER = new Indexer()
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendStat.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendStat.java
index 1d2d53e..8169182 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendStat.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendStat.java
@@ -157,7 +157,7 @@
     @Override
     public ByteString getTreeKey(String data)
     {
-      return ByteString.valueOf(data);
+      return ByteString.valueOfUtf8(data);
     }
 
     @Override
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
index acd2cf0..84626de 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
@@ -273,7 +273,7 @@
     }
     catch (Exception e)
     {
-      return ByteString.valueOf(key.getBytes());
+      return ByteString.valueOfBytes(key.getBytes());
     }
   }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryID.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryID.java
index 0d20143..68e8ab0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryID.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryID.java
@@ -77,7 +77,7 @@
   {
     if (value == null)
     {
-      value = ByteString.valueOf(id);
+      value = ByteString.valueOfLong(id);
     }
     return value;
   }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java
index a7aea6f..4fad6d3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java
@@ -51,7 +51,7 @@
   public static final EntryIDSetCodec CODEC_V1 = new EntryIDSetCodecV1();
   public static final EntryIDSetCodec CODEC_V2 = new EntryIDSetCodecV2();
 
-  private static final ByteSequence NO_KEY = ByteString.valueOf("<none>");
+  private static final ByteSequence NO_KEY = ByteString.valueOfUtf8("<none>");
   private static final long[] EMPTY_LONG_ARRAY = new long[0];
   private static final long[] NO_ENTRY_IDS_RANGE = new long[] { 0, 0 };
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Count.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Count.java
index baaba00..cd21d18 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Count.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Count.java
@@ -151,7 +151,7 @@
   ByteString toValue(final long count)
   {
     Reject.ifFalse(count != 0, "count must be != 0");
-    return ByteString.valueOf(count);
+    return ByteString.valueOfLong(count);
   }
 
   long fromValue(ByteString value)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java
index fba991c..91ab9e1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java
@@ -155,7 +155,7 @@
     for(IndexFlag flag : flags) {
       value |= flag.mask;
     }
-    return ByteString.valueOf(new byte[] { value });
+    return ByteString.valueOfBytes(new byte[] { value });
   }
 
   /**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
index 2901f8c..4132eed 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
@@ -847,7 +847,7 @@
           ATTR_TASK_LOG_MESSAGES.toLowerCase(), ATTR_TASK_LOG_MESSAGES);
 
       final List<Attribute> attrList = taskEntry.getAttribute(type);
-      ByteString value = ByteString.valueOf(messageString);
+      ByteString value = ByteString.valueOfUtf8(messageString);
       if (attrList == null)
       {
         taskEntry.putAttribute(type, newArrayList(Attributes.create(type, value)));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java
index 6b6f4c8..13953ca 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java
@@ -884,7 +884,7 @@
   static LinkedHashSet<ByteString> getValueSet(String value)
   {
     LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(1);
-    valueSet.add(ByteString.valueOf(value));
+    valueSet.add(ByteString.valueOfUtf8(value));
     return valueSet;
   }
 
@@ -905,7 +905,7 @@
     LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(values.size());
     for (String value : values)
     {
-      valueSet.add(ByteString.valueOf(value));
+      valueSet.add(ByteString.valueOfUtf8(value));
     }
     return valueSet;
   }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java
index 12d3ad0..4e01fd5 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java
@@ -413,7 +413,7 @@
         throw new ConfigException(ERR_CONFIG_ATTR_DN_NULL.get(getName()));
       }
 
-      ByteString attrValue = ByteString.valueOf(value.toString());
+      ByteString attrValue = ByteString.valueOfUtf8(value.toString());
       if (valueSet.contains(attrValue))
       {
         throw new ConfigException(ERR_CONFIG_ATTR_ADD_VALUES_ALREADY_EXISTS.get(getName(), value));
@@ -452,7 +452,7 @@
     {
       return new LinkedHashSet<>(0);
     }
-    return newLinkedHashSet(ByteString.valueOf(value.toString()));
+    return newLinkedHashSet(ByteString.valueOfUtf8(value.toString()));
   }
 
 
@@ -474,7 +474,7 @@
     LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(values.size());
     for (DN value : values)
     {
-      valueSet.add(ByteString.valueOf(value.toString()));
+      valueSet.add(ByteString.valueOfUtf8(value.toString()));
     }
     return valueSet;
   }
@@ -600,7 +600,7 @@
         continue;
       }
 
-      valueSet.add(ByteString.valueOf(dn.toString()));
+      valueSet.add(ByteString.valueOfUtf8(dn.toString()));
     }
 
     // If this method was configured to continue on error, then it is possible
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/IntegerConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/IntegerConfigAttribute.java
index 68f6d22..22cbe81 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/IntegerConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/IntegerConfigAttribute.java
@@ -610,7 +610,7 @@
       }
 
       String valueString = String.valueOf(value);
-      ByteString attrValue = ByteString.valueOf(valueString);
+      ByteString attrValue = ByteString.valueOfUtf8(valueString);
       if (valueSet.contains(attrValue))
       {
         LocalizableMessage message = ERR_CONFIG_ATTR_ADD_VALUES_ALREADY_EXISTS.get(
@@ -664,7 +664,7 @@
     LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(values.size());
     for (long value : values)
     {
-      valueSet.add(ByteString.valueOf(String.valueOf(value)));
+      valueSet.add(ByteString.valueOfUtf8(String.valueOf(value)));
     }
     return valueSet;
   }
@@ -799,7 +799,7 @@
         continue;
       }
 
-      valueSet.add(ByteString.valueOf(valueString));
+      valueSet.add(ByteString.valueOfUtf8(valueString));
     }
 
     // If this method was configured to continue on error, then it is possible
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/IntegerWithUnitConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/IntegerWithUnitConfigAttribute.java
index 464414b..74798ee 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/IntegerWithUnitConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/IntegerWithUnitConfigAttribute.java
@@ -778,7 +778,7 @@
         continue;
       }
 
-      valueSet.add(ByteString.valueOf(valueString));
+      valueSet.add(ByteString.valueOfUtf8(valueString));
     }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
index e703cb2..0d808d6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
@@ -474,7 +474,7 @@
         throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(value, getName()));
       }
 
-      ByteString attrValue = ByteString.valueOf(value);
+      ByteString attrValue = ByteString.valueOfUtf8(value);
       if (valueSet.contains(attrValue))
       {
         throw new ConfigException(ERR_CONFIG_ATTR_ADD_VALUES_ALREADY_EXISTS.get(getName(), value));
@@ -605,7 +605,7 @@
         continue;
       }
 
-      valueSet.add(ByteString.valueOf(valueString));
+      valueSet.add(ByteString.valueOfUtf8(valueString));
     }
 
     // If this method was configured to continue on error, then it is possible
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/StringConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/StringConfigAttribute.java
index 58a4996..3279597 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/StringConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/StringConfigAttribute.java
@@ -419,7 +419,7 @@
         throw new ConfigException(ERR_CONFIG_ATTR_EMPTY_STRING_VALUE.get(getName()));
       }
 
-      ByteString attrValue = ByteString.valueOf(value);
+      ByteString attrValue = ByteString.valueOfUtf8(value);
       if (valueSet.contains(attrValue))
       {
         throw new ConfigException(ERR_CONFIG_ATTR_ADD_VALUES_ALREADY_EXISTS.get(getName(), value));
@@ -535,7 +535,7 @@
         continue;
       }
 
-      valueSet.add(ByteString.valueOf(valueString));
+      valueSet.add(ByteString.valueOfUtf8(valueString));
     }
 
     // If this method was configured to continue on error, then it is possible
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/controls/ProxiedAuthV1Control.java b/opendj-server-legacy/src/main/java/org/opends/server/controls/ProxiedAuthV1Control.java
index 4dd6fe1..98dd979 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/controls/ProxiedAuthV1Control.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/controls/ProxiedAuthV1Control.java
@@ -190,7 +190,7 @@
 
     this.authorizationDN = authorizationDN;
 
-    rawAuthorizationDN = ByteString.valueOf(authorizationDN.toString());
+    rawAuthorizationDN = ByteString.valueOfUtf8(authorizationDN.toString());
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/AddOperationBasis.java b/opendj-server-legacy/src/main/java/org/opends/server/core/AddOperationBasis.java
index 180c887..f50aaae 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/AddOperationBasis.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/AddOperationBasis.java
@@ -148,7 +148,7 @@
     this.userAttributes        = userAttributes;
     this.operationalAttributes = operationalAttributes;
 
-    rawEntryDN = ByteString.valueOf(entryDN.toString());
+    rawEntryDN = ByteString.valueOfUtf8(entryDN.toString());
 
     ArrayList<String> values = new ArrayList<>(objectClasses.values());
     rawAttributes = new ArrayList<>();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/BindOperationBasis.java b/opendj-server-legacy/src/main/java/org/opends/server/core/BindOperationBasis.java
index d713900..9bb0429 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/BindOperationBasis.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/BindOperationBasis.java
@@ -244,7 +244,7 @@
   {
     if (bindDN != null)
     {
-      return ByteString.valueOf(bindDN.toString());
+      return ByteString.valueOfUtf8(bindDN.toString());
     }
     return ByteString.empty();
   }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java b/opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java
index ffa747d..1e46e12 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java
@@ -149,7 +149,7 @@
     this.assertionValue = assertionValue;
 
     responseControls       = new ArrayList<>();
-    rawEntryDN             = ByteString.valueOf(entryDN.toString());
+    rawEntryDN             = ByteString.valueOfUtf8(entryDN.toString());
     rawAttributeType       = attributeType.getNameOrOID();
     cancelRequest          = null;
     proxiedAuthorizationDN = null;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/DeleteOperationBasis.java b/opendj-server-legacy/src/main/java/org/opends/server/core/DeleteOperationBasis.java
index deda159..eb08609 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/DeleteOperationBasis.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/DeleteOperationBasis.java
@@ -107,7 +107,7 @@
     super(clientConnection, operationID, messageID, requestControls);
 
     this.entryDN = entryDN;
-    rawEntryDN = ByteString.valueOf(entryDN.toString());
+    rawEntryDN = ByteString.valueOfUtf8(entryDN.toString());
   }
 
   @Override
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/ModifyDNOperationBasis.java b/opendj-server-legacy/src/main/java/org/opends/server/core/ModifyDNOperationBasis.java
index a750b33..57f3764 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/ModifyDNOperationBasis.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/ModifyDNOperationBasis.java
@@ -169,8 +169,8 @@
     this.deleteOldRDN = deleteOldRDN;
     this.newSuperior  = newSuperior;
 
-    rawEntryDN = ByteString.valueOf(entryDN.toString());
-    rawNewRDN  = ByteString.valueOf(newRDN.toString());
+    rawEntryDN = ByteString.valueOfUtf8(entryDN.toString());
+    rawNewRDN  = ByteString.valueOfUtf8(newRDN.toString());
 
     if (newSuperior == null)
     {
@@ -178,7 +178,7 @@
     }
     else
     {
-      rawNewSuperior = ByteString.valueOf(newSuperior.toString());
+      rawNewSuperior = ByteString.valueOfUtf8(newSuperior.toString());
     }
 
     responseControls = new ArrayList<>();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/ModifyOperationBasis.java b/opendj-server-legacy/src/main/java/org/opends/server/core/ModifyOperationBasis.java
index e4c7527..daf5396 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/ModifyOperationBasis.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/ModifyOperationBasis.java
@@ -132,7 +132,7 @@
     this.entryDN       = entryDN;
     this.modifications = modifications;
 
-    rawEntryDN = ByteString.valueOf(entryDN.toString());
+    rawEntryDN = ByteString.valueOfUtf8(entryDN.toString());
 
     rawModifications = new ArrayList<>(modifications.size());
     for (Modification m : modifications)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyFactory.java b/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyFactory.java
index b96adf7..50e267c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyFactory.java
@@ -315,7 +315,7 @@
       {
         if (requireChangeBy != null)
         {
-          ByteString valueString = ByteString.valueOf(requireChangeBy);
+          ByteString valueString = ByteString.valueOfUtf8(requireChangeBy);
           requireChangeByTime = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
         }
       }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java b/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java
index 724d9ea..4cbd014 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java
@@ -684,7 +684,7 @@
             valuesToRemove = new LinkedHashSet<>();
           }
 
-          valuesToRemove.add(ByteString.valueOf(GeneralizedTimeSyntax.format(l)));
+          valuesToRemove.add(ByteString.valueOfUtf8(GeneralizedTimeSyntax.format(l)));
         }
       }
 
@@ -2172,7 +2172,7 @@
   {
     return passwordPolicy.isAuthPasswordSyntax()
         ? scheme.getAuthPasswordPlaintextValue(pwComponents[1], pwComponents[2])
-        : scheme.getPlaintextValue(ByteString.valueOf(pwComponents[1]));
+        : scheme.getPlaintextValue(ByteString.valueOfUtf8(pwComponents[1]));
   }
 
   @Override
@@ -2476,7 +2476,7 @@
   {
     return passwordPolicy.isAuthPasswordSyntax()
         ? scheme.authPasswordMatches(password, pwComponents[1], pwComponents[2])
-        : scheme.passwordMatches(password, ByteString.valueOf(pwComponents[1]));
+        : scheme.passwordMatches(password, ByteString.valueOfUtf8(pwComponents[1]));
   }
 
   private ByteString encodePassword(ByteString password, PasswordStorageScheme<?> s) throws DirectoryException
@@ -2622,8 +2622,8 @@
           {
             try
             {
-              long timestamp =
-                   GeneralizedTimeSyntax.decodeGeneralizedTimeValue(ByteString.valueOf(histStr.substring(0, hashPos)));
+              ByteString timeValue = ByteString.valueOfUtf8(histStr.substring(0, hashPos));
+              long timestamp = GeneralizedTimeSyntax.decodeGeneralizedTimeValue(timeValue);
               historyMap.put(timestamp, v);
             }
             catch (Exception e)
@@ -2729,7 +2729,7 @@
   {
     String[] userPWComponents = UserPasswordSyntax.decodeUserPassword(encodedUserPassword);
     PasswordStorageScheme<?> scheme = DirectoryServer.getPasswordStorageScheme(userPWComponents[0]);
-    return scheme.passwordMatches(password, ByteString.valueOf(userPWComponents[1]));
+    return scheme.passwordMatches(password, ByteString.valueOfUtf8(userPWComponents[1]));
   }
 
   private boolean logResult(String passwordType, boolean passwordMatches)
@@ -3051,7 +3051,7 @@
     }
 
     InternalClientConnection conn = getRootConnection();
-    ModifyOperation internalModify = conn.processModify(ByteString.valueOf(userDNString), modList);
+    ModifyOperation internalModify = conn.processModify(ByteString.valueOfUtf8(userDNString), modList);
 
     ResultCode resultCode = internalModify.getResultCode();
     if (resultCode != ResultCode.SUCCESS)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/SearchOperationBasis.java b/opendj-server-legacy/src/main/java/org/opends/server/core/SearchOperationBasis.java
index a895957..a918ff4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/SearchOperationBasis.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/SearchOperationBasis.java
@@ -260,7 +260,7 @@
     this.filter      = filter;
     this.attributes  = attributes != null ? attributes : new LinkedHashSet<String>(0);
 
-    rawBaseDN = ByteString.valueOf(baseDN.toString());
+    rawBaseDN = ByteString.valueOfUtf8(baseDN.toString());
     rawFilter = new LDAPFilter(filter);
 
     this.sizeLimit = getSizeLimit(sizeLimit, clientConnection);
@@ -596,7 +596,7 @@
            filteredEntry.getObjectClasses().values().iterator();
       while (ocIterator.hasNext())
       {
-        ByteString ocName = ByteString.valueOf(ocIterator.next());
+        ByteString ocName = ByteString.valueOfUtf8(ocIterator.next());
         if (! matchedValuesControl.valueMatches(attrType, ocName))
         {
           ocIterator.remove();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java b/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
index da83993..2a129b1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
@@ -470,7 +470,7 @@
   static byte[] getInstanceKeyCertificateFromLocalTruststore()
           throws CryptoManagerException {
     // Construct the key entry DN.
-    final ByteString distinguishedValue = ByteString.valueOf(ADS_CERTIFICATE_ALIAS);
+    final ByteString distinguishedValue = ByteString.valueOfUtf8(ADS_CERTIFICATE_ALIAS);
     final DN entryDN = localTruststoreDN.child(RDN.create(attrKeyID, distinguishedValue));
     // Construct the search filter.
     final String FILTER_OC_INSTANCE_KEY = "(objectclass=" + ocInstanceKey.getNameOrOID() + ")";
@@ -594,7 +594,7 @@
     final byte[] instanceKeyCertificate = getInstanceKeyCertificateFromLocalTruststore();
     final String instanceKeyID = getInstanceKeyID(instanceKeyCertificate);
     // Construct the key entry DN.
-    final ByteString distinguishedValue = ByteString.valueOf(instanceKeyID);
+    final ByteString distinguishedValue = ByteString.valueOfUtf8(instanceKeyID);
     final DN entryDN = instanceKeysDN.child(
          RDN.create(attrKeyID, distinguishedValue));
 
@@ -1575,7 +1575,7 @@
     {
       // Construct the key entry DN.
       ByteString distinguishedValue =
-           ByteString.valueOf(keyEntry.getKeyID().getStringValue());
+           ByteString.valueOfUtf8(keyEntry.getKeyID().getStringValue());
       DN entryDN = secretKeysDN.child(
            RDN.create(attrKeyID, distinguishedValue));
 
@@ -2096,7 +2096,7 @@
     {
       // Construct the key entry DN.
       ByteString distinguishedValue =
-           ByteString.valueOf(keyEntry.getKeyID().getStringValue());
+           ByteString.valueOfUtf8(keyEntry.getKeyID().getStringValue());
       DN entryDN = secretKeysDN.child(
            RDN.create(attrKeyID, distinguishedValue));
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/crypto/GetSymmetricKeyExtendedOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/crypto/GetSymmetricKeyExtendedOperation.java
index 6897eb6..30f9b87 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/crypto/GetSymmetricKeyExtendedOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/crypto/GetSymmetricKeyExtendedOperation.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2008-2009 Sun Microsystems, Inc.
- *      Portions Copyright 2013-2014 ForgeRock AS
+ *      Portions Copyright 2013-2015 ForgeRock AS
  */
 package org.opends.server.crypto;
 
@@ -156,7 +156,7 @@
 
       operation.setResponseOID(
            ServerConstants.OID_GET_SYMMETRIC_KEY_EXTENDED_OP);
-      operation.setResponseValue(ByteString.valueOf(responseSymmetricKey));
+      operation.setResponseValue(ByteString.valueOfUtf8(responseSymmetricKey));
       operation.setResultCode(ResultCode.SUCCESS);
     }
     catch (CryptoManagerException e)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/AESPasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/AESPasswordStorageScheme.java
index 51def31..f50427a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/AESPasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/AESPasswordStorageScheme.java
@@ -108,7 +108,7 @@
       byte[] encodedBytes = cryptoManager.encrypt(CIPHER_TRANSFORMATION_AES,
                                                   KEY_SIZE_AES,
                                                   plaintextBytes);
-      return ByteString.valueOf(Base64.encode(encodedBytes));
+      return ByteString.valueOfUtf8(Base64.encode(encodedBytes));
     }
     catch (Exception e)
     {
@@ -164,7 +164,7 @@
       }
     }
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
   /** {@inheritDoc} */
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java
index 197c69c..7e23367 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java
@@ -166,8 +166,8 @@
         continue;
       }
 
-      ByteString vf = ByteString.valueOf(password);
-      ByteString vr = ByteString.valueOf(reversed);
+      ByteString vf = ByteString.valueOfUtf8(password);
+      ByteString vr = ByteString.valueOfUtf8(reversed);
 
       for (Attribute a : attrList)
       {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/Base64PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/Base64PasswordStorageScheme.java
index b11f5cd..ba57179 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/Base64PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/Base64PasswordStorageScheme.java
@@ -94,7 +94,7 @@
   public ByteString encodePassword(ByteSequence plaintext)
          throws DirectoryException
   {
-    return ByteString.valueOf(Base64.encode(plaintext));
+    return ByteString.valueOfUtf8(Base64.encode(plaintext));
   }
 
 
@@ -110,7 +110,7 @@
     buffer.append('}');
     buffer.append(Base64.encode(plaintext));
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/BlowfishPasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/BlowfishPasswordStorageScheme.java
index 528235c..b030260 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/BlowfishPasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/BlowfishPasswordStorageScheme.java
@@ -114,7 +114,7 @@
       byte[] encodedBytes =
            cryptoManager.encrypt(CIPHER_TRANSFORMATION_BLOWFISH,
                                  KEY_SIZE_BLOWFISH, plaintextBytes);
-      return ByteString.valueOf(Base64.encode(encodedBytes));
+      return ByteString.valueOfUtf8(Base64.encode(encodedBytes));
     }
     catch (Exception e)
     {
@@ -173,7 +173,7 @@
       }
     }
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java
index b84645c..f8c02f0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java
@@ -188,7 +188,7 @@
       }
       challengeString.append('>');
 
-      final ByteString challenge = ByteString.valueOf(challengeString);
+      final ByteString challenge = ByteString.valueOfUtf8(challengeString);
       clientConnection.setSASLAuthStateInfo(challenge);
       bindOperation.setServerSASLCredentials(challenge);
       bindOperation.setResultCode(ResultCode.SASL_BIND_IN_PROGRESS);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ClearPasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ClearPasswordStorageScheme.java
index b3616f5..6c9a672 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ClearPasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ClearPasswordStorageScheme.java
@@ -103,7 +103,7 @@
     buffer.append('}');
     buffer.append(plaintext.toString());
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
index 4dcd59b..21047b4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
@@ -587,7 +587,7 @@
       {
         try
         {
-          ByteString ts = ByteString.valueOf(name.substring(7, dotPos));
+          ByteString ts = ByteString.valueOfUtf8(name.substring(7, dotPos));
           long timestamp = GeneralizedTimeSyntax.decodeGeneralizedTimeValue(ts);
           if (timestamp > latestTimestamp)
           {
@@ -606,7 +606,7 @@
       {
         try
         {
-          ByteString ts = ByteString.valueOf(name.substring(7, dashPos));
+          ByteString ts = ByteString.valueOfUtf8(name.substring(7, dashPos));
           long timestamp = GeneralizedTimeSyntax.decodeGeneralizedTimeValue(ts);
           int counter = Integer.parseInt(name.substring(dashPos+1, dotPos));
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/CryptPasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/CryptPasswordStorageScheme.java
index 17623a5..928c99a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/CryptPasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/CryptPasswordStorageScheme.java
@@ -183,7 +183,7 @@
       throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                    message, e);
     }
-    return ByteString.valueOf(output);
+    return ByteString.valueOfUtf8(output);
   }
 
   private ByteString sha256CryptEncodePassword(ByteSequence plaintext)
@@ -210,7 +210,7 @@
         Arrays.fill(plaintextBytes, (byte) 0);
       }
     }
-    return ByteString.valueOf(output);
+    return ByteString.valueOfUtf8(output);
   }
 
   private ByteString sha512CryptEncodePassword(ByteSequence plaintext)
@@ -237,7 +237,7 @@
         Arrays.fill(plaintextBytes, (byte) 0);
       }
     }
-    return ByteString.valueOf(output);
+    return ByteString.valueOfUtf8(output);
   }
 
   /** {@inheritDoc} */
@@ -278,7 +278,7 @@
 
     buffer.append(encodePassword(plaintext));
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
   /**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java
index 7e133a6..a91916f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java
@@ -92,7 +92,7 @@
     try
     {
       MatchingRule eqRule = rule.getAttributeType().getEqualityMatchingRule();
-      ByteString dn = ByteString.valueOf(entry.getName().toString());
+      ByteString dn = ByteString.valueOfUtf8(entry.getName().toString());
       ByteString normalizedDN = eqRule.normalizeAttributeValue(dn);
       ByteString normalizedValue = eqRule.normalizeAttributeValue(value);
       return normalizedDN.equals(normalizedValue);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java
index baf6e7e..7092750 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java
@@ -180,7 +180,7 @@
     SearchFilter filter;
     if (attributeTypes.length == 1)
     {
-      ByteString value = ByteString.valueOf(id);
+      ByteString value = ByteString.valueOfUtf8(id);
       filter = SearchFilter.createEqualityFilter(attributeTypes[0], value);
     }
     else
@@ -188,7 +188,7 @@
       ArrayList<SearchFilter> filterComps = new ArrayList<>(attributeTypes.length);
       for (AttributeType t : attributeTypes)
       {
-        ByteString value = ByteString.valueOf(id);
+        ByteString value = ByteString.valueOfUtf8(id);
         filterComps.add(SearchFilter.createEqualityFilter(t, value));
       }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java
index 0d0b4d2..e8c2128 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java
@@ -215,7 +215,7 @@
 
 
     // Create the search filter from the fingerprint.
-    ByteString value = ByteString.valueOf(fingerprintString);
+    ByteString value = ByteString.valueOfUtf8(fingerprintString);
     SearchFilter filter =
          SearchFilter.createEqualityFilter(fingerprintAttributeType, value);
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
index 9ace482..d7a2f65 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -460,8 +460,8 @@
       {
         try
         {
-          connection.simpleBind(ByteString.valueOf(username.toString()),
-              ByteString.valueOf(password));
+          connection.simpleBind(ByteString.valueOfUtf8(username.toString()),
+              ByteString.valueOfUtf8(password));
         }
         catch (final DirectoryException e)
         {
@@ -924,7 +924,7 @@
         // Create the search request and send it to the server.
         final SearchRequestProtocolOp searchRequest =
           new SearchRequestProtocolOp(
-            ByteString.valueOf(baseDN.toString()), scope,
+            ByteString.valueOfUtf8(baseDN.toString()), scope,
             DereferenceAliasesPolicy.ALWAYS, 1 /* size limit */,
             (timeoutMS / 1000), true /* types only */,
             RawFilter.create(filter), NO_ATTRIBUTES);
@@ -948,7 +948,7 @@
                 .getSearchResultEntryProtocolOp();
             if (username == null)
             {
-              username = ByteString.valueOf(searchEntry.getDN().toString());
+              username = ByteString.valueOfUtf8(searchEntry.getDN().toString());
             }
             resultCount++;
             break;
@@ -1605,7 +1605,7 @@
           {
           case UNMAPPED:
             // The bind DN is the name of the user's entry.
-            username = ByteString.valueOf(userEntry.getName().toString());
+            username = ByteString.valueOfUtf8(userEntry.getName().toString());
             break;
           case MAPPED_BIND:
             // The bind DN is contained in an attribute in the user's entry.
@@ -1869,7 +1869,7 @@
           if (scheme != null)
           {
             return scheme.passwordMatches(password,
-                ByteString.valueOf(userPwComponents[1]));
+                ByteString.valueOfUtf8(userPwComponents[1]));
           }
         }
         catch (DirectoryException e)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/MD5PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/MD5PasswordStorageScheme.java
index bef0c99..f2bc5d3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/MD5PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/MD5PasswordStorageScheme.java
@@ -159,7 +159,7 @@
       }
     }
 
-    return ByteString.valueOf(Base64.encode(digestBytes));
+    return ByteString.valueOfUtf8(Base64.encode(digestBytes));
   }
 
 
@@ -206,7 +206,7 @@
     buffer.append(Base64.encode(digestBytes));
 
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/MemberVirtualAttributeProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/MemberVirtualAttributeProvider.java
index 0116994..bb91827 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/MemberVirtualAttributeProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/MemberVirtualAttributeProvider.java
@@ -128,7 +128,7 @@
           DN memberDN = memberList.nextMemberDN();
           if (memberDN != null)
           {
-            builder.add(ByteString.valueOf(memberDN.toString()));
+            builder.add(ByteString.valueOfUtf8(memberDN.toString()));
           }
         }
         catch (MembershipException me)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PBKDF2PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PBKDF2PasswordStorageScheme.java
index 3478ced..a4c0188 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PBKDF2PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PBKDF2PasswordStorageScheme.java
@@ -146,7 +146,7 @@
     byte[] digestBytes = encodeWithRandomSalt(plaintext, saltBytes, iterations,random);
     byte[] hashPlusSalt = concatenateHashPlusSalt(saltBytes, digestBytes);
 
-    return ByteString.valueOf(iterations + ":" + Base64.encode(hashPlusSalt));
+    return ByteString.valueOfUtf8(iterations + ":" + Base64.encode(hashPlusSalt));
   }
 
   /** {@inheritDoc} */
@@ -154,7 +154,7 @@
   public ByteString encodePasswordWithScheme(ByteSequence plaintext)
       throws DirectoryException
   {
-    return ByteString.valueOf('{' + STORAGE_SCHEME_NAME_PBKDF2 + '}' + encodePassword(plaintext));
+    return ByteString.valueOfUtf8('{' + STORAGE_SCHEME_NAME_PBKDF2 + '}' + encodePassword(plaintext));
   }
 
   /** {@inheritDoc} */
@@ -219,7 +219,7 @@
     byte[] digestBytes = encodeWithRandomSalt(plaintext, saltBytes, iterations,random);
 
     // Encode and return the value.
-    return ByteString.valueOf(AUTH_PASSWORD_SCHEME_NAME_PBKDF2 + '$'
+    return ByteString.valueOfUtf8(AUTH_PASSWORD_SCHEME_NAME_PBKDF2 + '$'
         + iterations + ':' + Base64.encode(saltBytes) + '$' + Base64.encode(digestBytes));
   }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PKCS5S2PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PKCS5S2PasswordStorageScheme.java
index 471aa75..48700c2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PKCS5S2PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PKCS5S2PasswordStorageScheme.java
@@ -122,7 +122,7 @@
     byte[] digestBytes = encodeWithRandomSalt(plaintext, saltBytes,random);
     byte[] hashPlusSalt = concatenateSaltPlusHash(saltBytes, digestBytes);
 
-    return ByteString.valueOf(Base64.encode(hashPlusSalt));
+    return ByteString.valueOfUtf8(Base64.encode(hashPlusSalt));
   }
 
   /** {@inheritDoc} */
@@ -130,7 +130,7 @@
   public ByteString encodePasswordWithScheme(ByteSequence plaintext)
       throws DirectoryException
   {
-    return ByteString.valueOf('{' + STORAGE_SCHEME_NAME_PKCS5S2 + '}' + encodePassword(plaintext));
+    return ByteString.valueOfUtf8('{' + STORAGE_SCHEME_NAME_PKCS5S2 + '}' + encodePassword(plaintext));
   }
 
   /** {@inheritDoc} */
@@ -186,7 +186,7 @@
     byte[] saltBytes      = new byte[NUM_SALT_BYTES];
     byte[] digestBytes = encodeWithRandomSalt(plaintext, saltBytes,random);
     // Encode and return the value.
-    return ByteString.valueOf(AUTH_PASSWORD_SCHEME_NAME_PKCS5S2 + '$' + iterations
+    return ByteString.valueOfUtf8(AUTH_PASSWORD_SCHEME_NAME_PKCS5S2 + '$' + iterations
         + ':' + Base64.encode(saltBytes) + '$' + Base64.encode(digestBytes));
   }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java
index e665d96..21a900d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java
@@ -882,7 +882,7 @@
   {
     return pwPolicyState.getAuthenticationPolicy().isAuthPasswordSyntax()
         ? scheme.authPasswordMatches(oldPassword, components[1], components[2])
-        : scheme.passwordMatches(oldPassword, ByteString.valueOf(components[1]));
+        : scheme.passwordMatches(oldPassword, ByteString.valueOfUtf8(components[1]));
   }
 
   private boolean isSelfChange(ByteString userIdentity, Entry requestorEntry, DN userDN, ByteString oldPassword)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java
index 5482402..3235284 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java
@@ -1136,7 +1136,7 @@
         {
           try
           {
-            ByteString valueString = ByteString.valueOf(opValues.get(0));
+            ByteString valueString = ByteString.valueOfUtf8(opValues.get(0));
             long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
             pwpState.setAccountExpirationTime(time);
           }
@@ -1181,7 +1181,7 @@
         {
           try
           {
-            ByteString valueString = ByteString.valueOf(opValues.get(0));
+            ByteString valueString = ByteString.valueOfUtf8(opValues.get(0));
             long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
             pwpState.setPasswordChangedTime(time);
           }
@@ -1222,7 +1222,7 @@
         {
           try
           {
-            ByteString valueString = ByteString.valueOf(opValues.get(0));
+            ByteString valueString = ByteString.valueOfUtf8(opValues.get(0));
             long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
             pwpState.setWarnedTime(time);
           }
@@ -1277,7 +1277,7 @@
         {
           try
           {
-            ByteString valueString = ByteString.valueOf(opValues.get(0));
+            ByteString valueString = ByteString.valueOfUtf8(opValues.get(0));
             long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
             List<Long> authFailureTimes = pwpState.getAuthFailureTimes();
             ArrayList<Long> newFailureTimes = new ArrayList<>(authFailureTimes.size()+1);
@@ -1360,7 +1360,7 @@
         {
           try
           {
-            ByteString valueString = ByteString.valueOf(opValues.get(0));
+            ByteString valueString = ByteString.valueOfUtf8(opValues.get(0));
             long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
             pwpState.setLastLoginTime(time);
           }
@@ -1456,7 +1456,7 @@
         {
           try
           {
-            ByteString valueString = ByteString.valueOf(opValues.get(0));
+            ByteString valueString = ByteString.valueOfUtf8(opValues.get(0));
             long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
             List<Long> authFailureTimes = pwpState.getGraceLoginTimes();
             ArrayList<Long> newGraceTimes = new ArrayList<>(authFailureTimes.size()+1);
@@ -1535,7 +1535,7 @@
         {
           try
           {
-            ByteString valueString = ByteString.valueOf(opValues.get(0));
+            ByteString valueString = ByteString.valueOfUtf8(opValues.get(0));
             long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
             pwpState.setRequiredChangeTime(time);
           }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PlainSASLMechanismHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PlainSASLMechanismHandler.java
index 4d0a556..9ca4996 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PlainSASLMechanismHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PlainSASLMechanismHandler.java
@@ -443,7 +443,7 @@
         return;
       }
 
-      if (!authState.passwordMatches(ByteString.valueOf(password)))
+      if (!authState.passwordMatches(ByteString.valueOfUtf8(password)))
       {
         bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS);
         LocalizableMessage message = ERR_SASLPLAIN_INVALID_PASSWORD.get();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RC4PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RC4PasswordStorageScheme.java
index 713e5c7..a44dba6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RC4PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RC4PasswordStorageScheme.java
@@ -113,7 +113,7 @@
       byte[] encodedBytes = cryptoManager.encrypt(CIPHER_TRANSFORMATION_RC4,
                                                   KEY_SIZE_RC4,
                                                   plaintextBytes);
-      return ByteString.valueOf(Base64.encode(encodedBytes));
+      return ByteString.valueOfUtf8(Base64.encode(encodedBytes));
     }
     catch (Exception e)
     {
@@ -172,7 +172,7 @@
       }
     }
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java
index 6bda156..026f856 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java
@@ -252,7 +252,7 @@
       }
     }
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java
index bee4d8b..98bf57a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java
@@ -197,7 +197,7 @@
     SearchFilter filter;
     if (attributeTypes.length == 1)
     {
-      ByteString value = ByteString.valueOf(processedID);
+      ByteString value = ByteString.valueOfUtf8(processedID);
       filter = SearchFilter.createEqualityFilter(attributeTypes[0], value);
     }
     else
@@ -205,7 +205,7 @@
       ArrayList<SearchFilter> filterComps = new ArrayList<>(attributeTypes.length);
       for (AttributeType t : attributeTypes)
       {
-        ByteString value = ByteString.valueOf(processedID);
+        ByteString value = ByteString.valueOfUtf8(processedID);
         filterComps.add(SearchFilter.createEqualityFilter(t, value));
       }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SHA1PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SHA1PasswordStorageScheme.java
index df0edc2..445fbb6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SHA1PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SHA1PasswordStorageScheme.java
@@ -158,7 +158,7 @@
       }
     }
 
-    return ByteString.valueOf(Base64.encode(digestBytes));
+    return ByteString.valueOfUtf8(Base64.encode(digestBytes));
   }
 
 
@@ -204,7 +204,7 @@
 
     buffer.append(Base64.encode(digestBytes));
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedMD5PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedMD5PasswordStorageScheme.java
index 22f4931..3bf05f7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedMD5PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedMD5PasswordStorageScheme.java
@@ -188,7 +188,7 @@
     System.arraycopy(saltBytes, 0, hashPlusSalt, digestBytes.length,
                      NUM_SALT_BYTES);
 
-    return ByteString.valueOf(Base64.encode(hashPlusSalt));
+    return ByteString.valueOfUtf8(Base64.encode(hashPlusSalt));
   }
 
 
@@ -246,7 +246,7 @@
                      NUM_SALT_BYTES);
     buffer.append(Base64.encode(hashPlusSalt));
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
@@ -383,7 +383,7 @@
     authPWValue.append('$');
     authPWValue.append(Base64.encode(digestBytes));
 
-    return ByteString.valueOf(authPWValue);
+    return ByteString.valueOfUtf8(authPWValue);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA1PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA1PasswordStorageScheme.java
index 0768f6c..d89bc2b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA1PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA1PasswordStorageScheme.java
@@ -187,7 +187,7 @@
     System.arraycopy(saltBytes, 0, hashPlusSalt, digestBytes.length,
                      NUM_SALT_BYTES);
 
-    return ByteString.valueOf(Base64.encode(hashPlusSalt));
+    return ByteString.valueOfUtf8(Base64.encode(hashPlusSalt));
   }
 
 
@@ -245,7 +245,7 @@
                      NUM_SALT_BYTES);
     buffer.append(Base64.encode(hashPlusSalt));
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
@@ -382,7 +382,7 @@
     authPWValue.append('$');
     authPWValue.append(Base64.encode(digestBytes));
 
-    return ByteString.valueOf(authPWValue);
+    return ByteString.valueOfUtf8(authPWValue);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA256PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA256PasswordStorageScheme.java
index 698a070..28624f6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA256PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA256PasswordStorageScheme.java
@@ -192,7 +192,7 @@
     System.arraycopy(saltBytes, 0, hashPlusSalt, digestBytes.length,
                      NUM_SALT_BYTES);
 
-    return ByteString.valueOf(Base64.encode(hashPlusSalt));
+    return ByteString.valueOfUtf8(Base64.encode(hashPlusSalt));
   }
 
 
@@ -250,7 +250,7 @@
                      NUM_SALT_BYTES);
     buffer.append(Base64.encode(hashPlusSalt));
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
@@ -389,7 +389,7 @@
     authPWValue.append('$');
     authPWValue.append(Base64.encode(digestBytes));
 
-    return ByteString.valueOf(authPWValue);
+    return ByteString.valueOfUtf8(authPWValue);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA384PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA384PasswordStorageScheme.java
index 5dc812c..d38f909 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA384PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA384PasswordStorageScheme.java
@@ -193,7 +193,7 @@
     System.arraycopy(saltBytes, 0, hashPlusSalt, digestBytes.length,
                      NUM_SALT_BYTES);
 
-    return ByteString.valueOf(Base64.encode(hashPlusSalt));
+    return ByteString.valueOfUtf8(Base64.encode(hashPlusSalt));
   }
 
 
@@ -251,7 +251,7 @@
                      NUM_SALT_BYTES);
     buffer.append(Base64.encode(hashPlusSalt));
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
@@ -390,7 +390,7 @@
     authPWValue.append('$');
     authPWValue.append(Base64.encode(digestBytes));
 
-    return ByteString.valueOf(authPWValue);
+    return ByteString.valueOfUtf8(authPWValue);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA512PasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA512PasswordStorageScheme.java
index 7a57732..7b92049 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA512PasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SaltedSHA512PasswordStorageScheme.java
@@ -192,7 +192,7 @@
     System.arraycopy(saltBytes, 0, hashPlusSalt, digestBytes.length,
                      NUM_SALT_BYTES);
 
-    return ByteString.valueOf(Base64.encode(hashPlusSalt));
+    return ByteString.valueOfUtf8(Base64.encode(hashPlusSalt));
   }
 
 
@@ -250,7 +250,7 @@
                      NUM_SALT_BYTES);
     buffer.append(Base64.encode(hashPlusSalt));
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
@@ -389,7 +389,7 @@
     authPWValue.append('$');
     authPWValue.append(Base64.encode(digestBytes));
 
-    return ByteString.valueOf(authPWValue);
+    return ByteString.valueOfUtf8(authPWValue);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java
index e69d3d1..9acf916 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java
@@ -180,7 +180,7 @@
     X500Principal peerPrincipal = peerCertificate.getSubjectX500Principal();
     String peerName = peerPrincipal.getName(X500Principal.RFC2253);
     SearchFilter filter = SearchFilter.createEqualityFilter(
-        subjectAttributeType, ByteString.valueOf(peerName));
+        subjectAttributeType, ByteString.valueOfUtf8(peerName));
 
 
     // If we have an explicit set of base DNs, then use it.  Otherwise, use the
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/TripleDESPasswordStorageScheme.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/TripleDESPasswordStorageScheme.java
index 5ff6d7b..dc0b679 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/TripleDESPasswordStorageScheme.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/TripleDESPasswordStorageScheme.java
@@ -114,7 +114,7 @@
       byte[] encodedBytes = cryptoManager.encrypt(CIPHER_TRANSFORMATION_3DES,
                                                   KEY_SIZE_3DES,
                                                   plaintextBytes);
-      return ByteString.valueOf(Base64.encode(encodedBytes));
+      return ByteString.valueOfUtf8(Base64.encode(encodedBytes));
     }
     catch (Exception e)
     {
@@ -173,7 +173,7 @@
       }
     }
 
-    return ByteString.valueOf(buffer);
+    return ByteString.valueOfUtf8(buffer);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/WhoAmIExtendedOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/WhoAmIExtendedOperation.java
index 5819333..7f4c71e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/WhoAmIExtendedOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/WhoAmIExtendedOperation.java
@@ -146,7 +146,7 @@
       authzID = "dn:" + authzDN;
     }
 
-    operation.setResponseValue(ByteString.valueOf(authzID));
+    operation.setResponseValue(ByteString.valueOfUtf8(authzID));
     operation.addAdditionalLogItem(AdditionalLogItem.quotedKeyValue(
         getClass(), "authzID", authzID));
     operation.setResultCode(ResultCode.SUCCESS);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
index 6ed86d6..daac73e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -659,7 +659,7 @@
     for(AttributeType attributeType : attributeTypes)
     {
       componentFilters.add(SearchFilter.createEqualityFilter(attributeType,
-          ByteString.valueOf(oldEntryDN.toString())));
+          ByteString.valueOfUtf8(oldEntryDN.toString())));
     }
 
     SearchFilter orFilter = SearchFilter.createORFilter(componentFilters);
@@ -746,7 +746,7 @@
     {
       if(e.hasAttribute(type))
       {
-        ByteString value = ByteString.valueOf(oldEntryDN.toString());
+        ByteString value = ByteString.valueOfUtf8(oldEntryDN.toString());
         if (e.hasValue(type, null, value))
         {
           mods.add(new Modification(ModificationType.DELETE, Attributes
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/SdkConnectionAdapter.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/SdkConnectionAdapter.java
index 6f51982..c21c870 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/SdkConnectionAdapter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/SdkConnectionAdapter.java
@@ -21,7 +21,7 @@
  * CDDL HEADER END
  *
  *
- *      Portions Copyright 2013-2014 ForgeRock AS
+ *      Portions Copyright 2013-2015 ForgeRock AS
  */
 package org.opends.server.protocols.http;
 
@@ -254,7 +254,7 @@
   {
     final int messageID = nextMessageID.getAndIncrement();
     return enqueueOperation(new AddOperationBasis(clientConnection, messageID, messageID, to(request.getControls()),
-        valueOf(request.getName()), to(request.getAllAttributes())));
+        valueOfObject(request.getName()), to(request.getAllAttributes())));
   }
 
   /** {@inheritDoc} */
@@ -273,7 +273,7 @@
     String userName = request.getName();
     byte[] password = ((SimpleBindRequest) request).getPassword();
     return enqueueOperation(new BindOperationBasis(clientConnection, messageID, messageID, to(request.getControls()),
-        "3", ByteString.valueOf(userName), ByteString.wrap(password)));
+        "3", ByteString.valueOfUtf8(userName), ByteString.wrap(password)));
   }
 
   /** {@inheritDoc} */
@@ -311,7 +311,7 @@
   {
     final int messageID = nextMessageID.getAndIncrement();
     return enqueueOperation(new CompareOperationBasis(clientConnection, messageID, messageID,
-        to(request.getControls()), valueOf(request.getName()),
+        to(request.getControls()), valueOfObject(request.getName()),
         request.getAttributeDescription().getAttributeType().getOID(),
         request.getAssertionValue()));
   }
@@ -323,7 +323,7 @@
   {
     final int messageID = nextMessageID.getAndIncrement();
     return enqueueOperation(new DeleteOperationBasis(clientConnection, messageID, messageID,
-        to(request.getControls()), valueOf(request.getName())));
+        to(request.getControls()), valueOfObject(request.getName())));
   }
 
   /** {@inheritDoc} */
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
index 39dd7ca..36b89e2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
@@ -666,7 +666,7 @@
   public AddOperation processAdd(String rawEntryDN,
                                  List<RawAttribute> rawAttributes)
   {
-    return processAdd(ByteString.valueOf(rawEntryDN), rawAttributes, null);
+    return processAdd(ByteString.valueOfUtf8(rawEntryDN), rawAttributes, null);
   }
 
 
@@ -879,8 +879,8 @@
   public BindOperation processSimpleBind(String rawBindDN,
                                          String password)
   {
-    return processSimpleBind(ByteString.valueOf(rawBindDN),
-        ByteString.valueOf(password), null);
+    return processSimpleBind(ByteString.valueOfUtf8(rawBindDN),
+        ByteString.valueOfUtf8(password), null);
   }
 
 
@@ -903,8 +903,8 @@
                                          String password,
                                          List<Control> controls)
   {
-    return processSimpleBind(ByteString.valueOf(rawBindDN),
-        ByteString.valueOf(password), controls);
+    return processSimpleBind(ByteString.valueOfUtf8(rawBindDN),
+        ByteString.valueOfUtf8(password), controls);
   }
 
 
@@ -1137,8 +1137,8 @@
                                          String attributeType,
                                          String assertionValue)
   {
-    return processCompare(ByteString.valueOf(rawEntryDN), attributeType,
-        ByteString.valueOf(assertionValue), null);
+    return processCompare(ByteString.valueOfUtf8(rawEntryDN), attributeType,
+        ByteString.valueOfUtf8(assertionValue), null);
   }
 
 
@@ -1164,8 +1164,8 @@
                                          String assertionValue,
                                          List<Control> controls)
   {
-    return processCompare(ByteString.valueOf(rawEntryDN), attributeType,
-        ByteString.valueOf(assertionValue), controls);
+    return processCompare(ByteString.valueOfUtf8(rawEntryDN), attributeType,
+        ByteString.valueOfUtf8(assertionValue), controls);
   }
 
 
@@ -1296,7 +1296,7 @@
    */
   public DeleteOperation processDelete(String rawEntryDN)
   {
-    return processDelete(ByteString.valueOf(rawEntryDN), null);
+    return processDelete(ByteString.valueOfUtf8(rawEntryDN), null);
   }
 
 
@@ -1316,7 +1316,7 @@
   public DeleteOperation processDelete(String rawEntryDN,
                                        List<Control> controls)
   {
-    return processDelete(ByteString.valueOf(rawEntryDN), controls);
+    return processDelete(ByteString.valueOfUtf8(rawEntryDN), controls);
   }
 
 
@@ -1494,7 +1494,7 @@
   public ModifyOperation processModify(String rawEntryDN,
                               List<RawModification> rawModifications)
   {
-    return processModify(ByteString.valueOf(rawEntryDN),
+    return processModify(ByteString.valueOfUtf8(rawEntryDN),
                          rawModifications, null);
   }
 
@@ -1519,7 +1519,7 @@
                               List<RawModification> rawModifications,
                               List<Control> controls)
   {
-    return processModify(ByteString.valueOf(rawEntryDN),
+    return processModify(ByteString.valueOfUtf8(rawEntryDN),
                          rawModifications, controls);
   }
 
@@ -1662,8 +1662,8 @@
                                            String rawNewRDN,
                                            boolean deleteOldRDN)
   {
-    return processModifyDN(ByteString.valueOf(rawEntryDN),
-        ByteString.valueOf(rawNewRDN),
+    return processModifyDN(ByteString.valueOfUtf8(rawEntryDN),
+        ByteString.valueOfUtf8(rawNewRDN),
                            deleteOldRDN, null, null);
   }
 
@@ -1689,8 +1689,8 @@
                                            boolean deleteOldRDN,
                                            List<Control> controls)
   {
-    return processModifyDN(ByteString.valueOf(rawEntryDN),
-        ByteString.valueOf(rawNewRDN),
+    return processModifyDN(ByteString.valueOfUtf8(rawEntryDN),
+        ByteString.valueOfUtf8(rawNewRDN),
                            deleteOldRDN, null, controls);
   }
 
@@ -1740,9 +1740,9 @@
                                            boolean deleteOldRDN,
                                            String rawNewSuperior)
   {
-    return processModifyDN(ByteString.valueOf(rawEntryDN),
-        ByteString.valueOf(rawNewRDN), deleteOldRDN,
-        ByteString.valueOf(rawNewSuperior), null);
+    return processModifyDN(ByteString.valueOfUtf8(rawEntryDN),
+        ByteString.valueOfUtf8(rawNewRDN), deleteOldRDN,
+        ByteString.valueOfUtf8(rawNewSuperior), null);
   }
 
 
@@ -1771,9 +1771,9 @@
                                            String rawNewSuperior,
                                            List<Control> controls)
   {
-    return processModifyDN(ByteString.valueOf(rawEntryDN),
-        ByteString.valueOf(rawNewRDN), deleteOldRDN,
-        ByteString.valueOf(rawNewSuperior), controls);
+    return processModifyDN(ByteString.valueOfUtf8(rawEntryDN),
+        ByteString.valueOfUtf8(rawNewRDN), deleteOldRDN,
+        ByteString.valueOfUtf8(rawNewSuperior), controls);
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiAuthenticator.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiAuthenticator.java
index d915f42..1753017 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiAuthenticator.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiAuthenticator.java
@@ -200,7 +200,7 @@
     }
 
     ArrayList<Control> requestControls = new ArrayList<>();
-    ByteString bindPW = password != null ? ByteString.valueOf(password) : null;
+    ByteString bindPW = password != null ? ByteString.valueOfUtf8(password) : null;
 
     AuthenticationInfo authInfo = new AuthenticationInfo();
     JmxClientConnection jmxClientConnection = new JmxClientConnection(
@@ -210,7 +210,7 @@
         jmxClientConnection.nextOperationID(),
         jmxClientConnection.nextMessageID(), requestControls,
         jmxConnectionHandler.getRMIConnector().getProtocolVersion(),
-        ByteString.valueOf(authcID), bindPW);
+        ByteString.valueOfUtf8(authcID), bindPW);
 
     bindOp.run();
     if (bindOp.getResultCode() == ResultCode.SUCCESS)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java
index b9b4a95..09cf9fa 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java
@@ -81,7 +81,7 @@
   {
     this.attributeType = attributeType;
 
-    values = newArrayList(ByteString.valueOf(value));
+    values = newArrayList(ByteString.valueOfUtf8(value));
   }
 
 
@@ -120,7 +120,7 @@
       this.values = new ArrayList<>(values.size());
       for (String value : values)
       {
-        this.values.add(ByteString.valueOf(value));
+        this.values.add(ByteString.valueOfUtf8(value));
       }
     }
   }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java
index 51536bd..8d9e683 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java
@@ -212,7 +212,7 @@
     final ArrayList<ByteString> values = new ArrayList<>(0);
     for (CSN csn : serverIdToCSN.values())
     {
-      values.add(ByteString.valueOf(csn.toString()));
+      values.add(ByteString.valueOfUtf8(csn.toString()));
     }
     return values;
   }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
index 315a364..e1eb2e7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
@@ -146,7 +146,7 @@
       if (token.length == 4)
       {
         stringValue = token[3];
-        attributeValue = ByteString.valueOf(stringValue);
+        attributeValue = ByteString.valueOfUtf8(stringValue);
       }
       else
       {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
index 368fe7e..752aba2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -2125,7 +2125,7 @@
     try
     {
       filter = LDAPFilter.createEqualityFilter(DS_SYNC_CONFLICT,
-          ByteString.valueOf(freedDN.toString())).toSearchFilter();
+          ByteString.valueOfUtf8(freedDN.toString())).toSearchFilter();
     }
     catch (DirectoryException e)
     {
@@ -3190,7 +3190,7 @@
   private ResultCode runSaveGenerationId(DN entryDN, long generationId)
   {
     // The generationId is stored in the root entry of the domain.
-    final ByteString asn1BaseDn = ByteString.valueOf(entryDN.toString());
+    final ByteString asn1BaseDn = ByteString.valueOfUtf8(entryDN.toString());
 
     LDAPAttribute attr = new LDAPAttribute(REPLICATION_GENERATION_ID, Long.toString(generationId));
     List<RawModification> mods = new ArrayList<>(1);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PersistentServerState.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PersistentServerState.java
index da275e7..a9d1f93 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PersistentServerState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PersistentServerState.java
@@ -269,7 +269,7 @@
 
     ModifyOperationBasis op = new ModifyOperationBasis(getRootConnection(),
           nextOperationID(), nextMessageID(), null,
-          ByteString.valueOf(serverStateEntryDN.toString()),
+          ByteString.valueOfUtf8(serverStateEntryDN.toString()),
           Collections.singletonList(mod));
     op.setInternalOperation(true);
     op.setSynchronizationOperation(true);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AddMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AddMsg.java
index eaaf121..be94340 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AddMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AddMsg.java
@@ -174,7 +174,7 @@
     AddOperation add =  new AddOperationBasis(connection,
         InternalClientConnection.nextOperationID(),
         InternalClientConnection.nextMessageID(), null,
-        ByteString.valueOf(newDN.toString()), attr);
+        ByteString.valueOfUtf8(newDN.toString()), attr);
     AddContext ctx = new AddContext(getCSN(), getEntryUUID(), parentEntryUUID);
     add.setAttachment(SYNCHROCONTEXT, ctx);
     return add;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyDNMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyDNMsg.java
index 3be70cb..835c574 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyDNMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyDNMsg.java
@@ -156,10 +156,10 @@
     ModifyDNOperation moddn =  new ModifyDNOperationBasis(connection,
         InternalClientConnection.nextOperationID(),
         InternalClientConnection.nextMessageID(), null,
-        ByteString.valueOf(newDN.toString()),
-        ByteString.valueOf(newRDN),
+        ByteString.valueOfUtf8(newDN.toString()),
+        ByteString.valueOfUtf8(newRDN),
         deleteOldRdn,
-        (newSuperior == null ? null : ByteString.valueOf(newSuperior)));
+        (newSuperior == null ? null : ByteString.valueOfUtf8(newSuperior)));
 
     for (Modification mod : decodeMods(encodedMods))
     {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyMsg.java
index 06b5fcd..33f2c80 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyMsg.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2011-2014 ForgeRock AS
+ *      Portions Copyright 2011-2015 ForgeRock AS
  */
 package org.opends.server.replication.protocol;
 
@@ -133,7 +133,7 @@
     ModifyOperation mod = new ModifyOperationBasis(connection,
         InternalClientConnection.nextOperationID(),
         InternalClientConnection.nextMessageID(), null,
-        ByteString.valueOf(newDN.toString()), ldapmods);
+        ByteString.valueOfUtf8(newDN.toString()), ldapmods);
     ModifyContext ctx = new ModifyContext(getCSN(), getEntryUUID());
     mod.setAttachment(SYNCHROCONTEXT, ctx);
     return mod;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java
index 55bfe16..da04dee 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java
@@ -201,7 +201,7 @@
         dataRemaining -= distanceToBlockStart;
       }
       // append the offset to the record
-      writer.write(ByteString.valueOf(cumulatedDistanceToBeginning));
+      writer.write(ByteString.valueOfInt(cumulatedDistanceToBeginning));
 
       // next step
       distanceToBlockStart = dataSizeForOneBlock;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeSyntax.java
index 478169e..d42e919 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeSyntax.java
@@ -235,7 +235,7 @@
    */
   public static ByteString createGeneralizedTimeValue(long time)
   {
-    return ByteString.valueOf(format(time));
+    return ByteString.valueOfUtf8(format(time));
   }
 
   /**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
index 40d4b68..dfb0fde 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
@@ -484,7 +484,7 @@
           List<String> entries = new LinkedList<>();
           for (String v : values)
           {
-            ByteString entry = ByteString.valueOf(v);
+            ByteString entry = ByteString.valueOfUtf8(v);
             if (entries.contains(entry))
             {
               throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/UserPasswordEqualityMatchingRule.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/UserPasswordEqualityMatchingRule.java
index fc3d820..e3da750 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/UserPasswordEqualityMatchingRule.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/UserPasswordEqualityMatchingRule.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2008 Sun Microsystems, Inc.
- *      Portions Copyright 2014 ForgeRock AS
+ *      Portions Copyright 2014-2015 ForgeRock AS
  */
 package org.opends.server.schema;
 
@@ -73,7 +73,7 @@
 
     // We support the scheme, so make the determination.
     return ConditionResult.valueOf(
-        storageScheme.passwordMatches(assertionValue, ByteString.valueOf(userPWComponents[1])));
+        storageScheme.passwordMatches(assertionValue, ByteString.valueOfUtf8(userPWComponents[1])));
   }
 
 }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java
index a587794..33306a2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java
@@ -241,7 +241,7 @@
     ArrayList<RawModification> modList = CollectionUtils.<RawModification> newArrayList(m);
 
     String backendDNString = configEntryDN.toString();
-    ByteString rawEntryDN = ByteString.valueOf(backendDNString);
+    ByteString rawEntryDN = ByteString.valueOfUtf8(backendDNString);
     ModifyOperation internalModify = getRootConnection().processModify(rawEntryDN, modList);
 
     ResultCode resultCode = internalModify.getResultCode();
@@ -284,7 +284,7 @@
     ArrayList<RawModification> modList = CollectionUtils.<RawModification> newArrayList(m);
 
     String backendDNString = configEntryDN.toString();
-    ByteString rawEntryDN = ByteString.valueOf(backendDNString);
+    ByteString rawEntryDN = ByteString.valueOfUtf8(backendDNString);
     ModifyOperation internalModify = getRootConnection().processModify(rawEntryDN, modList);
 
     ResultCode resultCode = internalModify.getResultCode();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java
index 7d3cd75..28aec95 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java
@@ -336,12 +336,12 @@
     if (encodedPassword.hasValue())
     {
       compareMode = true;
-      encodedPW = ByteString.valueOf(encodedPassword.getValue());
+      encodedPW = ByteString.valueOfUtf8(encodedPassword.getValue());
     }
     else if (encodedPasswordFile.hasValue())
     {
       compareMode = true;
-      encodedPW = ByteString.valueOf(encodedPasswordFile.getValue());
+      encodedPW = ByteString.valueOfUtf8(encodedPasswordFile.getValue());
     }
     else
     {
@@ -577,7 +577,7 @@
         }
         boolean passwordMatches =
             storageScheme.passwordMatches(clearPW, ByteString
-                .valueOf(encodedPWString));
+                .valueOfUtf8(encodedPWString));
         out.println(getOutputMessage(passwordMatches));
         if (useCompareResultCode.isPresent())
         {
@@ -823,11 +823,11 @@
   {
     if (clearPassword.hasValue())
     {
-      return ByteString.valueOf(clearPassword.getValue());
+      return ByteString.valueOfUtf8(clearPassword.getValue());
     }
     else if (clearPasswordFile.hasValue())
     {
-      return ByteString.valueOf(clearPasswordFile.getValue());
+      return ByteString.valueOfUtf8(clearPasswordFile.getValue());
     }
     else if (interactivePassword.isPresent())
     {
@@ -838,7 +838,7 @@
         String pwd2 = encodePassword.getPassword(INFO_ENCPW_INPUT_PWD_2.get().toString());
         if (pwd1.equals(pwd2))
         {
-          return ByteString.valueOf(pwd1);
+          return ByteString.valueOfUtf8(pwd1);
         }
         else
         {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java
index 47c51ff..26a03ef 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java
@@ -567,7 +567,7 @@
     }
     else
     {
-      saslCredentials = ByteString.valueOf(trace);
+      saslCredentials = ByteString.valueOfUtf8(trace);
     }
 
     BindRequestProtocolOp bindRequest =
@@ -908,7 +908,7 @@
     // Create and send the second bind request to the server.
     BindRequestProtocolOp bindRequest2 =
          new BindRequestProtocolOp(bindDN.toByteString(),
-             SASL_MECHANISM_CRAM_MD5, ByteString.valueOf(buffer.toString()));
+             SASL_MECHANISM_CRAM_MD5, ByteString.valueOfUtf8(buffer.toString()));
     LDAPMessage requestMessage2 =
          new LDAPMessage(nextMessageID.getAndIncrement(), bindRequest2,
                          requestControls);
@@ -1652,7 +1652,7 @@
     BindRequestProtocolOp bindRequest2 =
          new BindRequestProtocolOp(bindDN.toByteString(),
              SASL_MECHANISM_DIGEST_MD5,
-             ByteString.valueOf(credBuffer.toString()));
+             ByteString.valueOfUtf8(credBuffer.toString()));
     LDAPMessage requestMessage2 =
          new LDAPMessage(nextMessageID.getAndIncrement(), bindRequest2,
                          requestControls);
@@ -2874,7 +2874,7 @@
     credBuffer.append(bindPassword.toString());
 
     ByteString saslCredentials =
-        ByteString.valueOf(credBuffer.toString());
+        ByteString.valueOfUtf8(credBuffer.toString());
     BindRequestProtocolOp bindRequest =
          new BindRequestProtocolOp(bindDN.toByteString(), SASL_MECHANISM_PLAIN,
                                 saslCredentials);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java
index 45630c0..f1fa730 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java
@@ -224,7 +224,7 @@
           throws IOException, LDAPException
   {
     ArrayList<Control> controls = compareOptions.getControls();
-    ByteString dnOctetStr = ByteString.valueOf(line);
+    ByteString dnOctetStr = ByteString.valueOfUtf8(line);
     ByteString attrValOctetStr = ByteString.wrap(attributeVal);
 
     ProtocolOp protocolOp = new CompareRequestProtocolOp(dnOctetStr,
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java
index d50b821..01f6db0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java
@@ -299,7 +299,7 @@
       }
       else
       {
-        bindDNBytes = ByteString.valueOf(bindDN);
+        bindDNBytes = ByteString.valueOfUtf8(bindDN);
       }
 
       ByteString bindPW;
@@ -309,7 +309,7 @@
       }
       else
       {
-        bindPW = ByteString.valueOf(bindPassword);
+        bindPW = ByteString.valueOfUtf8(bindPassword);
       }
 
       String result = null;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java
index 9c0513a..2925fba 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java
@@ -173,7 +173,7 @@
   {
     ArrayList<Control> controls = deleteOptions.getControls();
     ProtocolOp protocolOp = null;
-    ByteString asn1OctetStr = ByteString.valueOf(line);
+    ByteString asn1OctetStr = ByteString.valueOfUtf8(line);
 
     protocolOp = new DeleteRequestProtocolOp(asn1OctetStr);
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java
index eb43313..72a3669 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java
@@ -244,7 +244,7 @@
 
       ProtocolOp protocolOp = null;
       ByteString asn1OctetStr =
-          ByteString.valueOf(entry.getDN().toString());
+          ByteString.valueOfUtf8(entry.getDN().toString());
 
       String operationType = "";
       switch(entry.getChangeOperationType())
@@ -280,14 +280,14 @@
           if(modDNEntry.getNewSuperiorDN() != null)
           {
             protocolOp = new ModifyDNRequestProtocolOp(asn1OctetStr,
-                ByteString.valueOf(modDNEntry.getNewRDN().toString()),
+                ByteString.valueOfUtf8(modDNEntry.getNewRDN().toString()),
                  modDNEntry.deleteOldRDN(),
-                ByteString.valueOf(
+                ByteString.valueOfUtf8(
                           modDNEntry.getNewSuperiorDN().toString()));
           } else
           {
             protocolOp = new ModifyDNRequestProtocolOp(asn1OctetStr,
-                ByteString.valueOf(modDNEntry.getNewRDN().toString()),
+                ByteString.valueOfUtf8(modDNEntry.getNewRDN().toString()),
                  modDNEntry.deleteOldRDN());
           }
 
@@ -987,7 +987,7 @@
     {
       Control proxyControl =
           new ProxiedAuthV2Control(true,
-              ByteString.valueOf(proxyAuthzID.getValue()));
+              ByteString.valueOfUtf8(proxyAuthzID.getValue()));
       modifyOptions.getControls().add(proxyControl);
     }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java
index 27f283d..2adedf2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java
@@ -138,7 +138,7 @@
 
     for (LDAPFilter filter: filters)
     {
-      ByteString asn1OctetStr = ByteString.valueOf(baseDN);
+      ByteString asn1OctetStr = ByteString.valueOfUtf8(baseDN);
 
       SearchRequestProtocolOp protocolOp =
         new SearchRequestProtocolOp(asn1OctetStr,
@@ -1267,7 +1267,7 @@
     {
       Control proxyControl =
           new ProxiedAuthV2Control(true,
-              ByteString.valueOf(proxyAuthzID.getValue()));
+              ByteString.valueOfUtf8(proxyAuthzID.getValue()));
       searchOptions.getControls().add(proxyControl);
     }
 
@@ -1459,7 +1459,7 @@
         {
           int beforeCount = Integer.parseInt(tokenizer.nextToken());
           int afterCount  = Integer.parseInt(tokenizer.nextToken());
-          ByteString assertionValue = ByteString.valueOf(tokenizer.nextToken());
+          ByteString assertionValue = ByteString.valueOfUtf8(tokenizer.nextToken());
           searchOptions.getControls().add(
               new VLVRequestControl(beforeCount, afterCount, assertionValue));
         }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolUtils.java
index c7c1bf0..63286b8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolUtils.java
@@ -171,7 +171,7 @@
     if(valString.charAt(0) == ':')
     {
       controlValue =
-          ByteString.valueOf(valString.substring(1, valString.length()));
+          ByteString.valueOfUtf8(valString.substring(1, valString.length()));
     } else if(valString.charAt(0) == '<')
     {
       // Read data from the file.
@@ -187,7 +187,7 @@
       }
     } else
     {
-      controlValue = ByteString.valueOf(valString);
+      controlValue = ByteString.valueOfUtf8(valString);
     }
 
     return new LDAPControl(controlOID, controlCriticality, controlValue);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
index 45cf731..b763471 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
@@ -596,7 +596,7 @@
     // Construct the add request to send to the server.
     String taskID = UUID.randomUUID().toString();
     ByteString entryDN =
-        ByteString.valueOf(ATTR_TASK_ID + "=" + taskID + "," +
+        ByteString.valueOfUtf8(ATTR_TASK_ID + "=" + taskID + "," +
                             SCHEDULED_TASK_BASE_RDN + "," + DN_TASK_ROOT);
 
     ArrayList<RawAttribute> attributes = new ArrayList<>();
@@ -624,7 +624,7 @@
     if (proxyAuthzID.isPresent())
     {
       controls.add(new ProxiedAuthV2Control(
-          ByteString.valueOf(proxyAuthzID.getValue())));
+          ByteString.valueOfUtf8(proxyAuthzID.getValue())));
     }
 
     AddRequestProtocolOp addRequest = new AddRequestProtocolOp(entryDN, attributes);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalUserData.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalUserData.java
index 418ce1a..c5fbfbb 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalUserData.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalUserData.java
@@ -229,7 +229,7 @@
         while (values.hasMore())
         {
           Object v = values.next();
-          rawValues.add(ByteString.valueOf(v.toString()));
+          rawValues.add(ByteString.valueOfUtf8(v.toString()));
         }
         RawAttribute rAttr = RawAttribute.create(attr.getID(), rawValues);
         rawAttrs.add(rAttr);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
index 8b7aac9..316412a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
@@ -153,7 +153,7 @@
           return null;
         }
 
-        rdn = new RDN(t, ByteString.valueOf(v.getValue().toString()));
+        rdn = new RDN(t, ByteString.valueOfUtf8(v.getValue().toString()));
       }
       else
       {
@@ -169,7 +169,7 @@
           }
 
           names[i]  = t.getPrimaryName();
-          values[i] = ByteString.valueOf(v.getValue().toString());
+          values[i] = ByteString.valueOfUtf8(v.getValue().toString());
         }
 
         rdn = new RDN(rdnAttrs, names, values);
@@ -309,7 +309,7 @@
         AttributeBuilder base64Builder = null;
         for (TemplateValue v : valueList)
         {
-          ByteString value = ByteString.valueOf(v.getValue().toString());
+          ByteString value = ByteString.valueOfUtf8(v.getValue().toString());
           builder.add(value);
           if (v.getTemplateLine().isURL())
           {
@@ -350,7 +350,7 @@
     // First, write the DN.  It will always be included.
     StringBuilder dnLine = new StringBuilder("dn");
     appendLDIFSeparatorAndValue(dnLine,
-        ByteString.valueOf(getDN().toString()));
+        ByteString.valueOfUtf8(getDN().toString()));
     writeLDIFLine(dnLine, writer, wrapLines, wrapColumn);
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java
index 2f97eeb..fc277ea 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java
@@ -266,7 +266,7 @@
     ArrayList<Control> controls = new ArrayList<>();
     ArrayList<RawAttribute> attributes = getTaskAttributes(information);
 
-    ByteString entryDN = ByteString.valueOf(getTaskDN(attributes));
+    ByteString entryDN = ByteString.valueOfUtf8(getTaskDN(attributes));
     AddRequestProtocolOp addRequest = new AddRequestProtocolOp(entryDN, attributes);
     LDAPMessage requestMessage =
          new LDAPMessage(nextMessageID.getAndIncrement(), addRequest, controls);
@@ -316,7 +316,7 @@
     List<Entry> entries = new ArrayList<>();
 
     writeSearch(new SearchRequestProtocolOp(
-        ByteString.valueOf(ConfigConstants.DN_TASK_ROOT),
+        ByteString.valueOfUtf8(ConfigConstants.DN_TASK_ROOT),
             SearchScope.WHOLE_SUBTREE,
             DereferenceAliasesPolicy.NEVER,
             Integer.MAX_VALUE,
@@ -368,7 +368,7 @@
     Entry entry = null;
 
     writeSearch(new SearchRequestProtocolOp(
-        ByteString.valueOf(ConfigConstants.DN_TASK_ROOT),
+        ByteString.valueOfUtf8(ConfigConstants.DN_TASK_ROOT),
             SearchScope.WHOLE_SUBTREE,
             DereferenceAliasesPolicy.NEVER,
             Integer.MAX_VALUE,
@@ -422,7 +422,7 @@
     if (state != null) {
       if (!TaskState.isDone(state)) {
 
-        ByteString dn = ByteString.valueOf(entry.getDN().toString());
+        ByteString dn = ByteString.valueOfUtf8(entry.getDN().toString());
 
         ArrayList<RawModification> mods = new ArrayList<>();
 
@@ -468,7 +468,7 @@
         }
       } else if (TaskState.isRecurring(state)) {
 
-        ByteString dn = ByteString.valueOf(entry.getDN().toString());
+        ByteString dn = ByteString.valueOfUtf8(entry.getDN().toString());
         DeleteRequestProtocolOp deleteRequest =
           new DeleteRequestProtocolOp(dn);
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java
index 4fd6eba..4438939 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java
@@ -696,7 +696,7 @@
     Assertion assertion;
     try
     {
-      assertion = mrule.getAssertion(ByteString.valueOf(oid));
+      assertion = mrule.getAssertion(ByteString.valueOfUtf8(oid));
       for (final ByteString value : attribute)
       {
         final ByteString nvalue = mrule.normalizeAttributeValue(value);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java b/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
index b09c187..2d80a1b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
@@ -1107,7 +1107,7 @@
    */
   public boolean add(String valueString)
   {
-    return add(ByteString.valueOf(valueString));
+    return add(ByteString.valueOfUtf8(valueString));
   }
 
 
@@ -1339,7 +1339,7 @@
    */
   public boolean remove(String valueString)
   {
-    return remove(ByteString.valueOf(valueString));
+    return remove(ByteString.valueOfUtf8(valueString));
   }
 
 
@@ -1413,7 +1413,7 @@
    */
   public void replace(String valueString)
   {
-    replace(ByteString.valueOf(valueString));
+    replace(ByteString.valueOfUtf8(valueString));
   }
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java
index d119413..1eeb58b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java
@@ -148,7 +148,7 @@
    */
   public static Attribute create(AttributeType attributeType, String name, String valueString)
   {
-    return create(attributeType, name, ByteString.valueOf(valueString));
+    return create(attributeType, name, ByteString.valueOfUtf8(valueString));
   }
 
   /**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
index c593a38..3a404d0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
@@ -3788,7 +3788,7 @@
 
     // First, append the DN.
     StringBuilder dnLine = new StringBuilder("dn");
-    appendLDIFSeparatorAndValue(dnLine, ByteString.valueOf(dn.toString()));
+    appendLDIFSeparatorAndValue(dnLine, ByteString.valueOfUtf8(dn.toString()));
     ldifLines.add(dnLine);
 
     // Next, add the set of objectclasses.
@@ -3900,7 +3900,7 @@
 
     // First, write the DN.  It will always be included.
     StringBuilder dnLine = new StringBuilder("dn");
-    appendLDIFSeparatorAndValue(dnLine, ByteString.valueOf(dn.toString()));
+    appendLDIFSeparatorAndValue(dnLine, ByteString.valueOfUtf8(dn.toString()));
     LDIFWriter.writeLDIFLine(dnLine, writer, wrapLines, wrapColumn);
 
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
index 89e4e2a..831e752 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
@@ -1953,7 +1953,7 @@
   private AttributeType recreateFromDefinition(AttributeType attrType)
       throws DirectoryException
   {
-    ByteString value = ByteString.valueOf(attrType.toString());
+    ByteString value = ByteString.valueOfUtf8(attrType.toString());
     AttributeType copy =
         AttributeTypeSyntax.decodeAttributeType(value, this, false);
     setSchemaFile(copy, getSchemaFile(attrType));
@@ -1967,7 +1967,7 @@
   private DITContentRule recreateFromDefinition(DITContentRule dcr)
       throws DirectoryException
   {
-    ByteString value = ByteString.valueOf(dcr.toString());
+    ByteString value = ByteString.valueOfUtf8(dcr.toString());
     DITContentRule copy =
         DITContentRuleSyntax.decodeDITContentRule(value, this, false);
     setSchemaFile(copy, getSchemaFile(dcr));
@@ -1977,7 +1977,7 @@
   private DITStructureRule recreateFromDefinition(DITStructureRule dsr)
       throws DirectoryException
   {
-    ByteString value = ByteString.valueOf(dsr.toString());
+    ByteString value = ByteString.valueOfUtf8(dsr.toString());
     DITStructureRule copy =
         DITStructureRuleSyntax.decodeDITStructureRule(value, this, false);
     setSchemaFile(copy, getSchemaFile(dsr));
@@ -1987,7 +1987,7 @@
   private MatchingRuleUse recreateFromDefinition(MatchingRuleUse mru)
       throws DirectoryException
   {
-    ByteString value = ByteString.valueOf(mru.toString());
+    ByteString value = ByteString.valueOfUtf8(mru.toString());
     MatchingRuleUse copy =
         MatchingRuleUseSyntax.decodeMatchingRuleUse(value, this, false);
     setSchemaFile(copy, getSchemaFile(mru));
@@ -1997,7 +1997,7 @@
   private NameForm recreateFromDefinition(NameForm nf)
       throws DirectoryException
   {
-    ByteString value = ByteString.valueOf(nf.toString());
+    ByteString value = ByteString.valueOfUtf8(nf.toString());
     NameForm copy = NameFormSyntax.decodeNameForm(value, this, false);
     setSchemaFile(copy, getSchemaFile(nf));
     return copy;
@@ -2006,7 +2006,7 @@
   private ObjectClass recreateFromDefinition(ObjectClass oc)
       throws DirectoryException
   {
-    ByteString value = ByteString.valueOf(oc.toString());
+    ByteString value = ByteString.valueOfUtf8(oc.toString());
     ObjectClass copy = ObjectClassSyntax.decodeObjectClass(value, this, false);
     setSchemaFile(copy, getSchemaFile(oc));
     return copy;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/BSDMD5Crypt.java b/opendj-server-legacy/src/main/java/org/opends/server/util/BSDMD5Crypt.java
index f3fe212..087a597 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/BSDMD5Crypt.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/BSDMD5Crypt.java
@@ -272,11 +272,11 @@
     {
       if (argv.length == 2)
       {
-        System.out.println(BSDMD5Crypt.crypt(ByteString.valueOf(argv[0]),
+        System.out.println(BSDMD5Crypt.crypt(ByteString.valueOfUtf8(argv[0]),
                 argv[1]));
       } else
       {
-        System.out.println(BSDMD5Crypt.crypt(ByteString.valueOf(argv[0])));
+        System.out.println(BSDMD5Crypt.crypt(ByteString.valueOfUtf8(argv[0])));
       }
     } catch (Exception e)
     {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
index 9d38445..2776517 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
@@ -1592,7 +1592,7 @@
         // The rest of the line should be the value. Skip over any
         // spaces and take the rest of the line as the value.
         int pos = findFirstNonSpaceCharPosition(line, colonPos + 1);
-        value = ByteString.valueOf(line.substring(pos));
+        value = ByteString.valueOfUtf8(line.substring(pos));
       }
     }
     return value;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java
index c6b6dea..faef2ba 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java
@@ -644,7 +644,7 @@
 
     // Write the newRDN element.
     StringBuilder rdnLine = new StringBuilder("newrdn");
-    appendLDIFSeparatorAndValue(rdnLine, ByteString.valueOf(newRDN.toString()));
+    appendLDIFSeparatorAndValue(rdnLine, ByteString.valueOfUtf8(newRDN.toString()));
     writeLDIFLine(rdnLine, writer, wrapLines, wrapColumn);
 
 
@@ -668,7 +668,7 @@
       boolean wrapLines, int wrapColumn) throws IOException
   {
     final StringBuilder newLine = new StringBuilder(attrType);
-    appendLDIFSeparatorAndValue(newLine, ByteString.valueOf(dn.toString()));
+    appendLDIFSeparatorAndValue(newLine, ByteString.valueOfUtf8(dn.toString()));
     writeLDIFLine(newLine, writer, wrapLines, wrapColumn);
   }
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/ServerConstants.java b/opendj-server-legacy/src/main/java/org/opends/server/util/ServerConstants.java
index 558b25d..825edbb 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/ServerConstants.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/ServerConstants.java
@@ -3135,17 +3135,17 @@
   /**
    * The value representing just one space character.
    */
-  public static final ByteString SINGLE_SPACE_VALUE = ByteString.valueOf(" ");
+  public static final ByteString SINGLE_SPACE_VALUE = ByteString.valueOfUtf8(" ");
 
   /**
    * The normalized true value.
    */
-  public static final ByteString TRUE_VALUE = ByteString.valueOf("TRUE");
+  public static final ByteString TRUE_VALUE = ByteString.valueOfUtf8("TRUE");
 
   /**
    * The normalized false value.
    */
-  public static final ByteString FALSE_VALUE = ByteString.valueOf("FALSE");
+  public static final ByteString FALSE_VALUE = ByteString.valueOfUtf8("FALSE");
 
   /**
    * The root Dn for the external change log.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
index 580a262..12c4d2f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -1166,7 +1166,7 @@
     } else {
       String[] components = UserPasswordSyntax.decodeUserPassword(av.toString());
       PasswordStorageScheme<?> scheme = DirectoryServer.getPasswordStorageScheme(toLowerCase(components[0]));
-      return scheme != null && scheme.passwordMatches(val, ByteString.valueOf(components[1]));
+      return scheme != null && scheme.passwordMatches(val, ByteString.valueOfUtf8(components[1]));
     }
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java b/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
index bc4424f..249475d 100644
--- a/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
@@ -117,7 +117,7 @@
             entry.addControl(control);
         }
         entry.addAttribute(new LinkedAttribute("test", "value1"));
-        entry.addAttribute(new LinkedAttribute("Another", ByteString.valueOf("myValue")));
+        entry.addAttribute(new LinkedAttribute("Another", ByteString.valueOfUtf8("myValue")));
 
         SearchResultEntry result = to(entry);
         assertThat(result.getName().toString()).isEqualTo(entry.getName().toString());
@@ -135,7 +135,7 @@
             new LinkedHashMapEntry(org.forgerock.opendj.ldap.DN
                 .valueOf("uid=scarter,ou=People,dc=example,dc=com"));
         entry.addAttribute(new LinkedAttribute("test", "value1"));
-        entry.addAttribute(new LinkedAttribute("Another", ByteString.valueOf("myValue")));
+        entry.addAttribute(new LinkedAttribute("Another", ByteString.valueOfUtf8("myValue")));
 
         org.opends.server.types.Entry result = to(entry);
         assertThat(result.getName().toString()).isEqualTo(entry.getName().toString());
@@ -255,7 +255,7 @@
         assertThat(srvAttribute.getValues().get(0).toString()).isEqualTo("value1");
 
         org.forgerock.opendj.ldap.Attribute attribute2 =
-                new LinkedAttribute("Another", ByteString.valueOf("myValue"));
+                new LinkedAttribute("Another", ByteString.valueOfUtf8("myValue"));
 
         org.opends.server.types.RawAttribute srvAttribute2 = to(attribute2);
         assertThat(srvAttribute2.getAttributeType()).isEqualTo("Another");
@@ -273,7 +273,7 @@
         assertThat(srvAttribute.iterator().next().toString()).isEqualTo("value1");
 
         org.forgerock.opendj.ldap.Attribute attribute2 =
-                new LinkedAttribute("Another", ByteString.valueOf("myValue"));
+                new LinkedAttribute("Another", ByteString.valueOfUtf8("myValue"));
 
         org.opends.server.types.Attribute srvAttribute2 = toAttribute(attribute2);
         assertThat(srvAttribute2.getAttributeType().getNameOrOID()).isEqualTo("Another");
@@ -344,8 +344,8 @@
     @Test
     public final void testToRawModification() {
         org.forgerock.opendj.ldap.Attribute attribute =
-                new LinkedAttribute("test", ByteString.valueOf("value1"), ByteString
-                        .valueOf("value2"));
+                new LinkedAttribute("test", ByteString.valueOfUtf8("value1"), ByteString
+                        .valueOfUtf8("value2"));
 
         Modification mod = new Modification(ModificationType.ADD, attribute);
 
@@ -362,8 +362,8 @@
     @Test
     public final void testToModification() {
         org.forgerock.opendj.ldap.Attribute attribute =
-                new LinkedAttribute("test", ByteString.valueOf("value1"), ByteString
-                        .valueOf("value2"));
+                new LinkedAttribute("test", ByteString.valueOfUtf8("value1"), ByteString
+                        .valueOfUtf8("value2"));
 
         Modification mod = new Modification(ModificationType.ADD, attribute);
 
@@ -446,7 +446,7 @@
     @Test
     public static void testFromLDAPControl() {
         org.opends.server.protocols.ldap.LDAPControl ldapControl =
-                new LDAPControl("1.2.3.4", false, ByteString.valueOf("myData"));
+                new LDAPControl("1.2.3.4", false, ByteString.valueOfUtf8("myData"));
         Control sdkControl = from(ldapControl);
 
         Control expectedSdkControl = GenericControl.newControl("1.2.3.4", false, "myData");
@@ -476,7 +476,7 @@
     @Test
     public static void testFromControl() {
         final org.opends.server.types.Control control =
-                new LDAPControl("1.2.3.4", false, ByteString.valueOf("myData"));
+                new LDAPControl("1.2.3.4", false, ByteString.valueOfUtf8("myData"));
         Control sdkControl = from(control);
 
         Control expectedSdkControl = GenericControl.newControl("1.2.3.4", false, "myData");
@@ -513,7 +513,7 @@
         final GenericBindRequest genericBindRequest = bindClient.nextBindRequest();
 
         assertThat(getCredentials(genericBindRequest.getAuthenticationValue())).isEqualTo(
-                ByteString.valueOf("\u0000u:user.0\u0000password"));
+                ByteString.valueOfUtf8("\u0000u:user.0\u0000password"));
     }
 
     /**
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java b/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
index c89cc7f..1935ea1 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
@@ -1309,9 +1309,9 @@
 
       BindRequestProtocolOp bindRequest =
         new BindRequestProtocolOp(
-                 ByteString.valueOf(dn),
+                 ByteString.valueOfUtf8(dn),
                  3,
-                 ByteString.valueOf(pw));
+                 ByteString.valueOfUtf8(pw));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       message.write(w);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
index 582ab21..0d898a7 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
@@ -99,7 +99,7 @@
           + "MAY ( ds-cfg-base-dn $ ds-cfg-group-dn $ "
           + "ds-cfg-filter $ ds-cfg-conflict-behavior ) "
           + "X-ORIGIN 'OpenDS Directory Server' )";
-      ByteString b = ByteString.valueOf(ocd);
+      ByteString b = ByteString.valueOfUtf8(ocd);
 
       TEST_PARENT_OCD = ObjectClassSyntax.decodeObjectClass(b, DirectoryServer
           .getSchema(), false);
@@ -114,7 +114,7 @@
           + "MAY ( ds-cfg-base-dn $ ds-cfg-group-dn $ "
           + "ds-cfg-filter $ ds-cfg-conflict-behavior $"
           + "ds-cfg-rotation-policy) " + "X-ORIGIN 'OpenDS Directory Server' )";
-      ByteString b = ByteString.valueOf(ocd);
+      ByteString b = ByteString.valueOfUtf8(ocd);
 
       TEST_CHILD_OCD = ObjectClassSyntax.decodeObjectClass(b, DirectoryServer
           .getSchema(), false);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
index 02bf681..d69c7b5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
@@ -135,7 +135,7 @@
                  0);
 
     assertEquals(TestPasswordValidator.getLastNewPassword(),
-                 ByteString.valueOf("newPassword"));
+                 ByteString.valueOfUtf8("newPassword"));
     assertFalse(TestPasswordValidator.getLastCurrentPasswords().isEmpty());
   }
 
@@ -186,7 +186,7 @@
     assertNotEquals(returnCode, 0);
 
     assertEquals(TestPasswordValidator.getLastNewPassword(),
-                 ByteString.valueOf("newPassword"));
+                 ByteString.valueOfUtf8("newPassword"));
     assertFalse(TestPasswordValidator.getLastCurrentPasswords().isEmpty());
 
     TestPasswordValidator.setNextReturnValue(true);
@@ -286,7 +286,7 @@
     assertFalse(currentPasswords.isEmpty());
     assertEquals(currentPasswords.size(), 1);
     assertEquals(currentPasswords.iterator().next(),
-                 ByteString.valueOf("password"));
+                 ByteString.valueOfUtf8("password"));
   }
 
 
@@ -338,7 +338,7 @@
     assertFalse(currentPasswords.isEmpty());
     assertEquals(currentPasswords.size(), 1);
     assertEquals(currentPasswords.iterator().next(),
-                 ByteString.valueOf("password"));
+                 ByteString.valueOfUtf8("password"));
   }
 
 
@@ -391,7 +391,7 @@
     assertFalse(currentPasswords.isEmpty());
     assertEquals(currentPasswords.size(), 1);
     assertEquals(currentPasswords.iterator().next(),
-                 ByteString.valueOf("password"));
+                 ByteString.valueOfUtf8("password"));
   }
 
 
@@ -431,8 +431,8 @@
 
     BindRequestProtocolOp bindRequest =
       new BindRequestProtocolOp(
-               ByteString.valueOf("uid=test.user,o=test"),
-                                3, ByteString.valueOf("password"));
+               ByteString.valueOfUtf8("uid=test.user,o=test"),
+                                3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -446,7 +446,7 @@
 
     ModifyRequestProtocolOp modifyRequest =
          new ModifyRequestProtocolOp(
-                  ByteString.valueOf("uid=test.user,o=test"), mods);
+                  ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
     message = new LDAPMessage(2, modifyRequest);
     w.writeMessage(message);
 
@@ -456,7 +456,7 @@
     assertEquals(modifyResponse.getResultCode(), 0);
 
     assertEquals(TestPasswordValidator.getLastNewPassword(),
-                 ByteString.valueOf("newPassword"));
+                 ByteString.valueOfUtf8("newPassword"));
     assertTrue(TestPasswordValidator.getLastCurrentPasswords().isEmpty());
   }
 
@@ -497,8 +497,8 @@
 
     BindRequestProtocolOp bindRequest =
       new BindRequestProtocolOp(
-               ByteString.valueOf("uid=test.user,o=test"),
-                                3, ByteString.valueOf("password"));
+               ByteString.valueOfUtf8("uid=test.user,o=test"),
+                                3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -513,7 +513,7 @@
     TestPasswordValidator.setNextReturnValue(false);
     ModifyRequestProtocolOp modifyRequest =
          new ModifyRequestProtocolOp(
-                  ByteString.valueOf("uid=test.user,o=test"), mods);
+                  ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
     message = new LDAPMessage(2, modifyRequest);
     w.writeMessage(message);
 
@@ -523,7 +523,7 @@
     assertNotEquals(modifyResponse.getResultCode(), 0);
 
     assertEquals(TestPasswordValidator.getLastNewPassword(),
-                 ByteString.valueOf("newPassword"));
+                 ByteString.valueOfUtf8("newPassword"));
     assertTrue(TestPasswordValidator.getLastCurrentPasswords().isEmpty());
 
     TestPasswordValidator.setNextReturnValue(true);
@@ -567,8 +567,8 @@
 
     BindRequestProtocolOp bindRequest =
       new BindRequestProtocolOp(
-               ByteString.valueOf("uid=test.user,o=test"),
-                                3, ByteString.valueOf("password"));
+               ByteString.valueOfUtf8("uid=test.user,o=test"),
+                                3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -585,7 +585,7 @@
 
     ModifyRequestProtocolOp modifyRequest =
          new ModifyRequestProtocolOp(
-                  ByteString.valueOf("uid=test.user,o=test"), mods);
+                  ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
     message = new LDAPMessage(2, modifyRequest);
     w.writeMessage(message);
 
@@ -599,7 +599,7 @@
     assertFalse(currentPasswords.isEmpty());
     assertEquals(currentPasswords.size(), 1);
     assertEquals(currentPasswords.iterator().next(),
-                 ByteString.valueOf("password"));
+                 ByteString.valueOfUtf8("password"));
   }
 
 
@@ -642,8 +642,8 @@
 
     BindRequestProtocolOp bindRequest =
       new BindRequestProtocolOp(
-               ByteString.valueOf("uid=test.user,o=test"),
-                                3, ByteString.valueOf("password"));
+               ByteString.valueOfUtf8("uid=test.user,o=test"),
+                                3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -657,7 +657,7 @@
 
     ModifyRequestProtocolOp modifyRequest =
          new ModifyRequestProtocolOp(
-                  ByteString.valueOf("uid=test.user,o=test"), mods);
+                  ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
     message = new LDAPMessage(2, modifyRequest);
     w.writeMessage(message);
 
@@ -671,7 +671,7 @@
     assertFalse(currentPasswords.isEmpty());
     assertEquals(currentPasswords.size(), 1);
     assertEquals(currentPasswords.iterator().next(),
-                 ByteString.valueOf("password"));
+                 ByteString.valueOfUtf8("password"));
   }
 
 
@@ -714,8 +714,8 @@
 
     BindRequestProtocolOp bindRequest =
       new BindRequestProtocolOp(
-               ByteString.valueOf("uid=test.user,o=test"),
-                                3, ByteString.valueOf("password"));
+               ByteString.valueOfUtf8("uid=test.user,o=test"),
+                                3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -732,7 +732,7 @@
 
     ModifyRequestProtocolOp modifyRequest =
          new ModifyRequestProtocolOp(
-                  ByteString.valueOf("uid=test.user,o=test"), mods);
+                  ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
     message = new LDAPMessage(2, modifyRequest);
     w.writeMessage(message);
 
@@ -746,7 +746,7 @@
     assertFalse(currentPasswords.isEmpty());
     assertEquals(currentPasswords.size(), 1);
     assertEquals(currentPasswords.iterator().next(),
-                 ByteString.valueOf("password"));
+                 ByteString.valueOfUtf8("password"));
   }
 }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetTestCase.java
index e37981e..429c847 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetTestCase.java
@@ -426,7 +426,7 @@
   public void applicableTargets(String aciDN, String aciString, String entryDN)
        throws Exception
   {
-    Aci aci = Aci.decode(ByteString.valueOf(aciString), DN.valueOf(aciDN));
+    Aci aci = Aci.decode(ByteString.valueOfUtf8(aciString), DN.valueOf(aciDN));
     boolean match = AciTargets.isTargetApplicable(aci,
                                                   aci.getTargets(),
                                                   DN.valueOf(entryDN));
@@ -440,7 +440,7 @@
                                    String entryDN)
        throws Exception
   {
-    Aci aci = Aci.decode(ByteString.valueOf(aciString), DN.valueOf(aciDN));
+    Aci aci = Aci.decode(ByteString.valueOfUtf8(aciString), DN.valueOf(aciDN));
     boolean match = AciTargets.isTargetApplicable(aci,
                                                   aci.getTargets(),
                                                   DN.valueOf(entryDN));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestBackendImpl.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestBackendImpl.java
index 8c21ee3..21e7154 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestBackendImpl.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestBackendImpl.java
@@ -994,21 +994,21 @@
           Attributes.create("title", "debugger")));
 
       final Attribute cnAttr = entry.getAttribute("cn").get(0);
-      assertTrue(cnAttr.contains(ByteString.valueOf("Aaren Rigor")));
-      assertTrue(cnAttr.contains(ByteString.valueOf("Aarenister Rigor")));
-      assertFalse(cnAttr.contains(ByteString.valueOf("Aaren Atp")));
+      assertTrue(cnAttr.contains(ByteString.valueOfUtf8("Aaren Rigor")));
+      assertTrue(cnAttr.contains(ByteString.valueOfUtf8("Aarenister Rigor")));
+      assertFalse(cnAttr.contains(ByteString.valueOfUtf8("Aaren Atp")));
 
       Set<String> options = Collections.singleton("lang-de");
       assertTrue(entry.getAttribute("givenname", options).get(0).contains(
-          ByteString.valueOf("test")));
+          ByteString.valueOfUtf8("test")));
       options = Collections.singleton("lang-cn");
       assertNull(entry.getAttribute("givenname", options));
       options = Collections.singleton("lang-es");
       assertTrue(entry.getAttribute("givenname", options).get(0).contains(
-          ByteString.valueOf("newtest3")));
+          ByteString.valueOfUtf8("newtest3")));
       options = Collections.singleton("lang-fr");
       assertTrue(entry.getAttribute("givenname", options).get(0).contains(
-          ByteString.valueOf("test2")));
+          ByteString.valueOfUtf8("test2")));
 
       assertTrue(entry.getAttribute("employeenumber").contains(
           Attributes.create("employeenumber", "222")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java
index 62c3c70..f130d0e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java
@@ -472,7 +472,7 @@
       assertNotNull(entry);
 
       AttributeType attrType = DirectoryServer.getAttributeTypeOrNull("cn");
-      assertTrue(entry.hasValue(attrType, null, ByteString.valueOf("Annalee Bogard")));
+      assertTrue(entry.hasValue(attrType, null, ByteString.valueOfUtf8("Annalee Bogard")));
 
       assertEquals(verifyBackend(importtest1DN), 0);
     }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java
index f573d8a..2fd8cee 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java
@@ -713,7 +713,7 @@
   {
     final SearchRequest request = Requests.newSearchRequest(DN.valueOf("dc=vlvtest,dc=com"), SearchScope.WHOLE_SUBTREE)
         .addControl(new ServerSideSortRequestControl(sortOrder))
-        .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("a")));
+        .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("a")));
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
 
     assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
@@ -763,7 +763,7 @@
   {
     final SearchRequest request = Requests.newSearchRequest(DN.valueOf("dc=vlvtest,dc=com"), SearchScope.WHOLE_SUBTREE)
         .addControl(new ServerSideSortRequestControl(sortOrder))
-        .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("aaccf")));
+        .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("aaccf")));
 
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
     assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
@@ -813,7 +813,7 @@
   {
     final SearchRequest request = Requests.newSearchRequest(DN.valueOf("dc=vlvtest,dc=com"), SearchScope.WHOLE_SUBTREE)
         .addControl(new ServerSideSortRequestControl(sortOrder))
-        .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("albert")));
+        .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("albert")));
 
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
     assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
@@ -869,7 +869,7 @@
   {
     final SearchRequest request = Requests.newSearchRequest(DN.valueOf("dc=vlvtest,dc=com"), SearchScope.WHOLE_SUBTREE)
         .addControl(new ServerSideSortRequestControl(sortOrder))
-        .addControl(new VLVRequestControl(1, 3, ByteString.valueOf("albert")));
+        .addControl(new VLVRequestControl(1, 3, ByteString.valueOfUtf8("albert")));
 
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
     assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
@@ -926,7 +926,7 @@
   {
     final SearchRequest request = Requests.newSearchRequest(DN.valueOf("dc=vlvtest,dc=com"), SearchScope.WHOLE_SUBTREE)
         .addControl(new ServerSideSortRequestControl(sortOrder))
-        .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("zz")));
+        .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("zz")));
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
 
     // It will be successful because the control isn't critical.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/ControlsTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/ControlsTestCase.java
index 296c253..deb1563 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/ControlsTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/ControlsTestCase.java
@@ -666,7 +666,7 @@
     final SearchRequest request =
         newSearchRequest(BACKEND_BASE_DN, SearchScope.WHOLE_SUBTREE, VLV_FILTER).addControl(
             new ServerSideSortRequestControl(mangleSortOrder(sortOrder))).addControl(
-            new VLVRequestControl(beforeCount, afterCount, ByteString.valueOf(assertion)));
+            new VLVRequestControl(beforeCount, afterCount, ByteString.valueOfUtf8(assertion)));
     final InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
     assertThat(internalSearch.getResultCode()).isEqualTo(ResultCode.SUCCESS);
     assertThat(getDNs(internalSearch.getSearchEntries())).isEqualTo(getDNs(expectedOrder));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/DefaultIndexTest.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/DefaultIndexTest.java
index c246230..41f39fb 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/DefaultIndexTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/DefaultIndexTest.java
@@ -26,7 +26,7 @@
 package org.opends.server.backends.pluggable;
 
 import static org.assertj.core.api.Assertions.*;
-import static org.forgerock.opendj.ldap.ByteString.valueOf;
+import static org.forgerock.opendj.ldap.ByteString.valueOfUtf8;
 import static org.mockito.Matchers.*;
 import static org.mockito.Mockito.*;
 import static org.opends.server.backends.pluggable.EntryIDSet.*;
@@ -104,24 +104,24 @@
     put(newDefinedSet(1, 2, 3, 4));
     update(newDefinedSet(1, 2, 3, 4), newDefinedSet());
 
-    assertThat(txn.read(index.getName(), valueOf("key"))).isNull();
+    assertThat(txn.read(index.getName(), valueOfUtf8("key"))).isNull();
   }
 
   private void update(EntryIDSet deletedIDSet, EntryIDSet addedIDSet) {
-    index.update(txn, valueOf("key"), deletedIDSet, addedIDSet);
+    index.update(txn, valueOfUtf8("key"), deletedIDSet, addedIDSet);
   }
 
   private void put(EntryIDSet idSet)
   {
-    txn.put(index.getName(), valueOf("key"), CODEC_V2.encode(idSet));
+    txn.put(index.getName(), valueOfUtf8("key"), CODEC_V2.encode(idSet));
   }
 
   private ByteString getFromDb() {
-    return txn.read(index.getName(), valueOf("key"));
+    return txn.read(index.getName(), valueOfUtf8("key"));
   }
 
   private EntryIDSet get() {
-    return CODEC_V2.decode(valueOf("key"), getFromDb());
+    return CODEC_V2.decode(valueOfUtf8("key"), getFromDb());
   }
 
   private static DefaultIndex newIndex(String name, int indexLimit, EnumSet<IndexFlag> indexFlags)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/EntryIDSetTest.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/EntryIDSetTest.java
index 2f3d64f..61b34f8 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/EntryIDSetTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/EntryIDSetTest.java
@@ -39,7 +39,7 @@
 @Test(groups = { "precommit", "pluggablebackend", "unit" }, sequential=true)
 public class EntryIDSetTest extends DirectoryServerTestCase
 {
-  private final static ByteString KEY = ByteString.valueOf("test");
+  private final static ByteString KEY = ByteString.valueOfUtf8("test");
 
   @Test(expectedExceptions = NullPointerException.class)
   public void testDefinedCannotCreateWithNull()
@@ -181,7 +181,7 @@
     assertThat(codec.decode(KEY, string).isDefined()).isFalse();
     assertThat(codec.decode(KEY, string).size()).isEqualTo(Long.MAX_VALUE);
 
-    string = codec.encode(newUndefinedSetWithKey(ByteString.valueOf("none")));
+    string = codec.encode(newUndefinedSetWithKey(ByteString.valueOfUtf8("none")));
     assertThat(codec.decode(KEY, string).isDefined()).isFalse();
     assertThat(codec.decode(KEY, string).size()).isEqualTo(Long.MAX_VALUE);
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/OnDiskMergeImporterTest.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/OnDiskMergeImporterTest.java
index 6cddd2e..d4d00aa 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/OnDiskMergeImporterTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/OnDiskMergeImporterTest.java
@@ -282,7 +282,7 @@
   public void testExternalSortChunk() throws Exception
   {
     final int NB_REGION = 10;
-    final ByteString KEY = ByteString.valueOf("key");
+    final ByteString KEY = ByteString.valueOfUtf8("key");
     final File tempDir = TestCaseUtils.createTemporaryDirectory("testExternalSortChunk");
     try(final BufferPool bufferPool = new BufferPool(2, 4 + 1 + KEY.length() + 1 + 4)) {
       // 4: record offset, 1: key length, 1: value length, 4: value
@@ -292,7 +292,7 @@
       List<ByteString> expected = new ArrayList<>(NB_REGION);
       for (int i = 0; i < NB_REGION; i++)
       {
-        final ByteString value = ByteString.valueOf(String.format("%02d", i));
+        final ByteString value = ByteString.valueOfUtf8(String.format("%02d", i));
         chunk.put(KEY, value);
         expected.add(value);
       }
@@ -310,7 +310,7 @@
     final List<Pair<ByteString, ByteString>> content = new ArrayList<>(data.length);
     for (String[] keyValue : data)
     {
-      content.add(Pair.of(ByteString.valueOf(keyValue[0]), ByteString.valueOf(keyValue[1])));
+      content.add(Pair.of(ByteString.valueOfUtf8(keyValue[0]), ByteString.valueOfUtf8(keyValue[1])));
     }
     return content;
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
index b3f18ee..ddbbaaf 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
@@ -132,7 +132,7 @@
   protected String[] backendVlvIndexes = { "people" };
 
   private AttributeType modifyAttribute;
-  private final ByteString modifyValue = ByteString.valueOf("foo");
+  private final ByteString modifyValue = ByteString.valueOfUtf8("foo");
   private String backupPath;
   private BackupDirectory backupDirectory;
 
@@ -1183,7 +1183,7 @@
         @Override
         public void run(WriteableTransaction txn) throws Exception
         {
-          txn.put(new TreeName("dc=test,dc=com", "id2entry"), ByteString.valueOf("key"), ByteString.valueOf("value"));
+          txn.put(new TreeName("dc=test,dc=com", "id2entry"), ByteString.valueOfUtf8("key"), ByteString.valueOfUtf8("value"));
         }
       });
     }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
index 48e0028..59727dd 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
@@ -107,16 +107,16 @@
       // excepted behavior
     }
 
-    MatchedValuesFilter mvf = MatchedValuesFilter.createEqualityFilter(type, ByteString.valueOf(value));
+    MatchedValuesFilter mvf = MatchedValuesFilter.createEqualityFilter(type, ByteString.valueOfUtf8(value));
     assertNotNull(mvf);
     assertEquals(mvf.getRawAttributeType(), type);
-    assertEquals(mvf.getRawAssertionValue(), ByteString.valueOf(value));
+    assertEquals(mvf.getRawAssertionValue(), ByteString.valueOfUtf8(value));
     assertEquals(mvf.getMatchType(), MatchedValuesFilter.EQUALITY_MATCH_TYPE);
     checkEncodeDecode(mvf);
 
     try
     {
-      MatchedValuesFilter.createEqualityFilter((String) null, ByteString.valueOf(value));
+      MatchedValuesFilter.createEqualityFilter((String) null, ByteString.valueOfUtf8(value));
       fail("Expected NullPointerException");
     }
     catch (NullPointerException e)
@@ -129,7 +129,7 @@
     ByteString attVal = null;
     if (attType != null)
     {
-      attVal = ByteString.valueOf(value);
+      attVal = ByteString.valueOfUtf8(value);
     }
 
     try
@@ -205,13 +205,13 @@
     // input parameter
     String             rawAttTypeTest = type;
     AttributeType         attTypeTest = DirectoryServer.getAttributeTypeOrNull(type);
-    ByteString            subInitialTest = ByteString.valueOf(subInitial);
+    ByteString            subInitialTest = ByteString.valueOfUtf8(subInitial);
     List<ByteString> subAnyTest = new ArrayList<>(subAny.size());
     for (String s : subAny)
     {
-      subAnyTest.add(ByteString.valueOf(s));
+      subAnyTest.add(ByteString.valueOfUtf8(s));
     }
-    ByteString subFinalTest = ByteString.valueOf(subFinal);
+    ByteString subFinalTest = ByteString.valueOfUtf8(subFinal);
 
     // test parameter
     AttributeType    attTypeCurrent;
@@ -363,17 +363,17 @@
     {
       MatchedValuesFilter mvf;
       mvf = MatchedValuesFilter.createGreaterOrEqualFilter(type,
-          ByteString.valueOf(value));
+          ByteString.valueOfUtf8(value));
       assertNotNull(mvf);
       assertEquals(mvf.getRawAttributeType(), type);
-      assertEquals(mvf.getRawAssertionValue(), ByteString.valueOf(value));
+      assertEquals(mvf.getRawAssertionValue(), ByteString.valueOfUtf8(value));
       assertEquals(mvf.getMatchType(),
           MatchedValuesFilter.GREATER_OR_EQUAL_TYPE);
     }
 
     try
     {
-      MatchedValuesFilter.createGreaterOrEqualFilter((String) null, ByteString.valueOf(value));
+      MatchedValuesFilter.createGreaterOrEqualFilter((String) null, ByteString.valueOfUtf8(value));
       fail("Expected NullPointerException");
     }
     catch (NullPointerException e)
@@ -386,7 +386,7 @@
     ByteString attVal = null;
     if (attType != null)
     {
-      attVal = ByteString.valueOf(value);
+      attVal = ByteString.valueOfUtf8(value);
     }
 
     try
@@ -461,16 +461,16 @@
     // Check type, value
     MatchedValuesFilter mvf;
     mvf = MatchedValuesFilter.createLessOrEqualFilter(type,
-        ByteString.valueOf(value));
+        ByteString.valueOfUtf8(value));
     assertNotNull(mvf);
     assertEquals(mvf.getRawAttributeType(), type);
-    assertEquals(mvf.getRawAssertionValue(), ByteString.valueOf(value));
+    assertEquals(mvf.getRawAssertionValue(), ByteString.valueOfUtf8(value));
     assertEquals(mvf.getMatchType(), MatchedValuesFilter.LESS_OR_EQUAL_TYPE);
 
     try
     {
       mvf = MatchedValuesFilter.createLessOrEqualFilter((String) null,
-          ByteString.valueOf(value));
+          ByteString.valueOfUtf8(value));
     }
     catch (NullPointerException e)
     {
@@ -482,7 +482,7 @@
     ByteString attVal = null ;
     if (attType != null)
     {
-      attVal = ByteString.valueOf(value);
+      attVal = ByteString.valueOfUtf8(value);
     }
 
     try
@@ -606,15 +606,15 @@
     // Check type, value
     MatchedValuesFilter mvf;
     mvf = MatchedValuesFilter.createApproximateFilter(type,
-        ByteString.valueOf(value));
+        ByteString.valueOfUtf8(value));
     assertNotNull(mvf);
     assertEquals(mvf.getRawAttributeType(), type);
-    assertEquals(mvf.getRawAssertionValue(), ByteString.valueOf(value));
+    assertEquals(mvf.getRawAssertionValue(), ByteString.valueOfUtf8(value));
     assertEquals(mvf.getMatchType(), MatchedValuesFilter.APPROXIMATE_MATCH_TYPE);
 
     try
     {
-      MatchedValuesFilter.createApproximateFilter((String) null, ByteString.valueOf(value));
+      MatchedValuesFilter.createApproximateFilter((String) null, ByteString.valueOfUtf8(value));
       fail("Expected NullPointerException");
     }
     catch (NullPointerException e)
@@ -627,7 +627,7 @@
     ByteString attVal = null ;
     if (attType != null)
     {
-      attVal = ByteString.valueOf(value);
+      attVal = ByteString.valueOfUtf8(value);
     }
 
     try
@@ -706,7 +706,7 @@
     String          rawAttTypeTest = type ;
     AttributeType      attTypeTest = DirectoryServer.getAttributeTypeOrNull(type) ;
     String             matchingRuleIdTest = matchingRule.getOID() ;
-    ByteString    attValueTest = (attTypeTest == null) ? null : ByteString.valueOf(value);
+    ByteString    attValueTest = (attTypeTest == null) ? null : ByteString.valueOfUtf8(value);
     // parameter used for the test.
     String          rawAttTypeTestCurrent;
     AttributeType      attTypeTestCurrent ;
@@ -815,7 +815,7 @@
                                          String assertion)
   {
     AttributeType attrType = DirectoryServer.getAttributeTypeOrNull("usercertificate");
-    MatchedValuesFilter mvf = MatchedValuesFilter.createEqualityFilter(type, ByteString.valueOf(assertion));
+    MatchedValuesFilter mvf = MatchedValuesFilter.createEqualityFilter(type, ByteString.valueOfUtf8(assertion));
     assertTrue(mvf.valueMatches(attrType, value));
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java
index 2196a7c..03a7dcf 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java
@@ -242,7 +242,7 @@
     assertEquals(pec.getOID(),OID_NS_PASSWORD_EXPIRED);
 
     control = new LDAPControl(OID_NS_PASSWORD_EXPIRED, isCritical,
-        ByteString.valueOf("value"));
+        ByteString.valueOfUtf8("value"));
     try
     {
       pec = PasswordExpiredControl.DECODER.decode(control.isCritical(), control.getValue());
@@ -314,7 +314,7 @@
     }
 
     control = new LDAPControl(OID_NS_PASSWORD_EXPIRING, isCritical,
-        ByteString.valueOf("Wrong value"));
+        ByteString.valueOfUtf8("Wrong value"));
     try
     {
       pec = PasswordExpiringControl.DECODER.decode(control.isCritical(), control.getValue());
@@ -381,7 +381,7 @@
     assertEquals(pec.getOID(),OID_PASSWORD_POLICY_CONTROL);
 
     control = new LDAPControl(OID_PASSWORD_POLICY_CONTROL,
-        isCritical, ByteString.valueOf("value"));
+        isCritical, ByteString.valueOfUtf8("value"));
     try
     {
       pec = PasswordPolicyRequestControl.DECODER.decode(control.isCritical(), control.getValue());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java
index 8f6b8bf..f4c59ac 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java
@@ -111,8 +111,8 @@
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
 
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest, controls);
       w.writeMessage(message);
 
@@ -132,7 +132,7 @@
       rawAttrs.add(RawAttribute.create("ou", "People"));
 
       AddRequestProtocolOp addRequest = new AddRequestProtocolOp(
-           ByteString.valueOf("ou=People,o=test"), rawAttrs);
+           ByteString.valueOfUtf8("ou=People,o=test"), rawAttrs);
 
       controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -179,8 +179,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("cn=Directory Manager"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("cn=Directory Manager"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -199,7 +199,7 @@
                         "{SSHA}0pZPpMIm6xSBIW4hGvR/72fjO4M9p3Ff1g7QFw=="));
 
       AddRequestProtocolOp addRequest = new AddRequestProtocolOp(
-           ByteString.valueOf("ou=uid=test.user,o=test"), rawAttrs);
+           ByteString.valueOfUtf8("ou=uid=test.user,o=test"), rawAttrs);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -269,8 +269,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("cn=Directory Manager"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("cn=Directory Manager"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -288,7 +288,7 @@
       rawAttrs.add(RawAttribute.create("userPassword", "short"));
 
       AddRequestProtocolOp addRequest = new AddRequestProtocolOp(
-           ByteString.valueOf("ou=uid=test.user,o=test"), rawAttrs);
+           ByteString.valueOfUtf8("ou=uid=test.user,o=test"), rawAttrs);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -351,8 +351,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("wrong"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("wrong"));
 
       for (int i=1; i <= 3; i++)
       {
@@ -365,8 +365,8 @@
       }
 
       bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -427,8 +427,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -438,8 +438,8 @@
 
 
       CompareRequestProtocolOp compareRequest =
-           new CompareRequestProtocolOp(ByteString.valueOf("o=test"), "o",
-                                        ByteString.valueOf("test"));
+           new CompareRequestProtocolOp(ByteString.valueOfUtf8("o=test"), "o",
+                                        ByteString.valueOfUtf8("test"));
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -507,8 +507,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -518,7 +518,7 @@
 
 
       DeleteRequestProtocolOp deleteRequest =
-           new DeleteRequestProtocolOp(ByteString.valueOf("ou=People,o=test"));
+           new DeleteRequestProtocolOp(ByteString.valueOfUtf8("ou=People,o=test"));
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -628,8 +628,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf(userDN), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8(userDN), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -643,7 +643,7 @@
                                       "foo"));
 
       ModifyRequestProtocolOp modifyRequest =
-           new ModifyRequestProtocolOp(ByteString.valueOf(entryDN), mods);
+           new ModifyRequestProtocolOp(ByteString.valueOfUtf8(entryDN), mods);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -773,8 +773,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf(userDN), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8(userDN), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -788,12 +788,12 @@
                                       "foo"));
 
       ModifyRequestProtocolOp modifyRequest =
-           new ModifyRequestProtocolOp(ByteString.valueOf(entryDN), mods);
+           new ModifyRequestProtocolOp(ByteString.valueOfUtf8(entryDN), mods);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
       controls.add(new LDAPControl(OID_PROXIED_AUTH_V2, true,
-          ByteString.valueOf("dn:" + authzDN)));
+          ByteString.valueOfUtf8("dn:" + authzDN)));
 
       message = new LDAPMessage(2, modifyRequest, controls);
       w.writeMessage(message);
@@ -856,8 +856,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -872,7 +872,7 @@
 
       ModifyRequestProtocolOp modifyRequest =
            new ModifyRequestProtocolOp(
-                    ByteString.valueOf("uid=test.user,o=test"), mods);
+                    ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -934,8 +934,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -950,7 +950,7 @@
 
       ModifyRequestProtocolOp modifyRequest =
            new ModifyRequestProtocolOp(
-                    ByteString.valueOf("uid=test.user,o=test"), mods);
+                    ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -1014,8 +1014,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -1030,7 +1030,7 @@
 
       ModifyRequestProtocolOp modifyRequest =
            new ModifyRequestProtocolOp(
-                    ByteString.valueOf("uid=test.user,o=test"), mods);
+                    ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -1094,8 +1094,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -1110,7 +1110,7 @@
 
       ModifyRequestProtocolOp modifyRequest =
            new ModifyRequestProtocolOp(
-                    ByteString.valueOf("uid=test.user,o=test"), mods);
+                    ByteString.valueOfUtf8("uid=test.user,o=test"), mods);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -1178,8 +1178,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -1190,8 +1190,8 @@
 
       ModifyDNRequestProtocolOp modifyDNRequest =
            new ModifyDNRequestProtocolOp(
-                    ByteString.valueOf("ou=People,o=test"),
-                    ByteString.valueOf("ou=Users"), true);
+                    ByteString.valueOfUtf8("ou=People,o=test"),
+                    ByteString.valueOfUtf8("ou=Users"), true);
 
       List<Control> controls = new ArrayList<>();
       controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
@@ -1252,8 +1252,8 @@
     try
     {
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -1263,7 +1263,7 @@
 
 
       SearchRequestProtocolOp searchRequest =
-           new SearchRequestProtocolOp(ByteString.valueOf("o=test"),
+           new SearchRequestProtocolOp(ByteString.valueOfUtf8("o=test"),
                                        SearchScope.BASE_OBJECT,
                                        DereferenceAliasesPolicy.NEVER, 0, 0, false,
                                        LDAPFilter.objectClassPresent(),
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java
index 74d3afb..efe5e0e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java
@@ -332,7 +332,7 @@
       try
       {
         control = new LDAPControl(OID_PERSISTENT_SEARCH, isCritical,
-            ByteString.valueOf("invalid value"));
+            ByteString.valueOfUtf8("invalid value"));
         psc = PersistentSearchControl.DECODER.decode(control.isCritical(), control.getValue());
         fail();
       }
@@ -525,7 +525,7 @@
     mods.add(new LDAPModification(ModificationType.REPLACE, attr));
 
     ModifyOperation modifyOperation =
-         conn.processModify(ByteString.valueOf("cn=config"), mods);
+         conn.processModify(ByteString.valueOfUtf8("cn=config"), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
 
     //Create a persistent search request.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV1ControlTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV1ControlTestCase.java
index cce398c..dd1db22 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV1ControlTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV1ControlTestCase.java
@@ -87,7 +87,7 @@
 
 
     // Try an empty DN, which is acceptable.
-    proxyControl = new ProxiedAuthV1Control(ByteString.valueOf(""));
+    proxyControl = new ProxiedAuthV1Control(ByteString.valueOfUtf8(""));
     assertEquals(proxyControl.getOID(), OID_PROXIED_AUTH_V1);
     assertTrue(proxyControl.isCritical());
     assertTrue(proxyControl.getAuthorizationDN().isRootDN());
@@ -95,7 +95,7 @@
 
     // Try a valid DN, which is acceptable.
     proxyControl =
-         new ProxiedAuthV1Control(ByteString.valueOf("uid=test,o=test"));
+         new ProxiedAuthV1Control(ByteString.valueOfUtf8("uid=test,o=test"));
     assertEquals(proxyControl.getOID(), OID_PROXIED_AUTH_V1);
     assertTrue(proxyControl.isCritical());
     assertEquals(proxyControl.getAuthorizationDN(),
@@ -104,7 +104,7 @@
 
     // Try an invalid DN, which will be initally accepted but will fail when
     // attempting to get the authorization DN.
-    proxyControl = new ProxiedAuthV1Control(ByteString.valueOf("invalid"));
+    proxyControl = new ProxiedAuthV1Control(ByteString.valueOfUtf8("invalid"));
     assertEquals(proxyControl.getOID(), OID_PROXIED_AUTH_V1);
     assertTrue(proxyControl.isCritical());
     try
@@ -208,7 +208,7 @@
   {
     LDAPControl c =
         new LDAPControl(OID_PROXIED_AUTH_V1, true,
-            ByteString.valueOf("uid=test,o=test"));
+            ByteString.valueOfUtf8("uid=test,o=test"));
 
     ProxiedAuthV1Control.DECODER.decode(c.isCritical(), c.getValue());
   }
@@ -256,7 +256,7 @@
     LDAPControl c =
         new LDAPControl(OID_PROXIED_AUTH_V1, true, bsb.toByteString());
 
-    assertEquals(ByteString.valueOf("uid=element1,o=test"),
+    assertEquals(ByteString.valueOfUtf8("uid=element1,o=test"),
         ProxiedAuthV1Control.DECODER.decode(c.isCritical(),
             c.getValue()).getRawAuthorizationDN());
   }
@@ -346,13 +346,13 @@
          throws Exception
   {
     ProxiedAuthV1Control proxyControl =
-         new ProxiedAuthV1Control(ByteString.valueOf(""));
-    assertEquals(proxyControl.getRawAuthorizationDN(), ByteString.valueOf(""));
+         new ProxiedAuthV1Control(ByteString.valueOfUtf8(""));
+    assertEquals(proxyControl.getRawAuthorizationDN(), ByteString.valueOfUtf8(""));
 
     proxyControl =
-         new ProxiedAuthV1Control(ByteString.valueOf("uid=test,o=test"));
+         new ProxiedAuthV1Control(ByteString.valueOfUtf8("uid=test,o=test"));
     assertEquals(proxyControl.getRawAuthorizationDN(),
-        ByteString.valueOf("uid=test,o=test"));
+        ByteString.valueOfUtf8("uid=test,o=test"));
   }
 
 
@@ -369,13 +369,13 @@
   {
     ProxiedAuthV1Control proxyControl =
          new ProxiedAuthV1Control(DN.rootDN());
-    assertEquals(proxyControl.getRawAuthorizationDN(), ByteString.valueOf(""));
+    assertEquals(proxyControl.getRawAuthorizationDN(), ByteString.valueOfUtf8(""));
     assertEquals(proxyControl.getAuthorizationDN(), DN.rootDN());
 
     proxyControl =
          new ProxiedAuthV1Control(DN.valueOf("uid=test,o=test"));
     assertEquals(proxyControl.getRawAuthorizationDN(),
-                 ByteString.valueOf("uid=test,o=test"));
+                 ByteString.valueOfUtf8("uid=test,o=test"));
     assertEquals(proxyControl.getAuthorizationDN(),
                  DN.valueOf("uid=test,o=test"));
   }
@@ -493,7 +493,7 @@
     // The default toString() calls the version that takes a string builder
     // argument, so we only need to use the default version to cover both cases.
     ProxiedAuthV1Control proxyControl =
-         new ProxiedAuthV1Control(ByteString.valueOf("uid=test,o=test"));
+         new ProxiedAuthV1Control(ByteString.valueOfUtf8("uid=test,o=test"));
     proxyControl.toString();
 
     proxyControl = new ProxiedAuthV1Control(DN.valueOf("uid=test,o=test"));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV2ControlTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV2ControlTestCase.java
index 4b54045..9712dc3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV2ControlTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/ProxiedAuthV2ControlTestCase.java
@@ -83,8 +83,8 @@
   public void testConstructorEmptyAuthzID()
   {
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf(""));
-    assertEquals(proxyControl.getAuthorizationID(), ByteString.valueOf(""));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8(""));
+    assertEquals(proxyControl.getAuthorizationID(), ByteString.valueOfUtf8(""));
   }
 
 
@@ -97,9 +97,9 @@
   public void testConstructorNonEmptyAuthzIDDN()
   {
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("dn:uid=test,o=test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:uid=test,o=test"));
     assertEquals(proxyControl.getAuthorizationID(),
-                 ByteString.valueOf("dn:uid=test,o=test"));
+                 ByteString.valueOfUtf8("dn:uid=test,o=test"));
   }
 
 
@@ -112,9 +112,9 @@
   public void testConstructorNonEmptyAuthzIDUsername()
   {
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("u:test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("u:test"));
     assertEquals(proxyControl.getAuthorizationID(),
-                 ByteString.valueOf("u:test"));
+                 ByteString.valueOfUtf8("u:test"));
   }
 
 
@@ -130,7 +130,7 @@
          throws Exception
   {
     LDAPControl c = new LDAPControl(OID_PROXIED_AUTH_V2, false,
-                            ByteString.valueOf("u:test"));
+                            ByteString.valueOfUtf8("u:test"));
     ProxiedAuthV2Control.DECODER.decode(c.isCritical(), c.getValue());
   }
 
@@ -162,7 +162,7 @@
   public void testDecodeControlDNValue()
          throws Exception
   {
-    ByteString authzID = ByteString.valueOf("dn:uid=test,o=test");
+    ByteString authzID = ByteString.valueOfUtf8("dn:uid=test,o=test");
 
     LDAPControl c = new LDAPControl(OID_PROXIED_AUTH_V2, true, authzID);
     ProxiedAuthV2Control proxyControl = ProxiedAuthV2Control.DECODER.decode(c.isCritical(), c.getValue());
@@ -181,7 +181,7 @@
   public void testDecodeControlUsernameValue()
          throws Exception
   {
-    ByteString authzID = ByteString.valueOf("u:test");
+    ByteString authzID = ByteString.valueOfUtf8("u:test");
 
     LDAPControl c = new LDAPControl(OID_PROXIED_AUTH_V2, true, authzID);
     ProxiedAuthV2Control proxyControl = ProxiedAuthV2Control.DECODER.decode(c.isCritical(), c.getValue());
@@ -200,7 +200,7 @@
   public void testDecodeControlInvalidValue()
          throws Exception
   {
-    ByteString authzID = ByteString.valueOf("invalid");
+    ByteString authzID = ByteString.valueOfUtf8("invalid");
 
     LDAPControl c = new LDAPControl(OID_PROXIED_AUTH_V2, true, authzID);
     ProxiedAuthV2Control proxyControl = ProxiedAuthV2Control.DECODER.decode(c.isCritical(), c.getValue());
@@ -220,7 +220,7 @@
   public void testDecodeControlLegacyDNValue()
          throws Exception
   {
-    ByteString innerValue = ByteString.valueOf("dn:uid=test,o=test");
+    ByteString innerValue = ByteString.valueOfUtf8("dn:uid=test,o=test");
     ByteStringBuilder bsb = new ByteStringBuilder();
     ASN1Writer writer = ASN1.getWriter(bsb);
     writer.writeOctetString(innerValue);
@@ -244,7 +244,7 @@
   public void testDecodeControlLegacyUsernameValue()
          throws Exception
   {
-    ByteString innerValue = ByteString.valueOf("u:test");
+    ByteString innerValue = ByteString.valueOfUtf8("u:test");
     ByteStringBuilder bsb = new ByteStringBuilder();
     ASN1Writer writer = ASN1.getWriter(bsb);
     writer.writeOctetString(innerValue);
@@ -268,7 +268,7 @@
          throws Exception
   {
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf(""));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8(""));
     assertNull(proxyControl.getAuthorizationEntry());
   }
 
@@ -285,7 +285,7 @@
          throws Exception
   {
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("dn:"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:"));
     assertNull(proxyControl.getAuthorizationEntry());
   }
 
@@ -314,7 +314,7 @@
       "cn: Test User");
 
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("dn:uid=test,o=test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:uid=test,o=test"));
     assertEquals(proxyControl.getAuthorizationEntry().getName(),
                  DN.valueOf("uid=test,o=test"));
   }
@@ -334,7 +334,7 @@
     TestCaseUtils.initializeTestBackend(true);
 
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("dn:uid=test,o=test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:uid=test,o=test"));
     proxyControl.getAuthorizationEntry();
   }
 
@@ -365,7 +365,7 @@
       "ds-pwp-account-disabled: true");
 
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("dn:uid=test,o=test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:uid=test,o=test"));
     proxyControl.getAuthorizationEntry();
   }
 
@@ -382,7 +382,7 @@
          throws Exception
   {
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("u:"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("u:"));
     assertNull(proxyControl.getAuthorizationEntry());
   }
 
@@ -411,7 +411,7 @@
       "cn: Test User");
 
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("u:test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("u:test"));
     assertEquals(proxyControl.getAuthorizationEntry().getName(),
                  DN.valueOf("uid=test,o=test"));
   }
@@ -431,7 +431,7 @@
     TestCaseUtils.initializeTestBackend(true);
 
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("u:test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("u:test"));
     proxyControl.getAuthorizationEntry();
   }
 
@@ -462,7 +462,7 @@
       "ds-pwp-account-disabled: true");
 
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("u:test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("u:test"));
     proxyControl.getAuthorizationEntry();
   }
 
@@ -479,7 +479,7 @@
          throws Exception
   {
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("invalid"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("invalid"));
     proxyControl.getAuthorizationEntry();
   }
 
@@ -497,10 +497,10 @@
     // The default toString() calls the version that takes a string builder
     // argument, so we only need to use the default version to cover both cases.
     ProxiedAuthV2Control proxyControl =
-         new ProxiedAuthV2Control(ByteString.valueOf("dn:uid=test,o=test"));
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:uid=test,o=test"));
     proxyControl.toString();
 
-    proxyControl = new ProxiedAuthV2Control(ByteString.valueOf("u:test"));
+    proxyControl = new ProxiedAuthV2Control(ByteString.valueOfUtf8("u:test"));
     proxyControl.toString();
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java
index f82e71b..8047a8b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java
@@ -284,7 +284,7 @@
               throws Exception
   {
     VLVRequestControl vlvRequest =
-         new VLVRequestControl(true, 0, 9, 1, 0, ByteString.valueOf("foo"));
+         new VLVRequestControl(true, 0, 9, 1, 0, ByteString.valueOfUtf8("foo"));
 
     assertEquals(vlvRequest.isCritical(), true);
     assertEquals(vlvRequest.getBeforeCount(), 0);
@@ -310,7 +310,7 @@
               throws Exception
   {
     VLVRequestControl vlvRequest =
-         new VLVRequestControl(0, 9, ByteString.valueOf("a"));
+         new VLVRequestControl(0, 9, ByteString.valueOfUtf8("a"));
 
     assertEquals(vlvRequest.isCritical(), false);
     assertEquals(vlvRequest.getBeforeCount(), 0);
@@ -336,7 +336,7 @@
               throws Exception
   {
     VLVRequestControl vlvRequest =
-         new VLVRequestControl(true, 0, 9, ByteString.valueOf("a"), null);
+         new VLVRequestControl(true, 0, 9, ByteString.valueOfUtf8("a"), null);
 
     assertEquals(vlvRequest.isCritical(), true);
     assertEquals(vlvRequest.getBeforeCount(), 0);
@@ -362,8 +362,8 @@
               throws Exception
   {
     VLVRequestControl vlvRequest =
-         new VLVRequestControl(true, 0, 9, ByteString.valueOf("a"),
-                               ByteString.valueOf("foo"));
+         new VLVRequestControl(true, 0, 9, ByteString.valueOfUtf8("a"),
+                               ByteString.valueOfUtf8("foo"));
 
     assertEquals(vlvRequest.isCritical(), true);
     assertEquals(vlvRequest.getBeforeCount(), 0);
@@ -388,7 +388,7 @@
     ByteStringBuilder builder = new ByteStringBuilder();
     ASN1Writer writer = ASN1.getWriter(builder);
     VLVResponseControl vlvResponse = new VLVResponseControl(true, 0, 15, 0,
-        ByteString.valueOf("foo"));
+        ByteString.valueOfUtf8("foo"));
     vlvResponse.writeValue(writer);
 
     ASN1Reader reader = ASN1.getReader(builder.toByteString());
@@ -466,7 +466,7 @@
          throws Exception
   {
     VLVResponseControl vlvResponse =
-         new VLVResponseControl(true, 0, 15, 0, ByteString.valueOf("foo"));
+         new VLVResponseControl(true, 0, 15, 0, ByteString.valueOfUtf8("foo"));
 
     assertEquals(vlvResponse.isCritical(), true);
     assertEquals(vlvResponse.getTargetPosition(), 0);
@@ -823,7 +823,7 @@
 
     SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)")
         .addControl(new ServerSideSortRequestControl("givenName"))
-        .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("a")));
+        .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("a")));
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
     assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
 
@@ -883,7 +883,7 @@
 
     SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)")
         .addControl(new ServerSideSortRequestControl("givenName"))
-        .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("aaccf")));
+        .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("aaccf")));
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
     assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
 
@@ -945,7 +945,7 @@
 
     SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)")
         .addControl(new ServerSideSortRequestControl("givenName"))
-        .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("albert")));
+        .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("albert")));
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
     assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
 
@@ -1007,7 +1007,7 @@
 
     SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)")
         .addControl(new ServerSideSortRequestControl("givenName"))
-        .addControl(new VLVRequestControl(1, 3, ByteString.valueOf("albert")));
+        .addControl(new VLVRequestControl(1, 3, ByteString.valueOfUtf8("albert")));
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
     assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
 
@@ -1075,7 +1075,7 @@
 
     SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)")
         .addControl(new ServerSideSortRequestControl("sn"))
-        .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("zz")));
+        .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("zz")));
     InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
 
     // It will be successful because the control isn't critical.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java
index 0152dab..fa7ed46 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java
@@ -259,8 +259,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -281,7 +281,7 @@
     attributes.add(new LDAPAttribute("ou", "People"));
 
     AddRequestProtocolOp addRequest =
-         new AddRequestProtocolOp(ByteString.valueOf("ou=People,o=test"), attributes);
+         new AddRequestProtocolOp(ByteString.valueOfUtf8("ou=People,o=test"), attributes);
     message = new LDAPMessage(2, addRequest,
                        DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -327,8 +327,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -345,8 +345,8 @@
     // the delay request control so it won't complete before we can send the
     // abandon request.
     CompareRequestProtocolOp compareRequest =
-      new CompareRequestProtocolOp(ByteString.valueOf("o=test"), "o",
-                                   ByteString.valueOf("test"));
+      new CompareRequestProtocolOp(ByteString.valueOfUtf8("o=test"), "o",
+                                   ByteString.valueOfUtf8("test"));
     message = new LDAPMessage(2, compareRequest,
                        DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -399,8 +399,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -417,7 +417,7 @@
     // the delay request control so it won't complete before we can send the
     // abandon request.
     DeleteRequestProtocolOp deleteRequest =
-         new DeleteRequestProtocolOp(ByteString.valueOf("cn=test,o=test"));
+         new DeleteRequestProtocolOp(ByteString.valueOfUtf8("cn=test,o=test"));
     message = new LDAPMessage(2, deleteRequest,
                        DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -465,8 +465,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -531,8 +531,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -553,7 +553,7 @@
                                   new LDAPAttribute("description", "foo")));
 
     ModifyRequestProtocolOp modifyRequest =
-         new ModifyRequestProtocolOp(ByteString.valueOf("o=test"), mods);
+         new ModifyRequestProtocolOp(ByteString.valueOfUtf8("o=test"), mods);
     message = new LDAPMessage(2, modifyRequest,
                        DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -606,8 +606,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -624,8 +624,8 @@
     // include the delay request control so it won't complete before we can send
     // the abandon request.
     ModifyDNRequestProtocolOp modifyDNRequest =
-         new ModifyDNRequestProtocolOp(ByteString.valueOf("cn=test,o=test"),
-                                       ByteString.valueOf("cn=test2"), true);
+         new ModifyDNRequestProtocolOp(ByteString.valueOfUtf8("cn=test,o=test"),
+                                       ByteString.valueOfUtf8("cn=test2"), true);
     message = new LDAPMessage(2, modifyDNRequest,
                        DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -673,8 +673,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -691,7 +691,7 @@
     // the delay request control so it won't complete before we can send the
     // abandon request.
     SearchRequestProtocolOp searchRequest =
-         new SearchRequestProtocolOp(ByteString.valueOf("o=test"),
+         new SearchRequestProtocolOp(ByteString.valueOfUtf8("o=test"),
                                      SearchScope.BASE_OBJECT,
                                      DereferenceAliasesPolicy.NEVER, 0,
                                      0, false,
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
index 03951f3..55e88a9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
@@ -114,10 +114,10 @@
     Operation[] opArray = new Operation[]
     {
       new AddOperationBasis(getRootConnection(), nextOperationID(), nextMessageID(),
-                       null, ByteString.valueOf("ou=People,o=test"),
+                       null, ByteString.valueOfUtf8("ou=People,o=test"),
                        ldapAttrList),
       new AddOperationBasis(getRootConnection(), nextOperationID(), nextMessageID(),
-                       noControls, ByteString.valueOf("ou=People,o=test"),
+                       noControls, ByteString.valueOfUtf8("ou=People,o=test"),
                        ldapAttrList),
       new AddOperationBasis(getRootConnection(), nextOperationID(), nextMessageID(),
                        null, entry.getName(), entry.getObjectClasses(),
@@ -169,10 +169,10 @@
     ByteString originalDN = addOperation.getRawEntryDN();
     assertNotNull(originalDN);
 
-    addOperation.setRawEntryDN(ByteString.valueOf("uid=test,o=test"));
+    addOperation.setRawEntryDN(ByteString.valueOfUtf8("uid=test,o=test"));
     assertNotNull(addOperation.getRawEntryDN());
     assertEquals(addOperation.getRawEntryDN(),
-                 ByteString.valueOf("uid=test,o=test"));
+                 ByteString.valueOfUtf8("uid=test,o=test"));
 
     addOperation.setRawEntryDN(originalDN);
     assertNotNull(addOperation.getRawEntryDN());
@@ -194,7 +194,7 @@
 
     AddOperationBasis addOperation =
          new AddOperationBasis(getRootConnection(), nextOperationID(), nextMessageID(),
-                          null, ByteString.valueOf("ou=People,o=test"),
+                          null, ByteString.valueOfUtf8("ou=People,o=test"),
                           ldapAttrList);
     assertNotNull(addOperation.getEntryDN());
   }
@@ -209,7 +209,7 @@
     ArrayList<ByteString> values = new ArrayList<>();
     for (String s : v)
     {
-      values.add(ByteString.valueOf(s));
+      values.add(ByteString.valueOfUtf8(s));
     }
     return values;
   }
@@ -262,7 +262,7 @@
                           entry.getOperationalAttributes());
     assertNotNull(addOperation.getEntryDN());
 
-    addOperation.setRawEntryDN(ByteString.valueOf("ou=Users,o=test"));
+    addOperation.setRawEntryDN(ByteString.valueOfUtf8("ou=Users,o=test"));
     assertNotNull(addOperation.getEntryDN());
   }
 
@@ -409,12 +409,12 @@
     boolean foundBar = false;
     for (Attribute attr : attrList)
     {
-      if (attr.contains(ByteString.valueOf("foo")))
+      if (attr.contains(ByteString.valueOfUtf8("foo")))
       {
         foundFoo = true;
       }
 
-      if (attr.contains(ByteString.valueOf("bar")))
+      if (attr.contains(ByteString.valueOfUtf8("bar")))
       {
         foundBar = true;
       }
@@ -714,7 +714,7 @@
         new LDAPAttribute("objectClass", newArrayList("top", "undefined")),
         new LDAPAttribute("ou", "People"));
 
-    AddOperation addOperation = getRootConnection().processAdd(ByteString.valueOf("ou=People,o=test"), attrs);
+    AddOperation addOperation = getRootConnection().processAdd(ByteString.valueOfUtf8("ou=People,o=test"), attrs);
     assertNotEquals(addOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -767,7 +767,7 @@
         new LDAPAttribute("ou", "People"),
         new LDAPAttribute("description", "bar"));
 
-    AddOperation addOperation = getRootConnection().processAdd(ByteString.valueOf("ou=People,o=test"), attrs);
+    AddOperation addOperation = getRootConnection().processAdd(ByteString.valueOfUtf8("ou=People,o=test"), attrs);
     assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -788,7 +788,7 @@
         new LDAPAttribute("ou", "People"),
         new LDAPAttribute("description;lang-en-us", "foo"));
 
-    AddOperation addOperation = getRootConnection().processAdd(ByteString.valueOf("ou=People,o=test"), attrs);
+    AddOperation addOperation = getRootConnection().processAdd(ByteString.valueOfUtf8("ou=People,o=test"), attrs);
     assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -810,7 +810,7 @@
         new LDAPAttribute("ou", "People"),
         new LDAPAttribute("description;lang-en-us", "foo"));
 
-    AddOperation addOperation = getRootConnection().processAdd(ByteString.valueOf("ou=People,o=test"), attrs);
+    AddOperation addOperation = getRootConnection().processAdd(ByteString.valueOfUtf8("ou=People,o=test"), attrs);
     assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -1309,7 +1309,7 @@
   private void bind(LDAPReader r, LDAPWriter w) throws Exception
   {
     final BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-        ByteString.valueOf("cn=Directory Manager"), 3, ByteString.valueOf("password"));
+        ByteString.valueOfUtf8("cn=Directory Manager"), 3, ByteString.valueOfUtf8("password"));
     w.writeMessage(new LDAPMessage(1, bindRequest));
 
     final LDAPMessage message = r.readMessage();
@@ -1642,7 +1642,7 @@
   private void writeAddRequest(LDAPWriter w, ArrayList<RawAttribute> attrs,
       String section) throws IOException
   {
-    AddRequestProtocolOp addRequest = new AddRequestProtocolOp(ByteString.valueOf("ou=People,o=test"), attrs);
+    AddRequestProtocolOp addRequest = new AddRequestProtocolOp(ByteString.valueOfUtf8("ou=People,o=test"), attrs);
     List<Control> controls = section != null
         ? DisconnectClientPlugin.createDisconnectControlList(section)
         : null;
@@ -1954,7 +1954,7 @@
 
     AddOperationBasis addOperation =
          new AddOperationBasis(getRootConnection(), nextOperationID(), nextMessageID(),
-                          controls, ByteString.valueOf("o=test"), rawAttrs);
+                          controls, ByteString.valueOfUtf8("o=test"), rawAttrs);
     addOperation.run();
     assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);
     assertFalse(DirectoryServer.entryExists(DN.valueOf("o=test")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java
index 2b5e61e..f9f5757 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java
@@ -99,8 +99,8 @@
                         noControls, "3", nullOS, nullOS),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         noControls, "3",
-                        ByteString.valueOf("cn=Directory Manager"),
-                        ByteString.valueOf("password")),
+                        ByteString.valueOfUtf8("cn=Directory Manager"),
+                        ByteString.valueOfUtf8("password")),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         null, "3", DN.rootDN(), ByteString.empty()),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
@@ -119,7 +119,7 @@
                         noControls, "3", nullDN, nullOS),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         noControls, "3", DN.valueOf("cn=Directory Manager"),
-                        ByteString.valueOf("password"))
+                        ByteString.valueOfUtf8("password"))
     };
 
     Object[][] array = new Object[simpleBinds.length][1];
@@ -163,16 +163,16 @@
                         noControls, "3", nullOS, "EXTERNAL", null),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         null, "3", ByteString.empty(), "PLAIN",
-                        ByteString.valueOf("\u0000u:test.user\u0000password")),
+                        ByteString.valueOfUtf8("\u0000u:test.user\u0000password")),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         noControls, "3", ByteString.empty(), "PLAIN",
-                        ByteString.valueOf("\u0000u:test.user\u0000password")),
+                        ByteString.valueOfUtf8("\u0000u:test.user\u0000password")),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         null, "3", nullOS, "PLAIN",
-                        ByteString.valueOf("\u0000u:test.user\u0000password")),
+                        ByteString.valueOfUtf8("\u0000u:test.user\u0000password")),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         noControls, "3", nullOS, "PLAIN",
-                        ByteString.valueOf("\u0000u:test.user\u0000password")),
+                        ByteString.valueOfUtf8("\u0000u:test.user\u0000password")),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         null, "3", DN.rootDN(), "EXTERNAL", null),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
@@ -183,16 +183,16 @@
                         noControls, "3", nullDN, "EXTERNAL", null),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         null, "3", DN.rootDN(), "PLAIN",
-                        ByteString.valueOf("\u0000u:test.user\u0000password")),
+                        ByteString.valueOfUtf8("\u0000u:test.user\u0000password")),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         noControls, "3", DN.rootDN(), "PLAIN",
-                        ByteString.valueOf("\u0000u:test.user\u0000password")),
+                        ByteString.valueOfUtf8("\u0000u:test.user\u0000password")),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         null, "3", nullDN, "PLAIN",
-                        ByteString.valueOf("\u0000u:test.user\u0000password")),
+                        ByteString.valueOfUtf8("\u0000u:test.user\u0000password")),
       new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                         noControls, "3", nullDN, "PLAIN",
-                        ByteString.valueOf("\u0000u:test.user\u0000password"))
+                        ByteString.valueOfUtf8("\u0000u:test.user\u0000password"))
     };
 
     Object[][] array = new Object[saslBinds.length][1];
@@ -330,8 +330,8 @@
     o.setRawBindDN(ByteString.empty());
     assertEquals(o.getRawBindDN(), ByteString.empty());
 
-    o.setRawBindDN(ByteString.valueOf("cn=Directory Manager"));
-    assertEquals(o.getRawBindDN(), ByteString.valueOf("cn=Directory Manager"));
+    o.setRawBindDN(ByteString.valueOfUtf8("cn=Directory Manager"));
+    assertEquals(o.getRawBindDN(), ByteString.valueOfUtf8("cn=Directory Manager"));
 
     o.setRawBindDN(originalRawBindDN);
     assertEquals(o.getRawBindDN(), originalRawBindDN);
@@ -356,8 +356,8 @@
     o.setRawBindDN(ByteString.empty());
     assertEquals(o.getRawBindDN(), ByteString.empty());
 
-    o.setRawBindDN(ByteString.valueOf("cn=Directory Manager"));
-    assertEquals(o.getRawBindDN(), ByteString.valueOf("cn=Directory Manager"));
+    o.setRawBindDN(ByteString.valueOfUtf8("cn=Directory Manager"));
+    assertEquals(o.getRawBindDN(), ByteString.valueOfUtf8("cn=Directory Manager"));
 
     o.setRawBindDN(originalRawBindDN);
     assertEquals(o.getRawBindDN(), originalRawBindDN);
@@ -495,7 +495,7 @@
     assertNull(o.getSASLCredentials());
 
     o.setSASLCredentials("PLAIN",
-         ByteString.valueOf("\u0000u:test.user\u0000password"));
+         ByteString.valueOfUtf8("\u0000u:test.user\u0000password"));
     assertEquals(o.getAuthenticationType(), AuthenticationType.SASL);
     assertNotNull(o.getSASLMechanism());
     assertNotNull(o.getSASLCredentials());
@@ -540,7 +540,7 @@
     assertEquals(o.getAuthenticationType(), AuthenticationType.SASL);
     assertNull(o.getSimplePassword());
 
-    o.setSimplePassword(ByteString.valueOf("password"));
+    o.setSimplePassword(ByteString.valueOfUtf8("password"));
     assertEquals(o.getAuthenticationType(), AuthenticationType.SIMPLE);
     assertNotNull(o.getSimplePassword());
 
@@ -618,7 +618,7 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindOperation bindOperation =
                        conn.processSASLBind(DN.rootDN(), "PLAIN", saslCreds);
@@ -653,8 +653,8 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("password"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
     assertNotNull(bindOperation.getUserEntryDN());
   }
@@ -686,7 +686,7 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindOperation bindOperation =
          conn.processSASLBind(DN.rootDN(), "PLAIN", saslCreds);
@@ -708,8 +708,8 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("password"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
     assertTrue(bindOperation.getProcessingStartTime() > 0);
     assertTrue(bindOperation.getProcessingStopTime() >=
@@ -731,7 +731,7 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindOperation bindOperation =
          conn.processSASLBind(DN.rootDN(), "PLAIN", saslCreds);
@@ -785,8 +785,8 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("password"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
 
 //    assertTrue(InvocationCounterPlugin.getPreParseCount() > 0);
@@ -811,7 +811,7 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindOperation bindOperation =
          conn.processSASLBind(DN.rootDN(), "PLAIN", saslCreds);
@@ -987,8 +987,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest,
          DisconnectClientPlugin.createDisconnectControlList("PreParse"));
     w.writeMessage(message);
@@ -1023,8 +1023,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PreOperation"));
@@ -1060,8 +1060,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PostOperation"));
@@ -1097,8 +1097,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PostResponse"));
@@ -1132,7 +1132,7 @@
     TestCaseUtils.configureSocket(s);
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindRequestProtocolOp bindRequest =
          new BindRequestProtocolOp(ByteString.empty(), "PLAIN", saslCreds);
@@ -1169,7 +1169,7 @@
     TestCaseUtils.configureSocket(s);
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindRequestProtocolOp bindRequest =
          new BindRequestProtocolOp(ByteString.empty(), "PLAIN", saslCreds);
@@ -1207,7 +1207,7 @@
     TestCaseUtils.configureSocket(s);
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindRequestProtocolOp bindRequest =
          new BindRequestProtocolOp(ByteString.empty(), "PLAIN", saslCreds);
@@ -1245,7 +1245,7 @@
     TestCaseUtils.configureSocket(s);
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindRequestProtocolOp bindRequest =
          new BindRequestProtocolOp(ByteString.empty(), "PLAIN", saslCreds);
@@ -1348,8 +1348,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest,
          ShortCircuitPlugin.createShortCircuitControlList(80, "PreParse"));
     w.writeMessage(message);
@@ -1380,8 +1380,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest,
          ShortCircuitPlugin.createShortCircuitControlList(80,
                                                               "PreOperation"));
@@ -1412,7 +1412,7 @@
     TestCaseUtils.configureSocket(s);
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindRequestProtocolOp bindRequest =
          new BindRequestProtocolOp(ByteString.empty(), "PLAIN", saslCreds);
@@ -1445,7 +1445,7 @@
     TestCaseUtils.configureSocket(s);
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindRequestProtocolOp bindRequest =
          new BindRequestProtocolOp(ByteString.empty(), "PLAIN", saslCreds);
@@ -1473,8 +1473,8 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("invaliddn"),
-                                ByteString.valueOf("password"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("invaliddn"),
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.INVALID_CREDENTIALS);
   }
 
@@ -1490,10 +1490,10 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindOperation bindOperation =
-         conn.processSASLBind(ByteString.valueOf("invaliddn"), "PLAIN",
+         conn.processSASLBind(ByteString.valueOfUtf8("invaliddn"), "PLAIN",
                               saslCreds);
     assertEquals(bindOperation.getResultCode(), ResultCode.INVALID_CREDENTIALS);
   }
@@ -1538,7 +1538,7 @@
     requestControls.add(new LDAPControl("1.2.3.4", true));
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindOperationBasis bindOperation =
          new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
@@ -1589,7 +1589,7 @@
     requestControls.add(new LDAPControl("1.2.3.4", false));
 
     ByteString saslCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     BindOperationBasis bindOperation =
          new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
@@ -1617,8 +1617,8 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("uid=test,o=test"),
-                                ByteString.valueOf("password"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("uid=test,o=test"),
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.INVALID_CREDENTIALS);
   }
 
@@ -1641,7 +1641,7 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
                                 ByteString.empty());
     assertEquals(bindOperation.getResultCode(),
                            ResultCode.UNWILLING_TO_PERFORM);
@@ -1672,7 +1672,7 @@
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
                                 ByteString.empty());
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
 
@@ -1707,8 +1707,8 @@
 
     InternalClientConnection conn = getRootConnection();
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("uid=test,o=test"),
-                                ByteString.valueOf("password"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("uid=test,o=test"),
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.INVALID_CREDENTIALS);
   }
 
@@ -1737,8 +1737,8 @@
          InternalClientConnection.getRootConnection();
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("uid=test,ou=people,dc=example,dc=com"),
-                                ByteString.valueOf("password"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("uid=test,ou=people,dc=example,dc=com"),
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.REFERRAL);
 
     List<String> referralURLs = bindOperation.getReferralURLs();
@@ -1760,8 +1760,8 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("wrongpassword"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                ByteString.valueOfUtf8("wrongpassword"));
     assertEquals(bindOperation.getResultCode(), ResultCode.INVALID_CREDENTIALS);
   }
 
@@ -1778,8 +1778,8 @@
          new InternalClientConnection(new AuthenticationInfo());
 
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("wrongpassword"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                ByteString.valueOfUtf8("wrongpassword"));
     assertEquals(bindOperation.getResultCode(), ResultCode.INVALID_CREDENTIALS);
     assertThat(bindOperation.getErrorMessage()).isEmpty();
 
@@ -1791,8 +1791,8 @@
       "--set", "return-bind-error-messages:true");
 
     bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("wrongpassword"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                ByteString.valueOfUtf8("wrongpassword"));
     assertEquals(bindOperation.getResultCode(), ResultCode.INVALID_CREDENTIALS);
     assertTrue(bindOperation.getErrorMessage().length() > 0);
 
@@ -1804,8 +1804,8 @@
       "--set", "return-bind-error-messages:false");
 
     bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("wrongpassword"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                ByteString.valueOfUtf8("wrongpassword"));
     assertEquals(bindOperation.getResultCode(), ResultCode.INVALID_CREDENTIALS);
     assertThat(bindOperation.getErrorMessage()).isEmpty();
   }
@@ -1844,8 +1844,8 @@
     LDAPWriter w = new LDAPWriter(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf(dnString),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8(dnString),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -1862,8 +1862,8 @@
     // for previous ops to complete.
     TestCaseUtils.quiesceServer();
     bindRequest = new BindRequestProtocolOp(
-                           ByteString.valueOf("cn=Directory Manager"), 3,
-                           ByteString.valueOf("password"));
+                           ByteString.valueOfUtf8("cn=Directory Manager"), 3,
+                           ByteString.valueOfUtf8("password"));
     message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -1917,8 +1917,8 @@
     LDAPWriter w = new LDAPWriter(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf(dnString),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8(dnString),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -1993,8 +1993,8 @@
     LDAPWriter w = new LDAPWriter(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf(dnString),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8(dnString),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java
index b1ad152..9e4a8f9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java
@@ -124,8 +124,8 @@
                            conn, InternalClientConnection.nextOperationID(),
                            InternalClientConnection.nextMessageID(),
                            new ArrayList<Control>(),
-                           ByteString.valueOf(entry.getName().toString()),
-                           "uid", ByteString.valueOf("rogasawara"))
+                           ByteString.valueOfUtf8(entry.getName().toString()),
+                           "uid", ByteString.valueOfUtf8("rogasawara"))
     };
   }
 
@@ -201,8 +201,8 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -226,8 +226,8 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawala"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawala"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -250,8 +250,8 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf("o=nonexistent,o=test"),
-                              "o", ByteString.valueOf("nonexistent"));
+                              ByteString.valueOfUtf8("o=nonexistent,o=test"),
+                              "o", ByteString.valueOfUtf8("nonexistent"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -273,8 +273,8 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf("rogasawara,o=test"),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8("rogasawara,o=test"),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -296,8 +296,8 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf(entry.getName().toString()),
-                              "description", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "description", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -320,9 +320,9 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf(entry.getName().toString()),
+                              ByteString.valueOfUtf8(entry.getName().toString()),
                               "NotAnAttribute",
-                              ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -343,9 +343,9 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf(entry.getName().toString()),
+                              ByteString.valueOfUtf8(entry.getName().toString()),
                               "name",
-                              ByteString.valueOf("Ogasawara"));
+                              ByteString.valueOfUtf8("Ogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -363,9 +363,9 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf(entry.getName().toString()),
+                              ByteString.valueOfUtf8(entry.getName().toString()),
                               "sn",
-                              ByteString.valueOf("Ogasawara"));
+                              ByteString.valueOfUtf8("Ogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -383,9 +383,9 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf(entry.getName().toString()),
+                              ByteString.valueOfUtf8(entry.getName().toString()),
                               "sn;lang-ja",
-                              ByteString.valueOf("Ogasawara"));
+                              ByteString.valueOfUtf8("Ogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -403,9 +403,9 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               new ArrayList<Control>(),
-                              ByteString.valueOf(entry.getName().toString()),
+                              ByteString.valueOfUtf8(entry.getName().toString()),
                               "givenName;lAnG-En",
-                              ByteString.valueOf("Rodney"));
+                              ByteString.valueOfUtf8("Rodney"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -429,8 +429,8 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               controls,
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -457,8 +457,8 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               controls,
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -473,7 +473,7 @@
     InvocationCounterPlugin.resetAllCounters();
 
     Control authV1Control =
-         new ProxiedAuthV1Control(ByteString.valueOf(
+         new ProxiedAuthV1Control(ByteString.valueOfUtf8(
               "cn=Directory Manager,cn=Root DNs,cn=config"));
     List<Control> controls = newArrayList(authV1Control);
 
@@ -483,8 +483,8 @@
                               InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               controls,
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -501,7 +501,7 @@
 
     InvocationCounterPlugin.resetAllCounters();
 
-    Control authV1Control = new ProxiedAuthV1Control(ByteString.valueOf("cn=nonexistent,o=test"));
+    Control authV1Control = new ProxiedAuthV1Control(ByteString.valueOfUtf8("cn=nonexistent,o=test"));
     List<Control> controls = newArrayList(authV1Control);
 
     CompareOperationBasis compareOperation =
@@ -510,8 +510,8 @@
                               InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               controls,
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -526,7 +526,7 @@
     InvocationCounterPlugin.resetAllCounters();
 
     Control authV2Control =
-         new ProxiedAuthV2Control(ByteString.valueOf(
+         new ProxiedAuthV2Control(ByteString.valueOfUtf8(
                   "dn:cn=Directory Manager,cn=Root DNs,cn=config"));
     List<Control> controls = newArrayList(authV2Control);
 
@@ -536,8 +536,8 @@
                               InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               controls,
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -552,7 +552,7 @@
   {
     InvocationCounterPlugin.resetAllCounters();
 
-    Control authV2Control = new ProxiedAuthV2Control(ByteString.valueOf("dn:cn=nonexistent,o=test"));
+    Control authV2Control = new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:cn=nonexistent,o=test"));
     List<Control> controls = newArrayList(authV2Control);
 
     CompareOperationBasis compareOperation =
@@ -561,8 +561,8 @@
                               InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               controls,
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -588,8 +588,8 @@
                               InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               controls,
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
@@ -614,8 +614,8 @@
                               conn, InternalClientConnection.nextOperationID(),
                               InternalClientConnection.nextMessageID(),
                               controls,
-                              ByteString.valueOf(entry.getName().toString()),
-                              "uid", ByteString.valueOf("rogasawara"));
+                              ByteString.valueOfUtf8(entry.getName().toString()),
+                              "uid", ByteString.valueOfUtf8("rogasawara"));
 
     compareOperation.run();
     assertEquals(compareOperation.getResultCode(),
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java
index 854b611..84d8cc5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java
@@ -78,8 +78,8 @@
     {
       newDeleteOperation(noControls, ByteString.empty()),
       newDeleteOperation(null, ByteString.empty()),
-      newDeleteOperation(noControls, ByteString.valueOf("o=test")),
-      newDeleteOperation(null, ByteString.valueOf("o=test")),
+      newDeleteOperation(noControls, ByteString.valueOfUtf8("o=test")),
+      newDeleteOperation(null, ByteString.valueOfUtf8("o=test")),
       newDeleteOperation(noControls, DN.rootDN()),
       newDeleteOperation(null, DN.rootDN()),
       newDeleteOperation(noControls, DN.valueOf("o=test")),
@@ -117,9 +117,9 @@
     ByteString originalRawDN = deleteOperation.getRawEntryDN();
     assertNotNull(originalRawDN);
 
-    deleteOperation.setRawEntryDN(ByteString.valueOf("dc=example,dc=com"));
+    deleteOperation.setRawEntryDN(ByteString.valueOfUtf8("dc=example,dc=com"));
     assertEquals(deleteOperation.getRawEntryDN(),
-                 ByteString.valueOf("dc=example,dc=com"));
+                 ByteString.valueOfUtf8("dc=example,dc=com"));
 
     deleteOperation.setRawEntryDN(originalRawDN);
     assertEquals(deleteOperation.getRawEntryDN(), originalRawDN);
@@ -135,7 +135,7 @@
   public void testGetEntryDNNull()
   {
     DeleteOperation deleteOperation =
-        newDeleteOperation(null, ByteString.valueOf("o=test"));
+        newDeleteOperation(null, ByteString.valueOfUtf8("o=test"));
     assertNotNull(deleteOperation.getEntryDN());
   }
 
@@ -172,7 +172,7 @@
         newDeleteOperation(null, DN.valueOf("o=test"));
     assertNotNull(deleteOperation.getEntryDN());
 
-    deleteOperation.setRawEntryDN(ByteString.valueOf("dc=example,dc=com"));
+    deleteOperation.setRawEntryDN(ByteString.valueOfUtf8("dc=example,dc=com"));
     assertNotNull(deleteOperation.getEntryDN());
   }
 
@@ -220,7 +220,7 @@
 
   private DeleteOperation processDeleteRaw(String entryDN)
   {
-    return getRootConnection().processDelete(ByteString.valueOf(entryDN));
+    return getRootConnection().processDelete(ByteString.valueOfUtf8(entryDN));
   }
 
   private DeleteOperation processDelete(String entryDN) throws DirectoryException
@@ -653,7 +653,7 @@
     TestCaseUtils.initializeTestBackend(true);
 
     DeleteOperation deleteOperation =
-        newDeleteOperation(null, ByteString.valueOf("o=test"));
+        newDeleteOperation(null, ByteString.valueOfUtf8("o=test"));
 
     CancelRequest cancelRequest = new CancelRequest(false,
                                                     LocalizableMessage.raw("testCancelBeforeStartup"));
@@ -673,7 +673,7 @@
     TestCaseUtils.initializeTestBackend(true);
 
     DeleteOperation deleteOperation =
-        newDeleteOperation(null, ByteString.valueOf("o=test"));
+        newDeleteOperation(null, ByteString.valueOfUtf8("o=test"));
     deleteOperation.run();
 
     CancelRequest cancelRequest = new CancelRequest(false,
@@ -727,8 +727,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -739,7 +739,7 @@
 
 
     DeleteRequestProtocolOp deleteRequest =
-         new DeleteRequestProtocolOp(ByteString.valueOf("o=test"));
+         new DeleteRequestProtocolOp(ByteString.valueOfUtf8("o=test"));
     message = new LDAPMessage(2, deleteRequest,
          DisconnectClientPlugin.createDisconnectControlList("PreParse"));
     w.writeMessage(message);
@@ -774,8 +774,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -786,7 +786,7 @@
 
 
     DeleteRequestProtocolOp deleteRequest =
-         new DeleteRequestProtocolOp(ByteString.valueOf("o=test"));
+         new DeleteRequestProtocolOp(ByteString.valueOfUtf8("o=test"));
     message = new LDAPMessage(2, deleteRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PreOperation"));
@@ -822,8 +822,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -834,7 +834,7 @@
 
 
     DeleteRequestProtocolOp deleteRequest =
-         new DeleteRequestProtocolOp(ByteString.valueOf("o=test"));
+         new DeleteRequestProtocolOp(ByteString.valueOfUtf8("o=test"));
     message = new LDAPMessage(2, deleteRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PostOperation"));
@@ -870,8 +870,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -882,7 +882,7 @@
 
 
     DeleteRequestProtocolOp deleteRequest =
-         new DeleteRequestProtocolOp(ByteString.valueOf("o=test"));
+         new DeleteRequestProtocolOp(ByteString.valueOfUtf8("o=test"));
     message = new LDAPMessage(2, deleteRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PostResponse"));
@@ -1000,7 +1000,7 @@
          ShortCircuitPlugin.createShortCircuitControlList(0, "PreParse");
 
     DeleteOperation deleteOperation =
-        newDeleteOperation(controls, ByteString.valueOf("o=test"));
+        newDeleteOperation(controls, ByteString.valueOfUtf8("o=test"));
     deleteOperation.run();
     assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS);
     assertTrue(DirectoryServer.entryExists(DN.valueOf("o=test")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/IdleTimeLimitTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/IdleTimeLimitTestCase.java
index 56043f4..69d6bca 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/IdleTimeLimitTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/IdleTimeLimitTestCase.java
@@ -145,8 +145,8 @@
 
 
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage m = new LDAPMessage(1, bindRequest);
       w.writeMessage(m);
 
@@ -211,8 +211,8 @@
 
 
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-           ByteString.valueOf("uid=test.user,o=test"), 3,
-           ByteString.valueOf("password"));
+           ByteString.valueOfUtf8("uid=test.user,o=test"), 3,
+           ByteString.valueOfUtf8("password"));
       LDAPMessage m = new LDAPMessage(1, bindRequest);
       w.writeMessage(m);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
index 613c9b1..724a151 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
@@ -127,22 +127,22 @@
 
     opList.add(newModifyOperation(null, ByteString.empty(), ldapMods));
     opList.add(newModifyOperation(noControls, ByteString.empty(), ldapMods));
-    opList.add(newModifyOperation(null, ByteString.valueOf("o=test"), ldapMods));
-    opList.add(newModifyOperation(noControls, ByteString.valueOf("o=test"), ldapMods));
+    opList.add(newModifyOperation(null, ByteString.valueOfUtf8("o=test"), ldapMods));
+    opList.add(newModifyOperation(noControls, ByteString.valueOfUtf8("o=test"), ldapMods));
 
     ldapMods = newRawModifications(delete(ldapAttr));
 
     opList.add(newModifyOperation(null, ByteString.empty(), ldapMods));
     opList.add(newModifyOperation(noControls, ByteString.empty(), ldapMods));
-    opList.add(newModifyOperation(null, ByteString.valueOf("o=test"), ldapMods));
-    opList.add(newModifyOperation(noControls, ByteString.valueOf("o=test"), ldapMods));
+    opList.add(newModifyOperation(null, ByteString.valueOfUtf8("o=test"), ldapMods));
+    opList.add(newModifyOperation(noControls, ByteString.valueOfUtf8("o=test"), ldapMods));
 
     ldapMods = newRawModifications(replace(ldapAttr));
 
     opList.add(newModifyOperation(null, ByteString.empty(), ldapMods));
     opList.add(newModifyOperation(noControls, ByteString.empty(), ldapMods));
-    opList.add(newModifyOperation(null, ByteString.valueOf("o=test"), ldapMods));
-    opList.add(newModifyOperation(noControls, ByteString.valueOf("o=test"), ldapMods));
+    opList.add(newModifyOperation(null, ByteString.valueOfUtf8("o=test"), ldapMods));
+    opList.add(newModifyOperation(noControls, ByteString.valueOfUtf8("o=test"), ldapMods));
 
     String value2 = "bar";
     LDAPAttribute ldapAttr2 = new LDAPAttribute("description", value2);
@@ -150,16 +150,16 @@
 
     opList.add(newModifyOperation(null, ByteString.empty(), ldapMods));
     opList.add(newModifyOperation(noControls, ByteString.empty(), ldapMods));
-    opList.add(newModifyOperation(null, ByteString.valueOf("o=test"), ldapMods));
-    opList.add(newModifyOperation(noControls, ByteString.valueOf("o=test"), ldapMods));
+    opList.add(newModifyOperation(null, ByteString.valueOfUtf8("o=test"), ldapMods));
+    opList.add(newModifyOperation(noControls, ByteString.valueOfUtf8("o=test"), ldapMods));
 
     ldapAttr2 = new LDAPAttribute("cn", value2);
     ldapMods = newRawModifications(replace(ldapAttr), replace(ldapAttr2));
 
     opList.add(newModifyOperation(null, ByteString.empty(), ldapMods));
     opList.add(newModifyOperation(noControls, ByteString.empty(), ldapMods));
-    opList.add(newModifyOperation(null, ByteString.valueOf("o=test"), ldapMods));
-    opList.add(newModifyOperation(noControls, ByteString.valueOf("o=test"), ldapMods));
+    opList.add(newModifyOperation(null, ByteString.valueOfUtf8("o=test"), ldapMods));
+    opList.add(newModifyOperation(noControls, ByteString.valueOfUtf8("o=test"), ldapMods));
 
 
 
@@ -279,10 +279,10 @@
     ByteString originalDN = modifyOperation.getRawEntryDN();
     assertNotNull(originalDN);
 
-    modifyOperation.setRawEntryDN(ByteString.valueOf("uid=test,o=test"));
+    modifyOperation.setRawEntryDN(ByteString.valueOfUtf8("uid=test,o=test"));
     assertNotNull(modifyOperation.getRawEntryDN());
     assertEquals(modifyOperation.getRawEntryDN(),
-                 ByteString.valueOf("uid=test,o=test"));
+                 ByteString.valueOfUtf8("uid=test,o=test"));
 
     modifyOperation.setRawEntryDN(originalDN);
     assertNotNull(modifyOperation.getRawEntryDN());
@@ -344,7 +344,7 @@
     ModifyOperation modifyOperation = newModifyOperation(null, DN.rootDN(), mods);
     assertNotNull(modifyOperation.getEntryDN());
 
-    modifyOperation.setRawEntryDN(ByteString.valueOf("ou=Users,o=test"));
+    modifyOperation.setRawEntryDN(ByteString.valueOfUtf8("ou=Users,o=test"));
     assertNotNull(modifyOperation.getEntryDN());
   }
 
@@ -778,20 +778,20 @@
       List<RawModification> mods)
   {
     InternalClientConnection conn = getRootConnection();
-    return conn.processModify(ByteString.valueOf(entryDN), mods);
+    return conn.processModify(ByteString.valueOfUtf8(entryDN), mods);
   }
 
   private ModifyOperation processModify(String entryDN, RawModification... mods)
   {
     InternalClientConnection conn = getRootConnection();
-    return conn.processModify(ByteString.valueOf(entryDN), Arrays.asList(mods));
+    return conn.processModify(ByteString.valueOfUtf8(entryDN), Arrays.asList(mods));
   }
 
   private ModifyOperation processModify(String entryDN,
       List<RawModification> mods, List<Control> requestControls)
   {
     InternalClientConnection conn = getRootConnection();
-    return conn.processModify(ByteString.valueOf(entryDN), mods, requestControls);
+    return conn.processModify(ByteString.valueOfUtf8(entryDN), mods, requestControls);
   }
 
   /**
@@ -2340,8 +2340,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -2358,7 +2358,7 @@
 
     ModifyRequestProtocolOp modifyRequest =
          new ModifyRequestProtocolOp(
-                  ByteString.valueOf("uid=test.user," + baseDN), mods);
+                  ByteString.valueOfUtf8("uid=test.user," + baseDN), mods);
     message = new LDAPMessage(2, modifyRequest);
     w.writeMessage(message);
 
@@ -2480,8 +2480,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -2498,7 +2498,7 @@
 
     ModifyRequestProtocolOp modifyRequest =
          new ModifyRequestProtocolOp(
-                  ByteString.valueOf("uid=test.user," + baseDN), mods);
+                  ByteString.valueOfUtf8("uid=test.user," + baseDN), mods);
     message = new LDAPMessage(2, modifyRequest);
     w.writeMessage(message);
 
@@ -2626,8 +2626,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -2644,7 +2644,7 @@
 
     ModifyRequestProtocolOp modifyRequest =
          new ModifyRequestProtocolOp(
-                  ByteString.valueOf("uid=test.user," + baseDN), mods);
+                  ByteString.valueOfUtf8("uid=test.user," + baseDN), mods);
     message = new LDAPMessage(2, modifyRequest);
     w.writeMessage(message);
 
@@ -2736,7 +2736,7 @@
     List<RawModification> mods = newRawModifications(replace(attr));
 
     ModifyOperation modifyOperation =
-        newModifyOperation(null, ByteString.valueOf(baseDN), mods);
+        newModifyOperation(null, ByteString.valueOfUtf8(baseDN), mods);
 
     CancelRequest cancelRequest = new CancelRequest(false,
                                                     LocalizableMessage.raw("testCancelBeforeStartup"));
@@ -2760,7 +2760,7 @@
     List<RawModification> mods = newRawModifications(replace(attr));
 
     ModifyOperation modifyOperation =
-        newModifyOperation(null, ByteString.valueOf(baseDN), mods);
+        newModifyOperation(null, ByteString.valueOfUtf8(baseDN), mods);
     modifyOperation.run();
 
     CancelRequest cancelRequest = new CancelRequest(false,
@@ -2812,8 +2812,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -2828,7 +2828,7 @@
     List<RawModification> mods = newRawModifications(replace(attr));
 
     ModifyRequestProtocolOp modifyRequest =
-         new ModifyRequestProtocolOp(ByteString.valueOf(baseDN), mods);
+         new ModifyRequestProtocolOp(ByteString.valueOfUtf8(baseDN), mods);
     message = new LDAPMessage(2, modifyRequest,
          DisconnectClientPlugin.createDisconnectControlList("PreParse"));
     w.writeMessage(message);
@@ -2862,8 +2862,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -2878,7 +2878,7 @@
     List<RawModification> mods = newRawModifications(replace(attr));
 
     ModifyRequestProtocolOp modifyRequest =
-         new ModifyRequestProtocolOp(ByteString.valueOf("o=test"), mods);
+         new ModifyRequestProtocolOp(ByteString.valueOfUtf8("o=test"), mods);
     message = new LDAPMessage(2, modifyRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PreOperation"));
@@ -2913,8 +2913,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -2929,7 +2929,7 @@
     List<RawModification> mods = newRawModifications(replace(attr));
 
     ModifyRequestProtocolOp modifyRequest =
-         new ModifyRequestProtocolOp(ByteString.valueOf(baseDN), mods);
+         new ModifyRequestProtocolOp(ByteString.valueOfUtf8(baseDN), mods);
     message = new LDAPMessage(2, modifyRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PostOperation"));
@@ -2989,8 +2989,8 @@
     TestCaseUtils.configureSocket(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -3004,7 +3004,7 @@
     List<RawModification> mods = newRawModifications(replace(attr));
 
     ModifyRequestProtocolOp modifyRequest =
-         new ModifyRequestProtocolOp(ByteString.valueOf(baseDN), mods);
+         new ModifyRequestProtocolOp(ByteString.valueOfUtf8(baseDN), mods);
     message = new LDAPMessage(2, modifyRequest,
          DisconnectClientPlugin.createDisconnectControlList(
               "PostResponse"));
@@ -3182,7 +3182,7 @@
         RawModification.create(ModificationType.REPLACE, "description", "foo"));
 
     ModifyOperation modifyOperation =
-        newModifyOperation(controls, ByteString.valueOf("o=test"), mods);
+        newModifyOperation(controls, ByteString.valueOfUtf8("o=test"), mods);
     modifyOperation.run();
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
     assertTrue(DirectoryServer.entryExists(DN.valueOf("o=test")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/RejectUnauthReqTests.java b/opendj-server-legacy/src/test/java/org/opends/server/core/RejectUnauthReqTests.java
index 5dc708f..d22def8 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/RejectUnauthReqTests.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/RejectUnauthReqTests.java
@@ -401,8 +401,8 @@
 
     InternalClientConnection conn = new InternalClientConnection(
         new AuthenticationInfo());
-    ByteString user = ByteString.valueOf("cn=Directory Manager");
-    ByteString password = ByteString.valueOf("password");
+    ByteString user = ByteString.valueOfUtf8("cn=Directory Manager");
+    ByteString password = ByteString.valueOfUtf8("password");
     BindOperation bindOperation = conn.processSimpleBind(user, password);
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
   }
@@ -447,8 +447,8 @@
     AtomicInteger nextMessageID = new AtomicInteger(1);
     LDAPAuthenticationHandler authHandler = new LDAPAuthenticationHandler(
         reader, writer, "localhost", nextMessageID);
-    authHandler.doSimpleBind(3, ByteString.valueOf("cn=Directory Manager"),
-        ByteString.valueOf("password"), new ArrayList<Control>(),
+    authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
+        ByteString.valueOfUtf8("password"), new ArrayList<Control>(),
         new ArrayList<Control>());
     ByteString authzID = authHandler.requestAuthorizationIdentity();
     assertNotNull(authzID);
@@ -649,8 +649,8 @@
 
       InternalClientConnection conn = new InternalClientConnection(
           new AuthenticationInfo());
-      ByteString user = ByteString.valueOf("cn=Directory Manager");
-      ByteString password = ByteString.valueOf("password");
+      ByteString user = ByteString.valueOfUtf8("cn=Directory Manager");
+      ByteString password = ByteString.valueOfUtf8("password");
       // Unauthenticated BIND request.
       BindOperation bindOperation = conn.processSimpleBind(DN.rootDN(), null);
       assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java
index 12263f5..12f08a0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java
@@ -291,8 +291,8 @@
     InvocationCounterPlugin.resetAllCounters();
     BindRequestProtocolOp bindRequest =
          new BindRequestProtocolOp(
-              ByteString.valueOf("cn=Directory Manager"),
-              3, ByteString.valueOf("password"));
+              ByteString.valueOfUtf8("cn=Directory Manager"),
+              3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -413,7 +413,7 @@
   {
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -432,7 +432,7 @@
     LinkedHashSet<String> attributes = newLinkedHashSet("*");
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -451,7 +451,7 @@
   {
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -475,7 +475,7 @@
     LinkedHashSet<String> attributes = newLinkedHashSet("*");
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -499,7 +499,7 @@
     LinkedHashSet<String> attributes = newLinkedHashSet("objectclass");
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -523,7 +523,7 @@
     LinkedHashSet<String> attributes = newLinkedHashSet("objectclass");
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -546,7 +546,7 @@
     LinkedHashSet<String> attributes = newLinkedHashSet("uid", "createtimestamp");
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -567,7 +567,7 @@
     LinkedHashSet<String> attributes = newLinkedHashSet("title");
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -589,7 +589,7 @@
     LinkedHashSet<String> attributes = newLinkedHashSet("title");
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -614,7 +614,7 @@
     LinkedHashSet<String> attributes = newLinkedHashSet("title;lang-ja;phonetic");
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -640,7 +640,7 @@
 
     SearchRequestProtocolOp searchRequest =
          new SearchRequestProtocolOp(
-              ByteString.valueOf(BASE),
+              ByteString.valueOfUtf8(BASE),
               SearchScope.WHOLE_SUBTREE,
               DereferenceAliasesPolicy.NEVER,
               Integer.MAX_VALUE,
@@ -1162,7 +1162,7 @@
 
     SearchRequestProtocolOp searchRequest =
       new SearchRequestProtocolOp(
-          ByteString.valueOf(userDNString),
+          ByteString.valueOfUtf8(userDNString),
           SearchScope.BASE_OBJECT,
           DereferenceAliasesPolicy.NEVER,
           Integer.MAX_VALUE,
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
index f05c70a..91b37f9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
@@ -251,7 +251,7 @@
       Attribute attribute = description.get(0);
       assertEquals(attribute.size(), 1);
       assertFalse(attribute.hasOptions());
-      assertTrue(attribute.contains(ByteString.valueOf("inherited description")));
+      assertTrue(attribute.contains(ByteString.valueOfUtf8("inherited description")));
     }
     finally
     {
@@ -336,7 +336,7 @@
     assertTrue(entry.hasAttribute(attrType));
     for (String value : values)
     {
-      assertTrue(entry.hasValue(attrType, null, ByteString.valueOf(value)));
+      assertTrue(entry.hasValue(attrType, null, ByteString.valueOfUtf8(value)));
     }
   }
 
@@ -347,7 +347,7 @@
     assertTrue(entry.hasAttribute(attrType));
     for (String value : values)
     {
-      assertFalse(entry.hasValue(attrType, null, ByteString.valueOf(value)));
+      assertFalse(entry.hasValue(attrType, null, ByteString.valueOfUtf8(value)));
     }
   }
 
@@ -369,7 +369,7 @@
     assertEquals(searchOperation.getEntriesSent(), 1);
     AttributeType attrType = DirectoryServer.getAttributeTypeOrNull("collectiveattributesubentries");
     Entry e = searchOperation.getSearchEntries().getFirst();
-    assertTrue(e.hasValue(attrType, null, ByteString.valueOf(collectiveSubentry.getName())));
+    assertTrue(e.hasValue(attrType, null, ByteString.valueOfObject(collectiveSubentry.getName())));
   }
 
   @Test
@@ -404,7 +404,7 @@
   {
     InternalClientConnection conn = getRootConnection();
     List<RawModification> mods = newRawModifications(DELETE, attrType);
-    ModifyOperation modifyOperation = conn.processModify(ByteString.valueOf(e.getName().toString()), mods);
+    ModifyOperation modifyOperation = conn.processModify(ByteString.valueOfUtf8(e.getName().toString()), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -412,7 +412,7 @@
   {
     InternalClientConnection conn = getRootConnection();
     List<RawModification> mods = newRawModifications(REPLACE, attrType, newValue);
-    ModifyOperation modifyOperation = conn.processModify(ByteString.valueOf(e.getName().toString()), mods);
+    ModifyOperation modifyOperation = conn.processModify(ByteString.valueOfUtf8(e.getName().toString()), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryPasswordPolicyTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryPasswordPolicyTestCase.java
index 8a917aa..a4f66f0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryPasswordPolicyTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryPasswordPolicyTestCase.java
@@ -423,7 +423,7 @@
     // for the user entry.
     assertTrue(testEntry.hasAttribute(attrType));
     assertTrue(testEntry.hasValue(attrType, null,
-            ByteString.valueOf(defaultPolicy.getDN().toString())));
+            ByteString.valueOfUtf8(defaultPolicy.getDN().toString())));
 
     // Add new subentry policy with the
     // scope to apply to the user entry.
@@ -445,7 +445,7 @@
     assertNotNull(testEntry);
 
     assertTrue(testEntry.hasAttribute(attrType));
-    assertTrue(testEntry.hasValue(attrType, null, ByteString.valueOf("cn=Temp Policy," + SUFFIX)));
+    assertTrue(testEntry.hasValue(attrType, null, ByteString.valueOfUtf8("cn=Temp Policy," + SUFFIX)));
 
     // Remove subentry policy and make sure
     // default policy is in effect again.
@@ -457,6 +457,6 @@
 
     assertTrue(testEntry.hasAttribute(attrType));
     assertTrue(testEntry.hasValue(attrType, null,
-            ByteString.valueOf(defaultPolicy.getDN().toString())));
+            ByteString.valueOfUtf8(defaultPolicy.getDN().toString())));
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java b/opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java
index dc7d0cb..4b66948 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java
@@ -299,7 +299,7 @@
 
   private ByteString b(String s)
   {
-    return s != null ? ByteString.valueOf(s) : null;
+    return s != null ? ByteString.valueOfUtf8(s) : null;
   }
 
   private DN dn(String s) throws DirectoryException
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/AnonymousSASLMechanismHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/AnonymousSASLMechanismHandlerTestCase.java
index bf03149..6c0fdf0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/AnonymousSASLMechanismHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/AnonymousSASLMechanismHandlerTestCase.java
@@ -194,7 +194,7 @@
          new BindOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(),
                            new ArrayList<Control>(), "3", DN.rootDN(),
                            SASL_MECHANISM_ANONYMOUS,
-                           ByteString.valueOf("Internal Trace String"));
+                           ByteString.valueOfUtf8("Internal Trace String"));
     handler.processSASLBind(bindOperation);
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java
index 76fc157..e5685c1 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java
@@ -434,7 +434,7 @@
          new AttributeValuePasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString pwOS = ByteString.valueOf(password);
+    ByteString pwOS = ByteString.valueOfUtf8(password);
     ArrayList<Modification> mods = CollectionUtils.newArrayList(
         new Modification(ModificationType.REPLACE, Attributes.create("userpassword", password)));
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandlerTestCase.java
index ae4aeef..be37092 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandlerTestCase.java
@@ -617,7 +617,7 @@
          new InternalClientConnection(new AuthenticationInfo());
     BindOperation bindOperation =
          conn.processSASLBind(DN.rootDN(), SASL_MECHANISM_CRAM_MD5,
-                              ByteString.valueOf("invalid"));
+                              ByteString.valueOfUtf8("invalid"));
     assertNotEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -642,7 +642,7 @@
 
     bindOperation =
          conn.processSASLBind(DN.rootDN(), SASL_MECHANISM_CRAM_MD5,
-                              ByteString.valueOf("malformed"));
+                              ByteString.valueOfUtf8("malformed"));
     assertNotEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -666,7 +666,7 @@
                  ResultCode.SASL_BIND_IN_PROGRESS);
 
     ByteString creds =
-         ByteString.valueOf("dn:cn=Directory Manager malformeddigest");
+         ByteString.valueOfUtf8("dn:cn=Directory Manager malformeddigest");
     bindOperation =
          conn.processSASLBind(DN.rootDN(), SASL_MECHANISM_CRAM_MD5, creds);
     assertNotEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
@@ -693,7 +693,7 @@
                  ResultCode.SASL_BIND_IN_PROGRESS);
 
     ByteString creds =
-         ByteString.valueOf("dn:cn=Directory Manager " +
+         ByteString.valueOfUtf8("dn:cn=Directory Manager " +
                           "malformedcredswiththerightlength");
     bindOperation =
          conn.processSASLBind(DN.rootDN(), SASL_MECHANISM_CRAM_MD5, creds);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java
index 9d489ee..14e688a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java
@@ -112,8 +112,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -130,7 +130,7 @@
     attributes.add(new LDAPAttribute("ou", "People"));
 
     AddRequestProtocolOp addRequest =
-         new AddRequestProtocolOp(ByteString.valueOf("ou=People,o=test"), attributes);
+         new AddRequestProtocolOp(ByteString.valueOfUtf8("ou=People,o=test"), attributes);
     message = new LDAPMessage(2, addRequest,
         DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -197,8 +197,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -211,8 +211,8 @@
     // the delay request control so it won't complete before we can send the
     // cancel request.
     CompareRequestProtocolOp compareRequest =
-         new CompareRequestProtocolOp(ByteString.valueOf("o=test"), "o",
-                                      ByteString.valueOf("test"));
+         new CompareRequestProtocolOp(ByteString.valueOfUtf8("o=test"), "o",
+                                      ByteString.valueOfUtf8("test"));
     message = new LDAPMessage(2, compareRequest,
         DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -285,8 +285,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -299,7 +299,7 @@
     // the delay request control so it won't complete before we can send the
     // cancel request.
     DeleteRequestProtocolOp deleteRequest =
-         new DeleteRequestProtocolOp(ByteString.valueOf("cn=test,o=test"));
+         new DeleteRequestProtocolOp(ByteString.valueOfUtf8("cn=test,o=test"));
     message = new LDAPMessage(2, deleteRequest,
         DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -367,8 +367,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -437,8 +437,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -455,7 +455,7 @@
         new LDAPAttribute("description", "foo")));
 
     ModifyRequestProtocolOp modifyRequest =
-         new ModifyRequestProtocolOp(ByteString.valueOf("o=test"), mods);
+         new ModifyRequestProtocolOp(ByteString.valueOfUtf8("o=test"), mods);
     message = new LDAPMessage(2, modifyRequest,
         DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -528,8 +528,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -542,8 +542,8 @@
     // include the delay request control so it won't complete before we can send
     // the cancel request.
     ModifyDNRequestProtocolOp modifyDNRequest =
-         new ModifyDNRequestProtocolOp(ByteString.valueOf("cn=test,o=test"),
-                                       ByteString.valueOf("cn=test2"), true);
+         new ModifyDNRequestProtocolOp(ByteString.valueOfUtf8("cn=test,o=test"),
+                                       ByteString.valueOfUtf8("cn=test2"), true);
     message = new LDAPMessage(2, modifyDNRequest,
         DelayPreOpPlugin.createDelayControlList(5000));
     w.writeMessage(message);
@@ -611,8 +611,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -625,7 +625,7 @@
     // the delay request control so it won't complete before we can send the
     // cancel request.
     SearchRequestProtocolOp searchRequest =
-         new SearchRequestProtocolOp(ByteString.valueOf("o=test"),
+         new SearchRequestProtocolOp(ByteString.valueOfUtf8("o=test"),
                                      SearchScope.BASE_OBJECT,
                                      DereferenceAliasesPolicy.NEVER, 0,
                                      0, false,
@@ -698,8 +698,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -755,8 +755,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -806,8 +806,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -819,7 +819,7 @@
     // Create a cancel request and send it to the server.
     ExtendedRequestProtocolOp extendedRequest =
          new ExtendedRequestProtocolOp(OID_CANCEL_REQUEST,
-                                       ByteString.valueOf("malformed"));
+                                       ByteString.valueOfUtf8("malformed"));
     message = new LDAPMessage(3, extendedRequest);
     w.writeMessage(message);
 
@@ -856,8 +856,8 @@
         new org.opends.server.tools.LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java
index 659d842..8273c32 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java
@@ -990,7 +990,7 @@
          new CharacterSetPasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString pwOS = ByteString.valueOf(password);
+    ByteString pwOS = ByteString.valueOfUtf8(password);
     ArrayList<Modification> mods = newArrayList(
         new Modification(REPLACE, Attributes.create("userpassword", password)));
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java
index 33c4eb7..619ce0e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java
@@ -671,7 +671,7 @@
          new DictionaryPasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString pwOS = ByteString.valueOf(password);
+    ByteString pwOS = ByteString.valueOfUtf8(password);
     ArrayList<Modification> mods = newArrayList(
         new Modification(REPLACE, Attributes.create("userpassword", password)));
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/DigestMD5SASLMechanismHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/DigestMD5SASLMechanismHandlerTestCase.java
index a39f8d9..ccc1844 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/DigestMD5SASLMechanismHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/DigestMD5SASLMechanismHandlerTestCase.java
@@ -930,7 +930,7 @@
          new InternalClientConnection(new AuthenticationInfo());
     BindOperation bindOperation =
          conn.processSASLBind(DN.rootDN(), SASL_MECHANISM_DIGEST_MD5,
-                              ByteString.valueOf("invalid"));
+                              ByteString.valueOfUtf8("invalid"));
     assertNotEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -954,7 +954,7 @@
 
     bindOperation =
          conn.processSASLBind(DN.rootDN(), SASL_MECHANISM_DIGEST_MD5,
-                              ByteString.valueOf("malformed"));
+                              ByteString.valueOfUtf8("malformed"));
     assertNotEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java
index 8f1dc95..0244366 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java
@@ -88,7 +88,7 @@
   private static final String DESCRIPTION = "description";
   private static final String ETAG = "etag";
 
-  private final ByteString dummyValue = ByteString.valueOf("dummy");
+  private final ByteString dummyValue = ByteString.valueOfUtf8("dummy");
   private final EntityTagVirtualAttributeProvider provider = new EntityTagVirtualAttributeProvider();
   private boolean changeListenerRemoved;
   private boolean changeListenerAdded;
@@ -515,7 +515,7 @@
     // Apply a change using the assertion control for optimistic concurrency.
     Attribute attr = Attributes.create(DESCRIPTION, "first modify");
     List<Modification> mods = newArrayList(new Modification(ModificationType.REPLACE, attr));
-    Control c = new LDAPAssertionRequestControl(true, LDAPFilter.createEqualityFilter(ETAG, ByteString.valueOf(etag1)));
+    Control c = new LDAPAssertionRequestControl(true, LDAPFilter.createEqualityFilter(ETAG, ByteString.valueOfUtf8(etag1)));
     List<Control> ctrls = Collections.singletonList(c);
     ModifyOperation modifyOperation = conn.processModify(userDN, mods, ctrls);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java
index 942ee4e..5cfe481 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java
@@ -134,7 +134,7 @@
     {
       assertFalse(a.isEmpty());
       assertEquals(a.size(), 1);
-      assertTrue(a.contains(ByteString.valueOf(entryDN.toString())));
+      assertTrue(a.contains(ByteString.valueOfUtf8(entryDN.toString())));
     }
   }
 
@@ -384,7 +384,7 @@
     Attribute values = provider.getValues(entry, getRule(provider));
     assertNotNull(values);
     assertEquals(values.size(), 1);
-    assertTrue(values.contains(ByteString.valueOf("o=test")));
+    assertTrue(values.contains(ByteString.valueOfUtf8("o=test")));
   }
 
 
@@ -434,7 +434,7 @@
       "o: test");
     entry.processVirtualAttributes();
 
-    assertTrue(provider.hasValue(entry, getRule(provider), ByteString.valueOf("o=test")));
+    assertTrue(provider.hasValue(entry, getRule(provider), ByteString.valueOfUtf8("o=test")));
   }
 
 
@@ -470,7 +470,7 @@
       "o: test");
     entry.processVirtualAttributes();
 
-    assertFalse(provider.hasValue(entry, getRule(provider), ByteString.valueOf("o=not test")));
+    assertFalse(provider.hasValue(entry, getRule(provider), ByteString.valueOfUtf8("o=not test")));
   }
 
 
@@ -495,7 +495,7 @@
       "o: test");
     entry.processVirtualAttributes();
 
-    LinkedList<ByteString> subAny = newLinkedList(ByteString.valueOf("="));
+    LinkedList<ByteString> subAny = newLinkedList(ByteString.valueOfUtf8("="));
 
     assertEquals(provider.matchesSubstring(entry, getRule(provider), null, subAny, null),
                  ConditionResult.UNDEFINED);
@@ -523,7 +523,7 @@
       "o: test");
     entry.processVirtualAttributes();
 
-    ByteString value = ByteString.valueOf("o=test2");
+    ByteString value = ByteString.valueOfUtf8("o=test2");
     assertEquals(provider.greaterThanOrEqualTo(entry, getRule(provider), value),
                  ConditionResult.UNDEFINED);
   }
@@ -550,7 +550,7 @@
       "o: test");
     entry.processVirtualAttributes();
 
-    ByteString value = ByteString.valueOf("o=test2");
+    ByteString value = ByteString.valueOfUtf8("o=test2");
     assertEquals(provider.lessThanOrEqualTo(entry, getRule(provider), value),
                  ConditionResult.UNDEFINED);
   }
@@ -577,7 +577,7 @@
       "o: test");
     entry.processVirtualAttributes();
 
-    ByteString value = ByteString.valueOf("o=test2");
+    ByteString value = ByteString.valueOfUtf8("o=test2");
     assertEquals(provider.approximatelyEqualTo(entry, getRule(provider), value),
                  ConditionResult.UNDEFINED);
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryUUIDVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryUUIDVirtualAttributeProviderTestCase.java
index be9f3e4..de46683 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryUUIDVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryUUIDVirtualAttributeProviderTestCase.java
@@ -129,7 +129,7 @@
     {
       assertFalse(a.isEmpty());
       assertEquals(a.size(), 1);
-      assertTrue(a.contains(ByteString.valueOf(uuidString)));
+      assertTrue(a.contains(ByteString.valueOfUtf8(uuidString)));
     }
   }
 
@@ -165,7 +165,7 @@
     {
       assertFalse(a.isEmpty());
       assertEquals(a.size(), 1);
-      assertFalse(a.contains(ByteString.valueOf(uuidString)));
+      assertFalse(a.contains(ByteString.valueOfUtf8(uuidString)));
     }
   }
 
@@ -412,7 +412,7 @@
     Attribute values = provider.getValues(entry, rule);
     assertNotNull(values);
     assertEquals(values.size(), 1);
-    assertTrue(values.contains(ByteString.valueOf(uuidString)));
+    assertTrue(values.contains(ByteString.valueOfUtf8(uuidString)));
   }
 
 
@@ -450,7 +450,7 @@
 
     Entry entry = makeEntry();
     VirtualAttributeRule rule = getRule(provider);
-    assertTrue(provider.hasValue(entry, rule, ByteString.valueOf(uuidString)));
+    assertTrue(provider.hasValue(entry, rule, ByteString.valueOfUtf8(uuidString)));
   }
 
   /**
@@ -467,7 +467,7 @@
 
     Entry entry = makeEntry();
     VirtualAttributeRule rule = getRule(provider);
-    assertFalse(provider.hasValue(entry, rule, ByteString.valueOf("wrong")));
+    assertFalse(provider.hasValue(entry, rule, ByteString.valueOfUtf8("wrong")));
   }
 
   private Entry makeEntry() throws Exception
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java
index 0be654b..528cc39 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java
@@ -805,14 +805,14 @@
 
     InternalClientConnection conn = getRootConnection();
     // Create a modification to change the map attribute from uid to cn.
-    ArrayList<ByteString> values = newArrayList(ByteString.valueOf("cn"));
+    ArrayList<ByteString> values = newArrayList(ByteString.valueOfUtf8("cn"));
 
     ArrayList<RawModification> mods = new ArrayList<>();
     mods.add(new LDAPModification(ModificationType.REPLACE,
                                   new LDAPAttribute("ds-cfg-match-attribute",
                                                     values)));
     ModifyOperation modifyOperation =
-         conn.processModify(ByteString.valueOf(mapperDNString), mods);
+         conn.processModify(ByteString.valueOfUtf8(mapperDNString), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
 
 
@@ -826,9 +826,9 @@
 
 
     // Change the configuration back to the way it was.
-    values.set(0, ByteString.valueOf("uid"));
+    values.set(0, ByteString.valueOfUtf8("uid"));
     modifyOperation =
-         conn.processModify(ByteString.valueOf(mapperDNString), mods);
+         conn.processModify(ByteString.valueOfUtf8(mapperDNString), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
 
 
@@ -883,14 +883,14 @@
 
     InternalClientConnection conn = getRootConnection();
     // Create a modification to set the map base DN to "dc=example,dc=com".
-    ArrayList<ByteString> values = newArrayList(ByteString.valueOf("dc=example,dc=com"));
+    ArrayList<ByteString> values = newArrayList(ByteString.valueOfUtf8("dc=example,dc=com"));
 
     ArrayList<RawModification> mods = new ArrayList<>();
     mods.add(new LDAPModification(ModificationType.REPLACE,
                                   new LDAPAttribute("ds-cfg-match-base-dn",
                                                     values)));
     ModifyOperation modifyOperation =
-         conn.processModify(ByteString.valueOf(mapperDNString), mods);
+         conn.processModify(ByteString.valueOfUtf8(mapperDNString), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
 
 
@@ -900,9 +900,9 @@
 
 
     // Change the base DN to "o=test".
-    values.set(0, ByteString.valueOf("o=test"));
+    values.set(0, ByteString.valueOfUtf8("o=test"));
     modifyOperation =
-         conn.processModify(ByteString.valueOf(mapperDNString), mods);
+         conn.processModify(ByteString.valueOfUtf8(mapperDNString), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
 
 
@@ -915,7 +915,7 @@
     // Change the configuration back to its original setting.
     values.clear();
     modifyOperation =
-         conn.processModify(ByteString.valueOf(mapperDNString), mods);
+         conn.processModify(ByteString.valueOfUtf8(mapperDNString), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
 
 
@@ -945,7 +945,7 @@
          InternalClientConnection.getRootConnection();
     String mapperDNString = "cn=Exact Match,cn=Identity Mappers,cn=config";
     ModifyOperation modifyOperation =
-         conn.processModify(ByteString.valueOf(mapperDNString), mods);
+         conn.processModify(ByteString.valueOfUtf8(mapperDNString), mods);
     assertNotSame(modifyOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -969,7 +969,7 @@
          InternalClientConnection.getRootConnection();
     String mapperDNString = "cn=Exact Match,cn=Identity Mappers,cn=config";
     ModifyOperation modifyOperation =
-         conn.processModify(ByteString.valueOf(mapperDNString), mods);
+         conn.processModify(ByteString.valueOfUtf8(mapperDNString), mods);
     assertNotSame(modifyOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -993,7 +993,7 @@
          InternalClientConnection.getRootConnection();
     String mapperDNString = "cn=Exact Match,cn=Identity Mappers,cn=config";
     ModifyOperation modifyOperation =
-         conn.processModify(ByteString.valueOf(mapperDNString), mods);
+         conn.processModify(ByteString.valueOfUtf8(mapperDNString), mods);
     assertNotSame(modifyOperation.getResultCode(), ResultCode.SUCCESS);
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/GoverningStructureRuleVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/GoverningStructureRuleVirtualAttributeProviderTestCase.java
index 00f8423..778de1b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/GoverningStructureRuleVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/GoverningStructureRuleVirtualAttributeProviderTestCase.java
@@ -190,7 +190,7 @@
     {
       assertFalse(a.isEmpty());
       assertEquals(a.size(), 1);
-      assertTrue(a.contains(ByteString.valueOf(ruleId)));
+      assertTrue(a.contains(ByteString.valueOfUtf8(ruleId)));
     }
   }
 
@@ -438,7 +438,7 @@
     Attribute values = provider.getValues(entry, getRule(provider));
     assertNotNull(values);
     assertEquals(values.size(), 1);
-    assertTrue(values.contains(ByteString.valueOf("22")));
+    assertTrue(values.contains(ByteString.valueOfUtf8("22")));
   }
 
 
@@ -488,7 +488,7 @@
       "o: test");
     entry.processVirtualAttributes();
 
-    assertTrue(provider.hasValue(entry, getRule(provider), ByteString.valueOf("22")));
+    assertTrue(provider.hasValue(entry, getRule(provider), ByteString.valueOfUtf8("22")));
   }
 
 
@@ -513,7 +513,7 @@
       "o: test");
     entry.processVirtualAttributes();
 
-    assertFalse(provider.hasValue(entry, getRule(provider), ByteString.valueOf("1")));
+    assertFalse(provider.hasValue(entry, getRule(provider), ByteString.valueOfUtf8("1")));
   }
 
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/HasSubordinatesVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/HasSubordinatesVirtualAttributeProviderTestCase.java
index 16b0dc4..a26a098 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/HasSubordinatesVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/HasSubordinatesVirtualAttributeProviderTestCase.java
@@ -228,7 +228,7 @@
     {
       assertFalse(a.isEmpty());
       assertEquals(a.size(), 1);
-      assertTrue(a.contains(ByteString.valueOf(toUpperCase(String.valueOf(hasSubs)))));
+      assertTrue(a.contains(ByteString.valueOfUtf8(toUpperCase(String.valueOf(hasSubs)))));
     }
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java
index b52f7e7..71b3827 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java
@@ -133,9 +133,9 @@
       assertEquals(a.size(), 1);
 
       assertFalse(a.isEmpty());
-      assertTrue(a.contains(ByteString.valueOf("cn=test static group,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("cn=not a group,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("invalid")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test static group,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("cn=not a group,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("invalid")));
     }
 
     delete("cn=test static group,ou=groups,o=test");
@@ -191,9 +191,9 @@
       assertEquals(a.size(), 1);
 
       assertFalse(a.isEmpty());
-      assertTrue(a.contains(ByteString.valueOf("cn=test static group,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("cn=not a group,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("invalid")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test static group,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("cn=not a group,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("invalid")));
     }
 
     delete("cn=test static group,ou=groups,o=test");
@@ -248,9 +248,9 @@
       assertEquals(a.size(), 1);
 
       assertFalse(a.isEmpty());
-      assertTrue(a.contains(ByteString.valueOf("cn=test dynamic group,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("cn=not a group,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("invalid")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test dynamic group,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("cn=not a group,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("invalid")));
     }
 
     delete("cn=test dynamic group,ou=groups,o=test");
@@ -329,11 +329,11 @@
       assertEquals(a.size(), 2);
 
       assertFalse(a.isEmpty());
-      assertTrue(a.contains(ByteString.valueOf("cn=test group 1,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("cn=test group 2,ou=groups,o=test")));
-      assertTrue(a.contains(ByteString.valueOf("cn=test group 3,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("cn=not a group,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("invalid")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test group 1,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("cn=test group 2,ou=groups,o=test")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test group 3,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("cn=not a group,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("invalid")));
     }
 
     delete("cn=test group 1,ou=groups,o=test",
@@ -432,14 +432,14 @@
       assertEquals(a.size(), 4);
 
       assertFalse(a.isEmpty());
-      assertTrue(a.contains(ByteString.valueOf("cn=test group 1,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("cn=test group 2,ou=groups,o=test")));
-      assertTrue(a.contains(ByteString.valueOf("cn=test group 3,ou=groups,o=test")));
-      assertTrue(a.contains(ByteString.valueOf("cn=test group 4,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("cn=test group 5,ou=groups,o=test")));
-      assertTrue(a.contains(ByteString.valueOf("cn=test group 6,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("cn=not a group,ou=groups,o=test")));
-      assertFalse(a.contains(ByteString.valueOf("invalid")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test group 1,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("cn=test group 2,ou=groups,o=test")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test group 3,ou=groups,o=test")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test group 4,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("cn=test group 5,ou=groups,o=test")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=test group 6,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("cn=not a group,ou=groups,o=test")));
+      assertFalse(a.contains(ByteString.valueOfUtf8("invalid")));
     }
 
     delete("cn=test group 1,ou=groups,o=test",
@@ -486,7 +486,7 @@
 
     VirtualAttributeRule rule = buildRule(provider);
 
-    LinkedList<ByteString> subAny = newLinkedList(ByteString.valueOf("="));
+    LinkedList<ByteString> subAny = newLinkedList(ByteString.valueOfUtf8("="));
 
     assertEquals(provider.matchesSubstring(entry, rule, null, subAny, null),
                  ConditionResult.UNDEFINED);
@@ -515,7 +515,7 @@
 
     VirtualAttributeRule rule = buildRule(provider);
 
-    ByteString value = ByteString.valueOf("o=test2");
+    ByteString value = ByteString.valueOfUtf8("o=test2");
     assertEquals(provider.greaterThanOrEqualTo(entry, rule, value),
                  ConditionResult.UNDEFINED);
   }
@@ -543,7 +543,7 @@
 
     VirtualAttributeRule rule = buildRule(provider);
 
-    ByteString value = ByteString.valueOf("o=test2");
+    ByteString value = ByteString.valueOfUtf8("o=test2");
     assertEquals(provider.lessThanOrEqualTo(entry, rule, value),
                  ConditionResult.UNDEFINED);
   }
@@ -571,7 +571,7 @@
 
     VirtualAttributeRule rule = buildRule(provider);
 
-    ByteString value = ByteString.valueOf("o=test2");
+    ByteString value = ByteString.valueOfUtf8("o=test2");
     assertEquals(provider.approximatelyEqualTo(entry, rule, value),
                  ConditionResult.UNDEFINED);
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
index 4710419..7dd212d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
@@ -292,7 +292,7 @@
       final Object result = mockProvider.assertExpectedEventWasReceived(event);
       if (result instanceof String)
       {
-        return ByteString.valueOf((String) result);
+        return ByteString.valueOfUtf8((String) result);
       }
       else
       {
@@ -1029,7 +1029,7 @@
       try
       {
         return GeneralizedTimeSyntax.decodeGeneralizedTimeValue(ByteString
-            .valueOf(currentTime));
+            .valueOfUtf8(currentTime));
       }
       catch (DirectoryException e)
       {
@@ -1638,7 +1638,7 @@
     // Perform authentication.
     try
     {
-      state.passwordMatches(ByteString.valueOf(userPassword));
+      state.passwordMatches(ByteString.valueOfUtf8(userPassword));
       fail("password match unexpectedly succeeded");
     }
     catch (final DirectoryException e)
@@ -1713,7 +1713,7 @@
     // Perform authentication.
     try
     {
-      state.passwordMatches(ByteString.valueOf(userPassword));
+      state.passwordMatches(ByteString.valueOfUtf8(userPassword));
       fail("password match unexpectedly succeeded");
     }
     catch (final DirectoryException e)
@@ -1810,7 +1810,7 @@
     // Perform authentication.
     try
     {
-      state.passwordMatches(ByteString.valueOf(userPassword));
+      state.passwordMatches(ByteString.valueOfUtf8(userPassword));
       fail("password match unexpectedly succeeded");
     }
     catch (final DirectoryException e)
@@ -1957,7 +1957,7 @@
       }
 
       // Perform authentication.
-      assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+      assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
 
       state.finalizeStateAfterBind();
     }
@@ -2079,13 +2079,13 @@
       {
       case 0:
         // First attempt should succeed.
-        assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+        assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
         break;
       case 1:
         // Second attempt should fail.
         try
         {
-          state.passwordMatches(ByteString.valueOf(userPassword));
+          state.passwordMatches(ByteString.valueOfUtf8(userPassword));
           fail("password match unexpectedly succeeded");
         }
         catch (final DirectoryException e)
@@ -2099,7 +2099,7 @@
       case 2:
         // Third attempt should succeed, once the monitor has run.
         provider.runMonitorTasks();
-        assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+        assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
         break;
       }
 
@@ -2288,13 +2288,13 @@
       {
       case 0:
         // First attempt should succeed.
-        assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+        assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
         break;
       case 1:
         // Second attempt should fail.
         try
         {
-          state.passwordMatches(ByteString.valueOf(userPassword));
+          state.passwordMatches(ByteString.valueOfUtf8(userPassword));
           fail("password match unexpectedly succeeded");
         }
         catch (final DirectoryException e)
@@ -2308,7 +2308,7 @@
       case 2:
         // Third attempt should succeed, once the monitor has run.
         provider.runMonitorTasks();
-        assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+        assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
         break;
       }
 
@@ -2352,8 +2352,8 @@
     try
     {
       connection = factory.getConnection();
-      connection.simpleBind(ByteString.valueOf(searchBindDNString),
-          ByteString.valueOf(userPassword));
+      connection.simpleBind(ByteString.valueOfUtf8(searchBindDNString),
+          ByteString.valueOfUtf8(userPassword));
       fail("Bind attempt should have failed");
     }
     catch (final DirectoryException e)
@@ -2396,8 +2396,8 @@
     try
     {
       connection = factory.getConnection();
-      connection.simpleBind(ByteString.valueOf(searchBindDNString),
-          ByteString.valueOf(userPassword));
+      connection.simpleBind(ByteString.valueOfUtf8(searchBindDNString),
+          ByteString.valueOfUtf8(userPassword));
       fail("Bind attempt should have failed");
     }
     catch (final DirectoryException e)
@@ -2442,8 +2442,8 @@
     try
     {
       connection = factory.getConnection();
-      connection.simpleBind(ByteString.valueOf(searchBindDNString),
-          ByteString.valueOf(userPassword));
+      connection.simpleBind(ByteString.valueOfUtf8(searchBindDNString),
+          ByteString.valueOfUtf8(userPassword));
       fail("Bind attempt should have failed");
     }
     catch (final DirectoryException e)
@@ -2486,8 +2486,8 @@
     try
     {
       connection = factory.getConnection();
-      connection.simpleBind(ByteString.valueOf(searchBindDNString),
-          ByteString.valueOf(userPassword));
+      connection.simpleBind(ByteString.valueOfUtf8(searchBindDNString),
+          ByteString.valueOfUtf8(userPassword));
       fail("Bind attempt should have failed");
     }
     catch (final DirectoryException e)
@@ -2529,8 +2529,8 @@
     try
     {
       connection = factory.getConnection();
-      connection.simpleBind(ByteString.valueOf(searchBindDNString),
-          ByteString.valueOf(userPassword));
+      connection.simpleBind(ByteString.valueOfUtf8(searchBindDNString),
+          ByteString.valueOfUtf8(userPassword));
       fail("Bind attempt should have failed");
     }
     catch (final DirectoryException e)
@@ -2570,8 +2570,8 @@
     try
     {
       connection = factory.getConnection();
-      connection.simpleBind(ByteString.valueOf(searchBindDNString),
-          ByteString.valueOf(userPassword));
+      connection.simpleBind(ByteString.valueOfUtf8(searchBindDNString),
+          ByteString.valueOfUtf8(userPassword));
     }
     finally
     {
@@ -2988,7 +2988,7 @@
       final ByteString username = connection.search(searchBindDN,
           SearchScope.WHOLE_SUBTREE,
           SearchFilter.createFilterFromString("(uid=aduser)"));
-      assertEquals(username, ByteString.valueOf(adDNString));
+      assertEquals(username, ByteString.valueOfUtf8(adDNString));
     }
     finally
     {
@@ -3206,7 +3206,7 @@
       assertEquals(state.getAuthenticationPolicy(), policy);
 
       // Perform authentication.
-      assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+      assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
 
       state.finalizeStateAfterBind();
     }
@@ -3305,15 +3305,15 @@
     switch (bindResultCode.asEnum())
     {
     case SUCCESS:
-      assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+      assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
       break;
     case INVALID_CREDENTIALS:
-      assertFalse(state.passwordMatches(ByteString.valueOf(userPassword)));
+      assertFalse(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
       break;
     default:
       try
       {
-        state.passwordMatches(ByteString.valueOf(userPassword));
+        state.passwordMatches(ByteString.valueOfUtf8(userPassword));
         fail("password match did not fail");
       }
       catch (final DirectoryException e)
@@ -3418,7 +3418,7 @@
     // Perform authentication.
     try
     {
-      state.passwordMatches(ByteString.valueOf(userPassword));
+      state.passwordMatches(ByteString.valueOfUtf8(userPassword));
       fail("password match unexpectedly succeeded");
     }
     catch (final DirectoryException e)
@@ -3506,7 +3506,7 @@
     assertEquals(state.getAuthenticationPolicy(), policy);
 
     // Perform authentication.
-    assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+    assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
 
     // There should be no more pending events.
     provider.assertAllExpectedEventsReceived();
@@ -3588,7 +3588,7 @@
     assertEquals(state.getAuthenticationPolicy(), policy);
 
     // Perform authentication.
-    assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+    assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
 
     // There should be no more pending events.
     provider.assertAllExpectedEventsReceived();
@@ -3663,7 +3663,7 @@
     assertEquals(state.getAuthenticationPolicy(), policy);
 
     // Perform authentication.
-    assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+    assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
 
     // There should be no more pending events.
     provider.assertAllExpectedEventsReceived();
@@ -3739,7 +3739,7 @@
 
       try
       {
-        state.passwordMatches(ByteString.valueOf(userPassword));
+        state.passwordMatches(ByteString.valueOfUtf8(userPassword));
         fail("password match unexpectedly succeeded");
       }
       catch (final DirectoryException e)
@@ -3848,13 +3848,13 @@
       // Perform authentication.
       if (i < 2)
       {
-        assertTrue(state.passwordMatches(ByteString.valueOf(userPassword)));
+        assertTrue(state.passwordMatches(ByteString.valueOfUtf8(userPassword)));
       }
       else
       {
         try
         {
-          state.passwordMatches(ByteString.valueOf(userPassword));
+          state.passwordMatches(ByteString.valueOfUtf8(userPassword));
           fail("password match unexpectedly succeeded");
         }
         catch (final DirectoryException e)
@@ -3969,7 +3969,7 @@
     // Perform authentication.
     try
     {
-      state.passwordMatches(ByteString.valueOf(userPassword));
+      state.passwordMatches(ByteString.valueOfUtf8(userPassword));
       fail("password match unexpectedly succeeded");
     }
     catch (final DirectoryException e)
@@ -3995,7 +3995,7 @@
     final AuthenticationPolicyState state2 = policy
         .createAuthenticationPolicyState(userEntry);
     assertEquals(state2.getAuthenticationPolicy(), policy);
-    assertTrue(state2.passwordMatches(ByteString.valueOf(userPassword)));
+    assertTrue(state2.passwordMatches(ByteString.valueOfUtf8(userPassword)));
     state2.finalizeStateAfterBind();
 
     // Run monitor which should still have nothing to do.
@@ -4066,8 +4066,8 @@
 
     // Authenticate three times, the third time was failing because the pool
     // would not retry the operation on a new connection.
-    ByteString username = ByteString.valueOf(searchBindDNString);
-    ByteString password = ByteString.valueOf("searchPassword");
+    ByteString username = ByteString.valueOfUtf8(searchBindDNString);
+    ByteString password = ByteString.valueOfUtf8("searchPassword");
 
     Connection c1 = pool.getConnection();
     c1.simpleBind(username, password);
@@ -4271,7 +4271,7 @@
     final AuthenticationPolicyState state = policy
         .createAuthenticationPolicyState(testUser);
     assertEquals(state.getAuthenticationPolicy(), policy);
-    assertEquals(state.passwordMatches(ByteString.valueOf(presentedPassword)),
+    assertEquals(state.passwordMatches(ByteString.valueOfUtf8(presentedPassword)),
         expectedBindResultIsSuccess);
     state.finalizeStateAfterBind();
 
@@ -4293,7 +4293,7 @@
       {
         assertFalse(newCachedPassword.equals(testCachedPassword));
         assertTrue(UserPasswordSyntax.isEncoded(ByteString
-            .valueOf(newCachedPassword)));
+            .valueOfUtf8(newCachedPassword)));
         assertEquals(newCachedPasswordTime, testCurrentTimeGMT);
       }
       else
@@ -4333,8 +4333,8 @@
   BindRequestProtocolOp newBindRequest(final String dn, final String password)
       throws LDAPException
   {
-    return new BindRequestProtocolOp(ByteString.valueOf(dn), 3,
-        ByteString.valueOf(password));
+    return new BindRequestProtocolOp(ByteString.valueOfUtf8(dn), 3,
+        ByteString.valueOfUtf8(password));
   }
 
 
@@ -4368,7 +4368,7 @@
       throws LDAPException
   {
     final int timeout = (int) (cfg.getConnectionTimeout() / 1000);
-    return new SearchRequestProtocolOp(ByteString.valueOf(dn),
+    return new SearchRequestProtocolOp(ByteString.valueOfUtf8(dn),
         SearchScope.WHOLE_SUBTREE, DereferenceAliasesPolicy.ALWAYS, 1, timeout,
         true, RawFilter.create(filter),
         LDAPPassThroughAuthenticationPolicyFactory.NO_ATTRIBUTES);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java
index 6b62bac..a8ded86 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java
@@ -358,7 +358,7 @@
     for (int i=0; i < 20; i++)
     {
       buffer.append('x');
-      ByteString password = ByteString.valueOf(buffer.toString());
+      ByteString password = ByteString.valueOfUtf8(buffer.toString());
 
       ModifyOperationBasis op = newModifyOperation(buffer);
 
@@ -430,7 +430,7 @@
     for (int i=0; i < 20; i++)
     {
       buffer.append('x');
-      ByteString password = ByteString.valueOf(buffer.toString());
+      ByteString password = ByteString.valueOfUtf8(buffer.toString());
 
       ModifyOperationBasis op = newModifyOperation(buffer);
 
@@ -493,7 +493,7 @@
     for (int i=0; i < 20; i++)
     {
       buffer.append('x');
-      ByteString password = ByteString.valueOf(buffer.toString());
+      ByteString password = ByteString.valueOfUtf8(buffer.toString());
 
       ModifyOperationBasis op = newModifyOperation(buffer);
 
@@ -556,7 +556,7 @@
     for (int i=0; i < 20; i++)
     {
       buffer.append('x');
-      ByteString password = ByteString.valueOf(buffer.toString());
+      ByteString password = ByteString.valueOfUtf8(buffer.toString());
 
       ModifyOperationBasis op = newModifyOperation(buffer);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/NumSubordinatesVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/NumSubordinatesVirtualAttributeProviderTestCase.java
index 572f9bd..edea02f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/NumSubordinatesVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/NumSubordinatesVirtualAttributeProviderTestCase.java
@@ -226,7 +226,7 @@
     {
       assertFalse(a.isEmpty());
       assertEquals(a.size(), 1);
-      assertTrue(a.contains(ByteString.valueOf(String.valueOf(count))));
+      assertTrue(a.contains(ByteString.valueOfUtf8(String.valueOf(count))));
     }
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java
index 48a874f..6260361 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java
@@ -962,7 +962,7 @@
   @Test
   public void testFailureInvalidRequestValueFormat()
   {
-    ByteString requestValue = ByteString.valueOf("malformed");
+    ByteString requestValue = ByteString.valueOfUtf8("malformed");
 
     InternalClientConnection conn = getRootConnection();
     ExtendedOperation extOp = conn.processExtendedOperation(OID_PASSWORD_MODIFY_REQUEST, requestValue);
@@ -1852,7 +1852,7 @@
     // Perform an internal bind to verify the password was actually changed.
     InternalClientConnection conn = new InternalClientConnection(new AuthenticationInfo());
     BindOperation bindOperation =
-        conn.processSimpleBind(name, ByteString.valueOf(newPwd));
+        conn.processSimpleBind(name, ByteString.valueOfUtf8(newPwd));
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java
index 9f6a960..07307a7 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java
@@ -120,26 +120,26 @@
     return new Object[][]
     {
       new Object[] { ByteString.empty() },
-      new Object[] { ByteString.valueOf("") },
-      new Object[] { ByteString.valueOf("\u0000") },
-      new Object[] { ByteString.valueOf("\t") },
-      new Object[] { ByteString.valueOf("\n") },
-      new Object[] { ByteString.valueOf("\r\n") },
-      new Object[] { ByteString.valueOf(" ") },
-      new Object[] { ByteString.valueOf("Test1\tTest2\tTest3") },
-      new Object[] { ByteString.valueOf("Test1\nTest2\nTest3") },
-      new Object[] { ByteString.valueOf("Test1\r\nTest2\r\nTest3") },
-      new Object[] { ByteString.valueOf("a") },
-      new Object[] { ByteString.valueOf("ab") },
-      new Object[] { ByteString.valueOf("abc") },
-      new Object[] { ByteString.valueOf("abcd") },
-      new Object[] { ByteString.valueOf("abcde") },
-      new Object[] { ByteString.valueOf("abcdef") },
-      new Object[] { ByteString.valueOf("abcdefg") },
-      new Object[] { ByteString.valueOf("abcdefgh") },
-      new Object[] { ByteString.valueOf("The Quick Brown Fox Jumps Over " +
+      new Object[] { ByteString.valueOfUtf8("") },
+      new Object[] { ByteString.valueOfUtf8("\u0000") },
+      new Object[] { ByteString.valueOfUtf8("\t") },
+      new Object[] { ByteString.valueOfUtf8("\n") },
+      new Object[] { ByteString.valueOfUtf8("\r\n") },
+      new Object[] { ByteString.valueOfUtf8(" ") },
+      new Object[] { ByteString.valueOfUtf8("Test1\tTest2\tTest3") },
+      new Object[] { ByteString.valueOfUtf8("Test1\nTest2\nTest3") },
+      new Object[] { ByteString.valueOfUtf8("Test1\r\nTest2\r\nTest3") },
+      new Object[] { ByteString.valueOfUtf8("a") },
+      new Object[] { ByteString.valueOfUtf8("ab") },
+      new Object[] { ByteString.valueOfUtf8("abc") },
+      new Object[] { ByteString.valueOfUtf8("abcd") },
+      new Object[] { ByteString.valueOfUtf8("abcde") },
+      new Object[] { ByteString.valueOfUtf8("abcdef") },
+      new Object[] { ByteString.valueOfUtf8("abcdefg") },
+      new Object[] { ByteString.valueOfUtf8("abcdefgh") },
+      new Object[] { ByteString.valueOfUtf8("The Quick Brown Fox Jumps Over " +
                                          "The Lazy Dog") },
-      new Object[] { ByteString.valueOf("\u00BFD\u00F3nde est\u00E1 el " +
+      new Object[] { ByteString.valueOfUtf8("\u00BFD\u00F3nde est\u00E1 el " +
                                          "ba\u00F1o?") }
     };
   }
@@ -170,7 +170,7 @@
     assertNotNull(encodedPassword);
     assertTrue(scheme.passwordMatches(plaintext, encodedPassword));
     assertFalse(scheme.passwordMatches(plaintext,
-                                       ByteString.valueOf("garbage")));
+                                       ByteString.valueOfUtf8("garbage")));
 
     ByteString schemeEncodedPassword =
          scheme.encodePasswordWithScheme(plaintext);
@@ -239,9 +239,9 @@
       // or other characters that will cause LDIF parsing errors.
       // We really don't need many test cases here, since that functionality
       // is tested above.
-      new Object[] { ByteString.valueOf("a") },
-      new Object[] { ByteString.valueOf("abcdefgh") },
-      new Object[] { ByteString.valueOf("abcdefghi") },
+      new Object[] { ByteString.valueOfUtf8("a") },
+      new Object[] { ByteString.valueOfUtf8("abcdefgh") },
+      new Object[] { ByteString.valueOfUtf8("abcdefghi") },
     };
   }
 
@@ -392,7 +392,7 @@
     if (passwordString != null)
     {
       String[] pwComps = UserPasswordSyntax.decodeUserPassword(passwordString);
-      ByteString encodedPassword = ByteString.valueOf(pwComps[1]);
+      ByteString encodedPassword = ByteString.valueOfUtf8(pwComps[1]);
 
       assertTrue(scheme.passwordMatches(plaintext, encodedPassword));
     }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PlainSASLMechanismHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PlainSASLMechanismHandlerTestCase.java
index 4c96901..465ac98 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PlainSASLMechanismHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PlainSASLMechanismHandlerTestCase.java
@@ -115,15 +115,15 @@
   {
     return new Object[][]
     {
-      new Object[] { ByteString.valueOf("a") },
-      new Object[] { ByteString.valueOf("ab") },
-      new Object[] { ByteString.valueOf("abc") },
-      new Object[] { ByteString.valueOf("abcd") },
-      new Object[] { ByteString.valueOf("abcde") },
-      new Object[] { ByteString.valueOf("abcdef") },
-      new Object[] { ByteString.valueOf("abcdefg") },
-      new Object[] { ByteString.valueOf("abcdefgh") },
-      new Object[] { ByteString.valueOf("The Quick Brown Fox Jumps Over " +
+      new Object[] { ByteString.valueOfUtf8("a") },
+      new Object[] { ByteString.valueOfUtf8("ab") },
+      new Object[] { ByteString.valueOfUtf8("abc") },
+      new Object[] { ByteString.valueOfUtf8("abcd") },
+      new Object[] { ByteString.valueOfUtf8("abcde") },
+      new Object[] { ByteString.valueOfUtf8("abcdef") },
+      new Object[] { ByteString.valueOfUtf8("abcdefg") },
+      new Object[] { ByteString.valueOfUtf8("abcdefgh") },
+      new Object[] { ByteString.valueOfUtf8("The Quick Brown Fox Jumps Over " +
                                          "The Lazy Dog") },
     };
   }
@@ -353,7 +353,7 @@
          throws Exception
   {
     ByteString rootCreds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     InternalClientConnection anonymousConn =
          new InternalClientConnection(new AuthenticationInfo());
@@ -408,20 +408,20 @@
     {
       new Object[] { null },
       new Object[] { ByteString.empty() },
-      new Object[] { ByteString.valueOf("u:test.user") },
-      new Object[] { ByteString.valueOf("password") },
-      new Object[] { ByteString.valueOf("\u0000") },
-      new Object[] { ByteString.valueOf("\u0000\u0000") },
-      new Object[] { ByteString.valueOf("\u0000password") },
-      new Object[] { ByteString.valueOf("\u0000\u0000password") },
-      new Object[] { ByteString.valueOf("\u0000u:test.user\u0000") },
-      new Object[] { ByteString.valueOf("\u0000dn:\u0000password") },
-      new Object[] { ByteString.valueOf("\u0000dn:bogus\u0000password") },
-      new Object[] { ByteString.valueOf("\u0000dn:cn=no such user" +
+      new Object[] { ByteString.valueOfUtf8("u:test.user") },
+      new Object[] { ByteString.valueOfUtf8("password") },
+      new Object[] { ByteString.valueOfUtf8("\u0000") },
+      new Object[] { ByteString.valueOfUtf8("\u0000\u0000") },
+      new Object[] { ByteString.valueOfUtf8("\u0000password") },
+      new Object[] { ByteString.valueOfUtf8("\u0000\u0000password") },
+      new Object[] { ByteString.valueOfUtf8("\u0000u:test.user\u0000") },
+      new Object[] { ByteString.valueOfUtf8("\u0000dn:\u0000password") },
+      new Object[] { ByteString.valueOfUtf8("\u0000dn:bogus\u0000password") },
+      new Object[] { ByteString.valueOfUtf8("\u0000dn:cn=no such user" +
                                          "\u0000password") },
-      new Object[] { ByteString.valueOf("\u0000u:\u0000password") },
-      new Object[] { ByteString.valueOf("\u0000u:nosuchuser\u0000password") },
-      new Object[] { ByteString.valueOf("\u0000u:test.user\u0000" +
+      new Object[] { ByteString.valueOfUtf8("\u0000u:\u0000password") },
+      new Object[] { ByteString.valueOfUtf8("\u0000u:nosuchuser\u0000password") },
+      new Object[] { ByteString.valueOfUtf8("\u0000u:test.user\u0000" +
                                          "wrongpassword") },
     };
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java
index 94c3c22..2e5929b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java
@@ -450,7 +450,7 @@
   private void assertAcceptable(RepeatedCharactersPasswordValidator validator, String value, Entry userEntry,
       boolean expectedResult) throws DirectoryException
   {
-    ByteString password = ByteString.valueOf(value);
+    ByteString password = ByteString.valueOfUtf8(value);
     ModifyOperationBasis modifyOperation = replaceUserPasswordAttribute(value);
 
     LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SaltedMD5PasswordStorageSchemeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SaltedMD5PasswordStorageSchemeTestCase.java
index 4fd82db..8aa838e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SaltedMD5PasswordStorageSchemeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SaltedMD5PasswordStorageSchemeTestCase.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2008 Sun Microsystems, Inc.
- *      Portions Copyright 2014 ForgeRock AS
+ *      Portions Copyright 2014-2015 ForgeRock AS
  */
 package org.opends.server.extensions;
 
@@ -88,7 +88,7 @@
 
     scheme.initializePasswordStorageScheme(configuration);
     // The stored value has a 12 byte salt instead of the default 8
-    assertTrue(scheme.passwordMatches(ByteString.valueOf("password"),
-      ByteString.valueOf("so5s1vK3oEi4uL/oVY3bqs5LRlKjgMN+u4A4bw==")));
+    assertTrue(scheme.passwordMatches(ByteString.valueOfUtf8("password"),
+      ByteString.valueOfUtf8("so5s1vK3oEi4uL/oVY3bqs5LRlKjgMN+u4A4bw==")));
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java
index f543622..9ad69bb 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java
@@ -279,7 +279,7 @@
     for (int i=0; i < 20; i++)
     {
       buffer.append('x');
-      ByteString password = ByteString.valueOf(buffer.toString());
+      ByteString password = ByteString.valueOfUtf8(buffer.toString());
 
       ArrayList<Modification> mods = newArrayList(
           new Modification(REPLACE, Attributes.create("userpassword", buffer.toString())));
@@ -349,11 +349,11 @@
 
     StringBuilder buffer = new StringBuilder();
     HashSet<ByteString> currentPassword = new HashSet<>(3);
-    currentPassword.add(ByteString.valueOf("xxx"));
+    currentPassword.add(ByteString.valueOfUtf8("xxx"));
     for (int i=0; i < 7; i++)
     {
       buffer.append('x');
-      ByteString password = ByteString.valueOf(buffer.toString());
+      ByteString password = ByteString.valueOfUtf8(buffer.toString());
 
       ArrayList<Modification> mods = newArrayList(
           new Modification(REPLACE, Attributes.create("userpassword", buffer.toString())));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/StructuralObjectClassVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/StructuralObjectClassVirtualAttributeProviderTestCase.java
index 788427b..7eb3811 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/StructuralObjectClassVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/StructuralObjectClassVirtualAttributeProviderTestCase.java
@@ -156,7 +156,7 @@
     {
       assertFalse(a.isEmpty());
       assertEquals(a.size(), 1);
-      assertTrue(a.contains(ByteString.valueOf(e.getStructuralObjectClass().getNameOrOID())));
+      assertTrue(a.contains(ByteString.valueOfUtf8(e.getStructuralObjectClass().getNameOrOID())));
     }
   }
 
@@ -414,7 +414,7 @@
     Attribute values = provider.getValues(entry, rule);
     assertNotNull(values);
     assertEquals(values.size(), 1);
-    assertTrue(values.contains(ByteString.valueOf(entry.getStructuralObjectClass().getNameOrOID())));
+    assertTrue(values.contains(ByteString.valueOfUtf8(entry.getStructuralObjectClass().getNameOrOID())));
   }
 
 
@@ -479,7 +479,7 @@
                        VIRTUAL_OVERRIDES_REAL);
 
     assertTrue(provider.hasValue(entry, rule,
-        ByteString.valueOf(entry.getStructuralObjectClass().getNameOrOID())));
+        ByteString.valueOfUtf8(entry.getStructuralObjectClass().getNameOrOID())));
   }
 
 
@@ -511,6 +511,6 @@
                   VirtualAttributeCfgDefn.ConflictBehavior.
                        VIRTUAL_OVERRIDES_REAL);
 
-    assertFalse(provider.hasValue(entry, rule, ByteString.valueOf("inetorgperson")));
+    assertFalse(provider.hasValue(entry, rule, ByteString.valueOfUtf8("inetorgperson")));
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProviderTestCase.java
index 6db9b7d..452539f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProviderTestCase.java
@@ -134,7 +134,7 @@
     {
       assertFalse(a.isEmpty());
       assertEquals(a.size(), 1);
-      assertTrue(a.contains(ByteString.valueOf("cn=schema")));
+      assertTrue(a.contains(ByteString.valueOfUtf8("cn=schema")));
     }
   }
 
@@ -390,7 +390,7 @@
     Attribute values = provider.getValues(entry, rule);
     assertNotNull(values);
     assertEquals(values.size(), 1);
-    assertTrue(values.contains(ByteString.valueOf("cn=schema")));
+    assertTrue(values.contains(ByteString.valueOfUtf8("cn=schema")));
   }
 
 
@@ -456,7 +456,7 @@
                   VirtualAttributeCfgDefn.ConflictBehavior.
                        VIRTUAL_OVERRIDES_REAL);
 
-    assertTrue(provider.hasValue(entry, rule, ByteString.valueOf("cn=schema")));
+    assertTrue(provider.hasValue(entry, rule, ByteString.valueOfUtf8("cn=schema")));
   }
 
 
@@ -488,6 +488,6 @@
                   VirtualAttributeCfgDefn.ConflictBehavior.
                        VIRTUAL_OVERRIDES_REAL);
 
-    assertFalse(provider.hasValue(entry, rule, ByteString.valueOf("cn=not schema")));
+    assertFalse(provider.hasValue(entry, rule, ByteString.valueOfUtf8("cn=not schema")));
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java
index 6f82e05..d3f0cfd 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java
@@ -302,7 +302,7 @@
          new UniqueCharactersPasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString password = ByteString.valueOf("password");
+    ByteString password = ByteString.valueOfUtf8("password");
     ArrayList<Modification> mods = new ArrayList<>();
     mods.add(new Modification(ModificationType.REPLACE,
         Attributes.create("userpassword", "password")));
@@ -371,7 +371,7 @@
          new UniqueCharactersPasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString password = ByteString.valueOf("passw");
+    ByteString password = ByteString.valueOfUtf8("passw");
     ArrayList<Modification> mods = new ArrayList<>();
     mods.add(new Modification(ModificationType.REPLACE,
         Attributes.create("userpassword", "passw")));
@@ -439,7 +439,7 @@
          new UniqueCharactersPasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString password = ByteString.valueOf("pasSw");
+    ByteString password = ByteString.valueOfUtf8("pasSw");
     ArrayList<Modification> mods = new ArrayList<>();
     mods.add(new Modification(ModificationType.REPLACE,
         Attributes.create("userpassword", "pasSw")));
@@ -508,7 +508,7 @@
          new UniqueCharactersPasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString password = ByteString.valueOf("pasSw");
+    ByteString password = ByteString.valueOfUtf8("pasSw");
     ArrayList<Modification> mods = new ArrayList<>();
     mods.add(new Modification(ModificationType.REPLACE,
         Attributes.create("userpassword", "pasSw")));
@@ -575,7 +575,7 @@
          new UniqueCharactersPasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString password = ByteString.valueOf("aaaaaaaa");
+    ByteString password = ByteString.valueOfUtf8("aaaaaaaa");
     ArrayList<Modification> mods = new ArrayList<>();
     mods.add(new Modification(ModificationType.REPLACE,
         Attributes.create("userpassword", "aaaaaaaa")));
@@ -643,7 +643,7 @@
          new UniqueCharactersPasswordValidator();
     validator.initializePasswordValidator(configuration);
 
-    ByteString password = ByteString.valueOf("aaaaaaaa");
+    ByteString password = ByteString.valueOfUtf8("aaaaaaaa");
     ArrayList<Modification> mods = new ArrayList<>();
     mods.add(new Modification(ModificationType.REPLACE,
         Attributes.create("userpassword", "aaaaaaaa")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/UserDefinedVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/UserDefinedVirtualAttributeProviderTestCase.java
index dabd964..8b791ec 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/UserDefinedVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/UserDefinedVirtualAttributeProviderTestCase.java
@@ -254,7 +254,7 @@
 
       Attribute attr = attrList.get(0);
       assertEquals(attr.size(), 1);
-      assertTrue(attr.contains(ByteString.valueOf(value)));
+      assertTrue(attr.contains(ByteString.valueOfUtf8(value)));
     }
     finally
     {
@@ -322,8 +322,8 @@
 
       Attribute attr = attrList.get(0);
       assertEquals(attr.size(), 2);
-      assertTrue(attr.contains(ByteString.valueOf(value1)));
-      assertTrue(attr.contains(ByteString.valueOf(value2)));
+      assertTrue(attr.contains(ByteString.valueOfUtf8(value1)));
+      assertTrue(attr.contains(ByteString.valueOfUtf8(value2)));
     }
     finally
     {
@@ -391,7 +391,7 @@
 
       Attribute attr = attrList.get(0);
       assertEquals(attr.size(), 1);
-      assertTrue(attr.contains(ByteString.valueOf(realValue)));
+      assertTrue(attr.contains(ByteString.valueOfUtf8(realValue)));
     }
     finally
     {
@@ -459,7 +459,7 @@
 
       Attribute attr = attrList.get(0);
       assertEquals(attr.size(), 1);
-      assertTrue(attr.contains(ByteString.valueOf(virtualValue)));
+      assertTrue(attr.contains(ByteString.valueOfUtf8(virtualValue)));
     }
     finally
     {
@@ -527,8 +527,8 @@
       Attribute a = attrList.get(0);
       assertEquals(a.size(), 2);
 
-      assertTrue(a.contains(ByteString.valueOf(realValue)));
-      assertTrue(a.contains(ByteString.valueOf(virtualValue)));
+      assertTrue(a.contains(ByteString.valueOfUtf8(realValue)));
+      assertTrue(a.contains(ByteString.valueOfUtf8(virtualValue)));
 
     }
     finally
@@ -601,8 +601,8 @@
       Attribute a = attrList.get(0);
       assertEquals(a.size(), 2);
 
-      assertTrue(a.contains(ByteString.valueOf(realValue)));
-      assertTrue(a.contains(ByteString.valueOf(virtualValue)));
+      assertTrue(a.contains(ByteString.valueOfUtf8(realValue)));
+      assertTrue(a.contains(ByteString.valueOfUtf8(virtualValue)));
     }
     finally
     {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java
index e9f91e5..9529b5d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java
@@ -636,8 +636,8 @@
     assertNotNull(values);
     assertFalse(values.isEmpty());
     assertTrue(provider.hasValue(entry, rule));
-    assertTrue(provider.hasValue(entry, rule, ByteString.valueOf(u1.toString())));
-    assertFalse(provider.hasValue(entry, rule, ByteString.valueOf(ne.toString())));
+    assertTrue(provider.hasValue(entry, rule, ByteString.valueOfUtf8(u1.toString())));
+    assertFalse(provider.hasValue(entry, rule, ByteString.valueOfUtf8(ne.toString())));
     assertEquals(provider.matchesSubstring(entry, rule, null, null, null),
                  ConditionResult.UNDEFINED);
     assertEquals(provider.greaterThanOrEqualTo(entry, rule, null),
@@ -692,8 +692,8 @@
     assertNotNull(values);
     assertTrue(values.isEmpty());
     assertFalse(provider.hasValue(entry, rule));
-    assertFalse(provider.hasValue(entry, rule, ByteString.valueOf(u1.toString())));
-    assertFalse(provider.hasValue(entry, rule, ByteString.valueOf(ne.toString())));
+    assertFalse(provider.hasValue(entry, rule, ByteString.valueOfUtf8(u1.toString())));
+    assertFalse(provider.hasValue(entry, rule, ByteString.valueOfUtf8(ne.toString())));
     assertEquals(provider.matchesSubstring(entry, rule, null, null, null),
                  ConditionResult.UNDEFINED);
     assertEquals(provider.greaterThanOrEqualTo(entry, rule, null),
@@ -746,7 +746,7 @@
 
     Attribute a = e.getAttribute(memberType).get(0);
     assertEquals(a.size(), 4);
-    assertTrue(a.contains(ByteString.valueOf(u1.toString())));
+    assertTrue(a.contains(ByteString.valueOfUtf8(u1.toString())));
 
     cleanUp();
   }
@@ -775,7 +775,7 @@
     Attribute a = e.getAttribute(memberType).get(0);
     assertEquals(a.size(), 1);
 
-    ByteString v = ByteString.valueOf(u4.toString());
+    ByteString v = ByteString.valueOfUtf8(u4.toString());
     assertTrue(a.contains(v));
 
     LinkedList<Modification> mods = newLinkedList(new Modification(ModificationType.ADD,
@@ -811,7 +811,7 @@
     Attribute a = e.getAttribute(memberType).get(0);
     assertEquals(a.size(), 1);
 
-    ByteString v = ByteString.valueOf(u4.toString());
+    ByteString v = ByteString.valueOfUtf8(u4.toString());
     assertTrue(a.contains(v));
 
 
@@ -832,7 +832,7 @@
     a = e.getAttribute(memberType).get(0);
     assertEquals(a.size(), 0);
 
-    v = ByteString.valueOf(u4.toString());
+    v = ByteString.valueOfUtf8(u4.toString());
     assertTrue(a.contains(v));
 
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java
index a9e2cc4..bb00273 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java
@@ -164,8 +164,8 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(reader, writer, "localhost",
                                        nextMessageID);
-    authHandler.doSimpleBind(3, ByteString.valueOf("cn=Directory Manager"),
-                             ByteString.valueOf("password"),
+    authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
+                             ByteString.valueOfUtf8("password"),
                              new ArrayList<Control>(),
                              new ArrayList<Control>());
     ByteString authzID = authHandler.requestAuthorizationIdentity();
@@ -240,8 +240,8 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(reader, writer, "localhost",
                                        nextMessageID);
-    authHandler.doSimpleBind(3, ByteString.valueOf("uid=test.user,o=test"),
-                             ByteString.valueOf("password"),
+    authHandler.doSimpleBind(3, ByteString.valueOfUtf8("uid=test.user,o=test"),
+                             ByteString.valueOfUtf8("password"),
                              new ArrayList<Control>(),
                              new ArrayList<Control>());
     ByteString authzID = authHandler.requestAuthorizationIdentity();
@@ -311,7 +311,7 @@
     saslProperties.put("authzID", newArrayList("dn:uid=test.user,o=test"));
 
     authHandler.doSASLPlain(ByteString.empty(),
-                            ByteString.valueOf("password"), saslProperties,
+                            ByteString.valueOfUtf8("password"), saslProperties,
                             new ArrayList<Control>(),
                             new ArrayList<Control>());
     ByteString authzID = authHandler.requestAuthorizationIdentity();
@@ -377,8 +377,8 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(reader, writer, "localhost",
                                        nextMessageID);
-    authHandler.doSimpleBind(3, ByteString.valueOf("uid=proxy.user,o=test"),
-                             ByteString.valueOf("password"),
+    authHandler.doSimpleBind(3, ByteString.valueOfUtf8("uid=proxy.user,o=test"),
+                             ByteString.valueOfUtf8("password"),
                              new ArrayList<Control>(),
                              new ArrayList<Control>());
     ByteString authzID = authHandler.requestAuthorizationIdentity();
@@ -391,7 +391,7 @@
          new ExtendedRequestProtocolOp(OID_WHO_AM_I_REQUEST);
     ArrayList<Control> requestControls = new ArrayList<>(1);
     requestControls.add(new ProxiedAuthV2Control(
-         ByteString.valueOf("dn:uid=test.user,o=test")));
+         ByteString.valueOfUtf8("dn:uid=test.user,o=test")));
     LDAPMessage message = new LDAPMessage(nextMessageID.getAndIncrement(),
                                           extendedRequest, requestControls);
     writer.writeMessage(message);
@@ -464,8 +464,8 @@
          new LDAPAuthenticationHandler(reader, writer, "localhost",
                                        nextMessageID);
     authHandler.doSimpleBind(3,
-                             ByteString.valueOf("uid=cantproxy.user,o=test"),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("uid=cantproxy.user,o=test"),
+                             ByteString.valueOfUtf8("password"),
                              new ArrayList<Control>(),
                              new ArrayList<Control>());
     ByteString authzID = authHandler.requestAuthorizationIdentity();
@@ -478,7 +478,7 @@
          new ExtendedRequestProtocolOp(OID_WHO_AM_I_REQUEST);
     ArrayList<Control> requestControls = new ArrayList<>(1);
     requestControls.add(new ProxiedAuthV2Control(
-         ByteString.valueOf("dn:uid=test.user,o=test")));
+         ByteString.valueOfUtf8("dn:uid=test.user,o=test")));
     LDAPMessage message = new LDAPMessage(nextMessageID.getAndIncrement(),
                                           extendedRequest, requestControls);
     writer.writeMessage(message);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java
index 38cd115..a28e6b9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java
@@ -253,10 +253,10 @@
      * sn: Surname
      */
     ArrayList<ByteString> values = new ArrayList<>();
-    values.add(ByteString.valueOf("top"));
-    values.add(ByteString.valueOf("person"));
-    values.add(ByteString.valueOf("organizationalperson"));
-    values.add(ByteString.valueOf("inetorgperson"));
+    values.add(ByteString.valueOfUtf8("top"));
+    values.add(ByteString.valueOfUtf8("person"));
+    values.add(ByteString.valueOfUtf8("organizationalperson"));
+    values.add(ByteString.valueOfUtf8("inetorgperson"));
 
     List<RawAttribute> rawAttributes = new ArrayList<>();
     rawAttributes.add(RawAttribute.create("objectClass", values));
@@ -269,7 +269,7 @@
                             1,
                             1,
                             null,
-                            ByteString.valueOf("dn: uid=test,dc=example,dc=com"),
+                            ByteString.valueOfUtf8("dn: uid=test,dc=example,dc=com"),
                             rawAttributes);
 
     /* Process the operation. The processing should continue. */
@@ -351,10 +351,10 @@
      */
 
     ArrayList<ByteString> values = new ArrayList<>();
-    values.add(ByteString.valueOf("top"));
-    values.add(ByteString.valueOf("person"));
-    values.add(ByteString.valueOf("organizationalperson"));
-    values.add(ByteString.valueOf("inetorgperson"));
+    values.add(ByteString.valueOfUtf8("top"));
+    values.add(ByteString.valueOfUtf8("person"));
+    values.add(ByteString.valueOfUtf8("organizationalperson"));
+    values.add(ByteString.valueOfUtf8("inetorgperson"));
 
     List<RawAttribute> rawAttributes = new ArrayList<>();
 
@@ -370,7 +370,7 @@
                             1,
                             1,
                             null,
-                            ByteString.valueOf("dn: uid=test,dc=example,dc=com"),
+                            ByteString.valueOfUtf8("dn: uid=test,dc=example,dc=com"),
                             rawAttributes);
 
     /* Process the operation and expect the server to continue
@@ -461,7 +461,7 @@
                                1,
                                1,
                                null,
-                               ByteString.valueOf("dn: uid=test,dc=example,dc=com"),
+                               ByteString.valueOfUtf8("dn: uid=test,dc=example,dc=com"),
                                rawMods);
 
     /* Process the request. The result should be SUCCESS and the server
@@ -547,7 +547,7 @@
                                1,
                                1,
                                null,
-                               ByteString.valueOf("dn: uid=test,dc=example,dc=com"),
+                               ByteString.valueOfUtf8("dn: uid=test,dc=example,dc=com"),
                                rawMods);
 
     /* Process the MODIFY operation making sure the remaining number of
@@ -638,7 +638,7 @@
                                1,
                                1,
                                null,
-                               ByteString.valueOf("dn: uid=test,dc=example,dc=com"),
+                               ByteString.valueOfUtf8("dn: uid=test,dc=example,dc=com"),
                                rawMods);
 
     /* Process the MODIFY operation. */
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
index ad43949..a6ce17e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
@@ -1125,7 +1125,7 @@
     InternalSearchOperation operation = getRootConnection().processSearch(request);
     for (SearchResultEntry entry : operation.getSearchEntries()) {
       for(String dn : dns) {
-        ByteString value = ByteString.valueOf(dn);
+        ByteString value = ByteString.valueOfUtf8(dn);
         assertEquals(entry.hasValue(type, null, value), expected);
       }
     }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
index e217aad..f003be0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
@@ -311,7 +311,7 @@
   {
     TestCaseUtils.initializeTestBackend(true);
 
-    ByteString dn = ByteString.valueOf("cn=test,o=test");
+    ByteString dn = ByteString.valueOfUtf8("cn=test,o=test");
 
     ArrayList<RawAttribute> attrs = new ArrayList<>();
     attrs.add(new LDAPAttribute("objectClass", newArrayList("top", "device")));
@@ -354,8 +354,8 @@
   {
     InternalClientConnection conn = getRootConnection();
     BindOperation bindOperation =
-         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("password"));
+         conn.processSimpleBind(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -374,7 +374,7 @@
     InternalClientConnection conn = getRootConnection();
     BindOperation bindOperation =
          conn.processSimpleBind(DN.valueOf("cn=Directory Manager"),
-                                ByteString.valueOf("password"));
+                                ByteString.valueOfUtf8("password"));
     assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -391,7 +391,7 @@
          throws Exception
   {
     ByteString creds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     InternalClientConnection conn = getRootConnection();
     BindOperation bindOperation =
@@ -412,7 +412,7 @@
          throws Exception
   {
     ByteString creds =
-         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");
+         ByteString.valueOfUtf8("\u0000dn:cn=Directory Manager\u0000password");
 
     InternalClientConnection conn = getRootConnection();
     BindOperation bindOperation =
@@ -441,8 +441,8 @@
 
     InternalClientConnection conn = getRootConnection();
     CompareOperation compareOperation =
-         conn.processCompare(ByteString.valueOf("cn=test,o=test"), "cn",
-                             ByteString.valueOf("test"));
+         conn.processCompare(ByteString.valueOfUtf8("cn=test,o=test"), "cn",
+                             ByteString.valueOfUtf8("test"));
     assertEquals(compareOperation.getResultCode(), ResultCode.COMPARE_TRUE);
   }
 
@@ -468,7 +468,7 @@
     CompareOperation compareOperation =
          conn.processCompare(DN.valueOf("cn=test,o=test"),
                              DirectoryServer.getAttributeTypeOrDefault("cn"),
-                             ByteString.valueOf("test"));
+                             ByteString.valueOfUtf8("test"));
     assertEquals(compareOperation.getResultCode(), ResultCode.COMPARE_TRUE);
   }
 
@@ -491,7 +491,7 @@
                                       "cn: test");
 
     DeleteOperation deleteOperation =
-         getRootConnection().processDelete(ByteString.valueOf("cn=test,o=test"));
+         getRootConnection().processDelete(ByteString.valueOfUtf8("cn=test,o=test"));
     assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -559,7 +559,7 @@
 
     InternalClientConnection conn = getRootConnection();
     ModifyOperation modifyOperation =
-         conn.processModify(ByteString.valueOf("cn=test,o=test"), mods);
+         conn.processModify(ByteString.valueOfUtf8("cn=test,o=test"), mods);
     assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -611,8 +611,8 @@
 
     InternalClientConnection conn = getRootConnection();
     ModifyDNOperation modifyDNOperation =
-         conn.processModifyDN(ByteString.valueOf("cn=test,o=test"),
-                              ByteString.valueOf("cn=test2"), true);
+         conn.processModifyDN(ByteString.valueOfUtf8("cn=test,o=test"),
+                              ByteString.valueOfUtf8("cn=test2"), true);
     assertEquals(modifyDNOperation.getResultCode(), ResultCode.SUCCESS);
   }
 
@@ -636,9 +636,9 @@
 
     InternalClientConnection conn = getRootConnection();
     ModifyDNOperation modifyDNOperation =
-         conn.processModifyDN(ByteString.valueOf("cn=test,o=test"),
-                              ByteString.valueOf("cn=test2"), true,
-                              ByteString.valueOf("dc=example,dc=com"));
+         conn.processModifyDN(ByteString.valueOfUtf8("cn=test,o=test"),
+                              ByteString.valueOfUtf8("cn=test2"), true,
+                              ByteString.valueOfUtf8("dc=example,dc=com"));
     assertEquals(modifyDNOperation.getResultCode(),
                  ResultCode.UNWILLING_TO_PERFORM);
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java
index 6945fc0..029da29 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java
@@ -95,8 +95,8 @@
     LDAPWriter writer = new LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     writer.writeMessage(message);
 
@@ -110,7 +110,7 @@
     attrList.add(RawAttribute.create("o", "test"));
 
     AddRequestProtocolOp addRequest =
-         new AddRequestProtocolOp(ByteString.valueOf("o=test"), attrList);
+         new AddRequestProtocolOp(ByteString.valueOfUtf8("o=test"), attrList);
     writer.writeMessage(new LDAPMessage(2, addRequest));
 
     message = reader.readMessage();
@@ -188,8 +188,8 @@
     LDAPWriter writer = new LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     writer.writeMessage(message);
 
@@ -199,8 +199,8 @@
 
 
     CompareRequestProtocolOp compareRequest =
-         new CompareRequestProtocolOp(ByteString.valueOf("o=test"), "o",
-                                      ByteString.valueOf("test"));
+         new CompareRequestProtocolOp(ByteString.valueOfUtf8("o=test"), "o",
+                                      ByteString.valueOfUtf8("test"));
     writer.writeMessage(new LDAPMessage(2, compareRequest));
 
     message = reader.readMessage();
@@ -272,8 +272,8 @@
     LDAPWriter writer = new LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     writer.writeMessage(message);
 
@@ -283,7 +283,7 @@
 
 
     DeleteRequestProtocolOp deleteRequest =
-         new DeleteRequestProtocolOp(ByteString.valueOf("o=test"));
+         new DeleteRequestProtocolOp(ByteString.valueOfUtf8("o=test"));
     writer.writeMessage(new LDAPMessage(2, deleteRequest));
 
     message = reader.readMessage();
@@ -346,8 +346,8 @@
     LDAPWriter writer = new LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     writer.writeMessage(message);
 
@@ -393,8 +393,8 @@
     LDAPWriter writer = new LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     writer.writeMessage(message);
 
@@ -407,7 +407,7 @@
     mods.add(RawModification.create(ModificationType.REPLACE, "description", "foo"));
 
     ModifyRequestProtocolOp modifyRequest =
-         new ModifyRequestProtocolOp(ByteString.valueOf("o=test"), mods);
+         new ModifyRequestProtocolOp(ByteString.valueOfUtf8("o=test"), mods);
     writer.writeMessage(new LDAPMessage(2, modifyRequest));
 
     message = reader.readMessage();
@@ -482,8 +482,8 @@
     LDAPWriter writer = new LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     writer.writeMessage(message);
 
@@ -493,8 +493,8 @@
 
 
     ModifyDNRequestProtocolOp modifyDNRequest =
-         new ModifyDNRequestProtocolOp(ByteString.valueOf("ou=People,o=test"),
-                                       ByteString.valueOf("ou=Users"), true);
+         new ModifyDNRequestProtocolOp(ByteString.valueOfUtf8("ou=People,o=test"),
+                                       ByteString.valueOfUtf8("ou=Users"), true);
     writer.writeMessage(new LDAPMessage(2, modifyDNRequest));
 
     message = reader.readMessage();
@@ -571,8 +571,8 @@
     LDAPWriter writer = new LDAPWriter(socket);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     writer.writeMessage(message);
 
@@ -582,7 +582,7 @@
 
 
     SearchRequestProtocolOp searchRequest =
-         new SearchRequestProtocolOp(ByteString.valueOf("o=test"),
+         new SearchRequestProtocolOp(ByteString.valueOfUtf8("o=test"),
                                      SearchScope.BASE_OBJECT,
                                      DereferenceAliasesPolicy.NEVER,
                                      0, 0, false,
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
index 8037f74..b7ce3f7 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
@@ -587,7 +587,7 @@
     CompareOperationBasis compareOp = new CompareOperationBasis(
         conn, conn.nextOperationID(), conn.nextMessageID(), controls,
         targetDN, DirectoryServer.getAttributeTypeOrDefault("cn"),
-        ByteString.valueOf("PWReset Target"));
+        ByteString.valueOfUtf8("PWReset Target"));
     assertSuccess(hasProxyPrivilege, compareOp);
 
     // Test a search operation against the PWReset Target user.
@@ -630,7 +630,7 @@
 
     ArrayList<Control> controls = new ArrayList<>(1);
     controls.add(new ProxiedAuthV2Control(
-                          ByteString.valueOf("dn:cn=PWReset Target,o=test")));
+                          ByteString.valueOfUtf8("dn:cn=PWReset Target,o=test")));
 
     // Try to add the entry.  If this fails with the proxy control, then add it
     // with a root connection so we can do other things with it.
@@ -694,13 +694,13 @@
 
     DN targetDN = DN.valueOf("cn=PWReset Target,o=test");
     ArrayList<Control> controls = new ArrayList<>(1);
-    controls.add(new ProxiedAuthV2Control(ByteString.valueOf("dn:" + targetDN)));
+    controls.add(new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:" + targetDN)));
 
     // Test a compare operation against the PWReset Target user.
     CompareOperationBasis compareOp = new CompareOperationBasis(
         conn, conn.nextOperationID(), conn.nextMessageID(), controls,
         targetDN, DirectoryServer.getAttributeTypeOrDefault("cn"),
-        ByteString.valueOf("PWReset Target"));
+        ByteString.valueOfUtf8("PWReset Target"));
     assertSuccess(hasProxyPrivilege, compareOp);
 
     // Test a search operation against the PWReset Target user.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java
index a8d9a9b..fdc5445 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java
@@ -248,8 +248,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -267,7 +267,7 @@
                                        ByteString.wrap(Base64.decode(CERT))));
 
       AddRequestProtocolOp addRequest =
-           new AddRequestProtocolOp(ByteString.valueOf("uid=user.7,o=test"),
+           new AddRequestProtocolOp(ByteString.valueOfUtf8("uid=user.7,o=test"),
                                     addAttrs);
       message = new LDAPMessage(2, addRequest);
       w.writeMessage(message);
@@ -282,7 +282,7 @@
       attrs.add("sn");
       attrs.add("userCertificate;binary");
       SearchRequestProtocolOp searchRequest =
-         new SearchRequestProtocolOp(ByteString.valueOf("o=test"),
+         new SearchRequestProtocolOp(ByteString.valueOfUtf8("o=test"),
                                      SearchScope.WHOLE_SUBTREE,
                                      DereferenceAliasesPolicy.NEVER, 0,
                                      0, false,
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
index c0f9046..c19596b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
@@ -91,8 +91,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -134,8 +134,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -177,8 +177,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -191,7 +191,7 @@
       addAttrs.add(RawAttribute.create("ou", "People"));
 
       AddRequestProtocolOp addRequest =
-           new AddRequestProtocolOp(ByteString.valueOf("ou=People,o=test"), addAttrs);
+           new AddRequestProtocolOp(ByteString.valueOfUtf8("ou=People,o=test"), addAttrs);
       ArrayList<Control> controls = new ArrayList<>(1);
       controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
       message = new LDAPMessage(2, addRequest, controls);
@@ -228,8 +228,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       ArrayList<Control> controls = new ArrayList<>(1);
       controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
       LDAPMessage message = new LDAPMessage(1, bindRequest, controls);
@@ -266,8 +266,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -276,8 +276,8 @@
       assertEquals(bindResponse.getResultCode(), 0);
 
       CompareRequestProtocolOp compareRequest =
-           new CompareRequestProtocolOp(ByteString.valueOf("o=test"),
-                                        "o", ByteString.valueOf("test"));
+           new CompareRequestProtocolOp(ByteString.valueOfUtf8("o=test"),
+                                        "o", ByteString.valueOfUtf8("test"));
       ArrayList<Control> controls = new ArrayList<>(1);
       controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
       message = new LDAPMessage(2, compareRequest, controls);
@@ -316,8 +316,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -326,7 +326,7 @@
       assertEquals(bindResponse.getResultCode(), 0);
 
       DeleteRequestProtocolOp deleteRequest =
-           new DeleteRequestProtocolOp(ByteString.valueOf("o=test"));
+           new DeleteRequestProtocolOp(ByteString.valueOfUtf8("o=test"));
       ArrayList<Control> controls = new ArrayList<>(1);
       controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
       message = new LDAPMessage(2, deleteRequest, controls);
@@ -365,8 +365,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -378,7 +378,7 @@
       mods.add(RawModification.create(ModificationType.REPLACE, "description", "foo"));
 
       ModifyRequestProtocolOp modifyRequest =
-           new ModifyRequestProtocolOp(ByteString.valueOf("o=test"), mods);
+           new ModifyRequestProtocolOp(ByteString.valueOfUtf8("o=test"), mods);
       ArrayList<Control> controls = new ArrayList<>(1);
       controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
       message = new LDAPMessage(2, modifyRequest, controls);
@@ -417,8 +417,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
@@ -427,8 +427,8 @@
       assertEquals(bindResponse.getResultCode(), 0);
 
       ModifyDNRequestProtocolOp modifyDNRequest =
-           new ModifyDNRequestProtocolOp(ByteString.valueOf("o=test"),
-                                         ByteString.valueOf("cn=test"), false);
+           new ModifyDNRequestProtocolOp(ByteString.valueOfUtf8("o=test"),
+                                         ByteString.valueOfUtf8("cn=test"), false);
       ArrayList<Control> controls = new ArrayList<>(1);
       controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
       message = new LDAPMessage(2, modifyDNRequest, controls);
@@ -467,8 +467,8 @@
     {
       BindRequestProtocolOp bindRequest =
            new BindRequestProtocolOp(
-                    ByteString.valueOf("cn=Directory Manager"), 2,
-                    ByteString.valueOf("password"));
+                    ByteString.valueOfUtf8("cn=Directory Manager"), 2,
+                    ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java
index 6dacde8..7416222 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java
@@ -55,7 +55,7 @@
   /** The protocol op type for add responses. */
   private static final byte OP_TYPE_ADD_RESPONSE = 0x69;
   /** The DN for add requests in this test case. */
-  private static final ByteString dn = ByteString.valueOf("dc=example,dc=com");
+  private static final ByteString dn = ByteString.valueOfUtf8("dc=example,dc=com");
 
   /**
    * Generate attributes for use in test cases. Attributes will have names
@@ -364,7 +364,7 @@
     List<RawAttribute> attributes =
         generateAttributes(numAttributes, numValues, " test");
 
-    ByteString dnNeedsBase64 = ByteString.valueOf("dc=example,dc=com ");
+    ByteString dnNeedsBase64 = ByteString.valueOfUtf8("dc=example,dc=com ");
 
     AddRequestProtocolOp addRequest =
         new AddRequestProtocolOp(dnNeedsBase64, attributes);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
index 78bb4c5..0048747 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
@@ -73,7 +73,7 @@
 
     //Setup the DN to use in the response tests.
     AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
-    ByteString attributeValue = ByteString.valueOf("testValue");
+    ByteString attributeValue = ByteString.valueOfUtf8("testValue");
     dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java
index cc005e4..2966264 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java
@@ -50,8 +50,8 @@
     ASN1Writer simpleWriter = ASN1.getWriter(simpleBuilder);
     ByteStringBuilder saslBuilder = new ByteStringBuilder();
     ASN1Writer saslWriter = ASN1.getWriter(saslBuilder);
-    ByteString bindDn=ByteString.valueOf(dn);
-    ByteString pw=ByteString.valueOf(pwd);
+    ByteString bindDn=ByteString.valueOfUtf8(dn);
+    ByteString pw=ByteString.valueOfUtf8(pwd);
     BindRequestProtocolOp simple =
       new BindRequestProtocolOp(bindDn, 3, pw);
     BindRequestProtocolOp sasl =
@@ -97,8 +97,8 @@
   @Test
   public void testBindRequestToString() throws Exception
   {
-    ByteString bindDn=ByteString.valueOf(dn);
-    ByteString pw=ByteString.valueOf(pwd);
+    ByteString bindDn=ByteString.valueOfUtf8(dn);
+    ByteString pw=ByteString.valueOfUtf8(pwd);
     BindRequestProtocolOp sasl =
       new BindRequestProtocolOp(bindDn, SASL_MECHANISM_PLAIN, pw);
     StringBuilder sb = new StringBuilder();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java
index 8efe88f..63580ed 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java
@@ -75,7 +75,7 @@
         referralURLs.add(url);
         DN responseDn = DN.valueOf(dn);
         ByteString serverSASLCredentials =
-            ByteString.valueOf(saslCreds);
+            ByteString.valueOfUtf8(saslCreds);
         BindResponseProtocolOp r =
             new BindResponseProtocolOp(okCode.intValue(),
                     message, responseDn, referralURLs,
@@ -146,7 +146,7 @@
     public void testBindResponseBadReferral() throws Exception {
       DN responseDn = DN.valueOf(dn);
       ByteString serverSASLCredentials =
-          ByteString.valueOf(saslCreds);
+          ByteString.valueOfUtf8(saslCreds);
 
       ByteStringBuilder bsb = new ByteStringBuilder();
       ASN1Writer writer = ASN1.getWriter(bsb);
@@ -177,7 +177,7 @@
         referralURLs.add(url);
         DN responseDn = DN.valueOf(dn);
         ByteString serverSASLCredentials =
-            ByteString.valueOf(saslCreds);
+            ByteString.valueOfUtf8(saslCreds);
 
         BindResponseProtocolOp saslOkResp =
             new BindResponseProtocolOp(okCode.intValue(),
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareRequestProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareRequestProtocolOp.java
index 72e4be2..756fc89 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareRequestProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareRequestProtocolOp.java
@@ -51,10 +51,10 @@
 
   /** The DN for compare requests in this test case. */
   private static final ByteString dn =
-      ByteString.valueOf("dc=example,dc=com");
+      ByteString.valueOfUtf8("dc=example,dc=com");
 
   /** The assertion value for this compare request. */
-  private ByteString assertionValue = ByteString.valueOf("=test");
+  private ByteString assertionValue = ByteString.valueOfUtf8("=test");
 
   /** The attribute type for this compare request. */
   private String attributeType = "testAttribute";
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
index 40f18b4..5029687 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
@@ -73,7 +73,7 @@
 
     //Setup the DN to use in the response tests.
     AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
-    ByteString attributeValue = ByteString.valueOf("testValue");
+    ByteString attributeValue = ByteString.valueOfUtf8("testValue");
     dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteRequestProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteRequestProtocolOp.java
index 9ff382d..293d6ec 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteRequestProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteRequestProtocolOp.java
@@ -59,13 +59,13 @@
    * The DN for delete requests in this test case.
    */
   private static final ByteString dn =
-      ByteString.valueOf("dc=example,dc=com");
+      ByteString.valueOfUtf8("dc=example,dc=com");
 
   /**
    * The alternative DN for delete requests in this test case.
    */
   private static final ByteString dnAlt =
-      ByteString.valueOf("dc=sun,dc=com");
+      ByteString.valueOfUtf8("dc=sun,dc=com");
 
   /**
    * Test the constructors to make sure the right objects are constructed.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
index fd3bff7..bbd725d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
@@ -73,7 +73,7 @@
 
     //Setup the DN to use in the response tests.
     AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
-    ByteString attributeValue = ByteString.valueOf("testValue");
+    ByteString attributeValue = ByteString.valueOfUtf8("testValue");
     dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java
index e1377d0..0a00625e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java
@@ -82,59 +82,59 @@
   public Object[][] getFilterStrings() throws Exception
   {
     LDAPFilter equal = LDAPFilter.createEqualityFilter("objectClass",
-                                        ByteString.valueOf("\\test*(Value)"));
+                                        ByteString.valueOfUtf8("\\test*(Value)"));
     LDAPFilter equal2 = LDAPFilter.createEqualityFilter("objectClass",
-                                                      ByteString.valueOf(""));
+                                                      ByteString.valueOfUtf8(""));
     LDAPFilter approx = LDAPFilter.createApproximateFilter("sn",
-                                        ByteString.valueOf("\\test*(Value)"));
+                                        ByteString.valueOfUtf8("\\test*(Value)"));
     LDAPFilter greater = LDAPFilter.createGreaterOrEqualFilter("employeeNumber",
-                                        ByteString.valueOf("\\test*(Value)"));
+                                        ByteString.valueOfUtf8("\\test*(Value)"));
     LDAPFilter less = LDAPFilter.createLessOrEqualFilter("dob",
-                                        ByteString.valueOf("\\test*(Value)"));
+                                        ByteString.valueOfUtf8("\\test*(Value)"));
     LDAPFilter presense = LDAPFilter.createPresenceFilter("login");
 
     ArrayList<ByteString> any = new ArrayList<>(0);
-    ArrayList<ByteString> multiAny = newArrayList(ByteString.valueOf("\\wid*(get)"), ByteString.valueOf("*"));
+    ArrayList<ByteString> multiAny = newArrayList(ByteString.valueOfUtf8("\\wid*(get)"), ByteString.valueOfUtf8("*"));
 
     LDAPFilter substring1 = LDAPFilter.createSubstringFilter("givenName",
-                                                 ByteString.valueOf("\\Jo*()"),
+                                                 ByteString.valueOfUtf8("\\Jo*()"),
                                                       any,
-                                                 ByteString.valueOf("\\n*()"));
+                                                 ByteString.valueOfUtf8("\\n*()"));
     LDAPFilter substring2 = LDAPFilter.createSubstringFilter("givenName",
-                                                 ByteString.valueOf("\\Jo*()"),
+                                                 ByteString.valueOfUtf8("\\Jo*()"),
                                                       multiAny,
-                                                 ByteString.valueOf("\\n*()"));
+                                                 ByteString.valueOfUtf8("\\n*()"));
     LDAPFilter substring3 = LDAPFilter.createSubstringFilter("givenName",
-                                                      ByteString.valueOf(""),
+                                                      ByteString.valueOfUtf8(""),
                                                       any,
-                                                 ByteString.valueOf("\\n*()"));
+                                                 ByteString.valueOfUtf8("\\n*()"));
     LDAPFilter substring4 = LDAPFilter.createSubstringFilter("givenName",
-                                                 ByteString.valueOf("\\Jo*()"),
+                                                 ByteString.valueOfUtf8("\\Jo*()"),
                                                       any,
-                                                      ByteString.valueOf(""));
+                                                      ByteString.valueOfUtf8(""));
     LDAPFilter substring5 = LDAPFilter.createSubstringFilter("givenName",
-                                                      ByteString.valueOf(""),
+                                                      ByteString.valueOfUtf8(""),
                                                       multiAny,
-                                                      ByteString.valueOf(""));
+                                                      ByteString.valueOfUtf8(""));
     LDAPFilter extensible1 = LDAPFilter.createExtensibleFilter("2.4.6.8.19",
                                                 "cn",
-                                           ByteString.valueOf("\\John* (Doe)"),
+                                           ByteString.valueOfUtf8("\\John* (Doe)"),
                                                 false);
     LDAPFilter extensible2 = LDAPFilter.createExtensibleFilter("2.4.6.8.19",
                                                 "cn",
-                                           ByteString.valueOf("\\John* (Doe)"),
+                                           ByteString.valueOfUtf8("\\John* (Doe)"),
                                                 true);
     LDAPFilter extensible3 = LDAPFilter.createExtensibleFilter("2.4.6.8.19",
                                                 null,
-                                           ByteString.valueOf("\\John* (Doe)"),
+                                           ByteString.valueOfUtf8("\\John* (Doe)"),
                                                 true);
     LDAPFilter extensible4 = LDAPFilter.createExtensibleFilter(null,
                                                 "cn",
-                                           ByteString.valueOf("\\John* (Doe)"),
+                                           ByteString.valueOfUtf8("\\John* (Doe)"),
                                                 true);
     LDAPFilter extensible5 = LDAPFilter.createExtensibleFilter("2.4.6.8.19",
                                                 null,
-                                           ByteString.valueOf("\\John* (Doe)"),
+                                           ByteString.valueOfUtf8("\\John* (Doe)"),
                                                 false);
 
     ArrayList<RawFilter> list1 = new ArrayList<>();
@@ -198,7 +198,7 @@
         {
             "(ds-sync-conflict=uid=\\5c+3904211775265,ou=SharedAddressBook,cn=1038372,dc=cab)",
             LDAPFilter.createEqualityFilter("ds-sync-conflict",
-                    ByteString.valueOf("uid=\\+3904211775265,ou=SharedAddressBook,cn=1038372,dc=cab")) },
+                    ByteString.valueOfUtf8("uid=\\+3904211775265,ou=SharedAddressBook,cn=1038372,dc=cab")) },
 
       // OPENDJ-735
       { "(&)", LDAPFilter.createANDFilter(new ArrayList<RawFilter>()) },
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNRequestProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNRequestProtocolOp.java
index 426a514..e72ee10 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNRequestProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNRequestProtocolOp.java
@@ -56,37 +56,37 @@
    * The DN for modify DN requests in this test case.
    */
   private static final ByteString dn =
-      ByteString.valueOf("dc=example,dc=com");
+      ByteString.valueOfUtf8("dc=example,dc=com");
 
   /**
    * The alt DN for modify DN requests in this test case.
    */
   private static final ByteString altDn =
-      ByteString.valueOf("dc=alt,dc=example,dc=com");
+      ByteString.valueOfUtf8("dc=alt,dc=example,dc=com");
 
   /**
    * The new DN for modify DN requests in this test case.
    */
   private static final ByteString newRdn =
-      ByteString.valueOf("dc=example-new");
+      ByteString.valueOfUtf8("dc=example-new");
 
   /**
    * The alt new DN for modify DN requests in this test case.
    */
   private static final ByteString altNewRdn =
-      ByteString.valueOf("ou=alt,dc=example-new");
+      ByteString.valueOfUtf8("ou=alt,dc=example-new");
 
   /**
    * The new superiour DN for modify DN requests in this test case.
    */
   private static final ByteString newSuperiorDn =
-      ByteString.valueOf("dc=widget,dc=com");
+      ByteString.valueOfUtf8("dc=widget,dc=com");
 
   /**
    * The alt new superiour DN for modify DN requests in this test case.
    */
   private static final ByteString altNewSuperiorDn =
-      ByteString.valueOf("dc=alt,dc=widget,dc=com");
+      ByteString.valueOfUtf8("dc=alt,dc=widget,dc=com");
 
   /**
    * Test to make sure the class processes the right LDAP op type.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
index 28f5e64..9640a24 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
@@ -74,7 +74,7 @@
 
     //Setup the DN to use in the response tests.
     AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
-    ByteString attributeValue = ByteString.valueOf("testValue");
+    ByteString attributeValue = ByteString.valueOfUtf8("testValue");
     dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java
index 2c8b335..2707288 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java
@@ -65,13 +65,13 @@
    * The DN for modify requests in this test case.
    */
   private static final ByteString dn =
-      ByteString.valueOf("dc=example,dc=com");
+      ByteString.valueOfUtf8("dc=example,dc=com");
 
   /**
    * The alternative DN for add requests in this test case.
    */
   private static final ByteString dnAlt =
-      ByteString.valueOf("dc=sun,dc=com");
+      ByteString.valueOfUtf8("dc=sun,dc=com");
 
   /**
    * Generate modifications for use in test cases. Attributes will have names
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
index a807555..23444d0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
@@ -73,7 +73,7 @@
 
     //Setup the DN to use in the response tests.
     AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
-    ByteString attributeValue = ByteString.valueOf("testValue");
+    ByteString attributeValue = ByteString.valueOfUtf8("testValue");
     dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java
index 48e144c..fa812cf 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java
@@ -48,7 +48,7 @@
 @SuppressWarnings("javadoc")
 public class TestSearchProtocolOp extends LdapTestCase
 {
-  private ByteString baseDN = ByteString.valueOf("dc=example,dc=COM");
+  private ByteString baseDN = ByteString.valueOfUtf8("dc=example,dc=COM");
   private SearchScope scope = SearchScope.WHOLE_SUBTREE;
   private DereferenceAliasesPolicy dereferencePolicy =
       DereferenceAliasesPolicy.IN_SEARCHING;
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
index b4d219e..f0b7868 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -555,7 +555,7 @@
         List<Attribute> attrList = newEntry.getAttribute(attrTypeStr);
         Assertions.assertThat(attrList).isNotEmpty();
         Attribute attr = attrList.get(0);
-        boolean foundAttributeValue = attr.contains(ByteString.valueOf(valueString));
+        boolean foundAttributeValue = attr.contains(ByteString.valueOfUtf8(valueString));
         assertEquals(foundAttributeValue, expectedAttributeValueFound, foundMsg);
         return null;
       }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalMultipleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalMultipleTest.java
index 18f5a1c..520fd4b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalMultipleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalMultipleTest.java
@@ -101,9 +101,9 @@
   @DataProvider(name = "attrInfo")
   public Object[][] createData()
   {
-    ByteString att1 = ByteString.valueOf("string");
-    ByteString att2 = ByteString.valueOf("value");
-    ByteString att3 = ByteString.valueOf("again");
+    ByteString att1 = ByteString.valueOfUtf8("string");
+    ByteString att2 = ByteString.valueOfUtf8("value");
+    ByteString att3 = ByteString.valueOfUtf8("again");
 
     CSN del1 = new CSN(1,  0,  1);
     CSN del2 = new CSN(1,  1,  1);
@@ -482,7 +482,7 @@
     ByteString[] results = new ByteString[strings.length];
     for (int i = 0; i < results.length; i++)
     {
-      results[i] = ByteString.valueOf(strings[i]);
+      results[i] = ByteString.valueOfUtf8(strings[i]);
     }
     return results;
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalSingleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalSingleTest.java
index 60d0279..7c834cf 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalSingleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AttrHistoricalSingleTest.java
@@ -393,7 +393,7 @@
   private void assertAttributeValue(Entry entry, String expectedValue)
   {
     ByteString actualValue = getActualValue(entry.getAttribute(toLowerCase(ATTRIBUTE_NAME)));
-    assertEquals(actualValue, expectedValue != null ? ByteString.valueOf(expectedValue) : null);
+    assertEquals(actualValue, expectedValue != null ? ByteString.valueOfUtf8(expectedValue) : null);
   }
 
   private void verifyModSuppressed(Iterator<Modification> it)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
index 7cb488e..3ab149e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
@@ -112,8 +112,8 @@
     CSN del1 = new CSN(1,  0,  1);
     CSN del2 = new CSN(1,  1,  1);
 
-    ByteString v1 = ByteString.valueOf("a:" + del1);
-    ByteString v2 = ByteString.valueOf("a:" + del2);
+    ByteString v1 = ByteString.valueOfUtf8("a:" + del1);
+    ByteString v2 = ByteString.valueOfUtf8("a:" + del2);
 
     Assertion assert1 = rule.getAssertion(v2);
     assertEquals(assert1.matches(rule.normalizeAttributeValue(v1)), ConditionResult.TRUE);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
index da1c83d..4c2a84c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
@@ -1201,7 +1201,7 @@
     assertThat(attr).hasSize(expectedValues.length);
     for (String value : expectedValues)
     {
-      attr.contains(ByteString.valueOf(value));
+      attr.contains(ByteString.valueOfUtf8(value));
     }
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ValueInfoTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ValueInfoTest.java
index a930bc2..7150166 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ValueInfoTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ValueInfoTest.java
@@ -47,9 +47,9 @@
    */
   @DataProvider(name = "valueInfo")
   public Object[][] createData() {
-    ByteString att1 = ByteString.valueOf("string");
-    ByteString att2 = ByteString.valueOf("value");
-    ByteString att3 = ByteString.valueOf("again");
+    ByteString att1 = ByteString.valueOfUtf8("string");
+    ByteString att2 = ByteString.valueOfUtf8("value");
+    ByteString att3 = ByteString.valueOfUtf8("again");
 
     CSN del1 = new CSN(1,  0,  1);
     CSN del2 = new CSN(1,  1,  1);
@@ -74,7 +74,7 @@
   {
     AttrValueHistorical valInfo1 = new AttrValueHistorical(value, csnUpdate, csnDelete);
     AttrValueHistorical valInfo2 = new AttrValueHistorical(value, csnUpdate, csnUpdate);
-    AttrValueHistorical valInfo3 = new AttrValueHistorical(ByteString.valueOf("Test"),
+    AttrValueHistorical valInfo3 = new AttrValueHistorical(ByteString.valueOfUtf8("Test"),
             csnUpdate, csnUpdate);
 
     // Check equals
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeSyntaxTest.java
index 9549c5a..7930fa6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeSyntaxTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeSyntaxTest.java
@@ -76,7 +76,7 @@
     LocalizableMessageBuilder reason = new LocalizableMessageBuilder();
     // test the valueIsAcceptable method
     Boolean liveResult =
-      syntax.valueIsAcceptable(ByteString.valueOf(value), reason);
+      syntax.valueIsAcceptable(ByteString.valueOfUtf8(value), reason);
 
     assertSame(liveResult, result, syntax + ".valueIsAcceptable gave bad result for " + value + " reason : " + reason);
   }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java
index 186109a..8f937e6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java
@@ -136,7 +136,7 @@
 
 
     // Create an attribute type definition and verify that it is acceptable.
-    ByteString definition = ByteString.valueOf(
+    ByteString definition = ByteString.valueOfUtf8(
       "( testxapproxtype-oid NAME 'testXApproxType' " +
            "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 " +
            "X-APPROX 'ds-mr-double-metaphone-approx' )");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/AuthPasswordEqualityMatchingRuleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/AuthPasswordEqualityMatchingRuleTest.java
index cc98c9c..d8bb5dc 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/AuthPasswordEqualityMatchingRuleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/AuthPasswordEqualityMatchingRuleTest.java
@@ -64,7 +64,7 @@
 
   private Object[] generateValues(String password) throws Exception
   {
-    ByteString bytePassword = ByteString.valueOf(password);
+    ByteString bytePassword = ByteString.valueOfUtf8(password);
     SaltedMD5PasswordStorageScheme scheme = new SaltedMD5PasswordStorageScheme();
 
     ConfigEntry configEntry =
@@ -110,7 +110,7 @@
   @Test(dataProvider= "equalityMatchingRuleInvalidValues", expectedExceptions = { DecodeException.class })
   public void equalityMatchingRulesInvalidValues(String value) throws Exception
   {
-    getRule().normalizeAttributeValue(ByteString.valueOf(value));
+    getRule().normalizeAttributeValue(ByteString.valueOfUtf8(value));
   }
 
   /** Test the valuesMatch method used for extensible filters. */
@@ -121,8 +121,8 @@
 
     // normalize the 2 provided values and check that they are equals
     ByteString normalizedValue1 =
-      rule.normalizeAttributeValue(ByteString.valueOf(value1));
-    Assertion assertion = rule.getAssertion(ByteString.valueOf(value2));
+      rule.normalizeAttributeValue(ByteString.valueOfUtf8(value1));
+    Assertion assertion = rule.getAssertion(ByteString.valueOfUtf8(value2));
 
     ConditionResult liveResult = assertion.matches(normalizedValue1);
     assertEquals(liveResult, ConditionResult.valueOf(result));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/BitStringSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/BitStringSyntaxTest.java
index 636075f..da13590 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/BitStringSyntaxTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/BitStringSyntaxTest.java
@@ -73,7 +73,7 @@
   {
     Syntax syntax = new BitStringSyntax().getSDKSyntax(CoreSchema.getInstance());
 
-    ByteString byteStringValue = ByteString.valueOf(value);
+    ByteString byteStringValue = ByteString.valueOfUtf8(value);
 
     LocalizableMessageBuilder reason = new LocalizableMessageBuilder();
     Boolean liveResult =
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/CertificateSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/CertificateSyntaxTest.java
index 2246bab..1e264b1 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/CertificateSyntaxTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/CertificateSyntaxTest.java
@@ -194,10 +194,10 @@
     try {
       return new Object [][] {
         {ByteString.wrap(Base64.decode(validcert1)), true},
-        {ByteString.valueOf(validcert1), false},
+        {ByteString.valueOfUtf8(validcert1), false},
         {ByteString.wrap(Base64.decode(invalidcert1)), false},
         {ByteString.wrap(Base64.decode(brokencert1)), false},
-        {ByteString.valueOf("invalid"), false}
+        {ByteString.valueOfUtf8("invalid"), false}
       };
     }
     catch (Exception e)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/EqualityMatchingRuleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/EqualityMatchingRuleTest.java
index 837a4a7..8f31a14 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/EqualityMatchingRuleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/EqualityMatchingRuleTest.java
@@ -110,7 +110,7 @@
     // normalize the 2 provided values
     try
     {
-      rule.normalizeAttributeValue(ByteString.valueOf(value));
+      rule.normalizeAttributeValue(ByteString.valueOfUtf8(value));
       fail("The matching rule : " + rule.getNameOrOID()
           + " should detect that value \"" + value + "\" is invalid");
     }
@@ -141,8 +141,8 @@
 
     // normalize the 2 provided values and check that they are equals
     ByteString normalizedValue1 =
-      rule.normalizeAttributeValue(ByteString.valueOf(value1));
-    Assertion assertion = rule.getAssertion(ByteString.valueOf(value2));
+      rule.normalizeAttributeValue(ByteString.valueOfUtf8(value1));
+    Assertion assertion = rule.getAssertion(ByteString.valueOfUtf8(value2));
 
     ConditionResult liveResult = assertion.matches(normalizedValue1);
     assertEquals(liveResult, ConditionResult.valueOf(result));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
index fccb067..71a2830 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
@@ -252,8 +252,8 @@
   {
     MatchingRule partialTimeRule = DirectoryServer.getMatchingRule(
             EXT_PARTIAL_DATE_TIME_NAME.toLowerCase());
-    Assertion assertion = partialTimeRule.getAssertion(ByteString.valueOf(assertionValue));
-    assertEquals(assertion.matches(ByteString.valueOf(attributeValue)), ConditionResult.TRUE);
+    Assertion assertion = partialTimeRule.getAssertion(ByteString.valueOfUtf8(assertionValue));
+    assertEquals(assertion.matches(ByteString.valueOfLong(attributeValue)), ConditionResult.TRUE);
   }
 
 
@@ -268,7 +268,7 @@
             DirectoryServer.getMatchingRule(EXT_OMR_RELATIVE_TIME_LT_ALT_NAME.toLowerCase());
     try
     {
-      relativeTimeLTRule.getAssertion(ByteString.valueOf(assertion));
+      relativeTimeLTRule.getAssertion(ByteString.valueOfUtf8(assertion));
       // An invalid value can't get away without throwing exception.
       assertTrue(isValid);
     }
@@ -291,7 +291,7 @@
             DirectoryServer.getMatchingRule(EXT_PARTIAL_DATE_TIME_OID);
     try
     {
-      partialDTRule.getAssertion(ByteString.valueOf(assertion));
+      partialDTRule.getAssertion(ByteString.valueOfUtf8(assertion));
       assertTrue(isValid);
     }
     catch (DecodeException e)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/UserPasswordEqualityMatchingRuleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/UserPasswordEqualityMatchingRuleTest.java
index 13fec0d..f5a318e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/UserPasswordEqualityMatchingRuleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/UserPasswordEqualityMatchingRuleTest.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2008 Sun Microsystems, Inc.
- *      Portions Copyright 2014 ForgeRock AS
+ *      Portions Copyright 2014-2015 ForgeRock AS
  */
 package org.opends.server.schema;
 
@@ -64,7 +64,7 @@
 
   private Object[] generateValues(String password) throws Exception
   {
-    ByteString bytePassword = ByteString.valueOf(password);
+    ByteString bytePassword = ByteString.valueOfUtf8(password);
     SaltedMD5PasswordStorageScheme scheme = new SaltedMD5PasswordStorageScheme();
 
     ConfigEntry configEntry = DirectoryServer.getConfigEntry(
@@ -104,7 +104,7 @@
   @Test(dataProvider= "equalityMatchingRuleInvalidValues", expectedExceptions = { DecodeException.class })
   public void equalityMatchingRulesInvalidValues(String value) throws Exception
   {
-    getRule().normalizeAttributeValue(ByteString.valueOf(value));
+    getRule().normalizeAttributeValue(ByteString.valueOfUtf8(value));
   }
 
   /**
@@ -115,8 +115,8 @@
   {
     MatchingRule rule = getRule();
 
-    ByteString normalizedValue1 = rule.normalizeAttributeValue(ByteString.valueOf(value1));
-    Assertion assertion = rule.getAssertion(ByteString.valueOf(value2));
+    ByteString normalizedValue1 = rule.normalizeAttributeValue(ByteString.valueOfUtf8(value1));
+    Assertion assertion = rule.getAssertion(ByteString.valueOfUtf8(value2));
 
     ConditionResult liveResult = assertion.matches(normalizedValue1);
     assertEquals(liveResult, ConditionResult.valueOf(result));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tasks/DisconnectClientTaskTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tasks/DisconnectClientTaskTestCase.java
index 5b6973e..8089fd1 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tasks/DisconnectClientTaskTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tasks/DisconnectClientTaskTestCase.java
@@ -77,8 +77,8 @@
         new org.opends.server.tools.LDAPWriter(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
@@ -150,8 +150,8 @@
         new org.opends.server.tools.LDAPWriter(s);
 
     BindRequestProtocolOp bindRequest =
-         new BindRequestProtocolOp(ByteString.valueOf("cn=Directory Manager"),
-                                   3, ByteString.valueOf("password"));
+         new BindRequestProtocolOp(ByteString.valueOfUtf8("cn=Directory Manager"),
+                                   3, ByteString.valueOfUtf8("password"));
     LDAPMessage message = new LDAPMessage(1, bindRequest);
     w.writeMessage(message);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java
index 0a7a9a3..c115052 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java
@@ -164,8 +164,8 @@
 
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
-    authHandler.doSimpleBind(3, ByteString.valueOf("cn=Directory Manager"),
-                             ByteString.valueOf("password"), requestControls,
+    authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
+                             ByteString.valueOfUtf8("password"), requestControls,
                              responseControls);
 
     s.close();
@@ -251,7 +251,7 @@
 
     try
     {
-      authHandler.doSimpleBind(3, ByteString.valueOf("cn=Directory Manager"),
+      authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
                                ByteString.empty(), requestControls,
                                responseControls);
     }
@@ -286,8 +286,8 @@
 
     try
     {
-      authHandler.doSimpleBind(3, ByteString.valueOf("cn=Directory Manager"),
-                               ByteString.valueOf("wrongPassword"),
+      authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
+                               ByteString.valueOfUtf8("wrongPassword"),
                                requestControls, responseControls);
     }
     finally
@@ -320,8 +320,8 @@
 
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
-    authHandler.doSimpleBind(3, ByteString.valueOf("cn=Directory Manager"),
-                             ByteString.valueOf("password"),
+    authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
+                             ByteString.valueOfUtf8("password"),
                              requestControls, responseControls);
 
     s.close();
@@ -714,7 +714,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -769,7 +769,7 @@
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
 
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"),
+                           ByteString.valueOfUtf8("password"),
                            "CRAM-MD5", saslProperties, requestControls,
                            responseControls);
     s.close();
@@ -807,7 +807,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -849,7 +849,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -905,7 +905,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("invalidPassword"),
+                             ByteString.valueOfUtf8("invalidPassword"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -959,7 +959,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -997,7 +997,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1034,7 +1034,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1077,7 +1077,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1123,7 +1123,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "CRAM-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1180,7 +1180,7 @@
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
 
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"),
+                           ByteString.valueOfUtf8("password"),
                            "CRAM-MD5", saslProperties, requestControls,
                            responseControls);
     s.close();
@@ -1241,7 +1241,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1298,7 +1298,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"),
+                           ByteString.valueOfUtf8("password"),
                            "DIGEST-MD5", saslProperties, requestControls,
                            responseControls);
 
@@ -1350,7 +1350,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"),
+                           ByteString.valueOfUtf8("password"),
                            "DIGEST-MD5", saslProperties, requestControls,
                            responseControls);
 
@@ -1385,7 +1385,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1422,7 +1422,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1462,7 +1462,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1503,7 +1503,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1543,7 +1543,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1589,7 +1589,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1647,7 +1647,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"),
+                           ByteString.valueOfUtf8("password"),
                            "DIGEST-MD5", saslProperties, requestControls,
                            responseControls);
 
@@ -1694,7 +1694,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1744,7 +1744,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1793,7 +1793,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1844,7 +1844,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1894,7 +1894,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1944,7 +1944,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -1989,7 +1989,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -2036,7 +2036,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -2097,7 +2097,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("wrongPassword"),
+                             ByteString.valueOfUtf8("wrongPassword"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -2156,7 +2156,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"),
+                             ByteString.valueOfUtf8("password"),
                              "DIGEST-MD5", saslProperties, requestControls,
                              responseControls);
     }
@@ -2214,7 +2214,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"),
+                           ByteString.valueOfUtf8("password"),
                            "DIGEST-MD5", saslProperties, requestControls,
                            responseControls);
 
@@ -3069,7 +3069,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"), "PLAIN",
+                             ByteString.valueOfUtf8("password"), "PLAIN",
                              saslProperties, requestControls, responseControls);
     }
     finally
@@ -3121,7 +3121,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"), "PLAIN",
+                           ByteString.valueOfUtf8("password"), "PLAIN",
                            saslProperties, requestControls, responseControls);
 
     s.close();
@@ -3155,7 +3155,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"), "PLAIN",
+                             ByteString.valueOfUtf8("password"), "PLAIN",
                              saslProperties, requestControls, responseControls);
     }
     finally
@@ -3191,7 +3191,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"), "PLAIN",
+                             ByteString.valueOfUtf8("password"), "PLAIN",
                              saslProperties, requestControls, responseControls);
     }
     finally
@@ -3232,7 +3232,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"), "PLAIN",
+                             ByteString.valueOfUtf8("password"), "PLAIN",
                              saslProperties, requestControls, responseControls);
     }
     finally
@@ -3272,7 +3272,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"), "PLAIN",
+                             ByteString.valueOfUtf8("password"), "PLAIN",
                              saslProperties, requestControls, responseControls);
     }
     finally
@@ -3317,7 +3317,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"), "PLAIN",
+                             ByteString.valueOfUtf8("password"), "PLAIN",
                              saslProperties, requestControls, responseControls);
     }
     finally
@@ -3361,7 +3361,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"), "PLAIN",
+                             ByteString.valueOfUtf8("password"), "PLAIN",
                              saslProperties, requestControls, responseControls);
     }
     finally
@@ -3401,7 +3401,7 @@
     try
     {
       authHandler.doSASLBind(ByteString.empty(),
-                             ByteString.valueOf("password"), "PLAIN",
+                             ByteString.valueOfUtf8("password"), "PLAIN",
                              saslProperties, requestControls, responseControls);
     }
     finally
@@ -3440,7 +3440,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"), "PLAIN",
+                           ByteString.valueOfUtf8("password"), "PLAIN",
                            saslProperties, requestControls, responseControls);
 
     s.close();
@@ -3487,7 +3487,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("wrongPassword"), "PLAIN",
+                           ByteString.valueOfUtf8("wrongPassword"), "PLAIN",
                            saslProperties, requestControls, responseControls);
 
     s.close();
@@ -3537,7 +3537,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"), "PLAIN",
+                           ByteString.valueOfUtf8("password"), "PLAIN",
                            saslProperties, requestControls, responseControls);
 
     s.close();
@@ -3618,8 +3618,8 @@
 
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
-    authHandler.doSimpleBind(3, ByteString.valueOf("cn=Directory Manager"),
-                             ByteString.valueOf("password"), requestControls,
+    authHandler.doSimpleBind(3, ByteString.valueOfUtf8("cn=Directory Manager"),
+                             ByteString.valueOfUtf8("password"), requestControls,
                              responseControls);
     assertNotNull(authHandler.requestAuthorizationIdentity());
 
@@ -3662,8 +3662,8 @@
 
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
-    authHandler.doSimpleBind(3, ByteString.valueOf("uid=test.user,o=test"),
-                             ByteString.valueOf("password"), requestControls,
+    authHandler.doSimpleBind(3, ByteString.valueOfUtf8("uid=test.user,o=test"),
+                             ByteString.valueOfUtf8("password"), requestControls,
                              responseControls);
     assertNotNull(authHandler.requestAuthorizationIdentity());
 
@@ -3753,7 +3753,7 @@
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
 
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"),
+                           ByteString.valueOfUtf8("password"),
                            "CRAM-MD5", saslProperties, requestControls,
                            responseControls);
     assertNotNull(authHandler.requestAuthorizationIdentity());
@@ -3806,7 +3806,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"),
+                           ByteString.valueOfUtf8("password"),
                            "DIGEST-MD5", saslProperties, requestControls,
                            responseControls);
     assertNotNull(authHandler.requestAuthorizationIdentity());
@@ -3910,7 +3910,7 @@
     LDAPAuthenticationHandler authHandler =
          new LDAPAuthenticationHandler(r, w, "localhost", messageID);
     authHandler.doSASLBind(ByteString.empty(),
-                           ByteString.valueOf("password"), "PLAIN",
+                           ByteString.valueOfUtf8("password"), "PLAIN",
                            saslProperties, requestControls, responseControls);
     assertNotNull(authHandler.requestAuthorizationIdentity());
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java b/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java
index e8e9c2a..2c0a752 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java
@@ -531,7 +531,7 @@
     cnType = DirectoryServer.getAttributeTypeOrNull("cn");
     Assert.assertNotNull(cnType);
 
-    cnValue = ByteString.valueOf("john doe");
+    cnValue = ByteString.valueOfUtf8("john doe");
   }
 
 
@@ -555,8 +555,8 @@
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 2);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value1")));
-    Assert.assertTrue(a.contains(ByteString.valueOf("value2")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value1")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value2")));
   }
 
 
@@ -570,17 +570,17 @@
     AttributeBuilder builder = new AttributeBuilder(cnType);
 
     // Note duplicate values.
-    Assert.assertTrue(builder.addAll(Arrays.asList(ByteString.valueOf("value1"), ByteString.valueOf("value1"), ByteString.valueOf("value2"))));
+    Assert.assertTrue(builder.addAll(Arrays.asList(ByteString.valueOfUtf8("value1"), ByteString.valueOfUtf8("value1"), ByteString.valueOfUtf8("value2"))));
     Assert.assertEquals(builder.size(), 2);
 
     // Add same values.
-    Assert.assertFalse(builder.addAll(Arrays.asList(ByteString.valueOf("value1"), ByteString.valueOf("value1"), ByteString.valueOf("value2"))));
+    Assert.assertFalse(builder.addAll(Arrays.asList(ByteString.valueOfUtf8("value1"), ByteString.valueOfUtf8("value1"), ByteString.valueOfUtf8("value2"))));
     Assert.assertEquals(builder.size(), 2);
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 2);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value1")));
-    Assert.assertTrue(a.contains(ByteString.valueOf("value2")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value1")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value2")));
   }
 
 
@@ -599,13 +599,13 @@
     Assert.assertFalse(builder.add(cnValue));
     Assert.assertEquals(builder.size(), 1);
 
-    Assert.assertTrue(builder.add(ByteString.valueOf("jane doe")));
+    Assert.assertTrue(builder.add(ByteString.valueOfUtf8("jane doe")));
     Assert.assertEquals(builder.size(), 2);
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 2);
     Assert.assertTrue(a.contains(cnValue));
-    Assert.assertTrue(a.contains(ByteString.valueOf("jane doe")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("jane doe")));
   }
 
 
@@ -629,8 +629,8 @@
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 2);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value1")));
-    Assert.assertTrue(a.contains(ByteString.valueOf("value2")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value1")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value2")));
   }
 
 
@@ -643,19 +643,19 @@
   {
     AttributeBuilder builder = new AttributeBuilder(cnType);
 
-    assertTrue(builder.add(ByteString.valueOf("value1")));
+    assertTrue(builder.add(ByteString.valueOfUtf8("value1")));
     assertEquals(builder.size(), 1);
 
-    assertFalse(builder.add(ByteString.valueOf("value1")));
+    assertFalse(builder.add(ByteString.valueOfUtf8("value1")));
     assertEquals(builder.size(), 1);
 
-    assertTrue(builder.add(ByteString.valueOf("value2")));
+    assertTrue(builder.add(ByteString.valueOfUtf8("value2")));
     assertEquals(builder.size(), 2);
 
     Attribute a = builder.toAttribute();
     assertEquals(a.size(), 2);
-    assertTrue(a.contains(ByteString.valueOf("value1")));
-    assertTrue(a.contains(ByteString.valueOf("value2")));
+    assertTrue(a.contains(ByteString.valueOfUtf8("value1")));
+    assertTrue(a.contains(ByteString.valueOfUtf8("value2")));
   }
 
 
@@ -689,9 +689,9 @@
 
     builder.addAll(createAttribute(cnType, "cn", noOptions, twoValues));
 
-    Assert.assertTrue(builder.contains(ByteString.valueOf("value1")));
-    Assert.assertTrue(builder.contains(ByteString.valueOf("value2")));
-    Assert.assertFalse(builder.contains(ByteString.valueOf("value3")));
+    Assert.assertTrue(builder.contains(ByteString.valueOfUtf8("value1")));
+    Assert.assertTrue(builder.contains(ByteString.valueOfUtf8("value2")));
+    Assert.assertFalse(builder.contains(ByteString.valueOfUtf8("value3")));
   }
 
 
@@ -706,9 +706,9 @@
 
     builder.addAll(createAttribute(cnType, "cn", noOptions, twoValues));
 
-    ByteString av1 = ByteString.valueOf("value1");
-    ByteString av2 = ByteString.valueOf("value2");
-    ByteString av3 = ByteString.valueOf("value3");
+    ByteString av1 = ByteString.valueOfUtf8("value1");
+    ByteString av2 = ByteString.valueOfUtf8("value2");
+    ByteString av3 = ByteString.valueOfUtf8("value3");
 
     Assert.assertTrue(builder.containsAll(Collections.<ByteString> emptySet()));
 
@@ -814,7 +814,7 @@
 
     builder.add("value1");
     Assert.assertTrue(builder.iterator().hasNext());
-    Assert.assertEquals(builder.iterator().next(), ByteString.valueOf("value1"));
+    Assert.assertEquals(builder.iterator().next(), ByteString.valueOfUtf8("value1"));
   }
 
 
@@ -850,7 +850,7 @@
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 1);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value3")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value3")));
   }
 
 
@@ -866,11 +866,11 @@
     builder.addAll(createAttribute(cnType, "cn", noOptions, threeValues));
 
     // Remove existing values.
-    Assert.assertTrue(builder.removeAll(Arrays.asList(ByteString.valueOf("value1"), ByteString.valueOf("value2"))));
+    Assert.assertTrue(builder.removeAll(Arrays.asList(ByteString.valueOfUtf8("value1"), ByteString.valueOfUtf8("value2"))));
     Assert.assertEquals(builder.size(), 1);
 
     // Remove removed values.
-    Assert.assertFalse(builder.removeAll(Arrays.asList(ByteString.valueOf("value1"), ByteString.valueOf("value2"))));
+    Assert.assertFalse(builder.removeAll(Arrays.asList(ByteString.valueOfUtf8("value1"), ByteString.valueOfUtf8("value2"))));
     Assert.assertEquals(builder.size(), 1);
 
     // Remove nothing.
@@ -879,12 +879,12 @@
 
     // Remove non existent value.
     Assert.assertFalse(builder.removeAll(Collections
-        .singleton(ByteString.valueOf("value4"))));
+        .singleton(ByteString.valueOfUtf8("value4"))));
     Assert.assertEquals(builder.size(), 1);
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 1);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value3")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value3")));
   }
 
 
@@ -899,21 +899,21 @@
 
     builder.addAll(createAttribute(cnType, "cn", noOptions, threeValues));
 
-    Assert.assertTrue(builder.remove(ByteString.valueOf("value1")));
+    Assert.assertTrue(builder.remove(ByteString.valueOfUtf8("value1")));
     Assert.assertEquals(builder.size(), 2);
 
     // Already removed.
-    Assert.assertFalse(builder.remove(ByteString.valueOf("value1")));
+    Assert.assertFalse(builder.remove(ByteString.valueOfUtf8("value1")));
     Assert.assertEquals(builder.size(), 2);
 
     // Non existent.
-    Assert.assertFalse(builder.remove(ByteString.valueOf("value4")));
+    Assert.assertFalse(builder.remove(ByteString.valueOfUtf8("value4")));
     Assert.assertEquals(builder.size(), 2);
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 2);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value2")));
-    Assert.assertTrue(a.contains(ByteString.valueOf("value3")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value2")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value3")));
   }
 
 
@@ -941,8 +941,8 @@
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 2);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value2")));
-    Assert.assertTrue(a.contains(ByteString.valueOf("value3")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value2")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value3")));
   }
 
 
@@ -961,8 +961,8 @@
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 2);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value2")));
-    Assert.assertTrue(a.contains(ByteString.valueOf("value4")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value2")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value4")));
   }
 
 
@@ -977,14 +977,14 @@
     builder.addAll(createAttribute(cnType, "cn", noOptions, threeValues));
 
     // Note duplicate values.
-    builder.replaceAll(Arrays.asList(ByteString.valueOf("value2"),
-        ByteString.valueOf("value2"), ByteString.valueOf("value4")));
+    builder.replaceAll(Arrays.asList(ByteString.valueOfUtf8("value2"),
+        ByteString.valueOfUtf8("value2"), ByteString.valueOfUtf8("value4")));
     Assert.assertEquals(builder.size(), 2);
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 2);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value2")));
-    Assert.assertTrue(a.contains(ByteString.valueOf("value4")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value2")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value4")));
   }
 
 
@@ -998,12 +998,12 @@
     AttributeBuilder builder = new AttributeBuilder(cnType);
     builder.addAll(createAttribute(cnType, "cn", noOptions, threeValues));
 
-    builder.replace(ByteString.valueOf("value4"));
+    builder.replace(ByteString.valueOfUtf8("value4"));
     Assert.assertEquals(builder.size(), 1);
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 1);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value4")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value4")));
   }
 
 
@@ -1022,7 +1022,7 @@
 
     Attribute a = builder.toAttribute();
     Assert.assertEquals(a.size(), 1);
-    Assert.assertTrue(a.contains(ByteString.valueOf("value4")));
+    Assert.assertTrue(a.contains(ByteString.valueOfUtf8("value4")));
   }
 
 
@@ -1170,13 +1170,13 @@
     // Check contains().
     for (String value : values)
     {
-      Assert.assertTrue(a.contains(ByteString.valueOf(value)));
+      Assert.assertTrue(a.contains(ByteString.valueOfUtf8(value)));
 
       // Assumes internal normalization to lower-case.
-      Assert.assertTrue(a.contains(ByteString.valueOf(value.toUpperCase())));
+      Assert.assertTrue(a.contains(ByteString.valueOfUtf8(value.toUpperCase())));
     }
 
-    Assert.assertFalse(a.contains(ByteString.valueOf("xxxx")));
+    Assert.assertFalse(a.contains(ByteString.valueOfUtf8("xxxx")));
   }
 
 
@@ -1206,7 +1206,7 @@
     Set<ByteString> expectedValues = new HashSet<>();
     for (String value : values)
     {
-      expectedValues.add(ByteString.valueOf(value));
+      expectedValues.add(ByteString.valueOfUtf8(value));
     }
 
     Assert.assertTrue(a.containsAll(Collections.<ByteString> emptySet()));
@@ -1220,14 +1220,14 @@
     }
 
     Set<ByteString> bigSet = new HashSet<>(expectedValues);
-    bigSet.add(ByteString.valueOf("xxxx"));
+    bigSet.add(ByteString.valueOfUtf8("xxxx"));
     Assert.assertFalse(a.containsAll(bigSet));
 
     expectedValues.clear();
     for (String value : values)
     {
       // Assumes internal normalization to lower-case.
-      expectedValues.add(ByteString.valueOf(value.toUpperCase()));
+      expectedValues.add(ByteString.valueOfUtf8(value.toUpperCase()));
     }
     Assert.assertTrue(a.containsAll(expectedValues));
   }
@@ -1631,7 +1631,7 @@
 
         ByteString v = i.next();
         ByteString nv = a.getAttributeType().getEqualityMatchingRule().normalizeAttributeValue(v);
-        Assert.assertEquals(nv, ByteString.valueOf(value));
+        Assert.assertEquals(nv, ByteString.valueOfUtf8(value));
 
         try
         {
@@ -1822,11 +1822,11 @@
     assertThat(a3.isNormalized()).isTrue();
 
     // no normalization on contains for 0-element and 1-element set
-    a1.contains(ByteString.valueOf("one"));
+    a1.contains(ByteString.valueOfUtf8("one"));
     assertThat(a1.isNormalized()).isFalse();
 
     // normalization on contains for 1-element set
-    a2.contains(ByteString.valueOf("one"));
+    a2.contains(ByteString.valueOfUtf8("one"));
     assertThat(a2.isNormalized()).isTrue();
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
index 6e20347..8c33f91 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
@@ -428,7 +428,7 @@
 
     AttributeType cnAttrType = DirectoryServer.getAttributeTypeOrNull("cn");
     CompareOperation compareOperation = conn.processCompare(
-        DN.valueOf("cn=config"), cnAttrType, ByteString.valueOf("config"));
+        DN.valueOf("cn=config"), cnAttrType, ByteString.valueOfUtf8("config"));
     if (hasPrivilege)
     {
       assertEquals(compareOperation.getResultCode(), COMPARE_TRUE);
@@ -1266,7 +1266,7 @@
                               nextOperationID(), nextMessageID(),
                               controls, targetDN,
                               DirectoryServer.getAttributeTypeOrDefault("cn"),
-                              ByteString.valueOf("PWReset Target"));
+                              ByteString.valueOfUtf8("PWReset Target"));
     compareOperation.run();
     if (hasProxyPrivilege)
     {
@@ -1320,7 +1320,7 @@
       "sn: Test");
 
     List<Control> controls = new ArrayList<>(1);
-    controls.add(new ProxiedAuthV2Control(ByteString.valueOf("dn:cn=PWReset Target,o=test")));
+    controls.add(new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:cn=PWReset Target,o=test")));
 
 
     // Try to add the entry.  If this fails with the proxy control, then add it
@@ -1405,14 +1405,14 @@
 
     DN targetDN = DN.valueOf("cn=PWReset Target,o=test");
     List<Control> controls = new ArrayList<>(1);
-    controls.add(new ProxiedAuthV2Control(ByteString.valueOf("dn:" + targetDN)));
+    controls.add(new ProxiedAuthV2Control(ByteString.valueOfUtf8("dn:" + targetDN)));
 
 
     // Test a compare operation against the PWReset Target user.
     CompareOperation compareOperation = new CompareOperationBasis(conn, nextOperationID(),
                               nextMessageID(), controls, targetDN,
                               DirectoryServer.getAttributeTypeOrDefault("cn"),
-             ByteString.valueOf("PWReset Target"));
+             ByteString.valueOfUtf8("PWReset Target"));
     compareOperation.run();
     if (hasProxyPrivilege)
     {
@@ -2267,8 +2267,8 @@
       LDAPWriter w = new LDAPWriter(s);
 
       BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
-          ByteString.valueOf("cn=Test User,o=test"), 3,
-          ByteString.valueOf("password"));
+          ByteString.valueOfUtf8("cn=Test User,o=test"), 3,
+          ByteString.valueOfUtf8("password"));
       LDAPMessage message = new LDAPMessage(1, bindRequest);
       w.writeMessage(message);
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java b/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
index 516e396..3934b8e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
@@ -578,7 +578,7 @@
 
     description.filterType = filterType;
     description.attributeType = DirectoryServer.getAttributeTypeOrNull(attributeType);
-    description.assertionValue = ByteString.valueOf(attributeValue);
+    description.assertionValue = ByteString.valueOfUtf8(attributeValue);
 
     if (filterType == FilterType.EQUALITY) {
       description.searchFilter = SearchFilter.createEqualityFilter(description.attributeType,
@@ -641,16 +641,16 @@
     description.filterType = FilterType.SUBSTRING;
     description.attributeType = DirectoryServer.getAttributeTypeOrNull(attributeType);
 
-    description.subInitialElement = ByteString.valueOf(subInitial);
+    description.subInitialElement = ByteString.valueOfUtf8(subInitial);
     description.subAnyElements = new ArrayList<>();
     if (subAny != null)
     {
       for (String s : subAny)
       {
-        description.subAnyElements.add(ByteString.valueOf(s));
+        description.subAnyElements.add(ByteString.valueOfUtf8(s));
       }
     }
-    description.subFinalElement = ByteString.valueOf(subFinal);
+    description.subFinalElement = ByteString.valueOfUtf8(subFinal);
 
     description.searchFilter = SearchFilter.createSubstringFilter(description.attributeType,
             description.subInitialElement,
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java
index bba6e43..eb920e1 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java
@@ -319,7 +319,7 @@
    */
   @Test(dataProvider = "testDNs")
   public void testDecodeByteString(String rawDN, String normDN, String unused) throws Exception {
-    DN dn = DN.decode(ByteString.valueOf(rawDN));
+    DN dn = DN.decode(ByteString.valueOfUtf8(rawDN));
     assertEquals(dn.toNormalizedUrlSafeString(), normDN);
   }
 
@@ -403,7 +403,7 @@
    */
   @Test(dataProvider = "illegalDNs", expectedExceptions = DirectoryException.class)
   public void testIllegalOctetStringDNs(String dn) throws Exception {
-    ByteString octetString = ByteString.valueOf(dn);
+    ByteString octetString = ByteString.valueOfUtf8(dn);
     DN.decode(octetString);
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java
index f17eb4a..f2e6cb3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java
@@ -225,7 +225,7 @@
         + "SYNTAX 1.3.6.1.4.1.1466.115.121.1.45 )";
 
     AttributeType type = AttributeTypeSyntax.decodeAttributeType(
-        ByteString.valueOf(string),
+        ByteString.valueOfUtf8(string),
         DirectoryServer.getSchema(), false);
 
     // Test values.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java
index be21177..fd6b30f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java
@@ -75,8 +75,8 @@
     AttributeType dummy = getAttributeTypeOrDefault(attrName, attrName, getDefaultIntegerSyntax());
     DirectoryServer.getSchema().registerAttributeType(dummy, true);
 
-    AV_DC_ORG = ByteString.valueOf("org");
-    AV_CN = ByteString.valueOf("hello world");
+    AV_DC_ORG = ByteString.valueOfUtf8("org");
+    AV_CN = ByteString.valueOfUtf8("hello world");
   }
 
 
@@ -187,7 +187,7 @@
    */
   @Test
   public void testEscaping() {
-    RDN rdn = new RDN(AT_DC, ByteString.valueOf(" "));
+    RDN rdn = new RDN(AT_DC, ByteString.valueOfUtf8(" "));
     assertEquals(rdn.toString(), "dc=\\ ");
   }
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java
index 40947ee..165961a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java
@@ -121,18 +121,18 @@
          throws Exception
   {
     assertEquals(virtualAttribute.size(), 1);
-    assertTrue(virtualAttribute.contains(ByteString.valueOf("o=test")));
+    assertTrue(virtualAttribute.contains(ByteString.valueOfUtf8("o=test")));
 
     assertFalse(virtualAttribute.isEmpty());
 
-    assertTrue(virtualAttribute.contains(ByteString.valueOf("o=test")));
-    assertFalse(virtualAttribute.contains(ByteString.valueOf("o=not test")));
+    assertTrue(virtualAttribute.contains(ByteString.valueOfUtf8("o=test")));
+    assertFalse(virtualAttribute.contains(ByteString.valueOfUtf8("o=not test")));
 
     LinkedHashSet<ByteString> testValues = new LinkedHashSet<>();
-    testValues.add(ByteString.valueOf("o=test"));
+    testValues.add(ByteString.valueOfUtf8("o=test"));
     assertTrue(virtualAttribute.containsAll(testValues));
 
-    testValues.add(ByteString.valueOf("o=not test"));
+    testValues.add(ByteString.valueOfUtf8("o=not test"));
     assertFalse(virtualAttribute.containsAll(testValues));
   }
 
@@ -148,11 +148,11 @@
          throws Exception
   {
     assertEquals(virtualAttribute.matchesSubstring(
-        ByteString.valueOf("o="), null,
-        ByteString.valueOf("test")),
+        ByteString.valueOfUtf8("o="), null,
+        ByteString.valueOfUtf8("test")),
                  ConditionResult.UNDEFINED);
 
-    ByteString assertionValue = ByteString.valueOf("o=test");
+    ByteString assertionValue = ByteString.valueOfUtf8("o=test");
     assertEquals(virtualAttribute.greaterThanOrEqualTo(assertionValue),
                  ConditionResult.UNDEFINED);
     assertEquals(virtualAttribute.lessThanOrEqualTo(assertionValue),
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java b/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java
index fd05551..3bbda26 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java
@@ -321,8 +321,8 @@
           .valueOf("cn=john, dc=foo, dc=com"));
       Assert.assertTrue(entry.hasObjectClass(OC_TOP));
       Assert.assertTrue(entry.hasObjectClass(OC_PERSON));
-      Assert.assertTrue(entry.hasValue(AT_CN, null, ByteString.valueOf("john")));
-      Assert.assertTrue(entry.hasValue(AT_SN, null, ByteString.valueOf("smith")));
+      Assert.assertTrue(entry.hasValue(AT_CN, null, ByteString.valueOfUtf8("john")));
+      Assert.assertTrue(entry.hasValue(AT_SN, null, ByteString.valueOfUtf8("smith")));
 
       Assert.assertNull(reader.readEntry());
 
@@ -353,7 +353,7 @@
     try {
       Entry entry = reader.readEntry();
       Assert.assertNotNull(entry);
-      Assert.assertTrue(entry.hasValue(AT_DESCR, null, ByteString.valueOf("once upon a time in the west")));
+      Assert.assertTrue(entry.hasValue(AT_DESCR, null, ByteString.valueOfUtf8("once upon a time in the west")));
     } finally {
       reader.close();
     }
@@ -377,7 +377,7 @@
     try {
       Entry entry = reader.readEntry();
       Assert.assertNotNull(entry);
-      Assert.assertTrue(entry.hasValue(AT_DESCR, null, ByteString.valueOf("once upon a time in the west")));
+      Assert.assertTrue(entry.hasValue(AT_DESCR, null, ByteString.valueOfUtf8("once upon a time in the west")));
     } finally {
       reader.close();
     }
@@ -409,8 +409,8 @@
           .valueOf("cn=anne, dc=foo, dc=com"));
       Assert.assertTrue(entry.hasObjectClass(OC_TOP));
       Assert.assertTrue(entry.hasObjectClass(OC_PERSON));
-      Assert.assertTrue(entry.hasValue(AT_CN, null, ByteString.valueOf("anne")));
-      Assert.assertTrue(entry.hasValue(AT_SN, null, ByteString.valueOf("other")));
+      Assert.assertTrue(entry.hasValue(AT_CN, null, ByteString.valueOfUtf8("anne")));
+      Assert.assertTrue(entry.hasValue(AT_SN, null, ByteString.valueOfUtf8("other")));
 
       Assert.assertNull(reader.readEntry());
 
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java b/opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java
index 2adef70..cd1f610 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java
@@ -605,7 +605,7 @@
   @Test(dataProvider = "needsBase64EncodingTestData")
   public void testNeedsBase64EncodingBytes(String s, boolean result)
       throws Exception {
-    ByteString bytes = s != null ? ByteString.valueOf(s) : null;
+    ByteString bytes = s != null ? ByteString.valueOfUtf8(s) : null;
     Assert.assertEquals(StaticUtils.needsBase64Encoding(bytes), result);
   }
 
@@ -1009,7 +1009,7 @@
   @Test(dataProvider = "stringCaseConversionTestData")
   public void testToLowerCaseBytes(String input, String lower, String upper)
       throws Exception {
-    ByteString bytes = input != null ? ByteString.valueOf(input) : null;
+    ByteString bytes = input != null ? ByteString.valueOfUtf8(input) : null;
     StringBuilder buffer = new StringBuilder();
     StaticUtils.toLowerCase(bytes, buffer, false);
     Assert.assertEquals(buffer.toString(), input != null ? lower : "");
@@ -1085,7 +1085,7 @@
   public void testToLowerCaseWithTrim(String input, String lower) throws Exception
   {
     StringBuilder sb = new StringBuilder();
-    ByteString bytes = input != null ? ByteString.valueOf(input) : null;
+    ByteString bytes = input != null ? ByteString.valueOfUtf8(input) : null;
     StaticUtils.toLowerCase(bytes, sb, true);
     Assert.assertEquals(sb.toString(), lower);
   }

--
Gitblit v1.10.0