mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
16.57.2015 a41662c1136b2bb4a4198df89e0e87d2be3ef099
AutoRefactor'ed simplify expressions
335 files modified
4788 ■■■■■ changed files
opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/BrowserController.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeSearcherQueue.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/BaseDNTableModel.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/BrowseActionListener.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/TextComponentFocusListener.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteEntryTask.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java 186 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ResetUserPasswordTask.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/Task.java 85 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBackendIndexesPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AttributeSyntaxPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BackupPanel.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BinaryAttributeEditorPanel.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java 63 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseGeneralMonitoringPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseIndexPanel.java 17 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ColorAndFontConstants.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/CustomAttributePanel.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/CustomObjectClassPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ExportLDIFPanel.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/GenericDialog.java 17 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/GenericFrame.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/InclusionExclusionPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDAPEntryPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDAPEntrySelectionPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/MatchingRulePanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RefreshOptionsPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RestorePanel.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SchemaBrowserRightPanel.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java 26 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StandardAttributePanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StandardObjectClassPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TaskToSchedulePanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java 27 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/WindowsServicePanel.java 18 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/AddRemovePanel.java 14 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/BinaryCellPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java 14 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/DoubleAddRemovePanel.java 130 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/NumericLimitedSizeDocumentFilter.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/SuperiorObjectClassesEditor.java 14 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/TimeDocumentFilter.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/AttributeCellEditor.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/BackupTableCellRenderer.java 14 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/LDAPEntryTableCellRenderer.java 19 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/SelectableTableCellRenderer.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/TreeCellRenderer.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/ConfigFromDirContext.java 61 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/NumSubordinateHacker.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/Configuration.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/CurrentInstallStatus.java 20 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/Launcher.java 28 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/UserData.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/event/BrowseActionListener.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/DataReplicationOptions.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataReplicationPanel.java 54 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/InstallReviewPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/JavaArgumentsDialog.java 15 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/RemoteReplicationPortsPanel.java 31 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/SelectAliasDialog.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/ServerSettingsPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/CertificateDialog.java 111 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/CurrentStepPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/GuiApplication.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/Utilities.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/FileManager.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/ZipExtractor.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/AbstractManagedObjectDefinition.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/DurationPropertyDefinition.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/IntegerPropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/SizePropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java 30 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagedObject.java 24 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/AttributeSyntax.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicy.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/Aci.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciBody.java 31 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciContainer.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciListenerManager.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciTargets.java 15 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/DNS.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/GroupDN.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternDN.java 52 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternIP.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/SSF.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargAttrFilters.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TimeOfDay.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserDN.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/RebuildConfig.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/ExportJob.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/IndexInputBuffer.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/IndexOutputBuffer.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/JebFormat.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/SortValuesSet.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ExportJob.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Count.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ImportRecord.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexInputBuffer.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexOutputBuffer.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java 21 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/BooleanConfigAttribute.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigConstants.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java 37 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/IntegerWithUnitConfigAttribute.java 30 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java 46 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/ReadOnlyConfigAttribute.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/StringConfigAttribute.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/AccessControlConfigManager.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/AccountStatusNotificationHandlerConfigManager.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/EntryCacheConfigManager.java 14 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/ExtendedOperationBasis.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyConfigManager.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyFactory.java 22 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordStorageSchemeConfigManager.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/RootDNConfigManager.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/SchemaConfigManager.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/SubentryManager.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryCacheCommon.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java 15 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/ExternalSASLMechanismHandler.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/FilteredStaticGroupMemberList.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java 11 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/LengthBasedPasswordValidator.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/NotificationPropertyNotificationMessageTemplateElement.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkQueue.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkerThread.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/PlainSASLMechanismHandler.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/SASLContext.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAlertHandler.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectEqualsDNCertificateMapper.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugMessageFormatter.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugTracer.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/MultifileTextWriter.java 25 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/RotationActionThread.java 18 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextAccessLogPublisher.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextAuditLogPublisher.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextDebugLogPublisher.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/ThreadFilterTextErrorLogPublisher.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/monitors/EntryCacheMonitorProvider.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/monitors/MemoryUsageMonitorProvider.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/monitors/SystemInfoMonitorProvider.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/monitors/VersionMonitorProvider.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/ChangeNumberControlPlugin.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java 30 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStack.java 18 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/LDIFConnectionHandler.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/asn1/GSERParser.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPInputStream.java 19 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPOutputStream.java 17 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPSocket.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/DirectoryRMIServerSocketFactory.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxConnectionHandler.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddRequestProtocolOp.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddResponseProtocolOp.java 32 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/BindResponseProtocolOp.java 26 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/CompareResponseProtocolOp.java 27 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/DeleteResponseProtocolOp.java 27 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ExtendedResponseProtocolOp.java 35 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java 54 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPControl.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java 24 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPRequestHandler.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyDNResponseProtocolOp.java 27 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyResponseProtocolOp.java 27 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java 27 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalSingle.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrValueHistorical.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/GenerationIdChecksum.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/ReplLDIFOutputStream.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ProtocolVersion.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/StartSessionMsg.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ServerHandler.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEReplicaDBCursor.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/AuthPasswordSyntax.java 18 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/DITContentRuleSyntax.java 121 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/DITStructureRuleSyntax.java 103 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeSyntax.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/GuideSyntax.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java 56 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/MatchingRuleUseSyntax.java 116 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/NameFormSyntax.java 131 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/ObjectClassSyntax.java 131 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/UserPasswordSyntax.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/EnterLockdownModeTask.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/LeaveLockdownModeTask.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/ShutdownTask.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesTool.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java 330 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPPasswordModify.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java 31 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolUtils.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFModify.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/ManageAccount.java 26 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/PromptTrustManager.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/AttributeValueTag.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Branch.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/DNTag.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/FileTag.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfAbsentTag.java 11 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfPresentTag.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/ParentDNTag.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/RandomTag.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/UnderscoreDNTag.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/UnderscoreParentDNTag.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskEntry.java 16 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java 15 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AccountStatusNotification.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AuthenticationInfo.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/CacheEntry.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/DITContentRule.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/DN.java 112 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/FilePermission.java 28 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/InvokableMethod.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/LDAPURL.java 38 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/NamedCharacterSet.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java 18 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/RawAttribute.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/RawFilter.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java 62 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultReference.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/BSDMD5Crypt.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/Base64.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/Crypt.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java 16 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java 83 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java 31 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/quicksetup/util/FileManagerTest.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/api/AlertHandlerTestCase.java 24 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTests.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/backends/task/TaskBackendTestCase.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java 26 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/core/PasswordPolicyTestCase.java 32 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandlerTestCase.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java 24 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/extensions/TraditionalWorkQueueTestCase.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxConnectTest.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/PostConnectedDisconnectTest.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/ASN1ReaderTestCase.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/InitOnLineTest.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java 14 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/FractionalReplicationTest.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java 18 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/schema/GenericSchemaTestCase.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tasks/DummyTask.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tasks/TestImportAndExport.java 16 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tools/EncodePasswordTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tools/LDIFDiffTestCase.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tools/ListBackendsTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/types/TestAttributeType.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/util/TestBase64.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java
@@ -446,7 +446,7 @@
      }
    } else {
      // otherwise if DN or password is null, send back an error
      if (((!authenticationIsID && (bindDN == null)) || bindPassword == null)
      if (((!authenticationIsID && bindDN == null) || bindPassword == null)
         && batchResponses.isEmpty()) {
        batchResponses.add(
              createErrorResponse(objFactory,
@@ -502,7 +502,7 @@
           *  Process optional authRequest (i.e. use authz)
           */
          if (batchRequest.authRequest != null) {
            if (authenticationIsID == true) {
            if (authenticationIsID) {
              // If we are using SASL, then use the bind authz.
              connOptions.addSASLProperty("authzid=" +
                  batchRequest.authRequest.getPrincipal());
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
@@ -671,7 +671,7 @@
    boolean throwException = false;
    if ((timeout > 0) && t.isAlive())
    if (timeout > 0 && t.isAlive())
    {
      t.interrupt();
      try
@@ -685,7 +685,7 @@
      throwException = true;
    }
    if ((pair[0] == null) && (pair[1] == null))
    if (pair[0] == null && pair[1] == null)
    {
      throwException = true;
    }
@@ -748,7 +748,7 @@
    if (attrs != null)
    {
      Attribute attr = attrs.get(attrName);
      if ((attr != null) && (attr.size() > 0))
      if (attr != null && attr.size() > 0)
      {
        Object o = attr.get();
        if (o instanceof String)
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/BrowserController.java
@@ -985,14 +985,14 @@
    if (node instanceof SuffixNode)
    {
      String dn = node.getDN();
      return (Utilities.areDnsEqual(dn, ADSContext.getAdministrationSuffixDN()) ||
      return Utilities.areDnsEqual(dn, ADSContext.getAdministrationSuffixDN()) ||
          Utilities.areDnsEqual(dn, ConfigConstants.DN_DEFAULT_SCHEMA_ROOT) ||
          Utilities.areDnsEqual(dn, ConfigConstants.DN_TASK_ROOT) ||
          Utilities.areDnsEqual(dn, ConfigConstants.DN_CONFIG_ROOT) ||
          Utilities.areDnsEqual(dn, ConfigConstants.DN_MONITOR_ROOT) ||
          Utilities.areDnsEqual(dn, ConfigConstants.DN_TRUST_STORE_ROOT) ||
          Utilities.areDnsEqual(dn, ConfigConstants.DN_BACKUP_ROOT) ||
          Utilities.areDnsEqual(dn, DN_EXTERNAL_CHANGELOG_ROOT));
          Utilities.areDnsEqual(dn, DN_EXTERNAL_CHANGELOG_ROOT);
    }
    else
    {
@@ -1301,8 +1301,8 @@
        nodeChanged = updateNodeRendering(node, task.getDisplayedEntry());
      }
    }
    else if ((newState == NodeRefresher.State.CANCELLED) ||
        (newState == NodeRefresher.State.INTERRUPTED)) {
    else if (newState == NodeRefresher.State.CANCELLED ||
        newState == NodeRefresher.State.INTERRUPTED) {
      // Let's collapse task.getNode()
      tree.collapsePath(new TreePath(treeModel.getPathToRoot(node)));
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeSearcherQueue.java
@@ -172,7 +172,7 @@
    do {
      int waitingSize = waitingQueue.size();
      int i = 0;
      while ((i < waitingSize) && !canBeFetched(i)) {
      while (i < waitingSize && !canBeFetched(i)) {
        i++;
      }
      if (i == waitingSize) { // Nothing found
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/BaseDNTableModel.java
@@ -128,8 +128,7 @@
  public void setData(Set<BaseDNDescriptor> newData,
      ServerDescriptor.ServerStatus status, boolean isAuthenticated)
  {
    if (!newData.equals(data) || (serverStatus != status) ||
        (this.isAuthenticated != isAuthenticated))
    if (!newData.equals(data) || serverStatus != status || this.isAuthenticated != isAuthenticated)
    {
      serverStatus = status;
      this.isAuthenticated = isAuthenticated;
@@ -474,8 +473,9 @@
  private int compareRepl(BaseDNDescriptor desc1, BaseDNDescriptor desc2)
  {
    return (String.valueOf(desc1.getType()).compareTo(
        String.valueOf(desc2.getType())));
    String val1 = String.valueOf(desc1.getType());
    String val2 = String.valueOf(desc2.getType());
    return val1.compareTo(val2);
  }
  private int compareMissingChanges(BaseDNDescriptor desc1,
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
@@ -96,9 +96,9 @@
  {
    String sName = sr.getName();
    Name name;
    if ((baseDN != null) && (baseDN.length() > 0))
    if (baseDN != null && baseDN.length() > 0)
    {
      if ((sName != null) && (sName.length() > 0))
      if (sName != null && sName.length() > 0)
      {
        name = new CompositeName(sName);
        name.add(baseDN);
@@ -115,12 +115,12 @@
    for (int i=0; i<name.size(); i++)
    {
      String n = name.get(i);
      if ((buf.length() != 0) && (n != null) && (n.length() > 0))
      if (n != null && n.length() > 0)
      {
        if (buf.length() != 0)
      {
        buf.append(",");
      }
      if ((n != null) && (n.length() > 0))
      {
        buf.append(n);
      }
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/BrowseActionListener.java
@@ -199,7 +199,7 @@
    if (path != null && path.trim().length() > 0)
    {
      File f = new File(path);
      while ((f != null) && !f.isDirectory())
      while (f != null && !f.isDirectory())
      {
        f = f.getParentFile();
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/TextComponentFocusListener.java
@@ -53,7 +53,7 @@
  /** {@inheritDoc} */
  public void focusGained(FocusEvent e)
  {
    if ((tf.getText() == null) || "".equals(tf.getText()))
    if (tf.getText() == null || "".equals(tf.getText()))
    {
      tf.setText(" ");
      tf.selectAll();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteEntryTask.java
@@ -295,7 +295,7 @@
        controller.getTree().setSelectionPath(pathToSelect);
      }
      else if (!selectedPath.equals(pathToSelect) &&
          (pathToSelect.getPathCount() < selectedPath.getPathCount()))
          pathToSelect.getPathCount() < selectedPath.getPathCount())
      {
        controller.getTree().setSelectionPath(pathToSelect);
      }
@@ -309,9 +309,9 @@
    lastDn = dnToRemove;
    long t = System.currentTimeMillis();
    boolean canDelete = nToDelete > 0 && nToDelete > nDeleted;
    boolean displayProgress =
      (((nDeleted % 20) == 0) || ((t - lastProgressTime) > 5000))  &&
      (nToDelete > 0) && (nToDelete > nDeleted);
      canDelete && ((nDeleted % 20) == 0 || t - lastProgressTime > 5000);
    if (displayProgress)
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java
@@ -28,6 +28,7 @@
package org.opends.guitools.controlpanel.task;
import static org.opends.messages.AdminToolMessages.*;
import static org.opends.server.config.ConfigConstants.*;
import java.util.ArrayList;
import java.util.Collection;
@@ -61,7 +62,6 @@
import org.opends.guitools.controlpanel.ui.nodes.BasicNode;
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.messages.AdminToolMessages;
import org.opends.server.config.ConfigConstants;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.*;
@@ -121,8 +121,7 @@
    }
    catch (OpenDsException ode)
    {
      throw new RuntimeException("Could not parse DN: "+oldEntry.getDN(),
          ode);
      throw new RuntimeException("Could not parse DN: " + oldEntry.getDN(), ode);
    }
    modifications = getModifications(newEntry, oldEntry, getInfo());
    // Find password modifications
@@ -276,8 +275,9 @@
  /** {@inheritDoc} */
  public void postOperation()
  {
    if ((lastException == null) && (state == State.FINISHED_SUCCESSFULLY) &&
        (passwordModification != null))
    if (lastException == null
        && state == State.FINISHED_SUCCESSFULLY
        && passwordModification != null)
    {
      try
      {
@@ -344,54 +344,15 @@
    RDN oldRDN = oldDN.rdn();
    RDN newRDN = newEntry.getName().rdn();
    boolean rdnTypeChanged =
    newRDN.getNumValues() != oldRDN.getNumValues();
    for (int i=0; (i<newRDN.getNumValues()) && !rdnTypeChanged; i++) {
      boolean found = false;
      for (int j=0;
      (j<oldRDN.getNumValues()) && !found; j++) {
        found = newRDN.getAttributeName(i).equalsIgnoreCase(
            oldRDN.getAttributeName(j));
      }
      rdnTypeChanged = !found;
    if (rdnTypeChanged(oldRDN, newRDN)
        && userChangedObjectclass(originalMods)
        /* See if the original entry contains the new naming attribute(s) if it does we will be able
        to perform the renaming and then the modifications without problem */
        && !entryContainsRdnTypes(originalEntry, newRDN))
    {
      throw new CannotRenameException(AdminToolMessages.ERR_CANNOT_MODIFY_OBJECTCLASS_AND_RENAME.get());
    }
    if (rdnTypeChanged) {
      /* Check if user changed the objectclass...*/
      boolean changedOc = false;
      for (ModificationItem mod : originalMods)
      {
        Attribute attr = mod.getAttribute();
        changedOc = attr.getID().equalsIgnoreCase(
            ConfigConstants.ATTR_OBJECTCLASS);
        if (changedOc)
        {
          break;
        }
      }
      if (changedOc)
      {
        /* See if the original entry contains the new
        naming attribute(s) if it does we will be able
        to perform the renaming and then the
        modifications without problem */
        boolean entryContainsRdnTypes = true;
        for (int i=0; (i<newRDN.getNumValues()) && entryContainsRdnTypes; i++)
        {
          List<Object> values = originalEntry.getAttributeValues(
          newRDN.getAttributeName(i));
          entryContainsRdnTypes = !values.isEmpty();
        }
        if (!entryContainsRdnTypes)
        {
          throw new CannotRenameException(
              AdminToolMessages.ERR_CANNOT_MODIFY_OBJECTCLASS_AND_RENAME.get());
        }
      }
    }
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
@@ -442,8 +403,7 @@
        }
      });
      ctx.modifyAttributes(Utilities.getJNDIName(newEntry.getName().toString()),
          mods);
      ctx.modifyAttributes(Utilities.getJNDIName(newEntry.getName().toString()), mods);
      SwingUtilities.invokeLater(new Runnable()
      {
@@ -460,6 +420,60 @@
    }
  }
  private boolean rdnTypeChanged(RDN oldRDN, RDN newRDN)
  {
    if (newRDN.getNumValues() != oldRDN.getNumValues())
    {
      return true;
    }
    for (int i = 0; i < newRDN.getNumValues(); i++)
    {
      if (!find(oldRDN, newRDN.getAttributeName(i)))
      {
        return true;
      }
    }
    return false;
  }
  private boolean find(RDN rdn, String attrName)
  {
    for (int j = 0; j < rdn.getNumValues(); j++)
    {
      if (attrName.equalsIgnoreCase(rdn.getAttributeName(j)))
      {
        return true;
      }
    }
    return false;
  }
  private boolean userChangedObjectclass(final ArrayList<ModificationItem> mods)
  {
    for (ModificationItem mod : mods)
    {
      if (ATTR_OBJECTCLASS.equalsIgnoreCase(mod.getAttribute().getID()))
      {
        return true;
      }
    }
    return false;
  }
  private boolean entryContainsRdnTypes(CustomSearchResult entry, RDN rdn)
  {
    for (int i = 0; i < rdn.getNumValues(); i++)
    {
      List<Object> values = entry.getAttributeValues(rdn.getAttributeName(i));
      if (!!values.isEmpty())
      {
        return false;
      }
    }
    return true;
  }
  /**
   * Gets the modifications to apply between two entries.
   * @param newEntry the new entry.
@@ -481,12 +495,10 @@
      {
        continue;
      }
      AttributeType attrType = schema.getAttributeType(
          attr.getName().toLowerCase());
      AttributeType attrType = schema.getAttributeType(attr.getName().toLowerCase());
      if (attrType == null)
      {
        attrType = DirectoryServer.getDefaultAttributeType(
            attr.getName().toLowerCase());
        attrType = DirectoryServer.getDefaultAttributeType(attr.getName().toLowerCase());
      }
      List<ByteString> newValues = new ArrayList<>();
      Iterator<ByteString> it = attr.iterator();
@@ -535,19 +547,9 @@
        if (oldRDN.getAttributeName(i).equalsIgnoreCase(attrName))
        {
          ByteString value = oldRDN.getAttributeValue(i);
          boolean containsValue = false;
          it = attr.iterator();
          while (it.hasNext())
          if (containsValue(attr, value))
          {
            if (value.equals(it.next()))
            {
              containsValue = true;
              break;
            }
          }
          if (containsValue)
          {
            if ((rdnValue == null) || !rdnValue.equals(value))
            if (rdnValue == null || !rdnValue.equals(value))
            {
              oldRdnValueToAdd = value;
            }
@@ -583,7 +585,7 @@
        {
          toAdd.add(oldRdnValueToAdd);
        }
        if ((toDelete.size() + toAdd.size() >= newValues.size()) &&
        if (toDelete.size() + toAdd.size() >= newValues.size() &&
            !isAttributeInNewRdn)
        {
          modifications.add(new ModificationItem(
@@ -627,21 +629,8 @@
      String attrNoOptions =
        Utilities.getAttributeNameWithoutOptions(attrName).toLowerCase();
      List<org.opends.server.types.Attribute> attrs =
        newEntry.getAttribute(attrNoOptions);
      boolean found = false;
      if (attrs != null)
      {
        for (org.opends.server.types.Attribute attr : attrs)
        {
          if (attr.getNameWithOptions().equalsIgnoreCase(attrName))
          {
            found = true;
            break;
          }
        }
      }
      if (!found && !oldValues.isEmpty())
      List<org.opends.server.types.Attribute> attrs = newEntry.getAttribute(attrNoOptions);
      if (!find(attrs, attrName) && !oldValues.isEmpty())
      {
        modifications.add(new ModificationItem(
            DirContext.REMOVE_ATTRIBUTE,
@@ -651,6 +640,33 @@
    return modifications;
  }
  private static boolean find(List<org.opends.server.types.Attribute> attrs, String attrName)
  {
    if (attrs != null)
    {
      for (org.opends.server.types.Attribute attr : attrs)
      {
        if (attr.getNameWithOptions().equalsIgnoreCase(attrName))
        {
          return true;
        }
      }
    }
    return false;
  }
  private static boolean containsValue(org.opends.server.types.Attribute attr, Object value)
  {
    for (Iterator<ByteString> it = attr.iterator(); it.hasNext();)
    {
      if (value.equals(it.next()))
      {
        return true;
      }
    }
    return false;
  }
  /**
   * Creates a JNDI attribute using an attribute name and a set of values.
   * @param attrName the attribute name.
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ResetUserPasswordTask.java
@@ -106,7 +106,7 @@
    {
      InitialLdapContext ctx =
        controller.findConnectionForDisplayedEntry(node);
      if ((ctx != null) && isBoundAs(dn, ctx))
      if (ctx != null && isBoundAs(dn, ctx))
      {
        currentPassword = ConnectionUtils.getBindPassword(ctx).toCharArray();
      }
@@ -199,9 +199,7 @@
    try
    {
      ArrayList<String> arguments = getCommandLineArguments();
      String[] args = new String[arguments.size()];
      arguments.toArray(args);
      returnCode = LDAPPasswordModify.mainPasswordModify(args, false,
@@ -213,7 +211,7 @@
      }
      else
      {
        if ((lastException == null) && (currentPassword != null))
        if (lastException == null && currentPassword != null)
        {
          // The connections must be updated, just update the environment, which
          // is what we use to clone connections and to launch scripts.
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/Task.java
@@ -36,6 +36,7 @@
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import javax.naming.NamingException;
@@ -477,9 +478,7 @@
    {
      return OBFUSCATED_VALUE;
    }
    else
    {
      if (o instanceof byte[])
    else if (o instanceof byte[])
      {
        byte[] bytes = (byte[])o;
        if (displayBase64(attrName))
@@ -512,7 +511,6 @@
        return String.valueOf(o);
      }
    }
  }
  /**
   * Obfuscates (if required) the attribute value in an LDIF line.
@@ -521,27 +519,17 @@
   */
  protected String obfuscateLDIFLine(String line)
  {
    String returnValue;
    int index = line.indexOf(":");
    if (index != -1)
    {
      String attrName = line.substring(0, index).trim();
      if (Utilities.mustObfuscate(attrName,
          getInfo().getServerDescriptor().getSchema()))
      {
        returnValue = attrName + ": " + OBFUSCATED_VALUE;
      }
      else
      {
        returnValue = line;
        return attrName + ": " + OBFUSCATED_VALUE;
      }
    }
    else
    {
      returnValue = line;
    }
    return returnValue;
    return line;
  }
  /**
@@ -603,7 +591,7 @@
   * @param incompatibilityReasons the list of incompatibility reasons that
   * must be updated.
   * @return <CODE>true</CODE> if the task that we are trying to launch can be
   * launched in paralel with this task and <CODE>false</CODE> otherwise.
   * launched in parallel with this task and <CODE>false</CODE> otherwise.
   */
  public abstract boolean canLaunch(Task taskToBeLaunched,
      Collection<LocalizableMessage> incompatibilityReasons);
@@ -638,7 +626,7 @@
      {
        binDir = f.getAbsolutePath();
      }
      if (binDir.lastIndexOf(File.separatorChar) != (binDir.length() - 1))
      if (binDir.lastIndexOf(File.separatorChar) != binDir.length() - 1)
      {
        binDir += File.separatorChar;
      }
@@ -655,41 +643,22 @@
   */
  protected boolean runningOnSameServer(Task task)
  {
    boolean runningOnSameServer = false;
    if (getServer().isLocal() && task.getServer().isLocal())
    {
      runningOnSameServer = true;
      return true;
    }
    else
    {
      // Compare the host name and the instance path.  This is safer than
      // comparing ports: we might be running locally on a stopped instance with
      // the same configuration as a "remote" (though located on the same
      // machine) server.
      String f1 = getServer().getInstancePath();
      String f2 = task.getServer().getInstancePath();
    // the same configuration as a "remote" (though located on the same machine) server.
      String host1 = getServer().getHostname();
      String host2 = task.getServer().getHostname();
      if (host1 == null)
      {
        runningOnSameServer = host2 == null;
      }
      else
      {
        runningOnSameServer = host1.equalsIgnoreCase(host2);
      }
    boolean runningOnSameServer = host1 == null ? host2 == null : host1.equalsIgnoreCase(host2);
      if (runningOnSameServer)
      {
        if (f1 == null)
        {
          runningOnSameServer = f2 == null;
        }
        else
        {
          runningOnSameServer = f1.equals(f2);
        }
      }
      String f1 = getServer().getInstancePath();
      String f2 = task.getServer().getInstancePath();
      return Objects.equals(f1, f2);
    }
    return runningOnSameServer;
  }
@@ -718,16 +687,11 @@
   */
  protected String getCommandLinePath(String scriptBasicName)
  {
    String cmdLineName;
    if (isWindows())
    {
      cmdLineName = getBinaryDir()+scriptBasicName+".bat";
      return getBinaryDir() + scriptBasicName + ".bat";
    }
    else
    {
      cmdLineName = getBinaryDir()+scriptBasicName;
    }
    return cmdLineName;
    return getBinaryDir() + scriptBasicName;
  }
  /**
@@ -744,11 +708,9 @@
   * @param clearArgs the arguments in clear.
   * @return the list of obfuscated command-line arguments.
   */
  protected List<String> getObfuscatedCommandLineArguments(
      List<String> clearArgs)
  protected List<String> getObfuscatedCommandLineArguments(List<String> clearArgs)
  {
    String[] toObfuscate = {"--bindPassword", "--currentPassword",
        "--newPassword"};
    String[] toObfuscate = { "--bindPassword", "--currentPassword", "--newPassword" };
    ArrayList<String> args = new ArrayList<>(clearArgs);
    for (int i=1; i<args.size(); i++)
    {
@@ -817,10 +779,10 @@
    {
      ctx = getInfo().getUserDataDirContext();
    }
    if (isServerRunning() && (ctx != null))
    if (isServerRunning() && ctx != null)
    {
      String hostName = localHostName;
      if ((hostName == null) || !getInfo().getServerDescriptor().isLocal())
      if (hostName == null || !getInfo().getServerDescriptor().isLocal())
      {
        hostName = ConnectionUtils.getHostName(ctx);
      }
@@ -877,11 +839,8 @@
      args.removeAll(getConfigCommandLineArguments());
      return getEquivalentCommandLine(cmdLineName, args);
    }
    else
    {
      return null;
    }
  }
  /**
   * Commodity method to know if the server is running or not.
@@ -938,8 +897,7 @@
    ArrayList<String> args = new ArrayList<>(getObfuscatedCommandLineArguments(
        getConnectionCommandLineArguments(useAdminCtx, true)));
    args.add(getNoPropertiesFileArgument());
    String equiv = getEquivalentCommandLine(getCommandLinePath("ldapmodify"),
        args);
    String equiv = getEquivalentCommandLine(getCommandLinePath("ldapmodify"), args);
    StringBuilder sb = new StringBuilder();
    sb.append(INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_MODIFY.get()).append("<br><b>");
@@ -1077,8 +1035,7 @@
    ArrayList<String> args = new ArrayList<>(getObfuscatedCommandLineArguments(
        getConnectionCommandLineArguments(useAdminCtx, true)));
    args.add(getNoPropertiesFileArgument());
    String equiv = getEquivalentCommandLine(getCommandLinePath("ldapmodify"),
        args);
    String equiv = getEquivalentCommandLine(getCommandLinePath("ldapmodify"), args);
    StringBuilder sb = new StringBuilder();
    sb.append(INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_RENAME.get()).append("<br><b>");
    sb.append(equiv);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBackendIndexesPanel.java
@@ -208,7 +208,7 @@
      public void mouseReleased(MouseEvent ev)
      {
        int selectedRow = table.getSelectedRow();
        if ((selectedRow != -1) && (lastRowMouseOver == selectedRow))
        if (selectedRow != -1 && lastRowMouseOver == selectedRow)
        {
          AbstractIndexDescriptor index = tableModel.getIndexAt(selectedRow);
          final IndexSelectionEvent ise = new IndexSelectionEvent(table, index);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AttributeSyntaxPanel.java
@@ -168,8 +168,8 @@
      /** {@inheritDoc} */
      public void keyTyped(KeyEvent ev)
      {
        if ((ev.getKeyChar() == KeyEvent.VK_SPACE) ||
            (ev.getKeyChar() == KeyEvent.VK_ENTER))
        if (ev.getKeyChar() == KeyEvent.VK_SPACE ||
            ev.getKeyChar() == KeyEvent.VK_ENTER)
        {
          usedBySelected();
        }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BackupPanel.java
@@ -371,7 +371,7 @@
    }
    String parentPath = parentDirectory.getText();
    if ((parentPath == null) || (parentPath.trim().equals("")))
    if (parentPath == null || parentPath.trim().equals(""))
    {
      errors.add(ERR_CTRL_PANEL_NO_BACKUP_PATH_PROVIDED.get());
      setPrimaryInvalid(lPath);
@@ -391,7 +391,7 @@
      }
    }
    String dir = backupID.getText();
    if ((dir == null) || (dir.trim().equals("")))
    if (dir == null || dir.trim().equals(""))
    {
      errors.add(ERR_CTRL_PANEL_NO_BACKUP_ID_PROVIDED.get());
      setPrimaryInvalid(lBackupID);
@@ -412,8 +412,7 @@
    {
      if (isLocal())
      {
        boolean selected = backupList.isVisible() &&
        (getSelectedBackup() != null);
        boolean selected = backupList.isVisible() && getSelectedBackup() != null;
        if (!selected)
        {
          errors.add(ERR_CTRL_PANEL_NO_PARENT_BACKUP_SELECTED.get());
@@ -423,7 +422,7 @@
      else
      {
        String parentID = parentBackupID.getText();
        if ((parentID == null) || (parentID.trim().equals("")))
        if (parentID == null || parentID.trim().equals(""))
        {
          errors.add(ERR_CTRL_PANEL_NO_PARENT_BACKUP_ID_PROVIDED.get());
          setPrimaryInvalid(lParentID);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BinaryAttributeEditorPanel.java
@@ -272,8 +272,7 @@
      String f = file.getText();
      if (f.trim().length() == 0)
      {
        if (hasImageSyntax(attrName.getText()) && (oldValue != null) &&
            !updateImage)
        if (hasImageSyntax(attrName.getText()) && oldValue != null && !updateImage)
        {
          // Do nothing.  We do not want to regenerate the image and we
          // are on the case where the user simply did not change the image.
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
@@ -97,7 +97,6 @@
/**
 * The pane that is displayed when the user clicks on 'Browse Entries...'.
 * It contains its own menu bar with all the actions to edit the entries.
 *
 */
public class BrowseEntriesPanel extends AbstractBrowseEntriesPanel
{
@@ -290,26 +289,13 @@
          }
          ignoreTreeSelectionEvents = false;
        }
        if ((paths != null) && (paths.length == 1))
        if (paths != null && paths.length == 1)
        {
          path = paths[0];
        }
//      Update menu items
        boolean enableDelete = false;
        if ((paths != null) && (paths.length > 0))
        {
          enableDelete = true;
          for (TreePath p : paths)
          {
            BasicNode n = (BasicNode)p.getLastPathComponent();
            enableDelete = entryPane.canDelete(n.getDN());
            if (!enableDelete)
            {
              break;
            }
          }
        }
        boolean enableDelete = enableDelete(paths);
        popupDeleteMenuItem.setEnabled(enableDelete);
        menuBar.deleteMenuItem.setEnabled(enableDelete);
@@ -335,7 +321,7 @@
        menuBar.resetPasswordMenuItem.setEnabled(enableResetPassword);
//      Assume that if we cannot delete, we cannot create a new path
        boolean enableNewEntry = (path != null) && enableDelete;
        boolean enableNewEntry = path != null && enableDelete;
        popupNewUserMenuItem.setEnabled(enableNewEntry);
        menuBar.newUserMenuItem.setEnabled(enableNewEntry);
@@ -353,6 +339,23 @@
        updateRightPane(paths);
      }
      private boolean enableDelete(TreePath[] paths)
      {
        if (paths != null && paths.length > 0)
        {
          for (TreePath p : paths)
          {
            BasicNode n = (BasicNode)p.getLastPathComponent();
            if (!entryPane.canDelete(n.getDN()))
            {
              return false;
            }
          }
          return true;
        }
        return false;
      }
    };
    tree.getSelectionModel().addTreeSelectionListener(treeSelectionListener);
  }
@@ -500,7 +503,7 @@
  private void updateRightPane(TreePath[] paths)
  {
    TreePath path = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      path = paths[0];
    }
@@ -560,7 +563,7 @@
    else
    {
      stopCurrentReader();
      if ((paths != null) && (paths.length > 1))
      if (paths != null && paths.length > 1)
      {
        entryPane.multipleEntriesSelected();
      }
@@ -586,7 +589,7 @@
  private void startReader(LDAPEntryReader reader)
  {
    entryReader = reader;
    if ((entryReaderThread == null) || !entryReaderThread.isAlive())
    if (entryReaderThread == null || !entryReaderThread.isAlive())
    {
      entryReaderThread = new Thread(new Runnable()
      {
@@ -815,7 +818,7 @@
          Utilities.getParentDialog(this));
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      TreePath path = paths[0];
      BasicNode node = (BasicNode)path.getLastPathComponent();
@@ -862,7 +865,7 @@
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    BasicNode parentNode = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      TreePath path = paths[0];
      parentNode = (BasicNode)path.getLastPathComponent();
@@ -886,7 +889,7 @@
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    BasicNode parentNode = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      TreePath path = paths[0];
      parentNode = (BasicNode)path.getLastPathComponent();
@@ -907,7 +910,7 @@
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    BasicNode parentNode = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      TreePath path = paths[0];
      parentNode = (BasicNode)path.getLastPathComponent();
@@ -929,7 +932,7 @@
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    BasicNode parentNode = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      TreePath path = paths[0];
      parentNode = (BasicNode)path.getLastPathComponent();
@@ -951,7 +954,7 @@
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    BasicNode parentNode = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      TreePath path = paths[0];
      parentNode = (BasicNode)path.getLastPathComponent();
@@ -973,7 +976,7 @@
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    BasicNode parentNode = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      TreePath path = paths[0];
      parentNode = (BasicNode)path.getLastPathComponent();
@@ -999,7 +1002,7 @@
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    BasicNode node = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      TreePath path = paths[0];
      node = (BasicNode)path.getLastPathComponent();
@@ -1013,7 +1016,7 @@
    ArrayList<LocalizableMessage> errors = new ArrayList<>();
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    if ((paths != null) && (paths.length > 0))
    if (paths != null && paths.length > 0)
    {
      ProgressDialog dlg = new ProgressDialog(
          Utilities.createFrame(),
@@ -1511,7 +1514,7 @@
    boolean isInterruptedException = false;
    isInterruptedException = t instanceof java.io.InterruptedIOException ||
    t instanceof InterruptedNamingException;
    while ((t != null) && !isInterruptedException)
    while (t != null && !isInterruptedException)
    {
      t = t.getCause();
      isInterruptedException = t instanceof java.io.InterruptedIOException ||
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseGeneralMonitoringPanel.java
@@ -480,7 +480,7 @@
    {
      TreePath[] paths = treePane.getTree().getSelectionPaths();
      TreePath path = null;
      if ((paths != null) && (paths.length == 1))
      if (paths != null && paths.length == 1)
      {
        path = paths[0];
      }
@@ -515,7 +515,7 @@
      }
      else
      {
        if ((paths != null) && (paths.length > 1))
        if (paths != null && paths.length > 1)
        {
          entryPane.displayMessage(MULTIPLE_ITEMS_SELECTED);
        }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseIndexPanel.java
@@ -199,7 +199,7 @@
      public void itemStateChanged(ItemEvent ev)
      {
        if (!ignoreSelectionEvents &&
            (ev.getStateChange() == ItemEvent.SELECTED))
            ev.getStateChange() == ItemEvent.SELECTED)
        {
          repopulateTree(treePane.getTree());
        }
@@ -614,20 +614,19 @@
        }
        else
        {
          expand = tree.isExpanded(new TreePath(parent)) ||
          (parent.getChildCount() == 0);
          expand = tree.isExpanded(new TreePath(parent)) || parent.getChildCount() == 0;
          parent.removeAllChildren();
        }
        for (AbstractIndexTreeNode node : nodes.get(i))
        {
          parent.add(node);
          if ((newSelectionPath == null) &&
              ((lastSelectedNode != null) || (lastCreatedIndex != null)))
          if (newSelectionPath == null &&
              (lastSelectedNode != null || lastCreatedIndex != null))
          {
            if (lastCreatedIndex != null)
            {
              if ((node instanceof IndexTreeNode) &&
                  (lastCreatedIndex instanceof IndexDescriptor))
              if (node instanceof IndexTreeNode &&
                  lastCreatedIndex instanceof IndexDescriptor)
              {
                if (node.getName().equals(lastCreatedIndex.getName()))
                {
@@ -698,7 +697,7 @@
    ViewPositions pos = Utilities.getViewPositions(entryPane);
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    TreePath path = null;
    if ((paths != null) && (paths.length == 1))
    if (paths != null && paths.length == 1)
    {
      path = paths[0];
    }
@@ -732,7 +731,7 @@
    }
    else
    {
      if ((paths != null) && (paths.length > 1))
      if (paths != null && paths.length > 1)
      {
        entryPane.displayMultiple();
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ColorAndFontConstants.java
@@ -66,8 +66,7 @@
    Color bg = Color.white;
    try
    {
      if ((foreground.getGreen() + foreground.getRed() + foreground.getBlue()) >
      (200 * 3))
      if (foreground.getGreen() + foreground.getRed() + foreground.getBlue() > 200 * 3)
      {
        // This is done to avoid problem in high contrast UIs
        bg = UIManager.getColor("TextField.background");
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/CustomAttributePanel.java
@@ -428,8 +428,8 @@
        @Override
        public void keyTyped(KeyEvent ev)
        {
          if ((ev.getKeyChar() == KeyEvent.VK_SPACE) ||
              (ev.getKeyChar() == KeyEvent.VK_ENTER))
          if (ev.getKeyChar() == KeyEvent.VK_SPACE ||
              ev.getKeyChar() == KeyEvent.VK_ENTER)
          {
            objectClassSelected(list);
          }
@@ -655,8 +655,7 @@
      }
      List<Syntax> newSyntaxes = new ArrayList<>(syntaxNameMap.values());
      updateComboBoxModel(newSyntaxes,
          ((DefaultComboBoxModel)syntax.getModel()));
      updateComboBoxModel(newSyntaxes, (DefaultComboBoxModel) syntax.getModel());
      Map<String, AttributeType> attributeNameMap = new TreeMap<>(lowerCase);
      for (String key : schema.getAttributeTypes().keySet())
@@ -667,8 +666,7 @@
      List<Object> newParents = new ArrayList<>();
      newParents.addAll(attributeNameMap.values());
      newParents.add(0, NO_PARENT);
      updateComboBoxModel(newParents,
          ((DefaultComboBoxModel)parent.getModel()));
      updateComboBoxModel(newParents, (DefaultComboBoxModel) parent.getModel());
      final Map<String, MatchingRule> matchingRuleNameMap = new TreeMap<>(lowerCase);
      for (String key : schema.getMatchingRules().keySet())
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/CustomObjectClassPanel.java
@@ -464,7 +464,7 @@
    ignoreChangeEvents = true;
    objectClass = oc;
    if ((oc == null) || (schema == null))
    if (oc == null || schema == null)
    {
      // Ignore: this is called to get an initial panel size.
      return;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ExportLDIFPanel.java
@@ -173,8 +173,7 @@
      public void changedUpdate(DocumentEvent ev)
      {
        String text = file.getText().trim();
        setEnabledOK((text != null) && (text.length() > 0) &&
            !errorPane.isVisible());
        setEnabledOK(text != null && text.length() > 0 && !errorPane.isVisible());
      }
      /** {@inheritDoc} */
      public void removeUpdate(DocumentEvent ev)
@@ -360,7 +359,7 @@
    }
    String ldifPath = file.getText();
    if ((ldifPath == null) || (ldifPath.trim().equals("")))
    if (ldifPath == null || ldifPath.trim().equals(""))
    {
      errors.add(INFO_NO_LDIF_PATH.get());
      setPrimaryInvalid(lFile);
@@ -410,7 +409,7 @@
              INFO_CTRL_PANEL_CONFIRMATION_EXPORT_LDIF_DETAILS.get(ldifPath));
        }
      }
      if ((errors.isEmpty()) && confirmed)
      if (errors.isEmpty() && confirmed)
      {
        launchOperation(newTask,
            INFO_CTRL_PANEL_EXPORTING_LDIF_SUMMARY.get(backends.getSelectedItem()),
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/GenericDialog.java
@@ -187,16 +187,16 @@
    for (int i=0; i < container.getComponentCount(); i++)
    {
      Component comp = container.getComponent(i);
      if ((comp instanceof AbstractButton) ||
          (comp instanceof JTextComponent) ||
          (comp instanceof JList) ||
          (comp instanceof JComboBox) ||
          (comp instanceof JTable))
      if (comp instanceof AbstractButton ||
          comp instanceof JTextComponent ||
          comp instanceof JList ||
          comp instanceof JComboBox ||
          comp instanceof JTable)
      {
        comp.addFocusListener(focusListener);
      }
      else if ((comp instanceof JPanel) || (comp instanceof JScrollPane)
          || (comp instanceof JViewport))
      else if (comp instanceof JPanel || comp instanceof JScrollPane
          || comp instanceof JViewport)
      {
        addFocusListener(focusListener, (Container)comp);
      }
@@ -210,8 +210,7 @@
    {
      lastComponentWithFocus = panel.getPreferredFocusComponent();
    }
    if (visible && (lastComponentWithFocus != null) &&
        lastComponentWithFocus.isVisible())
    if (visible && lastComponentWithFocus != null && lastComponentWithFocus.isVisible())
    {
      if (lastComponentWithFocus == null)
      {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/GenericFrame.java
@@ -174,16 +174,16 @@
    for (int i=0; i < container.getComponentCount(); i++)
    {
      Component comp = container.getComponent(i);
      if ((comp instanceof AbstractButton) ||
          (comp instanceof JTextComponent) ||
          (comp instanceof JList) ||
          (comp instanceof JComboBox) ||
          (comp instanceof JTable))
      if (comp instanceof AbstractButton ||
          comp instanceof JTextComponent ||
          comp instanceof JList ||
          comp instanceof JComboBox ||
          comp instanceof JTable)
      {
        comp.addFocusListener(focusListener);
      }
      else if ((comp instanceof JPanel) || (comp instanceof JScrollPane)
          || (comp instanceof JViewport))
      else if (comp instanceof JPanel || comp instanceof JScrollPane
          || comp instanceof JViewport)
      {
        addFocusListener(focusListener, (Container)comp);
      }
@@ -197,7 +197,7 @@
    {
      lastComponentWithFocus = panel.getPreferredFocusComponent();
    }
    if (visible && (lastComponentWithFocus != null))
    if (visible && lastComponentWithFocus != null)
    {
      lastComponentWithFocus.requestFocusInWindow();
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java
@@ -199,8 +199,7 @@
      public void changedUpdate(DocumentEvent ev)
      {
        String text = file.getText().trim();
        setEnabledOK((text != null) && (text.length() > 0) &&
            !errorPane.isVisible());
        setEnabledOK(text != null && text.length() > 0 && !errorPane.isVisible());
      }
      /** {@inheritDoc} */
      @Override
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/InclusionExclusionPanel.java
@@ -528,7 +528,7 @@
    }
    s = filter.getText();
    if ((s != null) && (s.trim().length() > 0))
    if (s != null && s.trim().length() > 0)
    {
      try
      {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java
@@ -594,11 +594,9 @@
        }
        String v = properties.getProperty("overwrite-env-java-home");
        readUseOpenDSJavaHome =
          (v == null) || ("false".equalsIgnoreCase(v.trim()));
        readUseOpenDSJavaHome = v == null || "false".equalsIgnoreCase(v.trim());
        v = properties.getProperty("overwrite-env-java-args");
        readUseOpenDSJavaArgs =
          (v == null) || ("false".equalsIgnoreCase(v.trim()));
        readUseOpenDSJavaArgs = v == null || "false".equalsIgnoreCase(v.trim());
        readJavaHome = properties.getProperty("default.java-home");
        if (readJavaHome == null)
@@ -769,7 +767,7 @@
          {
            jvms = new String[]{userJVM};
          }
          else if ((userJVM != null) && (userJVM.trim().length() > 0))
          else if (userJVM != null && userJVM.trim().length() > 0)
          {
            jvms = new String[]{defaultJVM, userJVM};
          }
@@ -1423,7 +1421,7 @@
        while ((line = reader.readLine()) != null)
        {
          String trimmedLine = line.trim();
          if (trimmedLine.startsWith("#") || (trimmedLine.length() == 0))
          if (trimmedLine.startsWith("#") || trimmedLine.length() == 0)
          {
            commentLines.add(line);
          }
@@ -1457,7 +1455,7 @@
        writer.write("overwrite-env-java-args="+overwriteOpenDSJavaArgs);
        writer.newLine();
        writer.newLine();
        if ((defaultJavaHome != null) && (defaultJavaHome.length() > 0))
        if (defaultJavaHome != null && defaultJavaHome.length() > 0)
        {
          writer.write("default.java-home="+defaultJavaHome);
          writer.newLine();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDAPEntryPanel.java
@@ -419,7 +419,7 @@
      {
        boolean isReadOnly = true;
        boolean canDelete = false;
        if ((searchResult != null) && desc.isAuthenticated())
        if (searchResult != null && desc.isAuthenticated())
        {
          isReadOnly = isReadOnly(searchResult.getDN());
          canDelete = canDelete(searchResult.getDN());
@@ -711,7 +711,7 @@
   */
  public boolean mustCheckUnsavedChanges()
  {
    return (displayedEntryPanel != null) &&
    return displayedEntryPanel != null &&
        saveChanges.isVisible() && saveChanges.isEnabled();
  }
@@ -735,7 +735,7 @@
    if (result == UnsavedChangesDialog.Result.SAVE)
    {
      saveChanges(false);
      if ((newTask == null) || // The user data is not valid
      if (newTask == null || // The user data is not valid
          newTask.getState() != Task.State.FINISHED_SUCCESSFULLY)
      {
        result = UnsavedChangesDialog.Result.CANCEL;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDAPEntrySelectionPanel.java
@@ -171,7 +171,7 @@
      public void valueChanged(TreeSelectionEvent ev)
      {
        TreePath[] paths = tree.getSelectionPaths();
        setEnabledOK((paths != null) && (paths.length > 0));
        setEnabledOK(paths != null && paths.length > 0);
      }
    });
    MouseListener mouseListener = new MouseAdapter() {
@@ -179,7 +179,7 @@
      @Override
      public void mousePressed(MouseEvent e) {
        int selRow = tree.getRowForLocation(e.getX(), e.getY());
        if ((selRow != -1) && (e.getClickCount() == 2))
        if (selRow != -1 && e.getClickCount() == 2)
        {
          okClicked();
        }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/MatchingRulePanel.java
@@ -178,8 +178,8 @@
      @Override
      public void keyTyped(KeyEvent ev)
      {
        if ((ev.getKeyChar() == KeyEvent.VK_SPACE) ||
            (ev.getKeyChar() == KeyEvent.VK_ENTER))
        if (ev.getKeyChar() == KeyEvent.VK_SPACE ||
            ev.getKeyChar() == KeyEvent.VK_ENTER)
        {
          usedBySelected();
        }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RefreshOptionsPanel.java
@@ -145,7 +145,7 @@
    catch (Throwable th)
    {
    }
    if ((t <= 0) || (t > MAX_VALUE))
    if (t <= 0 || t > MAX_VALUE)
    {
      errors.add(INFO_CTRL_PANEL_INVALID_PERIOD_VALUE.get(MAX_VALUE));
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RestorePanel.java
@@ -221,7 +221,7 @@
      public void valueChanged(ListSelectionEvent ev)
      {
        BackupDescriptor backup = getSelectedBackup();
        setEnabledOK((backup != null) && !errorPane.isVisible());
        setEnabledOK(backup != null && !errorPane.isVisible());
      }
    };
    backupList.getSelectionModel().addListSelectionListener(listener);
@@ -248,7 +248,7 @@
    if (isLocal())
    {
      boolean selected = backupList.isVisible() && (backup != null);
      boolean selected = backupList.isVisible() && backup != null;
      if (!selected)
      {
        if (backupList.getRowCount() == 0)
@@ -266,14 +266,14 @@
    else
    {
      String parentPath = parentDirectory.getText();
      if ((parentPath == null) || (parentPath.trim().equals("")))
      if (parentPath == null || parentPath.trim().equals(""))
      {
        errors.add(ERR_CTRL_PANEL_NO_BACKUP_PATH_PROVIDED.get());
        setPrimaryInvalid(lPath);
      }
      String id = backupID.getText();
      if ((id == null) || (id.trim().equals("")))
      if (id == null || id.trim().equals(""))
      {
        errors.add(ERR_CTRL_PANEL_NO_BACKUP_ID_PROVIDED.get());
        setPrimaryInvalid(lBackupID);
@@ -299,7 +299,7 @@
            INFO_CTRL_PANEL_CONFIRM_RESTORE_DETAILS.get());
      }
      if ((errors.isEmpty()) && confirmed)
      if (errors.isEmpty() && confirmed)
      {
        launchOperation(newTask,
            INFO_CTRL_PANEL_RESTORING_SUMMARY.get(backup.getID()),
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SchemaBrowserRightPanel.java
@@ -361,8 +361,7 @@
   */
  public boolean mustCheckUnsavedChanges()
  {
    return (schemaElementPanel != null) &&
    schemaElementPanel.mustCheckUnsavedChanges();
    return schemaElementPanel != null && schemaElementPanel.mustCheckUnsavedChanges();
  }
  /**
@@ -373,13 +372,10 @@
   */
  public UnsavedChangesDialog.Result checkUnsavedChanges()
  {
    if (schemaElementPanel == null)
    {
     return UnsavedChangesDialog.Result.DO_NOT_SAVE;
    }
    else
    if (schemaElementPanel != null)
    {
      return schemaElementPanel.checkUnsavedChanges();
    }
    return UnsavedChangesDialog.Result.DO_NOT_SAVE;
  }
}
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -407,7 +407,7 @@
  public void update(CustomSearchResult sr, boolean isReadOnly, TreePath path)
  {
    boolean sameEntry = false;
    if ((searchResult != null) && (sr != null))
    if (searchResult != null && sr != null)
    {
      sameEntry = searchResult.getDN().equals(sr.getDN());
    }
@@ -534,7 +534,7 @@
        {
          gbc.anchor = GridBagConstraints.WEST;
        }
        else if ((values.size() <= 1) &&
        else if (values.size() <= 1 &&
                (hasBinaryValue(values) || isBinary(attr)))
        {
          gbc.anchor = GridBagConstraints.WEST;
@@ -605,7 +605,7 @@
      /** {@inheritDoc} */
      public void run()
      {
        if ((p != null) && (scrollAttributes.getViewport().contains(p)))
        if (p != null && scrollAttributes.getViewport().contains(p))
        {
          scrollAttributes.getViewport().setViewPosition(p);
        }
@@ -630,7 +630,7 @@
      basicAttrName = attrName.substring(0, index);
      subType = attrName.substring(index + 1);
    }
    if ((subType != null) && (subType.equalsIgnoreCase("binary")))
    if (subType != null && subType.equalsIgnoreCase("binary"))
    {
      // TODO: use message
      subType = "binary";
@@ -1006,7 +1006,7 @@
              Utilities.centerGoldenMean(editOcDlg,
                  Utilities.getParentDialog(SimplifiedViewEntryPanel.this));
            }
            if ((newValue == null) && (ocDescriptor != null))
            if (newValue == null && ocDescriptor != null)
            {
              editOcPanel.setValue(ocDescriptor);
            }
@@ -1128,7 +1128,7 @@
            {
              // We use an empty binary array to not breaking the logic:
              // it means that there is no value for the attribute.
              if ((binaryValue != null) && (binaryValue.length > 0))
              if (binaryValue != null && binaryValue.length > 0)
              {
                newValue = BinaryValue.createBase64(binaryValue);
                editBinaryPanel.setValue(attrName, newValue);
@@ -1413,21 +1413,17 @@
  private boolean isAttrName(String attrName, CustomSearchResult sr)
  {
    boolean isAttrName = false;
    List<Object> values =
      sr.getAttributeValues(ServerConstants.OBJECTCLASS_ATTRIBUTE_TYPE_NAME);
    List<Object> values = sr.getAttributeValues(ServerConstants.OBJECTCLASS_ATTRIBUTE_TYPE_NAME);
    for (Object o : values)
    {
      String ocName = (String)o;
      String attr = hmNameAttrNames.get(ocName.toLowerCase());
      if ((attr != null) && (attr.equalsIgnoreCase(attrName)))
      if (attr != null && attr.equalsIgnoreCase(attrName))
      {
        isAttrName = true;
        break;
        return true;
      }
    }
    return isAttrName;
    return false;
  }
  private boolean hasBinaryValue(List<Object> values)
@@ -1935,7 +1931,7 @@
        }
        values.addAll(ocDesc.getAuxiliary());
        Schema schema = getInfo().getServerDescriptor().getSchema();
        if ((schema != null) && (structural != null))
        if (schema != null && structural != null)
        {
          ObjectClass oc = schema.getObjectClass(structural.toLowerCase());
          if (oc != null)
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StandardAttributePanel.java
@@ -228,8 +228,8 @@
        /** {@inheritDoc} */
        public void keyTyped(KeyEvent ev)
        {
          if ((ev.getKeyChar() == KeyEvent.VK_SPACE) ||
              (ev.getKeyChar() == KeyEvent.VK_ENTER))
          if (ev.getKeyChar() == KeyEvent.VK_SPACE ||
              ev.getKeyChar() == KeyEvent.VK_ENTER)
          {
            objectClassSelected(list);
          }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StandardObjectClassPanel.java
@@ -245,8 +245,8 @@
        @Override
        public void keyTyped(KeyEvent ev)
        {
          if ((ev.getKeyChar() == KeyEvent.VK_SPACE) ||
              (ev.getKeyChar() == KeyEvent.VK_ENTER))
          if (ev.getKeyChar() == KeyEvent.VK_SPACE ||
              ev.getKeyChar() == KeyEvent.VK_ENTER)
          {
            attrSelected(list);
          }
@@ -294,7 +294,7 @@
   */
  public void update(ObjectClass oc, Schema schema)
  {
    if ((oc == null) || (schema == null))
    if (oc == null || schema == null)
    {
      // Ignore: this is called to get an initial panel size.
      return;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java
@@ -166,7 +166,7 @@
  public void update(CustomSearchResult sr, boolean isReadOnly, TreePath path)
  {
    boolean sameEntry = false;
    if ((searchResult != null) && (sr != null))
    if (searchResult != null && sr != null)
    {
      sameEntry = searchResult.getDN().equals(sr.getDN());
    }
@@ -188,7 +188,7 @@
    {
      public void run()
      {
        if ((p != null) && (scroll.getViewport().contains(p)))
        if (p != null && scroll.getViewport().contains(p))
        {
          scroll.getViewport().setViewPosition(p);
        }
@@ -668,7 +668,7 @@
        addedAttrs.add(
            Utilities.getAttributeNameWithoutOptions(attrName).toLowerCase());
      }
      if ((ocs != null) && (schema != null))
      if (ocs != null && schema != null)
      {
        for (Object o : ocs)
        {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TaskToSchedulePanel.java
@@ -378,7 +378,7 @@
    try
    {
      d = Integer.parseInt(day.getText().trim());
      if ((d < 0) || (d > 31))
      if (d < 0 || d > 31)
      {
        errorMessages.add(ERR_CTRL_PANEL_INVALID_DAY.get());
        setPrimaryInvalid(lDay);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
@@ -187,31 +187,10 @@
    // simply to update the dn
    Entry entry = null;
    String dn = getDisplayedDN();
    if ((dn != null) && !dn.equals(title.getText()))
    if (dn != null && !dn.equals(title.getText()))
    {
      title.setText(dn);
    }
    /*
    Entry entry;
    try
    {
      entry = getEntry();
      String dn = entry.getDN().toString();
      if (!dn.equals(title.getText()))
      {
        title.setText(dn);
      }
    }
    catch (OpenDsException de)
    {
      entry = null;
    }
    catch (Throwable t)
    {
      entry = null;
      logger.warn(LocalizableMessage.raw("Unexpected error: "+t, t));
    }
    */
    LDAPEntryChangedEvent ev = new LDAPEntryChangedEvent(this, entry);
    for (LDAPEntryChangedListener listener : listeners)
    {
@@ -228,7 +207,7 @@
  protected void updateTitle(CustomSearchResult sr, TreePath path)
  {
    String dn = sr.getDN();
    if ((dn != null) && (dn.length() > 0))
    if (dn != null && dn.length() > 0)
    {
      title.setText(sr.getDN());
    }
@@ -251,7 +230,7 @@
    List<Object> ocs =
      sr.getAttributeValues(ServerConstants.OBJECTCLASS_ATTRIBUTE_TYPE_NAME);
    Schema schema = getInfo().getServerDescriptor().getSchema();
    if (!ocs.isEmpty() && (schema != null))
    if (!ocs.isEmpty() && schema != null)
    {
      ObjectClassValue ocDesc = getObjectClassDescriptor(ocs, schema);
      StringBuilder sb = new StringBuilder();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/WindowsServicePanel.java
@@ -188,8 +188,7 @@
    isWindowsServiceEnabled = ev.getNewDescriptor().isWindowsServiceEnabled();
    final boolean isLocal = ev.getNewDescriptor().isLocal();
    if ((isLocal != previousLocal) ||
        (isWindowsServiceEnabled != previousValue))
    if (isLocal != previousLocal || isWindowsServiceEnabled != previousValue)
    {
      previousLocal = isLocal;
      SwingUtilities.invokeLater(new Runnable()
@@ -342,10 +341,9 @@
      {
        if (enableService)
        {
          returnCode = ConfigureWindowsService.enableService(outPrintStream,
              errorPrintStream);
          if ((returnCode != ConfigureWindowsService.SERVICE_ALREADY_ENABLED) &&
              (returnCode != ConfigureWindowsService.SERVICE_ENABLE_SUCCESS))
          returnCode = ConfigureWindowsService.enableService(outPrintStream, errorPrintStream);
          if (returnCode != ConfigureWindowsService.SERVICE_ALREADY_ENABLED &&
              returnCode != ConfigureWindowsService.SERVICE_ENABLE_SUCCESS)
          {
            state = State.FINISHED_WITH_ERROR;
          }
@@ -356,11 +354,9 @@
        }
        else
        {
          returnCode = ConfigureWindowsService.disableService(outPrintStream,
              errorPrintStream);
          if ((returnCode != ConfigureWindowsService.SERVICE_ALREADY_DISABLED)
              &&
              (returnCode != ConfigureWindowsService.SERVICE_DISABLE_SUCCESS))
          returnCode = ConfigureWindowsService.disableService(outPrintStream, errorPrintStream);
          if (returnCode != ConfigureWindowsService.SERVICE_ALREADY_DISABLED
              && returnCode != ConfigureWindowsService.SERVICE_DISABLE_SUCCESS)
          {
            state = State.FINISHED_WITH_ERROR;
          }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/AddRemovePanel.java
@@ -156,7 +156,7 @@
    {
      /** {@inheritDoc} */
      public void mouseClicked(MouseEvent e) {
        if (isEnabled() && (e.getClickCount() == 2))
        if (isEnabled() && e.getClickCount() == 2)
        {
          if (e.getSource() == availableList)
          {
@@ -389,19 +389,19 @@
  private void updateButtonEnabling()
  {
    int index = availableList.getSelectedIndex();
    add.setEnabled((index != -1) &&
        (index <availableListModel.getSize()) && isEnabled());
    add.setEnabled(index != -1 &&
        index <availableListModel.getSize() && isEnabled());
    index = selectedList.getSelectedIndex();
    remove.setEnabled((index != -1) &&
        (index <selectedListModel.getSize()) && isEnabled());
    remove.setEnabled(index != -1 &&
        index <selectedListModel.getSize() && isEnabled());
    if (addAll != null)
    {
      addAll.setEnabled((availableListModel.getSize() > 0) && isEnabled());
      addAll.setEnabled(availableListModel.getSize() > 0 && isEnabled());
    }
    if (removeAll != null)
    {
      removeAll.setEnabled((selectedListModel.getSize() > 0) && isEnabled());
      removeAll.setEnabled(selectedListModel.getSize() > 0 && isEnabled());
    }
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/BinaryCellPanel.java
@@ -206,7 +206,7 @@
  public void setValue(byte[] value, boolean isImage)
  {
    label.setText(getString(value, isImage).toString());
    deleteButton.setVisible((value != null) && isDisplayDelete());
    deleteButton.setVisible(value != null && isDisplayDelete());
    this.value = value;
    if (!isImage)
    {
@@ -228,7 +228,7 @@
  public void setValue(BinaryValue value, boolean isImage)
  {
    label.setText(getMessage(value, isImage).toString());
    deleteButton.setVisible((value != null) && isDisplayDelete());
    deleteButton.setVisible(value != null && isDisplayDelete());
    this.value = value;
    if (!isImage)
    {
@@ -260,7 +260,7 @@
    else
    {
      Icon icon = getIcon(value);
      if ((icon == null) || (icon.getIconHeight() <= 0))
      if (icon == null || icon.getIconHeight() <= 0)
      {
        Utilities.setWarningLabel(label, ERR_LOADING_IMAGE.get());
        label.setVisible(true);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java
@@ -151,7 +151,7 @@
        MouseEvent newEvent = getTranslatedEvent(ev);
        if (isMacOS() && ev.isPopupTrigger() &&
            (ev.getButton() != MouseEvent.BUTTON1))
            ev.getButton() != MouseEvent.BUTTON1)
        {
          MouseEvent baseEvent = ev;
          if (newEvent != null)
@@ -159,8 +159,8 @@
            baseEvent = newEvent;
          }
          int mods = baseEvent.getModifiersEx();
          mods &= (InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK |
              InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
          mods &= InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK |
              InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK;
          mods |=  InputEvent.BUTTON1_DOWN_MASK;
          final MouseEvent  macEvent = new MouseEvent(
              baseEvent.getComponent(),
@@ -266,8 +266,8 @@
            Rectangle r = getPathBounds(path);
            if (r != null)
            {
              int newX = r.x + (r.width / 2);
              int newY = r.y + (r.height / 2);
              int newX = r.x + r.width / 2;
              int newY = r.y + r.height / 2;
              // Simulate an event
              newEvent = new MouseEvent(
                  ev.getComponent(),
@@ -318,8 +318,8 @@
    {
      Rectangle pathBounds = getPathBounds(closestPath);
      if (pathBounds != null &&
         x >= pathBounds.x && x < (getX() + getWidth()) &&
         y >= pathBounds.y && y < (pathBounds.y + pathBounds.height))
         x >= pathBounds.x && x < getX() + getWidth() &&
         y >= pathBounds.y && y < pathBounds.y + pathBounds.height)
      {
        path = closestPath;
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/DoubleAddRemovePanel.java
@@ -82,8 +82,8 @@
  private JScrollPane selectedScroll1;
  private JScrollPane selectedScroll2;
  private JList availableList;
  private JList selectedList1;
  private JList selectedList2;
  private JList<T> selectedList1;
  private JList<T> selectedList2;
  private Class<T> theClass;
  private Collection<T> unmovableItems = new ArrayList<>();
  private boolean ignoreListEvents;
@@ -167,13 +167,13 @@
    {
      /** {@inheritDoc} */
      public void mouseClicked(MouseEvent e) {
        if (isEnabled() && (e.getClickCount() == 2))
        if (isEnabled() && e.getClickCount() == 2)
        {
          if (e.getSource() == availableList)
          {
            if (availableList.getSelectedValue() != null)
            {
              add1Clicked();
              addClicked(selectedListModel1);
            }
          }
          else if (e.getSource() == selectedList1)
@@ -195,21 +195,21 @@
    availableListModel = new SortableListModel<>();
    availableListModel.addListDataListener(listDataListener);
    availableList = new JList();
    availableList = new JList<>();
    availableList.setModel(availableListModel);
    availableList.setVisibleRowCount(15);
    availableList.addMouseListener(doubleClickListener);
    selectedListModel1 = new SortableListModel<>();
    selectedListModel1.addListDataListener(listDataListener);
    selectedList1 = new JList();
    selectedList1 = new JList<>();
    selectedList1.setModel(selectedListModel1);
    selectedList1.setVisibleRowCount(7);
    selectedList1.addMouseListener(doubleClickListener);
    selectedListModel2 = new SortableListModel<>();
    selectedListModel2.addListDataListener(listDataListener);
    selectedList2 = new JList();
    selectedList2 = new JList<>();
    selectedList2.setModel(selectedListModel2);
    selectedList2.setVisibleRowCount(7);
    selectedList2.addMouseListener(doubleClickListener);
@@ -247,7 +247,7 @@
      /** {@inheritDoc} */
      public void actionPerformed(ActionEvent ev)
      {
        add1Clicked();
        addClicked(selectedListModel1);
      }
    });
    gbc.insets = new Insets(5, 5, 0, 5);
@@ -324,7 +324,7 @@
      /** {@inheritDoc} */
      public void actionPerformed(ActionEvent ev)
      {
        add2Clicked();
        addClicked(selectedListModel2);
      }
    });
    gbc.insets = new Insets(5, 5, 0, 5);
@@ -560,7 +560,7 @@
    ignoreListEvents = true;
    JList[] lists = {availableList, selectedList1, selectedList2};
    for (JList list : lists)
    for (JList<T> list : lists)
    {
      for (T element : unmovableItems)
      {
@@ -583,41 +583,38 @@
    }
    ignoreListEvents = false;
    int index = availableList.getSelectedIndex();
    add1.setEnabled((index != -1) &&
        (index <availableListModel.getSize()) && isEnabled());
    add1.setEnabled(isEnabled(availableList, availableListModel));
    add2.setEnabled(add1.isEnabled());
    index = selectedList1.getSelectedIndex();
    remove1.setEnabled((index != -1) &&
        (index <selectedListModel1.getSize()) && isEnabled());
    index = selectedList2.getSelectedIndex();
    remove2.setEnabled((index != -1) &&
        (index <selectedListModel2.getSize()) && isEnabled());
    remove1.setEnabled(isEnabled(selectedList1, selectedListModel1));
    remove2.setEnabled(isEnabled(selectedList2, selectedListModel2));
    if (addAll1 != null)
    {
      boolean onlyUnmovable =
        unmovableItems.containsAll(availableListModel.getData());
      addAll1.setEnabled((availableListModel.getSize() > 0) && isEnabled() &&
          !onlyUnmovable);
      addAll1.setEnabled(isEnabled(availableListModel));
      addAll2.setEnabled(addAll1.isEnabled());
    }
    if (removeAll1 != null)
    {
      boolean onlyUnmovable =
        unmovableItems.containsAll(selectedListModel1.getData());
      removeAll1.setEnabled((selectedListModel1.getSize() > 0) && isEnabled() &&
          !onlyUnmovable);
      removeAll1.setEnabled(isEnabled(selectedListModel1));
    }
    if (removeAll2 != null)
    {
      boolean onlyUnmovable =
        unmovableItems.containsAll(selectedListModel2.getData());
      removeAll2.setEnabled((selectedListModel2.getSize() > 0) && isEnabled() &&
          !onlyUnmovable);
      removeAll2.setEnabled(isEnabled(selectedListModel2));
    }
  }
  private boolean isEnabled(JList<T> list, SortableListModel<T> model)
  {
    int index = list.getSelectedIndex();
    return index != -1 && index < model.getSize() && isEnabled();
  }
  private boolean isEnabled(SortableListModel<T> model)
  {
    boolean onlyUnmovable = unmovableItems.containsAll(model.getData());
    return model.getSize() > 0 && isEnabled() && !onlyUnmovable;
  }
  /**
   * Returns the available list.
   * @return the available list.
@@ -631,7 +628,7 @@
   * Returns the first selected list.
   * @return the first selected list.
   */
  public JList getSelectedList1()
  public JList<T> getSelectedList1()
  {
    return selectedList1;
  }
@@ -640,73 +637,42 @@
   * Returns the second selected list.
   * @return the second selected list.
   */
  public JList getSelectedList2()
  public JList<T> getSelectedList2()
  {
    return selectedList2;
  }
  private void add1Clicked()
  private void addClicked(SortableListModel<T> selectedListModel)
  {
    @SuppressWarnings("deprecation")
    Object[] selectedObjects = availableList.getSelectedValues();
    for (int i=0; i<selectedObjects.length; i++)
    for (Object selectedObject : availableList.getSelectedValuesList())
    {
      T value = DoubleAddRemovePanel.this.theClass.cast(selectedObjects[i]);
      selectedListModel1.add(value);
      T value = DoubleAddRemovePanel.this.theClass.cast(selectedObject);
      selectedListModel.add(value);
      availableListModel.remove(value);
    }
    selectedListModel1.fireContentsChanged(selectedListModel1, 0,
        selectedListModel1.getSize());
    availableListModel.fireContentsChanged(availableListModel, 0,
        availableListModel.getSize());
  }
  private void add2Clicked()
  {
    @SuppressWarnings("deprecation")
    Object[] selectedObjects = availableList.getSelectedValues();
    for (int i=0; i<selectedObjects.length; i++)
    {
      T value = DoubleAddRemovePanel.this.theClass.cast(selectedObjects[i]);
      selectedListModel2.add(value);
      availableListModel.remove(value);
    }
    selectedListModel2.fireContentsChanged(selectedListModel2, 0,
        selectedListModel2.getSize());
    availableListModel.fireContentsChanged(availableListModel, 0,
        availableListModel.getSize());
    selectedListModel.fireContentsChanged(selectedListModel, 0, selectedListModel.getSize());
    availableListModel.fireContentsChanged(availableListModel, 0, availableListModel.getSize());
  }
  private void remove1Clicked()
  {
    @SuppressWarnings("deprecation")
    Object[] selectedObjects = selectedList1.getSelectedValues();
    for (int i=0; i<selectedObjects.length; i++)
    {
      T value = DoubleAddRemovePanel.this.theClass.cast(selectedObjects[i]);
      availableListModel.add(value);
      selectedListModel1.remove(value);
    }
    selectedListModel1.fireContentsChanged(selectedListModel1, 0,
        selectedListModel1.getSize());
    availableListModel.fireContentsChanged(availableListModel, 0,
        availableListModel.getSize());
    removeClicked(selectedListModel1, selectedList1);
  }
  private void remove2Clicked()
  {
    @SuppressWarnings("deprecation")
    Object[] selectedObjects = selectedList2.getSelectedValues();
    for (int i=0; i<selectedObjects.length; i++)
    {
      T value = DoubleAddRemovePanel.this.theClass.cast(selectedObjects[i]);
      availableListModel.add(value);
      selectedListModel2.remove(value);
    removeClicked(selectedListModel2, selectedList2);
    }
    selectedListModel2.fireContentsChanged(selectedListModel2, 0,
        selectedListModel2.getSize());
    availableListModel.fireContentsChanged(availableListModel, 0,
        availableListModel.getSize());
  private void removeClicked(SortableListModel<T> selectedListModel, JList<T> selectedList)
  {
    for (T value : selectedList.getSelectedValuesList())
    {
      availableListModel.add(value);
      selectedListModel.remove(value);
    }
    selectedListModel.fireContentsChanged(selectedListModel, 0, selectedListModel.getSize());
    availableListModel.fireContentsChanged(availableListModel, 0, availableListModel.getSize());
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/NumericLimitedSizeDocumentFilter.java
@@ -100,11 +100,10 @@
  throws BadLocationException
  {
    int totalLength = fb.getDocument().getLength();
    int caretPosition = tf.getCaretPosition();
    if ((totalLength >= maxSize) &&
        (caretPosition == fb.getDocument().getLength()))
    if (totalLength >= maxSize &&
        caretPosition == fb.getDocument().getLength())
    {
      tf.setCaretPosition(0);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/SuperiorObjectClassesEditor.java
@@ -258,20 +258,14 @@
    {
      return Collections.unmodifiableSet(selectedMultipleSuperiors);
    }
    else
    {
      ObjectClass oc = (ObjectClass)singleSuperior.getSelectedItem();
      if (oc == null)
    if (oc != null)
      {
      return Collections.singleton(oc);
    }
        return Collections.emptySet();
      }
      else
      {
        return Collections.singleton(
            (ObjectClass)(singleSuperior.getSelectedItem()));
      }
    }
  }
  /**
   * Sets the schema to be used by this panel.  This method assumes that it
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/TimeDocumentFilter.java
@@ -116,12 +116,12 @@
    String allText =
      fb.getDocument().getText(0, fb.getDocument().getLength());
    int index = allText.indexOf(':');
    if ((index != -1) && (newText.length() == 1))
    if (index != -1 && newText.length() == 1)
    {
      int minuteLength = allText.length() - index - 1;
      int hourLength = index;
      if ((minuteLength > 2) || (hourLength > 2))
      if (minuteLength > 2 || hourLength > 2)
      {
        if (offset < previousLength)
        {
@@ -148,8 +148,8 @@
      int hourLength = index;
      int caretPosition = tf.getCaretPosition();
      if ((minuteLength >= 2) &&
          (caretPosition == allText.length()))
      if (minuteLength >= 2 &&
          caretPosition == allText.length())
      {
        tf.setCaretPosition(0);
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/AttributeCellEditor.java
@@ -247,7 +247,7 @@
          value, isSelected, row, column));
      return ocPanel;
    }
    else if ((value instanceof byte[]) || (value instanceof BinaryValue))
    else if (value instanceof byte[] || value instanceof BinaryValue)
    {
      attrName = getAttributeName(table, row);
      boolean isImage = Utilities.hasImageSyntax(attrName,
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/BackupTableCellRenderer.java
@@ -149,9 +149,8 @@
      throw new IllegalArgumentException(
          "Unknown class for "+value+": "+" row: "+row+ "column: "+column);
    }
    super.getTableCellRendererComponent(table, s, isSelected, hasFocus, row,
        column);
    if (isFull && (row != 0))
    super.getTableCellRendererComponent(table, s, isSelected, hasFocus, row, column);
    if (isFull && row != 0)
    {
      setBorder(fullBorder);
    }
@@ -159,14 +158,7 @@
    {
      setBorder(incrementalBorder);
    }
    if (isDate)
    {
      setHorizontalAlignment(SwingConstants.RIGHT);
    }
    else
    {
      setHorizontalAlignment(SwingConstants.LEFT);
    }
    setHorizontalAlignment(isDate ? SwingConstants.RIGHT : SwingConstants.LEFT);
    return this;
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/LDAPEntryTableCellRenderer.java
@@ -109,7 +109,7 @@
      updateComponent(ocPanel, table, row, column, isSelected);
      return ocPanel;
    }
    else if ((value instanceof byte[]) || (value instanceof BinaryValue))
    else if (value instanceof byte[] || value instanceof BinaryValue)
    {
      if (value instanceof byte[])
      {
@@ -195,7 +195,7 @@
    }
    else
    {
      if ((column == 1) && !table.isCellEditable(row, column))
      if (column == 1 && !table.isCellEditable(row, column))
      {
        lockLabel.setIcon(lockIcon);
      }
@@ -209,27 +209,25 @@
  private boolean isPassword(JTable table, int row, int col)
  {
    boolean isPassword = false;
    if (col == 1)
    {
      Object o = table.getValueAt(row, 0);
      if (Utilities.hasPasswordSyntax((String)o, getSchema()))
      {
        isPassword = true;
        return true;
      }
    }
    return isPassword;
    return false;
  }
  private boolean isImage(JTable table, int row, int col)
  {
    boolean isImage = false;
    if (col == 1)
    {
      Object o = table.getValueAt(row, 0);
      isImage = Utilities.hasImageSyntax((String)o, schema);
      return Utilities.hasImageSyntax((String)o, schema);
    }
    return isImage;
    return false;
  }
  /**
@@ -263,13 +261,12 @@
  private boolean isRequired(JTable table, int row, int col)
  {
    boolean isRequired = false;
    if (col == 0)
    {
      Object o = table.getValueAt(row, 0);
      isRequired = requiredAttrs.contains(
      return requiredAttrs.contains(
          Utilities.getAttributeNameWithoutOptions((String)o).toLowerCase());
    }
    return isRequired;
    return false;
  }
}
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/SelectableTableCellRenderer.java
@@ -150,12 +150,12 @@
      comp.setBackground(ColorAndFontConstants.treeBackground);
      comp.setForeground(ColorAndFontConstants.treeForeground);
    }
    else if (isBeingPressed && hasMouseOver && (row == lastRowMouseOver))
    else if (isBeingPressed && hasMouseOver && row == lastRowMouseOver)
    {
      comp.setBackground(pressedBackground);
      comp.setForeground(pressedForeground);
    }
    else if ((hasMouseOver && (row == lastRowMouseOver)) || isSelected)
    else if ((hasMouseOver && row == lastRowMouseOver) || isSelected)
    {
      comp.setBackground(mouseOverBackground);
      comp.setForeground(mouseOverForeground);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/TreeCellRenderer.java
@@ -67,10 +67,7 @@
  private Border rootBorder = BorderFactory.createEmptyBorder(0, 5, 0, 0);
  private Border normalBorder = BorderFactory.createEmptyBorder(0, 0, 0, 0);
  /**
   * Constructor of the renderer.
   *
   */
  /** Constructor of the renderer. */
  public TreeCellRenderer()
  {
    backgroundNonSelectionColor = nonselectionBackground;
@@ -89,7 +86,7 @@
        isLeaf, row, hasFocus);
    setIcon(null);
    if ((row == 0) && (tree.isRootVisible()))
    if (row == 0 && tree.isRootVisible())
    {
      setBorder(rootBorder);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/ConfigFromDirContext.java
@@ -745,7 +745,7 @@
    String replicaId = ConnectionUtils.getFirstValue(sr, "server-id");
    String missingChanges = ConnectionUtils.getFirstValue(sr, "missing-changes");
    if ((dn != null)  && (replicaId != null) && (missingChanges != null))
    if (dn != null  && replicaId != null && missingChanges != null)
    {
      for (BackendDescriptor backend : backends)
      {
@@ -785,7 +785,7 @@
      String backendID = ConnectionUtils.getFirstValue(sr, "ds-backend-id");
      String entryCount = ConnectionUtils.getFirstValue(sr, "ds-backend-entry-count");
      Set<String> baseDnEntries = ConnectionUtils.getValues(sr, "ds-base-dn-entry-count");
      if ((backendID != null) && ((entryCount != null) || (baseDnEntries != null)))
      if (backendID != null && (entryCount != null || baseDnEntries != null))
      {
        for (BackendDescriptor backend : backends)
        {
@@ -831,7 +831,7 @@
      {
        // Check if it is the DB monitor entry
        String cn = ConnectionUtils.getFirstValue(sr, "cn");
        if ((cn != null) && cn.endsWith(DATABASE_ENVIRONMENT_SUFFIX))
        if (cn != null && cn.endsWith(DATABASE_ENVIRONMENT_SUFFIX))
        {
          String monitorBackendID = cn.substring(0, cn.length() - DATABASE_ENVIRONMENT_SUFFIX.length());
          for (BackendDescriptor backend : backends)
@@ -845,27 +845,27 @@
      }
      try
      {
        if ((rootMonitor == null) && isRootMonitor(csr))
        if (rootMonitor == null && isRootMonitor(csr))
        {
          rootMonitor = csr;
        }
        else if ((entryCaches == null) && isEntryCaches(csr))
        else if (entryCaches == null && isEntryCaches(csr))
        {
          entryCaches = csr;
        }
        else if ((workQueue == null) && isWorkQueue(csr))
        else if (workQueue == null && isWorkQueue(csr))
        {
          workQueue = csr;
        }
        else if ((jvmMemoryUsage == null) && isJvmMemoryUsage(csr))
        else if (jvmMemoryUsage == null && isJvmMemoryUsage(csr))
        {
          jvmMemoryUsage = csr;
        }
        else if ((systemInformation == null) && isSystemInformation(csr))
        else if (systemInformation == null && isSystemInformation(csr))
        {
          systemInformation = csr;
        }
        else if ((versionMonitor == null) && isVersionMonitor(csr))
        else if (versionMonitor == null && isVersionMonitor(csr))
        {
          versionMonitor = csr;
        }
@@ -1132,41 +1132,38 @@
  private boolean isConnectionHandler(CustomSearchResult csr) throws OpenDsException
  {
    boolean isConnectionHandler = false;
    DN dn = DN.valueOf(csr.getDN());
    DN parent = dn.parent();
    if ((parent != null) && parent.equals(monitorDN))
    if (parent != null && parent.equals(monitorDN))
    {
      List<?> vs = csr.getAttributeValues("cn");
      if ((vs != null) && !vs.isEmpty())
      if (vs != null && !vs.isEmpty())
      {
        String cn = (String) vs.iterator().next();
        String statistics = " Statistics";
        if (cn.endsWith(statistics))
        {
          isConnectionHandler = true;
          return true;
        }
      }
    }
    return isConnectionHandler;
    return false;
  }
  private static boolean isTaskEntry(CustomSearchResult csr) throws OpenDsException
  {
    boolean isTaskEntry = false;
    List<Object> vs = csr.getAttributeValues("objectclass");
    if ((vs != null) && !vs.isEmpty())
    if (vs != null && !vs.isEmpty())
    {
      for (Object oc : vs)
      {
        if (oc.toString().equalsIgnoreCase("ds-task"))
        {
          isTaskEntry = true;
          break;
          return true;
        }
      }
    }
    return isTaskEntry;
    return false;
  }
  /**
@@ -1196,26 +1193,26 @@
        // this connection handler is the right one.
        // See org.opends.server.protocols.ldap.LDAPConnectionHandler to see
        // how the DN of the monitoring entry is generated.
        if (key.contains(getKey("port " + ch.getPort())))
        {
          boolean hasAllAddresses = true;
          for (InetAddress a : ch.getAddresses())
          {
            if (!key.contains(getKey(a.getHostAddress())))
            {
              hasAllAddresses = false;
              break;
            }
          }
          if (hasAllAddresses)
        if (key.contains(getKey("port " + ch.getPort()))
            && hasAllAddresses(ch, key))
          {
            monitorEntries.add(hmConnectionHandlersMonitor.get(key));
          }
        }
      }
    }
    return monitorEntries;
  }
  private boolean hasAllAddresses(ConnectionHandlerDescriptor ch, String key)
  {
    for (InetAddress a : ch.getAddresses())
    {
      if (!key.contains(getKey(a.getHostAddress())))
      {
        return false;
      }
    }
    return true;
  }
}
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/NumSubordinateHacker.java
@@ -82,11 +82,10 @@
    * entry and <CODE>false</CODE> otherwise.
    */
  public boolean contains(LDAPURL url) {
    boolean contains = false;
    if (!isUnreliableEntryListEmpty) {
      boolean isInServer =
        serverHost.equalsIgnoreCase(String.valueOf(url.getHost())) &&
      (serverPort == url.getPort());
      serverPort == url.getPort();
      if (isInServer) {
        for (DN dn : unreliableEntryList)
        {
@@ -94,8 +93,7 @@
          {
            if (dn.equals(DN.valueOf(url.getRawBaseDN())))
            {
              contains = true;
              break;
              return true;
            }
          }
          catch (OpenDsException oe)
@@ -106,7 +104,7 @@
        }
      }
    }
    return contains;
    return false;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
@@ -1229,7 +1229,7 @@
    if (multipleScreen)
    {
      comp.setLocation((screenSize.width / 4) - (width / 2),
      comp.setLocation(screenSize.width / 4 - width / 2,
          (screenSize.height - height) / 2);
    } else
    {
@@ -2770,7 +2770,7 @@
        {
          if (v2 instanceof Number)
          {
            if ((v1 instanceof Double) || (v2 instanceof Double))
            if (v1 instanceof Double || v2 instanceof Double)
            {
              double n1 = ((Number) v1).doubleValue();
              double n2 = ((Number) v2).doubleValue();
opendj-server-legacy/src/main/java/org/opends/quicksetup/Configuration.java
@@ -350,16 +350,16 @@
    while (index1 != -1) {
      int index2 = lowerCaseContents.indexOf(Constants.LINE_SEPARATOR, index1);
      String value;
      if (index2 > (index1 + attrName.length())) {
      if (index2 > index1 + attrName.length()) {
        value = contents.substring(attrName.length() + index1, index2).trim();
      } else if (lowerCaseContents.length() > (index1 + attrName.length())) {
      } else if (lowerCaseContents.length() > index1 + attrName.length()) {
        // Assume end of file
        value = contents.substring(attrName.length() + index1).trim();
      } else {
        value = null;
      }
      if ((value != null) && (value.length() > 0)) {
      if (value != null && value.length() > 0) {
        set.add(value);
      }
@@ -368,5 +368,4 @@
    }
    return set;
  }
}
opendj-server-legacy/src/main/java/org/opends/quicksetup/CurrentInstallStatus.java
@@ -24,7 +24,6 @@
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2012-2015 ForgeRock AS.
 */
package org.opends.quicksetup;
import org.forgerock.i18n.LocalizableMessage;
@@ -49,21 +48,15 @@
 *
 * This class assumes that we are running in the case of an offline install.
 */
public class CurrentInstallStatus
{
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  private boolean isInstalled;
  private boolean canOverwriteCurrentInstall;
  private LocalizableMessage installationMsg;
  /**
   * The constructor of a CurrentInstallStatus object.
   *
   */
  /** The constructor of a CurrentInstallStatus object. */
  public CurrentInstallStatus()
  {
    if (Utils.isWebStart())
@@ -170,14 +163,12 @@
  private int getPort()
  {
    int port = -1;
    try {
      port = Installation.getLocal().getCurrentConfiguration().
              getPort();
      return Installation.getLocal().getCurrentConfiguration().getPort();
    } catch (IOException ioe) {
      logger.info(LocalizableMessage.raw("Failed to get port", ioe));
      return -1;
    }
    return port;
  }
@@ -192,7 +183,7 @@
  {
    File dbDir = Installation.getLocal().getDatabasesDirectory();
    File[] children = dbDir.listFiles();
    return ((children != null) && (children.length > 0));
    return children != null && children.length > 0;
  }
@@ -207,7 +198,6 @@
  {
    File configDir = Installation.getLocal().getConfigurationDirectory();
    File[] children = configDir.listFiles();
    return ((children != null) && (children.length > 0));
    return children != null && children.length > 0;
  }
}
opendj-server-legacy/src/main/java/org/opends/quicksetup/Launcher.java
@@ -24,7 +24,6 @@
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.quicksetup;
import org.forgerock.i18n.LocalizableMessage;
@@ -86,17 +85,16 @@
   * @return boolean where true indicates usage should be printed
   */
  protected boolean shouldPrintUsage() {
    boolean printUsage = false;
    if ((args != null) && (args.length > 0)) {
    if (args != null && args.length > 0) {
      for (String arg : args) {
        if (arg.equals("-?") ||
          arg.equalsIgnoreCase("-H") ||
          arg.equalsIgnoreCase("--help")) {
          printUsage = true;
          return true;
        }
      }
    }
    return printUsage;
    return false;
  }
  /**
@@ -106,17 +104,16 @@
   * @return boolean where true indicates usage should be printed
   */
  protected boolean isQuiet() {
    boolean printUsage = false;
    if ((args != null) && (args.length > 0)) {
    if (args != null && args.length > 0) {
      for (String arg : args) {
        if (arg.equals("-?") ||
          arg.equalsIgnoreCase("-Q") ||
          arg.equalsIgnoreCase("--quiet")) {
          printUsage = true;
          return true;
        }
      }
    }
    return printUsage;
    return false;
  }
  /**
@@ -126,18 +123,17 @@
   * @return boolean where true indicates version should be printed
   */
  protected boolean shouldPrintVersion() {
    boolean printVersion = false;
    if ((args != null) && (args.length > 0))
    if (args != null && args.length > 0)
    {
      for (String arg : args)
      {
        if (arg.equalsIgnoreCase("--version"))
        {
          printVersion = true;
          return true;
        }
      }
    }
    return printVersion;
    return false;
  }
  /**
@@ -149,15 +145,13 @@
   *         should be launched
   */
  protected boolean isCli() {
    boolean isCli = false;
    for (String arg : args) {
      if (arg.equalsIgnoreCase("--"+OPTION_LONG_CLI) ||
          arg.equalsIgnoreCase("-"+OPTION_SHORT_CLI)) {
        isCli = true;
        break;
        return true;
      }
    }
    return isCli;
    return false;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/quicksetup/UserData.java
@@ -643,7 +643,7 @@
  {
    int defaultJMXPort = -1;
    for (int i=0;i<65000 && (defaultJMXPort == -1);i+=1000)
    for (int i=0;i<65000 && defaultJMXPort == -1;i+=1000)
    {
      int port = i + CliConstants.DEFAULT_JMX_PORT;
      boolean isForbidden = false;
opendj-server-legacy/src/main/java/org/opends/quicksetup/event/BrowseActionListener.java
@@ -165,7 +165,7 @@
    if (path != null && path.trim().length() > 0)
    {
      File f = new File(path);
      while ((f != null) && !f.isDirectory())
      while (f != null && !f.isDirectory())
      {
        f = f.getParentFile();
      }
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/DataReplicationOptions.java
@@ -22,10 +22,8 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2013 ForgeRock AS.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.quicksetup.installer;
import org.opends.quicksetup.Constants;
@@ -34,14 +32,12 @@
/**
 * This class is used to provide a data model for the Data Replication
 * Options panel of the installer.
 *
 */
public class DataReplicationOptions
{
  /**
   * This enumeration is used to know what the user wants to do for the data
   * (import data or not, what use as source of the data...).
   *
   */
  public enum Type
  {
@@ -179,7 +175,7 @@
  {
    int defaultPort = -1;
    for (int i=0;i<10000 && (defaultPort == -1);i+=1000)
    for (int i=0;i<10000 && defaultPort == -1;i+=1000)
    {
      int port = i + Constants.DEFAULT_REPLICATION_PORT;
      if (Utils.canUseAsPort(port))
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataReplicationPanel.java
@@ -283,17 +283,15 @@
  /** {@inheritDoc} */
  protected LocalizableMessage getTextForIcon(UIFactory.IconType iconType)
  {
    LocalizableMessage text;
    if ((iconType == UIFactory.IconType.WAIT) &&
    if (iconType == UIFactory.IconType.WAIT &&
        rbReplicated.isSelected() && cbTopologyExists.isSelected())
    {
      text = INFO_CONTACTING_SERVER_LABEL.get();
      return INFO_CONTACTING_SERVER_LABEL.get();
    }
    else
    {
      text = super.getTextForIcon(iconType);
      return super.getTextForIcon(iconType);
    }
    return text;
  }
  /**
@@ -304,41 +302,25 @@
   */
  private Object getDefaultValue(FieldName fieldName)
  {
    Object value;
    AuthenticationData auth =
      defaultUserData.getReplicationOptions().getAuthenticationData();
    switch (fieldName)
    {
    case REPLICATION_PORT:
      value = defaultUserData.getReplicationOptions().getReplicationPort();
      break;
      return defaultUserData.getReplicationOptions().getReplicationPort();
    case REMOTE_SERVER_DN:
      value = auth.getDn();
      break;
      return auth.getDn();
    case REMOTE_SERVER_PWD:
      value = auth.getPwd();
      break;
      return auth.getPwd();
    case REMOTE_SERVER_HOST:
      value = auth.getHostName();
      break;
      return auth.getHostName();
    case REMOTE_SERVER_PORT:
      value = auth.getPort();
      break;
      return auth.getPort();
    case REPLICATION_OPTIONS:
      value = defaultUserData.getReplicationOptions().getType();
      break;
      return defaultUserData.getReplicationOptions().getType();
    default:
      throw new IllegalArgumentException("Unknown field name: " +
          fieldName);
      throw new IllegalArgumentException("Unknown field name: " + fieldName);
    }
    return value;
  }
  /**
@@ -349,20 +331,12 @@
   */
  private String getDefaultStringValue(FieldName fieldName)
  {
    String value = null;
    Object v = getDefaultValue(fieldName);
    if (v != null)
    {
      if (v instanceof String)
      {
        value = (String) v;
      } else
      {
        value = String.valueOf(v);
      return String.valueOf(v);
      }
    }
    return value;
    return null;
  }
  /**
@@ -408,16 +382,14 @@
    for (FieldName fieldName : hm.keySet())
    {
      JTextComponent field;
      LabelFieldDescriptor desc = hm.get(fieldName);
      String defaultValue = getDefaultStringValue(fieldName);
      field = UIFactory.makeJTextComponent(desc, defaultValue);
      JTextComponent field = UIFactory.makeJTextComponent(desc, defaultValue);
      hmFields.put(fieldName, field);
      JLabel l = UIFactory.makeJLabel(desc);
      l.setLabelFor(field);
      hmLabels.put(fieldName, l);
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/InstallReviewPanel.java
@@ -124,7 +124,7 @@
    }
    setFieldValue(FieldName.HOST_NAME, userData.getHostName());
    setFieldValue(FieldName.SERVER_PORT, Integer.toString(userData.getServerPort()));
    setFieldValue(FieldName.ADMIN_CONNECTOR_PORT, Integer.toString((userData.getAdminConnectorPort())));
    setFieldValue(FieldName.ADMIN_CONNECTOR_PORT, Integer.toString(userData.getAdminConnectorPort()));
    setFieldValue(FieldName.SECURITY_OPTIONS, Utils.getSecurityOptionsString(userData.getSecurityOptions(), false));
    setFieldValue(FieldName.DIRECTORY_MANAGER_DN, userData.getDirectoryManagerDn());
    setFieldValue(FieldName.DATA_OPTIONS, Utils.getDataDisplayString(userData));
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/JavaArgumentsDialog.java
@@ -755,7 +755,7 @@
    if (!Utils.isWebStart())
    {
      String javaHome = System.getProperty("java.home");
      if ((javaHome == null) || (javaHome.length() == 0))
      if (javaHome == null || javaHome.length() == 0)
      {
        javaHome = System.getenv(SetupUtils.OPENDJ_JAVA_HOME);
      }
@@ -912,21 +912,20 @@
  private boolean displayWebStartWarningIfRequired()
  {
    boolean returnValue = true;
    if (Utils.isWebStart() && !userAgreedWithWebStart)
    {
      JavaArguments args = getJavaArguments();
      if (!args.equals(javaArguments) &&
          ((args.getInitialMemory() != -1) ||
              (args.getMaxMemory() != -1) ||
              (args.getAdditionalArguments().length > 0)))
          (args.getInitialMemory() != -1 ||
              args.getMaxMemory() != -1 ||
              args.getAdditionalArguments().length > 0))
      {
        returnValue = displayConfirmationDialog(
        userAgreedWithWebStart = displayConfirmationDialog(
            INFO_JAVA_ARGUMENTS_CANNOT_BE_CHECKED_IN_WEBSTART.get(),
            INFO_CONFIRMATION_TITLE.get());
        userAgreedWithWebStart = returnValue;
        return userAgreedWithWebStart;
      }
    }
    return returnValue;
    return true;
  }
}
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/RemoteReplicationPortsPanel.java
@@ -127,20 +127,7 @@
        for (String id : hmLabels.keySet())
        {
          String sPort = hmFields.get(id).getText();
          boolean isValid = false;
          try
          {
            int replicationPort = Integer.parseInt(sPort);
            if ((replicationPort >= 1) &&
                (replicationPort <= 65535))
            {
              isValid = true;
            }
          }
          catch (Throwable t)
          {
          }
          if (!isValid)
          if (!isValid(sPort))
          {
            UIFactory.setTextStyle(hmLabels.get(id),
              UIFactory.TextStyle.SECONDARY_FIELD_INVALID);
@@ -150,6 +137,22 @@
    }
  }
  private boolean isValid(String sPort)
  {
    try
    {
      int port = Integer.parseInt(sPort);
      if (port >= 1 && port <= 65535)
      {
        return true;
      }
    }
    catch (Throwable t)
    {
    }
    return false;
  }
  /** {@inheritDoc} */
  protected boolean requiresScroll()
  {
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/SelectAliasDialog.java
@@ -99,7 +99,7 @@
   */
  public void display(String[] aliases)
  {
    if ((aliases == null) || (aliases.length ==0))
    if (aliases == null || aliases.length ==0)
    {
      throw new IllegalArgumentException(
          "The provided aliases are null or empty.");
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/ServerSettingsPanel.java
@@ -113,11 +113,11 @@
    {
      String parent = tfServerLocationParent.getText();
      String relative = tfServerLocationRelativePath.getText();
      if ((parent != null) && (parent.length() > 0))
      if (parent != null && parent.length() > 0)
      {
        value = parent;
      }
      if ((relative != null) && (relative.length() > 0))
      if (relative != null && relative.length() > 0)
      {
        if (value == null)
        {
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/CertificateDialog.java
@@ -27,6 +27,8 @@
package org.opends.quicksetup.ui;
import static org.opends.messages.QuickSetupMessages.*;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
@@ -45,9 +47,6 @@
import java.util.HashMap;
import java.util.Map;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import javax.naming.ldap.LdapName;
import javax.naming.ldap.Rdn;
import javax.swing.Box;
@@ -64,12 +63,12 @@
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.opends.quicksetup.UserDataCertificateException;
import org.opends.quicksetup.event.MinimumSizeComponentListener;
import org.forgerock.i18n.LocalizableMessageBuilder;
import static org.opends.messages.QuickSetupMessages.*;
/**
 * This class is used to present the user a certificate to the user in order
 * it to be accepted.
@@ -82,17 +81,11 @@
   */
  public enum ReturnType
  {
    /**
     * The user did not accept the certificate.
     */
    /** The user did not accept the certificate. */
    NOT_ACCEPTED,
    /**
     * The user accepted the certificate only for this session.
     */
    /** The user accepted the certificate only for this session. */
    ACCEPTED_FOR_SESSION,
    /**
     * The user accepted the certificate permanently.
     */
    /** The user accepted the certificate permanently. */
    ACCEPTED_PERMANENTLY
  }
  private static final long serialVersionUID = -8989965057591475064L;
@@ -165,6 +158,7 @@
   *
   * @param e the HyperlinkEvent.
   */
  @Override
  public void hyperlinkUpdate(HyperlinkEvent e)
  {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
@@ -309,7 +303,7 @@
    explanationPane.setEditable(false);
    explanationPane.addHyperlinkListener(this);
    p.add(explanationPane, gbc);
    if ((ce.getChain() != null) && (ce.getChain().length > 0))
    if (ce.getChain() != null && ce.getChain().length > 0)
    {
      LocalizableMessageBuilder mb = new LocalizableMessageBuilder();
      mb.append(text);
@@ -360,6 +354,7 @@
        INFO_CERTIFICATE_DIALOG_ACCEPT_FOR_SESSION_BUTTON_TOOLTIP.get());
    buttonsPanel.add(acceptSessionButton, gbc);
    acceptSessionButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent ev) {
        acceptForSession();
      }
@@ -372,6 +367,7 @@
        INFO_CERTIFICATE_DIALOG_ACCEPT_PERMANENTLY_BUTTON_TOOLTIP.get());
    buttonsPanel.add(acceptPermanentlyButton, gbc);
    acceptPermanentlyButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent ev) {
        acceptPermanently();
      }
@@ -385,6 +381,7 @@
    buttonsPanel.add(doNotAcceptButton, gbc);
    doNotAcceptButton.addActionListener(new ActionListener()
    {
      @Override
      public void actionPerformed(ActionEvent ev)
      {
        doNotAccept();
@@ -402,7 +399,7 @@
  {
    JPanel p = UIFactory.makeJPanel();
    p.setLayout(new GridBagLayout());
    if ((ce.getChain() != null) && (ce.getChain().length > 0))
    if (ce.getChain() != null && ce.getChain().length > 0)
    {
      final JComboBox combo = new JComboBox();
      combo.setToolTipText(
@@ -510,6 +507,7 @@
      combo.addActionListener(new ActionListener()
      {
        @Override
        public void actionPerformed(ActionEvent ev)
        {
          String selectedItem = (String)combo.getSelectedItem();
@@ -610,29 +608,7 @@
   */
  public static LocalizableMessage getSHA1FingerPrint(X509Certificate cert)
  {
    LocalizableMessage msg = null;
    try {
      MessageDigest md = MessageDigest.getInstance("SHA1");
      byte[] b = md.digest(cert.getEncoded());
      StringBuilder sb = new StringBuilder();
      for (int i = 0; i < b.length; i++)
      {
        if (i > 0)
        {
          sb.append(":");
        }
        sb.append(Integer.toHexString(((int) b[i]) & 0xFF));
      }
      msg = LocalizableMessage.raw(sb);
    }
    catch (NoSuchAlgorithmException nsae) {
      logger.warn(LocalizableMessage.raw("SHA1 algorithm not supported: "+nsae, nsae));
    }
    catch (CertificateEncodingException cee) {
      logger.warn(LocalizableMessage.raw("Certificate encoding exception: "+cee, cee));
    }
    return msg;
    return getFingerPrint(cert, "SHA1");
  }
  /**
@@ -642,10 +618,13 @@
   */
  public static LocalizableMessage getMD5FingerPrint(X509Certificate cert)
  {
    LocalizableMessage msg = null;
    try {
      MessageDigest md = MessageDigest.getInstance("MD5");
    return getFingerPrint(cert, "MD5");
  }
  private static LocalizableMessage getFingerPrint(X509Certificate cert, String algorithm)
  {
    try {
      MessageDigest md = MessageDigest.getInstance(algorithm);
      byte[] b = md.digest(cert.getEncoded());
      StringBuilder sb = new StringBuilder();
      for (int i = 0; i < b.length; i++)
@@ -654,17 +633,18 @@
        {
          sb.append(":");
        }
        sb.append(Integer.toHexString(((int) b[i]) & 0xFF));
        sb.append(Integer.toHexString(b[i] & 0xFF));
      }
      msg = LocalizableMessage.raw(sb);
      return LocalizableMessage.raw(sb);
    }
    catch (NoSuchAlgorithmException nsae) {
      logger.warn(LocalizableMessage.raw("MD5 algorithm not supported: "+nsae, nsae));
      logger.warn(LocalizableMessage.raw(algorithm + " algorithm not supported: " + nsae, nsae));
      return null;
    }
    catch (CertificateEncodingException cee) {
      logger.warn(LocalizableMessage.raw("Certificate encoding exception: "+cee, cee));
      return null;
    }
    return msg;
  }
  private JComponent createSHA1FingerprintComponent(X509Certificate cert)
@@ -696,61 +676,34 @@
    {
      LdapName dn = new LdapName(name);
      Rdn rdn = dn.getRdn(0);
      name = rdn.getValue().toString();
      return rdn.getValue().toString();
    }
    catch (Throwable t)
    {
      logger.warn(LocalizableMessage.raw("Error parsing subject dn: "+
          cert.getSubjectX500Principal(), t));
    }
    return name;
  }
  }
  /**
   * Method called when user clicks on ok.
   *
   */
  /** Method called when user clicks on ok. */
  private void acceptForSession()
  {
    returnValue = ReturnType.ACCEPTED_FOR_SESSION;
    dispose();
  }
  /**
   * Method called when user clicks on cancel.
   *
   */
  /** Method called when user clicks on cancel. */
  private void doNotAccept()
  {
    returnValue = ReturnType.NOT_ACCEPTED;
    dispose();
  }
  /**
   * Method called when user clicks on ok.
   *
   */
  /** Method called when user clicks on ok. */
  private void acceptPermanently()
  {
    returnValue = ReturnType.ACCEPTED_PERMANENTLY;
    dispose();
  }
  /**
   * Method written for testing purposes.
   * @param args the arguments to be passed to the test program.
   */
  /*
  public static void main(String[] args)
  {
    try
    {
      // TODO
    } catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }
  */
}
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/CurrentStepPanel.java
@@ -177,7 +177,7 @@
   */
  public void setDisplayedStep(final WizardStep step, final UserData userData)
  {
    final CardLayout cl = (CardLayout) (getLayout());
    final CardLayout cl = (CardLayout) getLayout();
    if (getPanel(step).blockingBeginDisplay())
    {
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/GuiApplication.java
@@ -429,7 +429,7 @@
    String authType = ce.getAuthType();
    String host = ce.getHost();
    if ((chain != null) && (authType != null) && (host != null))
    if (chain != null && authType != null && host != null)
    {
      logger.info(LocalizableMessage.raw("Accepting certificate presented by host "+host));
      getTrustManager().acceptCertificate(chain, authType, host);
@@ -492,13 +492,13 @@
    int lastPercentage = -1;
    WebStartDownloader.Status lastStatus =
      WebStartDownloader.Status.DOWNLOADING;
    while (!loader.isFinished() && (loader.getException() == null))
    while (!loader.isFinished() && loader.getException() == null)
    {
      checkAbort();
      // Pool until is over
      int perc = loader.getDownloadPercentage();
      WebStartDownloader.Status downloadStatus = loader.getStatus();
      if ((perc != lastPercentage) || (downloadStatus != lastStatus))
      if (perc != lastPercentage || downloadStatus != lastStatus)
      {
        lastPercentage = perc;
        int ratio = (perc * maxRatio) / 100;
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/Utilities.java
@@ -112,7 +112,7 @@
    if (multipleScreen)
    {
      comp.setLocation((screenSize.width / 4) - (width / 2),
      comp.setLocation(screenSize.width / 4 - width / 2,
          (screenSize.height - height) / 2);
    } else
    {
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/FileManager.java
@@ -479,7 +479,7 @@
        if (!destination.exists()) {
          if (Utils.insureParentsExist(destination)) {
            if ((application != null) && application.isVerbose()) {
            if (application != null && application.isVerbose()) {
              application.notifyListeners(application.getFormattedWithPoints(
                      INFO_PROGRESS_COPYING_FILE.get(
                              objectFile.getAbsolutePath(),
@@ -505,7 +505,7 @@
                Utils.setPermissionsUnix(Utils.getPath(destination), permissions);
              }
              if ((application != null) && application.isVerbose()) {
              if (application != null && application.isVerbose()) {
                application.notifyListeners(
                        application.getFormattedDoneWithLineBreak());
              }
@@ -532,7 +532,7 @@
          logger.info(LocalizableMessage.raw("Ignoring file '" +
                  objectFile.getAbsolutePath() + "' since '" +
                  destination.getAbsolutePath() + "' already exists"));
          if ((application != null) && application.isVerbose()) {
          if (application != null && application.isVerbose()) {
            application.notifyListeners(
                    INFO_INFO_IGNORING_FILE.get(
                                    objectFile.getAbsolutePath(),
@@ -576,7 +576,7 @@
      File file = getObjectFile();
      boolean isFile = file.isFile();
      if ((application != null) && application.isVerbose()) {
      if (application != null && application.isVerbose()) {
        if (isFile) {
          application.notifyListeners(application.getFormattedWithPoints(
                  INFO_PROGRESS_DELETING_FILE.get(file.getAbsolutePath())));
@@ -631,7 +631,7 @@
                errMsg, null);
      }
      if ((application != null) && application.isVerbose()) {
      if (application != null && application.isVerbose()) {
        application.notifyListeners(
                application.getFormattedDoneWithLineBreak());
      }
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/ZipExtractor.java
@@ -193,8 +193,7 @@
        int ratioBeforeCompleted = minRatio
                + ((nEntries - 1) * (maxRatio - minRatio) / numberZipEntries);
        int ratioWhenCompleted =
                minRatio + (nEntries * (maxRatio - minRatio) /
                        numberZipEntries);
                minRatio + (nEntries * (maxRatio - minRatio) / numberZipEntries);
        String name = entry.getName();
        if (name != null && removeFirstPath) {
opendj-server-legacy/src/main/java/org/opends/server/admin/AbstractManagedObjectDefinition.java
@@ -370,7 +370,7 @@
   */
  public final AbstractManagedObjectDefinition<? extends C, ? extends S>
      getChild(String name) throws IllegalArgumentException {
    if ((name == null) || (name.length() == 0)) {
    if (name == null || name.length() == 0) {
      throw new IllegalArgumentException("null or empty managed object name");
    }
@@ -510,7 +510,7 @@
   */
  public final PropertyDefinition<?> getPropertyDefinition(String name)
      throws IllegalArgumentException {
    if ((name == null) || (name.length() == 0)) {
    if (name == null || name.length() == 0) {
      throw new IllegalArgumentException("null or empty property name");
    }
@@ -556,7 +556,7 @@
   */
  public final RelationDefinition<?, ?> getRelationDefinition(String name)
      throws IllegalArgumentException {
    if ((name == null) || (name.length() == 0)) {
    if (name == null || name.length() == 0) {
      throw new IllegalArgumentException("null or empty relation name");
    }
@@ -619,7 +619,7 @@
  public final AggregationPropertyDefinition<?, ?>
    getAggregationPropertyDefinition(String name)
    throws IllegalArgumentException {
    if ((name == null) || (name.length() == 0)) {
    if (name == null || name.length() == 0) {
      throw new IllegalArgumentException(
        "null or empty aggregation property name");
    }
@@ -873,7 +873,7 @@
   *         definition is the {@link TopCfgDefn}.
   */
  public final boolean isTop() {
    return (this instanceof TopCfgDefn);
    return this instanceof TopCfgDefn;
  }
opendj-server-legacy/src/main/java/org/opends/server/admin/DurationPropertyDefinition.java
@@ -464,7 +464,7 @@
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    if ((upperLimit != null) && (nvalue > upperLimit)) {
    if (upperLimit != null && nvalue > upperLimit) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
  }
@@ -508,7 +508,7 @@
    // Check the unit is in range - values must not be more granular
    // than the base unit.
    if ((ms % baseUnit.getDuration()) != 0) {
    if (ms % baseUnit.getDuration() != 0) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
opendj-server-legacy/src/main/java/org/opends/server/admin/IntegerPropertyDefinition.java
@@ -287,7 +287,7 @@
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    if ((upperLimit != null) && (value > upperLimit)) {
    if (upperLimit != null && value > upperLimit) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/admin/SizePropertyDefinition.java
@@ -286,7 +286,7 @@
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    if ((upperLimit != null) && (value > upperLimit)) {
    if (upperLimit != null && value > upperLimit) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java
@@ -39,6 +39,7 @@
import org.opends.server.admin.AbsoluteInheritedDefaultBehaviorProvider;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.AdministratorAction.Type;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.std.meta.RootCfgDefn;
import org.opends.server.admin.*;
import org.opends.server.types.InitializationException;
@@ -101,7 +102,7 @@
    }
    // Create new dir if necessary
    try {
      (new File(generationDir)).mkdir();
      new File(generationDir).mkdir();
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
@@ -248,11 +249,10 @@
    for (String catName : list.keySet()) {
      heading3(getFriendlyName(catName));
      // Get the list of the category
      TreeMap<String, AbstractManagedObjectDefinition> catList =
        list.get(catName);
      TreeMap<String, AbstractManagedObjectDefinition> catList = list.get(catName);
      for (AbstractManagedObjectDefinition mo : catList.values()) {
        if ((relList.get(mo.getName()) != null) &&
          (relList.get(mo.getName()).hasOption(RelationOption.HIDDEN))) {
        RelationDefinition relDefn = relList.get(mo.getName());
        if (relDefn != null && relDefn.hasOption(RelationOption.HIDDEN)) {
          continue;
        }
        paragraph(
@@ -383,8 +383,8 @@
    TreeMap<String, AbstractManagedObjectDefinition> list) {
    for (AbstractManagedObjectDefinition mo : list.values()) {
      if ((relList.get(mo.getName()) != null) &&
        (relList.get(mo.getName()).hasOption(RelationOption.HIDDEN))) {
      RelationDefinition relDefn = relList.get(mo.getName());
      if (relDefn != null && relDefn.hasOption(RelationOption.HIDDEN)) {
        continue;
      }
      moList.put(mo.getName(), mo);
@@ -698,7 +698,7 @@
    tableRow("Allowed Values", getSyntaxStr(prop));
    tableRow("Multi-valued",
      (prop.hasOption(PropertyOption.MULTI_VALUED) ? "Yes" : "No"));
      prop.hasOption(PropertyOption.MULTI_VALUED) ? "Yes" : "No");
    if (prop.hasOption(PropertyOption.MANDATORY)) {
      tableRow("Required", "Yes");
@@ -720,7 +720,7 @@
      } else if (actionType == Type.NONE) {
        actionStr = "None";
      }
      String dot = (actionStr.equals("") ? "" : ". ");
      String dot = actionStr.equals("") ? "" : ". ";
      action = actionStr +
        ((synopsis != null) ? dot + synopsis : "");
    }
@@ -758,7 +758,7 @@
      advancedProps.values().toArray(new PropertyDefinition[0]);
    for (int ii=0;
        (ii < basicPropsArray.length) || (ii < advancedPropsArray.length);
        ii < basicPropsArray.length || ii < advancedPropsArray.length;
        ii++) {
      String basicPropName =
        ii < basicPropsArray.length ? basicPropsArray[ii].getName() : null;
@@ -770,7 +770,7 @@
      if (basicPropName != null) {
        basicHtmlCell = "  <td>&darr;&nbsp;<a href=\"#" + basicPropName + "\">"
          + basicPropName + "</a></td>\n";
      } else if ((basicPropsArray.length == 0) && (ii == 0)) {
      } else if (basicPropsArray.length == 0 && ii == 0) {
        basicHtmlCell = "  <td>&nbsp;None</td>\n";
      } else if (ii >= basicPropsArray.length) {
        // Case of nb of basic props < nb of advanced props
@@ -781,7 +781,7 @@
      if (advancedPropName != null) {
        advancedHtmlCell = "  <td>&darr;&nbsp;<a href=\"#" + advancedPropName +
          "\">" + advancedPropName + "</a></td>\n";
      } else if ((advancedPropsArray.length == 0) && (ii == 0)) {
      } else if (advancedPropsArray.length == 0 && ii == 0) {
        advancedHtmlCell = "  <td>&nbsp;None</td>\n";
      }
@@ -1353,7 +1353,7 @@
  private final String Now = new Date().toString();
  private String getHtmlHeader(String pageTitle) {
    return ("<html>\n" +
    return "<html>\n" +
      "<head>\n" +
      "<meta http-equiv=\"content-type\"\n" +
      "content=\"text/html; charset=ISO-8859-1\">\n" +
@@ -1362,7 +1362,7 @@
      "href=\"" + CSS_FILE + "\">\n" +
      "<link rel=\"shortcut icon\" href=\"" + FAVICON + "\">\n" +
      "<meta name=\"date generated\" content=\"" + Now + "\">\n" +
      "</head>\n");
      "</head>\n";
  }
  /** Add a Tab Menu, the active tab is the one given as parameter. */
@@ -1484,7 +1484,7 @@
  }
  private int getIndentPixels() {
    return (ind * 40);
    return ind * 40;
  }
  private void startTable() {
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagedObject.java
@@ -1417,8 +1417,7 @@
            for(; i > 0; i--)
            {
              wrappedListener = delayListener.getDelayedAddListener();
              if(wrappedListener != null &&
                  wrappedListener instanceof DelayedConfigAddListener)
              if(wrappedListener instanceof DelayedConfigAddListener)
              {
                delayListener = (DelayedConfigAddListener) l;
              }
@@ -1438,8 +1437,7 @@
            ConfigAddListener delayedListener =
                delayListener.getDelayedAddListener();
            if (delayedListener != null &&
                 delayedListener instanceof ConfigAddListenerAdaptor) {
            if (delayedListener instanceof ConfigAddListenerAdaptor) {
              ConfigAddListenerAdaptor<?> adaptor =
                  (ConfigAddListenerAdaptor<?>) delayedListener;
              ServerManagedObjectAddListener<?> l2 = adaptor
@@ -1486,8 +1484,7 @@
            for(; i > 0; i--)
            {
              wrappedListener = delayListener.getDelayedAddListener();
              if(wrappedListener != null &&
                  wrappedListener instanceof DelayedConfigAddListener)
              if(wrappedListener instanceof DelayedConfigAddListener)
              {
                delayListener = (DelayedConfigAddListener) l;
              }
@@ -1507,8 +1504,7 @@
            ConfigDeleteListener delayedListener =
                delayListener.getDelayedDeleteListener();
            if (delayedListener != null &&
                delayedListener instanceof ConfigDeleteListenerAdaptor) {
            if (delayedListener instanceof ConfigDeleteListenerAdaptor) {
              ConfigDeleteListenerAdaptor<?> adaptor =
                  (ConfigDeleteListenerAdaptor<?>) delayedListener;
              ServerManagedObjectDeleteListener<?> l2 = adaptor
@@ -1553,8 +1549,7 @@
            for(; i > 0; i--)
            {
              wrappedListener = delayListener.getDelayedAddListener();
              if(wrappedListener != null &&
                  wrappedListener instanceof DelayedConfigAddListener)
              if(wrappedListener instanceof DelayedConfigAddListener)
              {
                delayListener = (DelayedConfigAddListener) l;
              }
@@ -1574,8 +1569,7 @@
            ConfigAddListener delayedListener =
                delayListener.getDelayedAddListener();
            if (delayedListener != null &&
                 delayedListener instanceof ConfigAddListenerAdaptor) {
            if (delayedListener instanceof ConfigAddListenerAdaptor) {
              ConfigAddListenerAdaptor<?> adaptor =
                  (ConfigAddListenerAdaptor<?>) delayedListener;
              if (adaptor.getServerManagedObjectAddListener() == listener) {
@@ -1616,8 +1610,7 @@
            for(; i > 0; i--)
            {
              wrappedListener = delayListener.getDelayedAddListener();
              if(wrappedListener != null &&
                  wrappedListener instanceof DelayedConfigAddListener)
              if(wrappedListener instanceof DelayedConfigAddListener)
              {
                delayListener = (DelayedConfigAddListener) l;
              }
@@ -1637,8 +1630,7 @@
            ConfigDeleteListener delayedListener =
                delayListener.getDelayedDeleteListener();
            if (delayedListener != null &&
                 delayedListener instanceof ConfigDeleteListenerAdaptor) {
            if (delayedListener instanceof ConfigDeleteListenerAdaptor) {
              ConfigDeleteListenerAdaptor<?> adaptor =
                  (ConfigDeleteListenerAdaptor<?>) delayedListener;
              if (adaptor.getServerManagedObjectDeleteListener() == listener) {
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java
@@ -699,7 +699,7 @@
    // Get the configuration entry.
    DN targetDN = DNBuilder.create(path);
    try {
      return (getManagedObjectConfigEntry(targetDN) != null);
      return getManagedObjectConfigEntry(targetDN) != null;
    } catch (ConfigException e) {
      // Assume it doesn't exist.
      return false;
opendj-server-legacy/src/main/java/org/opends/server/api/AttributeSyntax.java
@@ -349,16 +349,10 @@
    buffer.append(getOID());
    String description = getDescription();
    if ((description == null) || (description.length() == 0))
    if (description != null && description.length() != 0)
    {
      buffer.append(" DESC '").append(description).append("'");
    }
      buffer.append(" )");
    }
    else
    {
      buffer.append(" DESC '");
      buffer.append(description);
      buffer.append("' )");
    }
  }
}
opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicy.java
@@ -144,7 +144,7 @@
    // search for the nearest applicable sub-entry.
    List<SubEntry> pwpSubEntries = DirectoryServer.getSubentryManager()
        .getSubentries(userEntry);
    if ((pwpSubEntries != null) && (!pwpSubEntries.isEmpty()))
    if (pwpSubEntries != null && !pwpSubEntries.isEmpty())
    {
      for (SubEntry subentry : pwpSubEntries)
      {
opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java
@@ -315,13 +315,13 @@
      return false;
    }
    final boolean result = isDisabled == ConditionResult.TRUE;
    if (logger.isTraceEnabled())
    {
      logger.trace("User %s is%s administratively disabled.", userEntry.getName(),
          (isDisabled == ConditionResult.TRUE ? "" : " not"));
          result ? "" : " not");
    }
    return isDisabled == ConditionResult.TRUE;
    return result;
  }
opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
@@ -539,7 +539,7 @@
    for (final byte b : idBytes)
    {
      id <<= 8;
      id |= (b & 0xFF);
      id |= b & 0xFF;
    }
    return id - 1; // Subtract 1 to compensate for old behavior.
  }
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/Aci.java
@@ -587,7 +587,7 @@
        return;
      }
      boolean lastWasPeriod = false;
      while ((pos < length) && ((c = oidStr.charAt(pos++)) != ' ')) {
      while (pos < length && ((c = oidStr.charAt(pos++)) != ' ')) {
        if (c == '.') {
          if (lastWasPeriod) {
            LocalizableMessage message = WARN_ACI_SYNTAX_DOUBLE_PERIOD_IN_NUMERIC_OID.get(
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciBody.java
@@ -28,6 +28,7 @@
import static org.opends.messages.AccessControlMessages.*;
import static org.opends.server.authorization.dseecompat.Aci.*;
import static org.opends.server.authorization.dseecompat.EnumEvalResult.*;
import java.util.ArrayList;
import java.util.List;
@@ -289,11 +290,10 @@
     * @return An enumeration result of the evaluation.
     */
    public  EnumEvalResult evaluate(AciEvalContext evalCtx) {
        EnumEvalResult res=EnumEvalResult.FALSE;
        EnumEvalResult res = FALSE;
        List<PermBindRulePair>pairs=getPermBindRulePairs();
        for(PermBindRulePair p : pairs) {
            if(evalCtx.isDenyEval() &&
                    (p.hasAccessType(EnumAccessType.ALLOW))) {
            if (evalCtx.isDenyEval() && p.hasAccessType(EnumAccessType.ALLOW)) {
                continue;
            }
            if(!p.hasRights(getEvalRights(evalCtx))) {
@@ -302,22 +302,17 @@
            res=p.getBindRule().evaluate(evalCtx);
            // The evaluation result could be FAIL. Stop processing and return
            //FAIL. Maybe an internal search failed.
            if((res != EnumEvalResult.TRUE) &&
                    (res != EnumEvalResult.FALSE)) {
                res=EnumEvalResult.FAIL;
            if(res != TRUE && res != FALSE) {
                res = FAIL;
                break;
                //If the access type is DENY and the pair evaluated to TRUE,
                //then stop processing and return TRUE. A deny pair
                //succeeded.
            } else if((p.hasAccessType(EnumAccessType.DENY)) &&
                    (res == EnumEvalResult.TRUE)) {
                res=EnumEvalResult.TRUE;
                //then stop processing and return TRUE. A deny pair succeeded.
            } else if (p.hasAccessType(EnumAccessType.DENY) && res == TRUE) {
                res = TRUE;
                break;
                //An allow access type evaluated TRUE, stop processing
                //and return TRUE.
            } else if((p.hasAccessType(EnumAccessType.ALLOW) &&
                    (res == EnumEvalResult.TRUE))) {
                res=EnumEvalResult.TRUE;
                //An allow access type evaluated TRUE, stop processing and return TRUE.
            } else if (p.hasAccessType(EnumAccessType.ALLOW) && res == TRUE) {
                res = TRUE;
                break;
            }
        }
@@ -346,8 +341,7 @@
   * @return  The evaluation rights to used in the evaluation.
   */
  private int getEvalRights(AciEvalContext evalCtx) {
    if(evalCtx.hasRights(ACI_WRITE) &&
            evalCtx.hasRights(ACI_SELF)) {
    if(evalCtx.hasRights(ACI_WRITE) && evalCtx.hasRights(ACI_SELF)) {
      return ACI_SELF;
    } else  if(evalCtx.hasRights(ACI_COMPARE)) {
      return ACI_COMPARE;
@@ -405,5 +399,4 @@
      buffer.append(pair);
    }
  }
}
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciContainer.java
@@ -805,7 +805,7 @@
  /** {@inheritDoc} */
  @Override
  public  void setEvalUserAttributes(int v) {
    if(operation instanceof SearchOperation && (rightsMask == ACI_READ)) {
    if(operation instanceof SearchOperation && rightsMask == ACI_READ) {
      if(v == ACI_FOUND_USER_ATTR_RULE) {
        evalAllAttributes |= ACI_FOUND_USER_ATTR_RULE;
        evalAllAttributes &= ~ACI_USER_ATTR_STAR_MATCHED;
@@ -820,7 +820,7 @@
  /** {@inheritDoc} */
  @Override
  public  void setEvalOpAttributes(int v) {
    if(operation instanceof SearchOperation && (rightsMask == ACI_READ)) {
    if(operation instanceof SearchOperation && rightsMask == ACI_READ) {
      if(v == ACI_FOUND_OP_ATTR_RULE) {
        evalAllAttributes |= ACI_FOUND_OP_ATTR_RULE;
        evalAllAttributes &= ~ACI_OP_ATTR_PLUS_MATCHED;
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciListenerManager.java
@@ -142,7 +142,7 @@
    {
      Entry entry = modifyOperation.getCurrentEntry();
      Entry modEntry = modifyOperation.getModifiedEntry();
      if ((entry != null) && (modEntry != null))
      if (entry != null && modEntry != null)
      {
        doPostModify(modifyOperation.getModifications(), entry, modEntry);
      }
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciTargets.java
@@ -548,7 +548,7 @@
    public static boolean skipRightsHasRights(int rights) {
      //geteffectiverights sets this flag, turn it off before evaluating.
      int tmpRights=rights & ~ACI_SKIP_PROXY_CHECK;
      return  ((skipRights & tmpRights) == tmpRights);
      return (skipRights & tmpRights) == tmpRights;
    }
@@ -593,8 +593,7 @@
         * contains a simple target DN and a equality operator, that
         * simple target DN is used as the target DN.
         */
        if((targets.getTarget() != null) &&
                (!targets.getTarget().isPattern())) {
        if(targets.getTarget() != null && !targets.getTarget().isPattern()) {
            EnumTargetOperator op=targets.getTarget().getOperator();
            if(op != EnumTargetOperator.NOT_EQUALITY)
            {
@@ -628,7 +627,7 @@
            }
            break;
        case SUBORDINATES:
            if ((entryDN.size() <= targetDN.size()) ||
            if (entryDN.size() <= targetDN.size() ||
                 !entryDN.isDescendantOf(targetDN)) {
              return false;
            }
@@ -641,8 +640,8 @@
         * against the entry containing the ACI. If operator is inequality,
         * check that it doesn't match the target DN.
         */
        if((targets.getTarget() != null) &&
                (!targets.getTarget().isPattern())) {
        if(targets.getTarget() != null &&
                !targets.getTarget().isPattern()) {
            EnumTargetOperator op=targets.getTarget().getOperator();
            if(op == EnumTargetOperator.NOT_EQUALITY) {
                DN tmpDN=targets.getTarget().getDN();
@@ -657,8 +656,8 @@
         * created when the ACI was decoded. If inequality flip the
         * result.
         */
        if((targets.getTarget() != null) &&
                (targets.getTarget().isPattern()))  {
        if(targets.getTarget() != null &&
                targets.getTarget().isPattern())  {
            final boolean ret = targets.getTarget().matchesPattern(entryDN);
            EnumTargetOperator op=targets.getTarget().getOperator();
            if(op == EnumTargetOperator.NOT_EQUALITY)
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/DNS.java
@@ -120,8 +120,8 @@
                  String canonicalName = addr.getCanonicalHostName();
                  if (! hn.equalsIgnoreCase(canonicalName))
                  {
                    if (hn.equalsIgnoreCase("localhost") &&
                        (! dns.contains(canonicalName)))
                    if (hn.equalsIgnoreCase("localhost")
                        && !dns.contains(canonicalName))
                    {
                      dns.add(canonicalName);
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/GroupDN.java
@@ -116,7 +116,7 @@
        EnumEvalResult matched = EnumEvalResult.FALSE;
        for (DN groupDN : groupDNs) {
            Group<?> group = getGroupManager().getGroupInstance(groupDN);
            if((group != null) && (evalCtx.isMemberOf(group))) {
            if(group != null && evalCtx.isMemberOf(group)) {
               matched = EnumEvalResult.TRUE;
               break;
            }
@@ -151,7 +151,7 @@
                  continue;
                }
                Group<?> group = getGroupManager().getGroupInstance(groupDN);
                if((group != null) && (evalCtx.isMemberOf(group))) {
                if(group != null && evalCtx.isMemberOf(group)) {
                    matched=EnumEvalResult.TRUE;
                    break;
                }
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternDN.java
@@ -182,7 +182,7 @@
      }
      if ((subAnyElements != null) && (! subAnyElements.isEmpty()))
      if (subAnyElements != null && ! subAnyElements.isEmpty())
      {
        for (PatternRDN[] element : subAnyElements)
        {
@@ -218,7 +218,7 @@
      {
        int finalLength = subFinal.length;
        if ((valueLength - finalLength) < pos)
        if (valueLength - finalLength < pos)
        {
          return false;
        }
@@ -400,7 +400,7 @@
      {
        pos++;
      }
      else if ((c == ',' || c == ';'))
      else if (c == ',' || c == ';')
      {
        if (name.equals("*"))
        {
@@ -427,7 +427,7 @@
      }
      // Skip over any spaces after the equal sign.
      while ((pos < length) && (dnString.charAt(pos) == ' '))
      while (pos < length && dnString.charAt(pos) == ' ')
      {
        pos++;
      }
@@ -456,7 +456,7 @@
      // Skip over any spaces that might be after the attribute value.
      while ((pos < length) && ((c = dnString.charAt(pos)) == ' '))
      while (pos < length && ((c = dnString.charAt(pos)) == ' '))
      {
        pos++;
      }
@@ -470,7 +470,7 @@
        rdnComponents.add(rdn);
        break;
      }
      else if ((c == ',') || (c == ';'))
      else if (c == ',' || c == ';')
      {
        // We're at the end of the RDN component, so add it to the list,
        // skip over the comma/semicolon, and start on the next component.
@@ -495,7 +495,7 @@
        // Skip over the plus sign and any spaces that may follow it
        // before the next attribute name.
        pos++;
        while ((pos < length) && (dnString.charAt(pos) == ' '))
        while (pos < length && dnString.charAt(pos) == ' ')
        {
          pos++;
        }
@@ -555,7 +555,7 @@
        // Skip over any spaces after the equal sign.
        while ((pos < length) && ((c = dnString.charAt(pos)) == ' '))
        while (pos < length && ((c = dnString.charAt(pos)) == ' '))
        {
          pos++;
        }
@@ -584,17 +584,15 @@
        rdn.addValue(name, parsedValue, dnString);
        // Skip over any spaces that might be after the attribute
        // value.
        while ((pos < length) && ((c = dnString.charAt(pos)) == ' '))
        // Skip over any spaces that might be after the attribute value.
        while (pos < length && ((c = dnString.charAt(pos)) == ' '))
        {
          pos++;
        }
        // Most likely, we will be at either the end of the RDN
        // component or the end of the DN.  If so, then handle that
        // appropriately.
        // component or the end of the DN.  If so, then handle that appropriately.
        if (pos >= length)
        {
          // We're at the end of the DN string and should have a valid
@@ -602,11 +600,10 @@
          rdnComponents.add(rdn);
          break;
        }
        else if ((c == ',') || (c == ';'))
        else if (c == ',' || c == ';')
        {
          // We're at the end of the RDN component, so add it to the
          // list, skip over the comma/semicolon, and start on the
          // next component.
          // list, skip over the comma/semicolon, and start on the next component.
          rdnComponents.add(rdn);
          pos++;
          break;
@@ -617,8 +614,7 @@
          // character, so throw an exception.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_DN_INVALID_CHAR.get(dnString, c, pos);
          throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
                                       message);
          throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX, message);
        }
      }
    }
@@ -1012,27 +1008,27 @@
        }
      }
      while (validOID && (namePos < nameLength))
      while (validOID && namePos < nameLength)
      {
        char ch = attributeName.charAt(namePos++);
        if (isDigit(ch))
        {
          while (validOID && (namePos < nameLength) &&
          while (validOID && namePos < nameLength &&
                 isDigit(attributeName.charAt(namePos)))
          {
            namePos++;
          }
          if ((namePos < nameLength) &&
              (attributeName.charAt(namePos) != '.'))
          if (namePos < nameLength &&
              attributeName.charAt(namePos) != '.')
          {
            validOID = false;
          }
        }
        else if (ch == '.')
        {
          if ((namePos == 1) ||
              (attributeName.charAt(namePos-2) == '.'))
          if (namePos == 1 ||
              attributeName.charAt(namePos-2) == '.')
          {
            validOID = false;
          }
@@ -1044,7 +1040,7 @@
      }
      if (validOID && (attributeName.charAt(nameLength-1) == '.'))
      if (validOID && attributeName.charAt(nameLength-1) == '.')
      {
        validOID = false;
      }
@@ -1100,7 +1096,7 @@
    {
      // The first two characters must be hex characters.
      StringBuilder hexString = new StringBuilder();
      if ((pos+2) > length)
      if (pos+2 > length)
      {
        LocalizableMessage message = ERR_ATTR_SYNTAX_DN_HEX_VALUE_TOO_SHORT.get(dnString);
        throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
@@ -1157,7 +1153,7 @@
                                         message);
          }
        }
        else if ((c == ' ') || (c == ',') || (c == ';'))
        else if (c == ' ' || c == ',' || c == ';')
        {
          // This denotes the end of the value.
          pos--;
@@ -1332,7 +1328,7 @@
        {
          escaped = true;
        }
        else if ((c == ',') || (c == ';'))
        else if (c == ',' || c == ';')
        {
          appendHexChars(dnString, valueString, hexChars);
          pos--;
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternIP.java
@@ -231,7 +231,7 @@
        }
        try {
            //Can only have one prefix value and one address string.
            if((numParts  < 1) || (numParts > 2) ) {
            if(numParts  < 1 || numParts > 2 ) {
                LocalizableMessage message =
                    WARN_ACI_SYNTAX_INVALID_PREFIX_FORMAT.get(expr);
                throw new AciException(message);
@@ -240,7 +240,7 @@
                prefix = Integer.parseInt(prefixStr);
            }
            //Must be between 0 to maxprefix.
            if((prefix < 0) || (prefix > maxPrefix)) {
            if(prefix < 0 || prefix > maxPrefix) {
                LocalizableMessage message =
                    WARN_ACI_SYNTAX_INVALID_PREFIX_VALUE.get(expr);
                throw new AciException(message);
@@ -273,7 +273,7 @@
            prefixBytes[i] = (byte) 0xff;
            prefix -= 8;
        }
        prefixBytes[i] = (byte) ((0xff) << (8 - prefix));
        prefixBytes[i] = (byte) (0xff << 8 - prefix);
        return prefixBytes;
    }
@@ -302,7 +302,7 @@
            throw new AciException(message);
        }
        //Can only have one netmask value and one address string.
        if((numParts  < 1) || (numParts > 2) ) {
        if(numParts  < 1 || numParts > 2 ) {
            LocalizableMessage message = WARN_ACI_SYNTAX_INVALID_NETMASK_FORMAT.get(expr);
            throw new AciException(message);
        }
@@ -353,7 +353,7 @@
                else {
                    long val=Integer.parseInt(quad);
                    //must be between 0-255
                    if((val < 0) ||  (val > 0xff)) {
                    if(val < 0 ||  val > 0xff) {
                        LocalizableMessage message =
                            WARN_ACI_SYNTAX_INVALID_IPV4_VALUE.get(expr);
                        throw new AciException(message);
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/SSF.java
@@ -63,7 +63,7 @@
                 WARN_ACI_SYNTAX_INVALID_SSF_FORMAT.get(expr, nfe.getMessage());
            throw new AciException(message);
        }
        if ((valueAsInt <= 0) || (valueAsInt > MAX_KEY_BITS)) {
        if (valueAsInt <= 0 || valueAsInt > MAX_KEY_BITS) {
            LocalizableMessage message = WARN_ACI_SYNTAX_INVALID_SSF_RANGE.get(expr);
            throw new AciException(message);
        }
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargAttrFilters.java
@@ -281,8 +281,7 @@
        {
          return firstFilterList;
        }
        else if((secondFilterList != null) &&
                secondFilterList.hasMask(mask))
        else if (secondFilterList != null && secondFilterList.hasMask(mask))
        {
          return secondFilterList;
        }
@@ -317,7 +316,7 @@
        //the attribute types value(s) against the corresponding filter.
        // If the filter list does not contain the attribute type skip the
        // attribute type.
        if((attrType != null) && (filterList.containsKey(attrType))) {
        if(attrType != null && filterList.containsKey(attrType)) {
            ByteString value = matchCtx.getCurrentAttributeValue();
            SearchFilter filter = filterList.get(attrType);
            attrMatched=matchFilterAttributeValue(attrType, value, filter);
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TimeOfDay.java
@@ -79,7 +79,7 @@
           WARN_ACI_SYNTAX_INVALID_TIMEOFDAY_FORMAT.get(expr, nfe.getMessage());
            throw new AciException(message);
        }
        if ((valueAsInt < 0) || (valueAsInt > 2359))
        if (valueAsInt < 0 || valueAsInt > 2359)
        {
            LocalizableMessage message = WARN_ACI_SYNTAX_INVALID_TIMEOFDAY_RANGE.get(expr);
            throw new AciException(message);
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserDN.java
@@ -241,8 +241,7 @@
            case PARENT:
            {
                DN parentDN = resDN.parent();
                if ((parentDN != null) &&
                        (parentDN.equals(clientDN)))
                if (parentDN != null && parentDN.equals(clientDN))
                {
                  matched = EnumEvalResult.TRUE;
                }
@@ -342,13 +341,13 @@
            }
        } else if(scope == SearchScope.SINGLE_LEVEL) {
            DN parent=evalCtx.getClientDN().parent();
            if((parent != null) && !parent.equals(urlDN))
            if(parent != null && !parent.equals(urlDN))
            {
              return EnumEvalResult.FALSE;
            }
        } else if(scope == SearchScope.SUBORDINATES) {
            DN userDN = evalCtx.getClientDN();
            if ((userDN.size() <= urlDN.size()) ||
            if (userDN.size() <= urlDN.size() ||
                 !userDN.isDescendantOf(urlDN)) {
              return EnumEvalResult.FALSE;
            }
opendj-server-legacy/src/main/java/org/opends/server/backends/RebuildConfig.java
@@ -108,7 +108,7 @@
        }
        else if ((newIndexParts.length == 1 && existingIndexParts.length == 1)
            || (newIndexParts.length > 1 && existingIndexParts.length == 1)
            || (newIndexParts[1].equalsIgnoreCase(existingIndexParts[1])))
            || newIndexParts[1].equalsIgnoreCase(existingIndexParts[1]))
        {
          return;
        }
@@ -142,7 +142,7 @@
          {
            if ((newIndexParts.length == 1 && existingIndexParts.length >= 1)
                || (newIndexParts.length > 1 && existingIndexParts.length == 1)
                || (newIndexParts[1].equalsIgnoreCase(existingIndexParts[1])))
                || newIndexParts[1].equalsIgnoreCase(existingIndexParts[1]))
            {
              return thatIndex;
            }
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/ExportJob.java
@@ -156,7 +156,7 @@
    long finishTime = System.currentTimeMillis();
    long totalTime = (finishTime - startTime);
    long totalTime = finishTime - startTime;
    float rate = 0;
    if (totalTime > 0)
@@ -289,7 +289,7 @@
    public void run()
    {
      long latestCount = exportedCount;
      long deltaCount = (latestCount - previousCount);
      long deltaCount = latestCount - previousCount;
      long latestTime = System.currentTimeMillis();
      long deltaTime = latestTime - previousTime;
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/IndexInputBuffer.java
@@ -113,7 +113,7 @@
    }
    else
    {
      bytesToRead = Math.min((end - offset), cache.remaining());
      bytesToRead = Math.min(end - offset, cache.remaining());
    }
    int bytesRead = 0;
    while (bytesRead < bytesToRead)
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/IndexOutputBuffer.java
@@ -619,7 +619,7 @@
    for (int i = 0; i < INT_SIZE; i++) {
      byte b = buffer[index + i];
      answer <<= 8;
      answer |= (b & 0xff);
      answer |= b & 0xff;
    }
    return answer;
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/JebFormat.java
@@ -85,7 +85,7 @@
    for (int i = start; i < end; i++)
    {
      v <<= 8;
      v |= (bytes[i] & 0xFF);
      v |= bytes[i] & 0xFF;
    }
    return v;
  }
@@ -108,11 +108,11 @@
    if(bytes.length == 8)
    {
      long v = 0;
      v |= (bytes[0] & 0x7F);
      v |= bytes[0] & 0x7F;
      for (int i = 1; i < 8; i++)
      {
        v <<= 8;
        v |= (bytes[i] & 0xFF);
        v |= bytes[i] & 0xFF;
      }
      return v;
    }
@@ -145,7 +145,7 @@
      v |= (decodedBytes[pos++] & 0xFFL) << 24;
      v |= (decodedBytes[pos++] & 0xFFL) << 16;
      v |= (decodedBytes[pos++] & 0xFFL) << 8;
      v |= (decodedBytes[pos++] & 0xFFL);
      v |= decodedBytes[pos++] & 0xFFL;
      entryIDList[i] = v;
    }
@@ -169,7 +169,7 @@
      v |= (decodedBytes[pos++] & 0xFFL) << 24;
      v |= (decodedBytes[pos++] & 0xFFL) << 16;
      v |= (decodedBytes[pos++] & 0xFFL) << 8;
      v |= (decodedBytes[pos++] & 0xFFL);
      v |= decodedBytes[pos++] & 0xFFL;
      entryIDList[i] = v;
    }
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/SortValuesSet.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.backends.jeb;
@@ -388,7 +388,7 @@
    for (int i = offset; i < offset + 4; i++)
    {
      v <<= 8;
      v |= (bytes[i] & 0xFF);
      v |= bytes[i] & 0xFF;
    }
    return v;
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java
@@ -261,7 +261,7 @@
        break;
      }
      ByteString b1Bytes = set.getValue((index * orderingRules.length) + j);
      ByteString b1Bytes = set.getValue(index * orderingRules.length + j);
      ByteString b2Bytes = null;
      if(values[j] != null)
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
@@ -202,7 +202,7 @@
        }
      }
    }
    return (nbSeparator == 1);
    return nbSeparator == 1;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ExportJob.java
@@ -169,7 +169,7 @@
    long finishTime = System.currentTimeMillis();
    long totalTime = (finishTime - startTime);
    long totalTime = finishTime - startTime;
    float rate = 0;
    if (totalTime > 0)
@@ -294,7 +294,7 @@
    public void run()
    {
      long latestCount = exportedCount;
      long deltaCount = (latestCount - previousCount);
      long deltaCount = latestCount - previousCount;
      long latestTime = System.currentTimeMillis();
      long deltaTime = latestTime - previousTime;
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Count.java
@@ -124,7 +124,7 @@
  private ByteSequence getShardedKey(EntryID entryID)
  {
    final long bucket = (Thread.currentThread().getId() & (SHARD_COUNT - 1));
    final long bucket = Thread.currentThread().getId() & (SHARD_COUNT - 1);
    return getKeyFromEntryIDAndBucket(entryID, bucket);
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ImportRecord.java
@@ -77,7 +77,7 @@
    {
      byte b = buffer[index + i];
      answer <<= 8;
      answer |= (b & 0xff);
      answer |= b & 0xff;
    }
    return answer;
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexInputBuffer.java
@@ -113,7 +113,7 @@
    }
    else
    {
      bytesToRead = Math.min((end - offset), cache.remaining());
      bytesToRead = Math.min(end - offset, cache.remaining());
    }
    int bytesRead = 0;
    while (bytesRead < bytesToRead)
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexOutputBuffer.java
@@ -467,7 +467,7 @@
    for (int i = 0; i < INT_SIZE; i++) {
      byte b = buffer[index + i];
      answer <<= 8;
      answer |= (b & 0xff);
      answer |= b & 0xff;
    }
    return answer;
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
@@ -389,19 +389,15 @@
  private String getAttributeValue(String attributeName, boolean isRequired)
          throws InitializationException
  {
    List<Attribute> attrList =
         taskEntry.getAttribute(attributeName.toLowerCase());
    if ((attrList == null) || attrList.isEmpty())
    List<Attribute> attrList = taskEntry.getAttribute(attributeName.toLowerCase());
    if (attrList == null || attrList.isEmpty())
    {
      if (isRequired)
      {
        throw new InitializationException(ERR_TASK_MISSING_ATTR.get(taskEntry.getName(), attributeName));
      }
      else
      {
        return null;
      }
    }
    if (attrList.size() > 1)
    {
@@ -415,11 +411,8 @@
      {
        throw new InitializationException(ERR_TASK_NO_VALUES_FOR_ATTR.get(attributeName, taskEntry.getName()));
      }
      else
      {
        return null;
      }
    }
    ByteString value = iterator.next();
    if (iterator.hasNext())
@@ -569,7 +562,7 @@
   */
  public boolean isRecurring()
  {
    return (recurringTaskID != null);
    return recurringTaskID != null;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java
@@ -212,7 +212,7 @@
          // If there is an existing task with the same id
          // and it is in completed state, take its place.
          Task t = tasks.get(task.getTaskID());
          if ((t != null) && TaskState.isDone(t.getTaskState()))
          if (t != null && TaskState.isDone(t.getTaskState()))
          {
            removeCompletedTask(t.getTaskID());
          }
@@ -256,8 +256,8 @@
      for (Task t : tasks.values())
      {
        // Find any existing task iterations and try to cancel them.
        if ((t.getRecurringTaskID() != null) &&
            (t.getRecurringTaskID().equals(recurringTaskID)))
        if (t.getRecurringTaskID() != null &&
            t.getRecurringTaskID().equals(recurringTaskID))
        {
          TaskState state = t.getTaskState();
          if (!TaskState.isDone(state) && !TaskState.isCancelled(state))
@@ -353,8 +353,7 @@
      }
      else if (TaskState.isDone(state))
      {
        if ((state == TaskState.CANCELED_BEFORE_STARTING) &&
          task.isRecurring())
        if (state == TaskState.CANCELED_BEFORE_STARTING && task.isRecurring())
        {
          pendingTasks.add(task);
        }
@@ -600,7 +599,7 @@
            // If there is an existing task with the same id
            // and it is in completed state, take its place.
            Task t = tasks.get(newIteration.getTaskID());
            if ((t != null) && TaskState.isDone(t.getTaskState()))
            if (t != null && TaskState.isDone(t.getTaskState()))
            {
              removeCompletedTask(t.getTaskID());
            }
@@ -831,13 +830,11 @@
            }
            // Recurring task iteration has to spawn the next one
            // even if the current iteration has been canceled.
            else if ((state == TaskState.CANCELED_BEFORE_STARTING) &&
                     t.isRecurring())
            else if (state == TaskState.CANCELED_BEFORE_STARTING && t.isRecurring())
            {
              if (t.getScheduledStartTime() > TimeThread.getTime()) {
                // If we're waiting for the start time to arrive,
                // then see if that will come before the next
                // sleep time is up.
                // then see if that will come before the next sleep time is up.
                long waitTime =
                  t.getScheduledStartTime() - TimeThread.getTime();
                sleepTime = Math.min(sleepTime, waitTime);
@@ -931,7 +928,7 @@
      state = null;
    }
    if ((state != null) && TaskState.isDone(state))
    if (state != null && TaskState.isDone(state))
    {
      return state;
    }
@@ -1806,7 +1803,7 @@
    // Get the name of the class that implements the task logic.
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_CLASS.toLowerCase(), ATTR_TASK_CLASS);
    List<Attribute> attrList = entry.getAttribute(attrType);
    if ((attrList == null) || attrList.isEmpty())
    if (attrList == null || attrList.isEmpty())
    {
      LocalizableMessage message = ERR_TASKSCHED_NO_CLASS_ATTRIBUTE.get(ATTR_TASK_ID);
      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
opendj-server-legacy/src/main/java/org/opends/server/config/BooleanConfigAttribute.java
@@ -303,7 +303,7 @@
  public LinkedHashSet<ByteString> stringsToValues(List<String> valueStrings,
      boolean allowFailures) throws ConfigException
  {
    if ((valueStrings == null) || valueStrings.isEmpty())
    if (valueStrings == null || valueStrings.isEmpty())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_IS_REQUIRED.get(getName());
      throw new ConfigException(message);
@@ -563,7 +563,7 @@
  {
    attributeList.add(new javax.management.Attribute(getName(), activeValue));
    if (requiresAdminAction() && (pendingValue != activeValue))
    if (requiresAdminAction() && pendingValue != activeValue)
    {
      String name = getName() + ";" + OPTION_PENDING_VALUES;
      attributeList.add(new javax.management.Attribute(name, pendingValue));
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java
@@ -382,7 +382,7 @@
  {
    // If no values are provided, then check to see if this is a required
    // attribute.  If it is, then reject the change.
    if ((values == null) || values.isEmpty())
    if (values == null || values.isEmpty())
    {
      if (isRequired)
      {
@@ -420,7 +420,7 @@
    // If this is not a multivalued attribute but there were more values
    // provided, then reject it.
    if ((! isMultiValued) && iterator.hasNext())
    if (! isMultiValued && iterator.hasNext())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(name);
      throw new ConfigException(message);
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigConstants.java
@@ -22,18 +22,14 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions copyright 2011-2013 ForgeRock AS
 *      Portions copyright 2011-2015 ForgeRock AS
 */
package org.opends.server.config;
import java.io.File;
import org.opends.server.types.SSLClientAuthPolicy;
/**
 * This class defines a number of constants used by the Directory Server
 * configuration, including configuration attribute and objectclass names,
@@ -1333,7 +1329,7 @@
   * The default maximum request size that should be used if none is specified
   * in the configuration.
   */
  public static final int DEFAULT_MAX_REQUEST_SIZE = (5 * 1024 * 1024); // 5 MB
  public static final int DEFAULT_MAX_REQUEST_SIZE = 5 * 1024 * 1024; // 5 MB
opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java
@@ -253,16 +253,13 @@
  public DN activeValue()
         throws ConfigException
  {
    if ((activeValues == null) || activeValues.isEmpty())
    if (activeValues == null || activeValues.isEmpty())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName()));
    }
    if (activeValues.size() > 1)
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName()));
    }
    return activeValues.get(0);
@@ -301,16 +298,13 @@
      return activeValue();
    }
    if ((pendingValues == null) || pendingValues.isEmpty())
    if (pendingValues == null || pendingValues.isEmpty())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName()));
    }
    if (pendingValues.size() > 1)
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName()));
    }
    return pendingValues.get(0);
@@ -381,7 +375,7 @@
         throws ConfigException
  {
    // First check if the set is empty and if that is allowed.
    if ((values == null) || (values.isEmpty()))
    if (values == null || values.isEmpty())
    {
      if (isRequired())
      {
@@ -403,7 +397,7 @@
    // Next check if the set contains multiple values and if that is allowed.
    int numValues = values.size();
    if (!isMultiValued() && (numValues > 1))
    if (!isMultiValued() && numValues > 1)
    {
      throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(getName()));
    }
@@ -566,7 +560,7 @@
  public LinkedHashSet<ByteString> stringsToValues(List<String> valueStrings, boolean allowFailures)
         throws ConfigException
  {
    if ((valueStrings == null) || valueStrings.isEmpty())
    if (valueStrings == null || valueStrings.isEmpty())
    {
      if (isRequired())
      {
@@ -577,11 +571,9 @@
    int numValues = valueStrings.size();
    if ((! isMultiValued()) && (numValues > 1))
    if (!isMultiValued() && numValues > 1)
    {
      LocalizableMessage message =
          ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(getName()));
    }
@@ -614,7 +606,7 @@
    // If this method was configured to continue on error, then it is possible
    // that we ended up with an empty list.  Check to see if this is a required
    // attribute and if so deal with it accordingly.
    if ((isRequired()) && valueSet.isEmpty())
    if (isRequired() && valueSet.isEmpty())
    {
      throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(getName()));
    }
@@ -737,7 +729,7 @@
          else
          {
            int numValues = a.size();
            if (numValues > 1 && (!isMultiValued()))
            if (numValues > 1 && !isMultiValued())
            {
              // This is illegal -- the attribute is single-valued.
              throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(a.getName()));
@@ -959,8 +951,7 @@
    }
    if (requiresAdminAction() && (pendingValues != null) &&
        (pendingValues != activeValues))
    if (requiresAdminAction() && pendingValues != null && pendingValues != activeValues)
    {
      String name = getName() + ";" + OPTION_PENDING_VALUES;
opendj-server-legacy/src/main/java/org/opends/server/config/IntegerWithUnitConfigAttribute.java
@@ -507,22 +507,20 @@
  public void setValue(long intValue, String unit)
         throws ConfigException
  {
    if ((unit == null) || (! units.containsKey(unit)))
    if (unit == null || !units.containsKey(unit))
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_INVALID_UNIT.get(unit, getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_INVALID_UNIT.get(unit, getName()));
    }
    long calculatedValue = (long) (intValue * units.get(unit));
    if (hasLowerBound && (calculatedValue < lowerBound))
    if (hasLowerBound && calculatedValue < lowerBound)
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_INT_BELOW_LOWER_BOUND.get(
          getName(), calculatedValue, lowerBound);
      throw new ConfigException(message);
    }
    if (hasUpperBound && (calculatedValue > upperBound))
    if (hasUpperBound && calculatedValue > upperBound)
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_INT_ABOVE_UPPER_BOUND.get(
          getName(), calculatedValue, upperBound);
@@ -692,29 +690,24 @@
    // The rest of the value should be the unit.  See if it is in the set of
    // available units.
    String unit = lowerValue.substring(spacePos+1);
    double multiplier;
    if (! units.containsKey(unit))
    {
      rejectReason.append(ERR_CONFIG_ATTR_INVALID_UNIT.get(unit, getName()));
      return false;
    }
    else
    {
      multiplier = units.get(unit);
    }
    // Multiply the int value by the unit multiplier and see if that is within
    // the specified bounds.
    double multiplier = units.get(unit);
    long calculatedValue = (long) (longValue * multiplier);
    if (hasLowerBound && (calculatedValue < lowerBound))
    if (hasLowerBound && calculatedValue < lowerBound)
    {
      rejectReason.append(ERR_CONFIG_ATTR_INT_BELOW_LOWER_BOUND.get(
              getName(), calculatedValue, lowerBound));
      return false;
    }
    if (hasUpperBound && (calculatedValue > upperBound))
    if (hasUpperBound && calculatedValue > upperBound)
    {
      rejectReason.append(ERR_CONFIG_ATTR_INT_ABOVE_UPPER_BOUND.get(
              getName(), calculatedValue, upperBound));
@@ -752,7 +745,7 @@
              stringsToValues(List<String> valueStrings, boolean allowFailures)
         throws ConfigException
  {
    if ((valueStrings == null) || valueStrings.isEmpty())
    if (valueStrings == null || valueStrings.isEmpty())
    {
      if (isRequired())
      {
@@ -763,7 +756,7 @@
    int numValues = valueStrings.size();
    if ((! isMultiValued()) && (numValues > 1))
    if (!isMultiValued() && numValues > 1)
    {
      throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(getName()));
    }
@@ -792,7 +785,7 @@
    // If this method was configured to continue on error, then it is possible
    // that we ended up with an empty list.  Check to see if this is a required
    // attribute and if so deal with it accordingly.
    if ((isRequired()) && valueSet.isEmpty())
    if (isRequired() && valueSet.isEmpty())
    {
      throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(getName()));
    }
@@ -1048,8 +1041,7 @@
    String activeValue = activeIntValue + " " + activeUnit;
    attributeList.add(new javax.management.Attribute(getName(), activeValue));
    if (requiresAdminAction() &&
        (pendingCalculatedValue != activeCalculatedValue))
    if (requiresAdminAction() && pendingCalculatedValue != activeCalculatedValue)
    {
      String name         = getName() + ";" + OPTION_PENDING_VALUES;
      String pendingValue = pendingIntValue + " " + pendingUnit;
opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
@@ -288,19 +288,15 @@
   * @throws  ConfigException  If this attribute does not have exactly one
   *                           active value.
   */
  public String activeValue()
         throws ConfigException
  public String activeValue() throws ConfigException
  {
    if ((activeValues == null) || activeValues.isEmpty())
    if (activeValues == null || activeValues.isEmpty())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName()));
    }
    if (activeValues.size() > 1)
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName()));
    }
    return activeValues.get(0);
@@ -339,16 +335,13 @@
      return activeValue();
    }
    if ((pendingValues == null) || pendingValues.isEmpty())
    if (pendingValues == null || pendingValues.isEmpty())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName()));
    }
    if (pendingValues.size() > 1)
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName()));
    }
    return pendingValues.get(0);
@@ -399,7 +392,7 @@
  public void setValue(String value)
         throws ConfigException
  {
    if ((value == null) || (value.length() == 0))
    if (value == null || value.length() == 0)
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_EMPTY_STRING_VALUE.get(getName());
      throw new ConfigException(message);
@@ -461,7 +454,7 @@
    // Next check if the set contains multiple values and if that is allowed.
    int numValues = values.size();
    if ((! isMultiValued()) && (numValues > 1))
    if (!isMultiValued() && numValues > 1)
    {
      throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(getName()));
    }
@@ -540,7 +533,7 @@
  {
    // Make sure that the value is non-empty.
    String stringValue;
    if (value == null || ((stringValue = value.toString()).length() == 0))
    if (value == null || (stringValue = value.toString()).length() == 0)
    {
      rejectReason.append(ERR_CONFIG_ATTR_EMPTY_STRING_VALUE.get(getName()));
      return false;
@@ -550,8 +543,7 @@
    // Make sure that the value is in the allowed value set.
    if (! allowedValues.contains(stringValue.toLowerCase()))
    {
      rejectReason.append(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(
              stringValue, getName()));
      rejectReason.append(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(stringValue, getName()));
      return false;
    }
@@ -731,7 +723,7 @@
          else
          {
            int numValues = a.size();
            if ((numValues > 1) && (! isMultiValued()))
            if (numValues > 1 && !isMultiValued())
            {
              // This is illegal -- the attribute is single-valued.
              LocalizableMessage message =
@@ -746,8 +738,7 @@
              if (! allowedValues.contains(lowerValue))
              {
                // This is illegal -- the value is not allowed.
                throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(
                    v, a.getName()));
                throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(v, a.getName()));
              }
              pendingValues.add(v.toString());
@@ -789,7 +780,7 @@
        else
        {
          int numValues = a.size();
          if ((numValues > 1) && (! isMultiValued()))
          if (numValues > 1 && ! isMultiValued())
          {
            // This is illegal -- the attribute is single-valued.
            LocalizableMessage message =
@@ -804,8 +795,7 @@
            if (! allowedValues.contains(lowerValue))
            {
              // This is illegal -- the value is not allowed.
              throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(
                  v, a.getName()));
              throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(v, a.getName()));
            }
            activeValues.add(v.toString());
@@ -943,8 +933,7 @@
    }
    if (requiresAdminAction() && (pendingValues != null) &&
        (pendingValues != activeValues))
    if (requiresAdminAction() && pendingValues != null && pendingValues != activeValues)
    {
      String name = getName() + ";" + OPTION_PENDING_VALUES;
@@ -957,8 +946,7 @@
      }
      else if (! pendingValues.isEmpty())
      {
        attributeList.add(new javax.management.Attribute(name,
                                                         pendingValues.get(0)));
        attributeList.add(new javax.management.Attribute(name, pendingValues.get(0)));
      }
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/config/ReadOnlyConfigAttribute.java
@@ -172,16 +172,13 @@
  public String activeValue()
         throws ConfigException
  {
    if ((values == null) || values.isEmpty())
    if (values == null || values.isEmpty())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName()));
    }
    if (values.size() > 1)
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName());
      throw new ConfigException(message);
      throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName()));
    }
    return values.get(0);
opendj-server-legacy/src/main/java/org/opends/server/config/StringConfigAttribute.java
@@ -256,7 +256,7 @@
  public String activeValue()
         throws org.forgerock.opendj.config.server.ConfigException
  {
    if ((activeValues == null) || activeValues.isEmpty())
    if (activeValues == null || activeValues.isEmpty())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName());
      throw new org.forgerock.opendj.config.server.ConfigException(message);
@@ -303,7 +303,7 @@
      return activeValue();
    }
    if ((pendingValues == null) || pendingValues.isEmpty())
    if (pendingValues == null || pendingValues.isEmpty())
    {
      LocalizableMessage message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName());
      throw new org.forgerock.opendj.config.server.ConfigException(message);
@@ -403,7 +403,7 @@
    // Next check if the set contains multiple values and if that is allowed.
    int numValues = values.size();
    if ((! isMultiValued()) && (numValues > 1))
    if (!isMultiValued() && numValues > 1)
    {
      throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(getName()));
    }
@@ -414,7 +414,7 @@
    LinkedHashSet<ByteString> valueSet = new LinkedHashSet<>(numValues);
    for (String value : values)
    {
      if ((value == null) || (value.length() == 0))
      if (value == null || value.length() == 0)
      {
        throw new ConfigException(ERR_CONFIG_ATTR_EMPTY_STRING_VALUE.get(getName()));
      }
@@ -521,7 +521,7 @@
    }
    int numValues = valueStrings.size();
    if ((! isMultiValued()) && (numValues > 1))
    if (!isMultiValued() && numValues > 1)
    {
      throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(getName()));
    }
@@ -651,7 +651,7 @@
          else
          {
            int numValues = a.size();
            if ((numValues > 1) && (! isMultiValued()))
            if (numValues > 1 && !isMultiValued())
            {
              // This is illegal -- the attribute is single-valued.
              LocalizableMessage message =
@@ -696,7 +696,7 @@
        else
        {
          int numValues = a.size();
          if ((numValues > 1) && (! isMultiValued()))
          if (numValues > 1 && !isMultiValued())
          {
            // This is illegal -- the attribute is single-valued.
            LocalizableMessage message =
@@ -843,8 +843,7 @@
    }
    if (requiresAdminAction() && (pendingValues != null) &&
        (pendingValues != activeValues))
    if (requiresAdminAction() && pendingValues != null && pendingValues != activeValues)
    {
      String name = getName() + ";" + OPTION_PENDING_VALUES;
@@ -857,8 +856,7 @@
      }
      else if (! pendingValues.isEmpty())
      {
        attributeList.add(new javax.management.Attribute(name,
                                                         pendingValues.get(0)));
        attributeList.add(new javax.management.Attribute(name, pendingValues.get(0)));
      }
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java
@@ -139,13 +139,11 @@
          }
          reader.readEndSequence();
          if ((orderingRule == null) &&
              (attrType.getOrderingMatchingRule() == null))
          if (orderingRule == null && attrType.getOrderingMatchingRule() == null)
          {
            LocalizableMessage message =
                INFO_SORTREQ_CONTROL_NO_ORDERING_RULE_FOR_ATTR.get(attrName);
            throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
                message);
            throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
          }
          sortKeys.add(new SortKey(attrType, ascending, orderingRule));
opendj-server-legacy/src/main/java/org/opends/server/core/AccessControlConfigManager.java
@@ -241,7 +241,7 @@
            getHandler(newHandlerClass,newConfiguration, false, false);
          }
        }
      } else if (enabledOld && (! enabledNew)) {
      } else if (enabledOld && !enabledNew) {
        //Access control has been disabled, switch to the default handler and
        //finalize the old handler.
        newHandlerClass = DefaultAccessControlHandler.class.getName();
opendj-server-legacy/src/main/java/org/opends/server/core/AccountStatusNotificationHandlerConfigManager.java
@@ -203,7 +203,7 @@
    if (handler != null)
    {
      String curClassName = handler.getClass().getName();
      boolean classIsNew = (! newClassName.equals (curClassName));
      boolean classIsNew = !newClassName.equals(curClassName);
      if (classIsNew)
      {
        changeResult.setAdminActionRequired (true);
@@ -212,7 +212,7 @@
    }
    // New entry cache is enabled and there were no previous one.
    // Instantiate the new class and initalize it.
    // Instantiate the new class and initialize it.
    try
    {
      loadAndInstallNotificationHandler (newClassName, configuration);
opendj-server-legacy/src/main/java/org/opends/server/core/EntryCacheConfigManager.java
@@ -235,8 +235,8 @@
        int currentCacheLevel = cacheNameToLevelMap.get(normDN);
        // Check if there any existing cache at the same level.
        if ((currentCacheLevel != configuration.getCacheLevel()) &&
          (cacheOrderMap.containsKey(configuration.getCacheLevel()))) {
        if (currentCacheLevel != configuration.getCacheLevel() &&
          cacheOrderMap.containsKey(configuration.getCacheLevel())) {
          unacceptableReasons.add(
            ERR_CONFIG_ENTRYCACHE_CONFIG_LEVEL_NOT_ACCEPTABLE.get(
              configuration.dn(), configuration.getCacheLevel()));
@@ -309,7 +309,7 @@
    if ( entryCache != null)
    {
      String curClassName = entryCache.getClass().getName();
      boolean classIsNew = (! newClassName.equals (curClassName));
      boolean classIsNew = !newClassName.equals(curClassName);
      if (classIsNew)
      {
        changeResult.setAdminActionRequired (true);
@@ -318,7 +318,7 @@
    }
    // New entry cache is enabled and there were no previous one.
    // Instantiate the new class and initalize it.
    // Instantiate the new class and initialize it.
    try
    {
      loadAndInstallEntryCache (newClassName, configuration);
@@ -562,7 +562,7 @@
      // If there is some entry cache instance already initialized work with
      // it instead of creating a new one unless explicit init is requested.
      EntryCache<T> cache;
      if (initialize || (entryCache == null)) {
      if (initialize || entryCache == null) {
        cache = cacheClass.newInstance();
      } else {
        cache = entryCache;
@@ -603,8 +603,8 @@
        }
      }
      LocalizableMessage message = ERR_CONFIG_ENTRYCACHE_CANNOT_INITIALIZE_CACHE.get(
        className, (e.getCause() != null ? e.getCause().getMessage() :
          stackTraceToSingleLineString(e)));
        className, e.getCause() != null ? e.getCause().getMessage() :
          stackTraceToSingleLineString(e));
      throw new InitializationException(message, e);
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/core/ExtendedOperationBasis.java
@@ -374,8 +374,7 @@
      // and any other controls specified.
      try
      {
        if (AccessControlConfigManager.getInstance()
            .getAccessControlHandler().isAllowed(this) == false)
        if (!AccessControlConfigManager.getInstance().getAccessControlHandler().isAllowed(this))
        {
          setResultCode(ResultCode.INSUFFICIENT_ACCESS_RIGHTS);
          appendErrorMessage(ERR_EXTENDED_AUTHZ_INSUFFICIENT_ACCESS_RIGHTS.get(requestOID));
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyConfigManager.java
@@ -139,7 +139,7 @@
    // Process and register any password policy subentries.
    List<SubEntry> pwpSubEntries = DirectoryServer.getSubentryManager().getSubentries();
    if ((pwpSubEntries != null) && (!pwpSubEntries.isEmpty()))
    if (pwpSubEntries != null && !pwpSubEntries.isEmpty())
    {
      for (SubEntry subentry : pwpSubEntries)
      {
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyFactory.java
@@ -222,7 +222,7 @@
      else
      {
        String syntax = passwordAttribute.getSyntax().getName();
        if ((syntax == null) || (syntax.length() == 0))
        if (syntax == null || syntax.length() == 0)
        {
          syntax = syntaxOID;
        }
@@ -239,7 +239,7 @@
        PasswordStorageScheme<?> scheme = DirectoryServer
            .getPasswordStorageScheme(schemeDN);
        if (authPasswordSyntax && (!scheme.supportsAuthPasswordSyntax()))
        if (authPasswordSyntax && !scheme.supportsAuthPasswordSyntax())
        {
          throw new ConfigException(ERR_PWPOLICY_SCHEME_DOESNT_SUPPORT_AUTH.get(
              schemeDN, passwordAttribute.getNameOrOID()));
@@ -300,8 +300,8 @@
      // If the expire without warning option is disabled, then there must be a
      // warning interval.
      if ((!configuration.isExpirePasswordsWithoutWarning())
          && (configuration.getPasswordExpirationWarningInterval() <= 0))
      if (!configuration.isExpirePasswordsWithoutWarning()
          && configuration.getPasswordExpirationWarningInterval() <= 0)
      {
        LocalizableMessage message =
          ERR_PWPOLICY_MUST_HAVE_WARNING_IF_NOT_EXPIRE_WITHOUT_WARNING.get(configEntryDN);
@@ -380,8 +380,7 @@
            configuration.getPasswordExpirationWarningInterval());
        if (configuration.getMinPasswordAge() > 0)
        {
          if ((warnInterval + configuration.getMinPasswordAge()) >=configuration
              .getMaxPasswordAge())
          if (warnInterval + configuration.getMinPasswordAge() >= configuration.getMaxPasswordAge())
          {
            LocalizableMessage message =
              ERR_PWPOLICY_MIN_AGE_PLUS_WARNING_GREATER_THAN_MAX_AGE.get(configEntryDN);
@@ -530,7 +529,7 @@
      buffer.append(EOL);
      buffer.append("Default Password Storage Schemes:      ");
      if ((defaultStorageSchemes == null) || defaultStorageSchemes.isEmpty())
      if (defaultStorageSchemes == null || defaultStorageSchemes.isEmpty())
      {
        buffer.append("{none specified}");
        buffer.append(EOL);
@@ -551,8 +550,7 @@
      }
      buffer.append("Deprecated Password Storage Schemes:   ");
      if ((deprecatedStorageSchemes == null)
          || deprecatedStorageSchemes.isEmpty())
      if (deprecatedStorageSchemes == null || deprecatedStorageSchemes.isEmpty())
      {
        buffer.append("{none specified}");
        buffer.append(EOL);
@@ -609,7 +607,7 @@
      buffer.append(EOL);
      buffer.append("Password Validators:                   ");
      if ((passwordValidators == null) || passwordValidators.isEmpty())
      if (passwordValidators == null || passwordValidators.isEmpty())
      {
        buffer.append("{none specified}");
        buffer.append(EOL);
@@ -644,7 +642,7 @@
      buffer.append(EOL);
      buffer.append("Account Status Notification Handlers:  ");
      if ((notificationHandlers == null) || notificationHandlers.isEmpty())
      if (notificationHandlers == null || notificationHandlers.isEmpty())
      {
        buffer.append("{none specified}");
        buffer.append(EOL);
@@ -746,7 +744,7 @@
      buffer.append(EOL);
      buffer.append("Previous Last Login Time Formats:      ");
      if ((configuration.getPreviousLastLoginTimeFormat().isEmpty()))
      if (configuration.getPreviousLastLoginTimeFormat().isEmpty())
      {
        buffer.append("{none specified}");
        buffer.append(EOL);
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordStorageSchemeConfigManager.java
@@ -198,7 +198,7 @@
    if (storageScheme != null)
    {
      String curClassName = storageScheme.getClass().getName();
      boolean classIsNew = (! newClassName.equals (curClassName));
      boolean classIsNew = !newClassName.equals(curClassName);
      if (classIsNew)
      {
        changeResult.setAdminActionRequired (true);
@@ -207,7 +207,7 @@
    }
    // New entry cache is enabled and there were no previous one.
    // Instantiate the new class and initalize it.
    // Instantiate the new class and initialize it.
    try
    {
      loadAndInstallPasswordStorageScheme (newClassName, configuration);
opendj-server-legacy/src/main/java/org/opends/server/core/RootDNConfigManager.java
@@ -274,8 +274,7 @@
    for (DN altBindDN: configuration.getAlternateBindDN())
    {
      DN existingRootDN = DirectoryServer.getActualRootBindDN(altBindDN);
      if ((existingRootDN != null) &&
          (! existingRootDN.equals(configuration.dn())))
      if (existingRootDN != null && !existingRootDN.equals(configuration.dn()))
      {
        unacceptableReasons.add(ERR_CONFIG_ROOTDN_CONFLICTING_MAPPING.get(
            altBindDN, configuration.dn(), existingRootDN));
opendj-server-legacy/src/main/java/org/opends/server/core/SchemaConfigManager.java
@@ -246,14 +246,14 @@
        }
        long modificationTime = f.lastModified();
        if ((oldestModificationTime <= 0L) ||
            (modificationTime < oldestModificationTime))
        if (oldestModificationTime <= 0L ||
            modificationTime < oldestModificationTime)
        {
          oldestModificationTime = modificationTime;
        }
        if ((youngestModificationTime <= 0) ||
            (modificationTime > youngestModificationTime))
        if (youngestModificationTime <= 0 ||
            modificationTime > youngestModificationTime)
        {
          youngestModificationTime = modificationTime;
        }
opendj-server-legacy/src/main/java/org/opends/server/core/SubentryManager.java
@@ -958,8 +958,8 @@
    Entry oldEntry = modifyOperation.getCurrentEntry();
    Entry newEntry = modifyOperation.getModifiedEntry();
    if ((newEntry.isSubentry() || newEntry.isLDAPSubentry()) ||
        (oldEntry.isSubentry() || oldEntry.isLDAPSubentry()))
    if (newEntry.isSubentry() || newEntry.isLDAPSubentry() ||
        oldEntry.isSubentry() || oldEntry.isLDAPSubentry())
    {
      ClientConnection conn = modifyOperation.getClientConnection();
      if (!conn.hasPrivilege(Privilege.SUBENTRY_WRITE,
@@ -1146,7 +1146,7 @@
  {
    Entry entry = modifyOperation.getCurrentEntry();
    Entry modEntry = modifyOperation.getModifiedEntry();
    if ((entry != null) && (modEntry != null))
    if (entry != null && modEntry != null)
    {
      doPostModify(entry, modEntry);
    }
@@ -1159,7 +1159,7 @@
  {
    Entry oldEntry = modifyDNOperation.getOriginalEntry();
    Entry newEntry = modifyDNOperation.getUpdatedEntry();
    if ((oldEntry != null) && (newEntry != null))
    if (oldEntry != null && newEntry != null)
    {
      doPostModifyDN(oldEntry, newEntry);
    }
opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java
@@ -250,7 +250,7 @@
      AttributeType pwdAttrType =
          DirectoryServer.getAttributeTypeOrDefault(PWD_ATTR_VALIDATOR);
      List<Attribute> pwdAttrList = entry.getAttribute(pwdAttrType);
      if ((pwdAttrList != null) && (!pwdAttrList.isEmpty()))
      if (pwdAttrList != null && !pwdAttrList.isEmpty())
      {
        for (Attribute attr : pwdAttrList)
        {
opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java
@@ -153,7 +153,7 @@
    // If we should check a specific set of attributes, then do that now.
    // Otherwise, check all user attributes.
    Set<AttributeType> matchAttributes = config.getMatchAttribute();
    if ((matchAttributes == null) || matchAttributes.isEmpty())
    if (matchAttributes == null || matchAttributes.isEmpty())
    {
      matchAttributes = userEntry.getUserAttributes().keySet();
    }
@@ -161,7 +161,7 @@
    for (AttributeType t : matchAttributes)
    {
      List<Attribute> attrList = userEntry.getAttribute(t);
      if ((attrList == null) || attrList.isEmpty())
      if (attrList == null || attrList.isEmpty())
      {
        continue;
      }
opendj-server-legacy/src/main/java/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java
@@ -246,13 +246,13 @@
    // Look at the digest portion of the provided credentials.  It must have a
    // length of exactly 32 bytes and be comprised only of hex characters.
    if (digest.length() != (2*MD5_DIGEST_LENGTH))
    if (digest.length() != 2*MD5_DIGEST_LENGTH)
    {
      bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS);
      LocalizableMessage message = ERR_SASLCRAMMD5_INVALID_DIGEST_LENGTH.get(
              digest.length(),
              (2*MD5_DIGEST_LENGTH));
              2*MD5_DIGEST_LENGTH);
      bindOperation.setAuthFailureReason(message);
      return;
    }
@@ -388,7 +388,7 @@
      PasswordPolicyState pwPolicyState = (PasswordPolicyState) authState;
      clearPasswords = pwPolicyState.getClearPasswords();
      if ((clearPasswords == null) || clearPasswords.isEmpty())
      if (clearPasswords == null || clearPasswords.isEmpty())
      {
        bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS);
opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java
@@ -176,7 +176,7 @@
          }
        }
      }
      if ((! found) && (! config.isAllowUnclassifiedCharacters()))
      if (!found && !config.isAllowUnclassifiedCharacters())
      {
        invalidReason.append(ERR_CHARSET_VALIDATOR_ILLEGAL_CHARACTER.get(c));
        return false;
@@ -194,7 +194,7 @@
      {
        // Mandatory character set.
        mandatoryCharacterSets++;
        if ((passwordCount == null) || (passwordCount < minimumCount))
        if (passwordCount == null || passwordCount < minimumCount)
        {
          invalidReason
              .append(ERR_CHARSET_VALIDATOR_TOO_FEW_CHARS_FROM_SET
@@ -220,7 +220,7 @@
      {
        // Mandatory character set.
        mandatoryCharacterSets++;
        if ((passwordCount == null) || (passwordCount < minimumCount))
        if (passwordCount == null || passwordCount < minimumCount)
        {
          invalidReason
              .append(ERR_CHARSET_VALIDATOR_TOO_FEW_CHARS_FROM_RANGE
@@ -464,7 +464,7 @@
        throw new ConfigException(message);
      }
      if (minCharacterSets > (characterSets.size() + characterRanges.size()))
      if (minCharacterSets > characterSets.size() + characterRanges.size())
      {
        LocalizableMessage message = ERR_CHARSET_VALIDATOR_MIN_CHAR_SETS_TOO_BIG
            .get(minCharacterSets);
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java
@@ -324,7 +324,7 @@
                               SearchFilter filter)
         throws DirectoryException
  {
    if ((baseDN == null) && (filter == null))
    if (baseDN == null && filter == null)
    {
      return new DynamicGroupMemberList(groupEntryDN, memberURLs);
    }
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java
@@ -410,7 +410,7 @@
      } catch (Exception e) {}
    }
    return (resultQueue.peek() != null);
    return resultQueue.peek() != null;
  }
opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryCacheCommon.java
@@ -305,7 +305,7 @@
    Set<SearchFilter> searchFilters = new HashSet<>();
    // Convert the string filters to search filters.
    if ((filters != null) && (! filters.isEmpty()))
    if (filters != null && ! filters.isEmpty())
    {
      for (String curFilter: filters)
      {
@@ -317,8 +317,8 @@
        {
          // We couldn't decode this filter. Report an error and continue.
          LocalizableMessage message = decodeErrorMsg.get(String.valueOf(configEntryDN),
            curFilter, (de.getMessage() != null ? de.getMessage() :
              stackTraceToSingleLineString(de)));
            curFilter, de.getMessage() != null ? de.getMessage() :
              stackTraceToSingleLineString(de));
          errorHandler.reportError(message, false,
            ResultCode.INVALID_ATTRIBUTE_SYNTAX);
        }
opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java
@@ -116,7 +116,7 @@
         currentConfig.getMatchAttribute().toArray(new AttributeType[0]);
    Set<DN> cfgBaseDNs = configuration.getMatchBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -126,7 +126,7 @@
      for (DN baseDN : cfgBaseDNs)
      {
        Backend b = DirectoryServer.getBackend(baseDN);
        if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
        if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
        {
          throw new ConfigException(ERR_EXACTMAP_ATTR_UNINDEXED.get(
              configuration.dn(), t.getNameOrOID(), b.getBackendID()));
@@ -201,7 +201,7 @@
    // then use size and time limits to constrain costly searches resulting from
    // non-unique or inefficient criteria.
    Collection<DN> baseDNs = config.getMatchBaseDN();
    if ((baseDNs == null) || baseDNs.isEmpty())
    if (baseDNs == null || baseDNs.isEmpty())
    {
      baseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -246,9 +246,8 @@
          throw new DirectoryException(internalSearch.getResultCode(), message);
      }
      LinkedList<SearchResultEntry> searchEntries =
           internalSearch.getSearchEntries();
      if ((searchEntries != null) && (! searchEntries.isEmpty()))
      LinkedList<SearchResultEntry> searchEntries = internalSearch.getSearchEntries();
      if (searchEntries != null && ! searchEntries.isEmpty())
      {
        if (matchingEntry == null)
        {
@@ -296,7 +295,7 @@
    // Make sure that all of the configured attributes are indexed for equality
    // in all appropriate backends.
    Set<DN> cfgBaseDNs = configuration.getMatchBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -306,7 +305,7 @@
      for (DN baseDN : cfgBaseDNs)
      {
        Backend b = DirectoryServer.getBackend(baseDN);
        if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
        if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
        {
          unacceptableReasons.add(ERR_EXACTMAP_ATTR_UNINDEXED.get(
              configuration.dn(), t.getNameOrOID(), b.getBackendID()));
opendj-server-legacy/src/main/java/org/opends/server/extensions/ExternalSASLMechanismHandler.java
@@ -172,7 +172,7 @@
    }
    LDAPClientConnection lc = (LDAPClientConnection) clientConnection;
    Certificate[] clientCertChain = lc.getClientCertificateChain();
    if ((clientCertChain == null) || (clientCertChain.length == 0)) {
    if (clientCertChain == null || clientCertChain.length == 0) {
      bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS);
      LocalizableMessage message = ERR_SASLEXTERNAL_NO_CLIENT_CERT.get();
      bindOperation.setAuthFailureReason(message);
opendj-server-legacy/src/main/java/org/opends/server/extensions/FilteredStaticGroupMemberList.java
@@ -156,7 +156,7 @@
            break;
          case SUBORDINATES:
            if (baseDN.equals(nextDN) || (! baseDN.isAncestorOf(nextDN)))
            if (baseDN.equals(nextDN) || !baseDN.isAncestorOf(nextDN))
            {
              continue;
            }
opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java
@@ -127,7 +127,7 @@
    // Make sure that the fingerprint attribute is configured for equality in
    // all appropriate backends.
    Set<DN> cfgBaseDNs = configuration.getUserBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -136,7 +136,7 @@
    for (DN baseDN : cfgBaseDNs)
    {
      Backend b = DirectoryServer.getBackend(baseDN);
      if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
      if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
      {
        logger.warn(WARN_SATUACM_ATTR_UNINDEXED, configuration.dn(),
            t.getNameOrOID(), b.getBackendID());
@@ -169,7 +169,7 @@
    String theFingerprintAlgorithm = this.fingerprintAlgorithm;
    // Make sure that a peer certificate was provided.
    if ((certificateChain == null) || (certificateChain.length == 0))
    if (certificateChain == null || certificateChain.length == 0)
    {
      LocalizableMessage message = ERR_FCM_NO_PEER_CERTIFICATE.get();
      throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, message);
@@ -223,7 +223,7 @@
    // If we have an explicit set of base DNs, then use it.  Otherwise, use the
    // set of public naming contexts in the server.
    Collection<DN> baseDNs = config.getUserBaseDN();
    if ((baseDNs == null) || baseDNs.isEmpty())
    if (baseDNs == null || baseDNs.isEmpty())
    {
      baseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -350,7 +350,7 @@
    // Make sure that the fingerprint attribute is configured for equality in
    // all appropriate backends.
    Set<DN> cfgBaseDNs = configuration.getUserBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -359,7 +359,7 @@
    for (DN baseDN : cfgBaseDNs)
    {
      Backend b = DirectoryServer.getBackend(baseDN);
      if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
      if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
      {
        LocalizableMessage message = WARN_SATUACM_ATTR_UNINDEXED.get(
            configuration.dn(), t.getNameOrOID(), b.getBackendID());
opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -1081,11 +1081,9 @@
              .getExtendedResponseProtocolOp();
          final String responseOID = extendedResponse.getOID();
          if ((responseOID != null)
              && responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
          if (OID_NOTICE_OF_DISCONNECTION.equals(responseOID))
          {
            ResultCode resultCode = ResultCode.valueOf(extendedResponse
                .getResultCode());
            ResultCode resultCode = ResultCode.valueOf(extendedResponse.getResultCode());
            /*
             * Since the connection has been disconnected we want to ensure that
@@ -1809,9 +1807,8 @@
                  {
                    long cachedPasswordTime = GeneralizedTime.valueOf(value.toString()).getTimeInMillis();
                    long currentTime = provider.getCurrentTimeMS();
                    long expiryTime = cachedPasswordTime
                        + (cfg.getCachedPasswordTTL() * 1000);
                    foundValidCachedPasswordTime = (expiryTime > currentTime);
                    long expiryTime = cachedPasswordTime + (cfg.getCachedPasswordTTL() * 1000);
                    foundValidCachedPasswordTime = expiryTime > currentTime;
                  }
                  catch (LocalizedIllegalArgumentException e)
                  {
opendj-server-legacy/src/main/java/org/opends/server/extensions/LengthBasedPasswordValidator.java
@@ -81,7 +81,7 @@
    // maximum length is greater than or equal to the minimum length.
    int maxLength = configuration.getMaxPasswordLength();
    int minLength = configuration.getMinPasswordLength();
    if ((maxLength > 0) && (minLength > 0) && (minLength > maxLength))
    if (maxLength > 0 && minLength > 0 && minLength > maxLength)
    {
      LocalizableMessage message =
          ERR_PWLENGTHVALIDATOR_MIN_GREATER_THAN_MAX.get(minLength, maxLength);
@@ -112,14 +112,14 @@
    int numChars = newPassword.toString().length();
    int minLength = config.getMinPasswordLength();
    if ((minLength > 0) && (numChars < minLength))
    if (minLength > 0 && numChars < minLength)
    {
      invalidReason.append(ERR_PWLENGTHVALIDATOR_TOO_SHORT.get(minLength));
      return false;
    }
    int maxLength = config.getMaxPasswordLength();
    if ((maxLength > 0) && (numChars > maxLength))
    if (maxLength > 0 && numChars > maxLength)
    {
      invalidReason.append(ERR_PWLENGTHVALIDATOR_TOO_LONG.get(maxLength));
      return false;
@@ -151,7 +151,7 @@
    // maximum length is greater than or equal to the minimum length.
    int maxLength = configuration.getMaxPasswordLength();
    int minLength = configuration.getMinPasswordLength();
    if ((maxLength > 0) && (minLength > 0) && (minLength > maxLength))
    if (maxLength > 0 && minLength > 0 && minLength > maxLength)
    {
      LocalizableMessage message = ERR_PWLENGTHVALIDATOR_MIN_GREATER_THAN_MAX.get(
              minLength, maxLength);
opendj-server-legacy/src/main/java/org/opends/server/extensions/NotificationPropertyNotificationMessageTemplateElement.java
@@ -63,7 +63,7 @@
  {
    List<String> propertyValues =
         notification.getNotificationProperty(property);
    if ((propertyValues != null) && (! propertyValues.isEmpty()))
    if (propertyValues != null && ! propertyValues.isEmpty())
    {
      buffer.append(propertyValues.get(0));
    }
opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkQueue.java
@@ -336,7 +336,7 @@
      }
    }
    if ((shutdownRequested) || (numFailures > MAX_RETRY_COUNT))
    if (shutdownRequested || numFailures > MAX_RETRY_COUNT)
    {
      if (numFailures > MAX_RETRY_COUNT)
      {
opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkerThread.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.server.extensions;
@@ -123,7 +123,7 @@
   */
  public boolean isActive()
  {
    return (isAlive() && (operation != null));
    return isAlive() && operation != null;
  }
opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java
@@ -904,7 +904,7 @@
        }
        else
        {
          long lockoutTime = lastLoginTime + (lockoutInterval*1000);
          long lockoutTime = lastLoginTime + lockoutInterval*1000;
          long currentTime = pwpState.getCurrentTime();
          int secondsUntilLockout = (int) ((lockoutTime - currentTime) / 1000L);
          if (secondsUntilLockout <= 0)
opendj-server-legacy/src/main/java/org/opends/server/extensions/PlainSASLMechanismHandler.java
@@ -404,8 +404,7 @@
          }
        }
        if ((authZEntry == null) ||
            (! authZEntry.getName().equals(userEntry.getName())))
        if (authZEntry == null || !authZEntry.getName().equals(userEntry.getName()))
        {
          AuthenticationInfo tempAuthInfo =
            new AuthenticationInfo(userEntry,
opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java
@@ -143,7 +143,7 @@
         currentConfig.getMatchAttribute().toArray(new AttributeType[0]);
    Set<DN> cfgBaseDNs = configuration.getMatchBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -153,7 +153,7 @@
      for (DN baseDN : cfgBaseDNs)
      {
        Backend b = DirectoryServer.getBackend(baseDN);
        if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
        if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
        {
          throw new ConfigException(ERR_REGEXMAP_ATTR_UNINDEXED.get(
              configuration.dn(), t.getNameOrOID(), b.getBackendID()));
@@ -218,7 +218,7 @@
    // then use size and time limits to constrain costly searches resulting from
    // non-unique or inefficient criteria.
    Collection<DN> baseDNs = config.getMatchBaseDN();
    if ((baseDNs == null) || baseDNs.isEmpty())
    if (baseDNs == null || baseDNs.isEmpty())
    {
      baseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -265,7 +265,7 @@
      LinkedList<SearchResultEntry> searchEntries =
           internalSearch.getSearchEntries();
      if ((searchEntries != null) && (! searchEntries.isEmpty()))
      if (searchEntries != null && ! searchEntries.isEmpty())
      {
        if (matchingEntry == null)
        {
@@ -313,7 +313,7 @@
    // Make sure that all of the configured attributes are indexed for equality
    // in all appropriate backends.
    Set<DN> cfgBaseDNs = configuration.getMatchBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -323,7 +323,7 @@
      for (DN baseDN : cfgBaseDNs)
      {
        Backend b = DirectoryServer.getBackend(baseDN);
        if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
        if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
        {
          unacceptableReasons.add(ERR_REGEXMAP_ATTR_UNINDEXED.get(
              configuration.dn(), t.getNameOrOID(), b.getBackendID()));
opendj-server-legacy/src/main/java/org/opends/server/extensions/SASLContext.java
@@ -89,7 +89,7 @@
      final String mechanism, final IdentityMapper<?> identityMapper)
      throws SaslException
  {
    return (new SASLContext(saslProps, serverFQDN, mechanism, identityMapper));
    return new SASLContext(saslProps, serverFQDN, mechanism, identityMapper);
  }
@@ -340,7 +340,7 @@
    this.bindOp = bindOp;
    final ByteString clientCredentials = bindOp.getSASLCredentials();
    if ((clientCredentials == null) || (clientCredentials.length() == 0))
    if (clientCredentials == null || clientCredentials.length() == 0)
    {
      final LocalizableMessage msg = ERR_SASL_NO_CREDENTIALS.get(mechanism, mechanism);
      handleError(msg);
@@ -799,8 +799,7 @@
      }
    }
    if ((authzEntry == null) || (!authzEntry.getName().
        equals(authEntry.getName())))
    if (authzEntry == null || !authzEntry.getName().equals(authEntry.getName()))
    {
      // Create temporary authorization information and run it both
      // through the privilege and then the access control subsystems.
@@ -1122,7 +1121,7 @@
      final PasswordPolicyState pwPolicyState = (PasswordPolicyState) authState;
      clearPasswords = pwPolicyState.getClearPasswords();
      if ((clearPasswords == null) || clearPasswords.isEmpty())
      if (clearPasswords == null || clearPasswords.isEmpty())
      {
        setCallbackMsg(ERR_SASL_NO_REVERSIBLE_PASSWORDS.get(mechanism, authEntry.getName()));
        return;
opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java
@@ -136,7 +136,7 @@
    // Make sure that the Directory Server is configured with information about
    // one or more mail servers.
    List<Properties> propList = DirectoryServer.getMailServerPropertySets();
    if ((propList == null) || propList.isEmpty())
    if (propList == null || propList.isEmpty())
    {
      throw new ConfigException(ERR_SMTP_ASNH_NO_MAIL_SERVERS_CONFIGURED.get(configuration.dn()));
    }
@@ -145,8 +145,8 @@
    // address attributes were provided.
    Set<AttributeType> mailAttrs = configuration.getEmailAddressAttributeType();
    Set<String> recipients = configuration.getRecipientAddress();
    if (((mailAttrs == null) || mailAttrs.isEmpty()) &&
        ((recipients == null) || recipients.isEmpty()))
    if ((mailAttrs == null || mailAttrs.isEmpty()) &&
        (recipients == null || recipients.isEmpty()))
    {
      throw new ConfigException(ERR_SMTP_ASNH_NO_RECIPIENTS.get(configuration.dn()));
    }
@@ -518,7 +518,7 @@
    LinkedList<String> recipients = new LinkedList<>();
    Set<AttributeType> addressAttrs = config.getEmailAddressAttributeType();
    Set<String> recipientAddrs = config.getRecipientAddress();
    if ((addressAttrs != null) && (! addressAttrs.isEmpty()))
    if (addressAttrs != null && !addressAttrs.isEmpty())
    {
      Entry userEntry = notification.getUserEntry();
      for (AttributeType t : addressAttrs)
@@ -544,7 +544,7 @@
      if (recipients.isEmpty())
      {
        if ((recipientAddrs == null) || recipientAddrs.isEmpty())
        if (recipientAddrs == null || recipientAddrs.isEmpty())
        {
          // There are no recipients at all, so there's no point in generating
          // the message.  Return without doing anything.
@@ -660,7 +660,7 @@
    // Make sure that the Directory Server is configured with information about
    // one or more mail servers.
    List<Properties> propList = DirectoryServer.getMailServerPropertySets();
    if ((propList == null) || propList.isEmpty())
    if (propList == null || propList.isEmpty())
    {
      unacceptableReasons.add(ERR_SMTP_ASNH_NO_MAIL_SERVERS_CONFIGURED.get(configuration.dn()));
      configAcceptable = false;
@@ -671,8 +671,8 @@
    // address attributes were provided.
    Set<AttributeType> mailAttrs = configuration.getEmailAddressAttributeType();
    Set<String> recipients = configuration.getRecipientAddress();
    if (((mailAttrs == null) || mailAttrs.isEmpty()) &&
        ((recipients == null) || recipients.isEmpty()))
    if ((mailAttrs == null || mailAttrs.isEmpty()) &&
        (recipients == null || recipients.isEmpty()))
    {
      unacceptableReasons.add(ERR_SMTP_ASNH_NO_RECIPIENTS.get(configuration.dn()));
      configAcceptable = false;
opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAlertHandler.java
@@ -83,11 +83,10 @@
  {
    // Make sure that the Directory Server is configured with information about
    // at least one SMTP server.
    if ((DirectoryServer.getMailServerPropertySets() == null) ||
    if (DirectoryServer.getMailServerPropertySets() == null ||
        DirectoryServer.getMailServerPropertySets().isEmpty())
    {
      LocalizableMessage message = ERR_SMTPALERTHANDLER_NO_SMTP_SERVERS.get();
      throw new ConfigException(message);
      throw new ConfigException(ERR_SMTPALERTHANDLER_NO_SMTP_SERVERS.get());
    }
    configuration.addSMTPChangeListener(this);
opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java
@@ -167,7 +167,7 @@
    // Make sure that a peer certificate was provided.
    if ((certificateChain == null) || (certificateChain.length == 0))
    if (certificateChain == null || certificateChain.length == 0)
    {
      LocalizableMessage message = ERR_SATUACM_NO_PEER_CERTIFICATE.get();
      throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, message);
@@ -358,7 +358,7 @@
  private Set<DN> getUserBaseDNs(SubjectAttributeToUserAttributeCertificateMapperCfg config)
  {
    Set<DN> baseDNs = config.getUserBaseDN();
    if ((baseDNs == null) || baseDNs.isEmpty())
    if (baseDNs == null || baseDNs.isEmpty())
    {
      baseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -383,7 +383,7 @@
      String certAttrName = lowerMap.substring(0, colonPos).trim();
      String userAttrName = lowerMap.substring(colonPos+1).trim();
      if ((certAttrName.length() == 0) || (userAttrName.length() == 0))
      if (certAttrName.length() == 0 || userAttrName.length() == 0)
      {
        ccr.setResultCodeIfSuccess(ResultCode.CONSTRAINT_VIOLATION);
        ccr.addMessage(ERR_SATUACM_INVALID_MAP_FORMAT.get(cfgEntryDN, mapStr));
opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java
@@ -110,7 +110,7 @@
    // Make sure that the subject attribute is configured for equality in all
    // appropriate backends.
    Set<DN> cfgBaseDNs = configuration.getUserBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -119,7 +119,7 @@
    for (DN baseDN : cfgBaseDNs)
    {
      Backend b = DirectoryServer.getBackend(baseDN);
      if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
      if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
      {
        logger.warn(WARN_SATUACM_ATTR_UNINDEXED, configuration.dn(),
            t.getNameOrOID(), b.getBackendID());
@@ -153,7 +153,7 @@
    // Make sure that a peer certificate was provided.
    if ((certificateChain == null) || (certificateChain.length == 0))
    if (certificateChain == null || certificateChain.length == 0)
    {
      LocalizableMessage message = ERR_SDTUACM_NO_PEER_CERTIFICATE.get();
      throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, message);
@@ -186,7 +186,7 @@
    // If we have an explicit set of base DNs, then use it.  Otherwise, use the
    // set of public naming contexts in the server.
    Collection<DN> baseDNs = config.getUserBaseDN();
    if ((baseDNs == null) || baseDNs.isEmpty())
    if (baseDNs == null || baseDNs.isEmpty())
    {
      baseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectEqualsDNCertificateMapper.java
@@ -101,7 +101,7 @@
         throws DirectoryException
  {
    // Make sure that a peer certificate was provided.
    if ((certificateChain == null) || (certificateChain.length == 0))
    if (certificateChain == null || certificateChain.length == 0)
    {
      LocalizableMessage message = ERR_SEDCM_NO_PEER_CERTIFICATE.get();
      throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, message);
opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java
@@ -468,13 +468,13 @@
      final long etime = operation.getProcessingTime();
      final Integer etimeGT = cfg.getResponseEtimeGreaterThan();
      if (etimeGT != null && etime <= ((long) etimeGT))
      if (etimeGT != null && etime <= etimeGT)
      {
        return false;
      }
      final Integer etimeLT = cfg.getResponseEtimeLessThan();
      if (etimeLT != null && etime >= ((long) etimeLT))
      if (etimeLT != null && etime >= etimeLT)
      {
        return false;
      }
@@ -583,7 +583,7 @@
          final Group<?> group = groupManager.getGroupInstance(groupDN);
          try
          {
            if ((group != null) && group.isMember(userEntry))
            if (group != null && group.isMember(userEntry))
            {
              return false;
            }
@@ -602,7 +602,7 @@
          final Group<?> group = groupManager.getGroupInstance(groupDN);
          try
          {
            if ((group != null) && group.isMember(userEntry))
            if (group != null && group.isMember(userEntry))
            {
              return true;
            }
opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugMessageFormatter.java
@@ -26,7 +26,11 @@
 */
package org.opends.server.loggers;
import java.util.*;
import java.util.Arrays;
import java.util.IllegalFormatException;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
 * This class is responsible for formatting messages and replacing
@@ -69,8 +73,10 @@
  private static void concatenateArgs(Object[] args, StringBuilder buffer)
  {
    for (int i = 0; (args != null) && (i < args.length); i++) {
      buffer.append(" ").append(args[i]);
    if (args != null) {
      for (Object arg : args) {
        buffer.append(" ").append(arg);
      }
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugTracer.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.loggers;
@@ -114,7 +114,7 @@
    StackTraceElement[] stackTrace = null;
    StackTraceElement[] filteredStackTrace = null;
    StackTraceElement callerFrame = null;
    final boolean hasException = (exception != null);
    final boolean hasException = exception != null;
    for (PublisherSettings settings : publisherSettings)
    {
      TraceSettings activeSettings = settings.classSettings;
opendj-server-legacy/src/main/java/org/opends/server/loggers/MultifileTextWriter.java
@@ -218,7 +218,7 @@
    if(policy instanceof SizeBasedRotationPolicy)
    {
      SizeBasedRotationPolicy sizePolicy = ((SizeBasedRotationPolicy)policy);
      SizeBasedRotationPolicy sizePolicy = (SizeBasedRotationPolicy) policy;
      if(sizeLimit == 0 ||
          sizeLimit > sizePolicy.currentConfig.getFileSizeLimit())
      {
@@ -251,7 +251,7 @@
        sizeLimit = 0;
        // Remove this as a change listener.
        SizeBasedRotationPolicy sizePolicy = ((SizeBasedRotationPolicy)policy);
        SizeBasedRotationPolicy sizePolicy = (SizeBasedRotationPolicy) policy;
        sizePolicy.currentConfig.removeSizeLimitChangeListener(this);
      }
    }
@@ -360,26 +360,17 @@
  {
    long newSizeLimit = Integer.MAX_VALUE;
    // Go through all current size rotation policies and get the
    // lowest size setting.
    // Go through all current size rotation policies and get the lowest size setting.
    for(RotationPolicy policy : rotationPolicies)
    {
      if(policy instanceof SizeBasedRotationPolicy)
      {
        SizeBasedRotationPolicy sizePolicy = ((SizeBasedRotationPolicy)policy);
        if(sizePolicy.currentConfig.dn().equals(config.dn()) )
        SizeBasedRotationPolicy sizePolicy = (SizeBasedRotationPolicy) policy;
        SizeLimitLogRotationPolicyCfg cfg =
            sizePolicy.currentConfig.dn().equals(config.dn()) ? config : sizePolicy.currentConfig;
        if(newSizeLimit > cfg.getFileSizeLimit())
        {
          if(newSizeLimit > config.getFileSizeLimit())
          {
            newSizeLimit = config.getFileSizeLimit();
          }
        }
        else
        {
          if(newSizeLimit > sizePolicy.currentConfig.getFileSizeLimit())
          {
            newSizeLimit = sizePolicy.currentConfig.getFileSizeLimit();
          }
          newSizeLimit = cfg.getFileSizeLimit();
        }
      }
    }
opendj-server-legacy/src/main/java/org/opends/server/loggers/RotationActionThread.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.loggers;
@@ -86,34 +86,20 @@
            action = new ZIPAction(filename, zipFile, true);
            break;
          case SIGN:
           //String alias = RotationConfigUtil.getCertificateAlias(configEntry);
            //action = new SignatureAction(filename, alias);
            break;
          case ENCRYPT:
          //String certAlias =
            //  RotationConfigUtil.getCertificateAlias(configEntry);
            // FIXME - make the encryption algorithm configurable.
            //action = new EncryptAction(filename, encFile, false, certAlias,
            //                           "RSA");
            break;
          default:
            System.err.println("Invalid post rollover action:" + at);
            break;
        }
        if(action != null)
        {
          boolean val = action.execute();
          if(val == false)
        if(action != null && !action.execute())
          {
            System.err.println("Post rotation action failed.");
          }
        }
      }
    } catch(Exception e)
    {
      logger.traceException(e);
    }
  }
}
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextAccessLogPublisher.java
@@ -166,8 +166,7 @@
            && !config.isAsynchronous())
        {
          // The asynchronous setting is being turned off.
          final AsynchronousTextWriter asyncWriter =
            ((AsynchronousTextWriter) writer);
          final AsynchronousTextWriter asyncWriter = (AsynchronousTextWriter) writer;
          writer = mfWriter;
          asyncWriter.shutdown(false);
        }
@@ -175,7 +174,7 @@
        if (writer instanceof ParallelTextWriter && !config.isAsynchronous())
        {
          // The asynchronous setting is being turned off.
          final ParallelTextWriter asyncWriter = ((ParallelTextWriter) writer);
          final ParallelTextWriter asyncWriter = (ParallelTextWriter) writer;
          writer = mfWriter;
          asyncWriter.shutdown(false);
        }
@@ -195,8 +194,8 @@
              config.isAutoFlush(), mfWriter);
        }
        if ((cfg.isAsynchronous() && config.isAsynchronous())
            && (cfg.getQueueSize() != config.getQueueSize()))
        if (cfg.isAsynchronous() && config.isAsynchronous()
            && cfg.getQueueSize() != config.getQueueSize())
        {
          ccr.setAdminActionRequired(true);
        }
@@ -1198,7 +1197,7 @@
    buffer.append(operation.getResultCode().intValue());
    final LocalizableMessageBuilder msg = operation.getErrorMessage();
    if ((msg != null) && (msg.length() > 0))
    if (msg != null && msg.length() > 0)
    {
      appendLabel(buffer, "message", msg);
    }
@@ -1337,7 +1336,7 @@
    searchOperation.getRawFilter().toString(buffer);
    final Set<String> attrs = searchOperation.getAttributes();
    if ((attrs == null) || attrs.isEmpty())
    if (attrs == null || attrs.isEmpty())
    {
      buffer.append("\" attrs=\"ALL\"");
    }
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextAuditLogPublisher.java
@@ -118,9 +118,8 @@
        if (writer instanceof AsynchronousTextWriter
            && !config.isAsynchronous())
        {
          // The asynronous setting is being turned off.
          AsynchronousTextWriter asyncWriter =
              ((AsynchronousTextWriter) writer);
          // The asynchronous setting is being turned off.
          AsynchronousTextWriter asyncWriter = (AsynchronousTextWriter) writer;
          writer = mfWriter;
          asyncWriter.shutdown(false);
        }
@@ -133,8 +132,8 @@
              config.getQueueSize(), config.isAutoFlush(), mfWriter);
        }
        if ((cfg.isAsynchronous() && config.isAsynchronous())
            && (cfg.getQueueSize() != config.getQueueSize()))
        if (cfg.isAsynchronous() && config.isAsynchronous()
            && cfg.getQueueSize() != config.getQueueSize())
        {
          ccr.setAdminActionRequired(true);
        }
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextDebugLogPublisher.java
@@ -280,8 +280,7 @@
        if(writer instanceof AsynchronousTextWriter && !config.isAsynchronous())
        {
          // The asynchronous setting is being turned off.
          AsynchronousTextWriter asyncWriter =
              ((AsynchronousTextWriter)writer);
          AsynchronousTextWriter asyncWriter = (AsynchronousTextWriter) writer;
          writer = mfWriter;
          asyncWriter.shutdown(false);
        }
@@ -294,8 +293,8 @@
              config.getQueueSize(), config.isAutoFlush(), mfWriter);
        }
        if((currentConfig.isAsynchronous() && config.isAsynchronous()) &&
            (currentConfig.getQueueSize() != config.getQueueSize()))
        if(currentConfig.isAsynchronous() && config.isAsynchronous() &&
            currentConfig.getQueueSize() != config.getQueueSize())
        {
          ccr.setAdminActionRequired(true);
        }
opendj-server-legacy/src/main/java/org/opends/server/loggers/ThreadFilterTextErrorLogPublisher.java
@@ -111,8 +111,8 @@
  public boolean isEnabledFor(String category, Severity severity)
  {
    Thread currentThread = Thread.currentThread();
    return (this.thread.equals(currentThread) || this.thread.getThreadGroup()
        .equals(currentThread.getThreadGroup()));
    return this.thread.equals(currentThread)
        || this.thread.getThreadGroup().equals(currentThread.getThreadGroup());
  }
  /** {@inheritDoc} */
opendj-server-legacy/src/main/java/org/opends/server/monitors/EntryCacheMonitorProvider.java
@@ -127,9 +127,9 @@
  @Override
  public List<Attribute> getMonitorData()
  {
    if ((entryCache != null) &&
        (monitorConfiguration != null) &&
        (monitorConfiguration.isEnabled())) {
    if (entryCache != null &&
        monitorConfiguration != null &&
        monitorConfiguration.isEnabled()) {
      // Get monitor data from the cache.
      return entryCache.getMonitorData();
    }
opendj-server-legacy/src/main/java/org/opends/server/monitors/MemoryUsageMonitorProvider.java
@@ -100,7 +100,7 @@
      {
        long recentGCCount = gcCount - lastGCCount;
        long recentGCTime  = gcTime  - lastGCTime;
        recentGCDuration   = (recentGCTime / recentGCCount);
        recentGCDuration   = recentGCTime / recentGCCount;
      }
      lastGCCounts.put(gcName, gcCount);
@@ -233,7 +233,7 @@
        if (Character.isUpperCase(c))
        {
          char lowerCaseCharacter = Character.toLowerCase(c);
          if ((buffer.length() > 0) && (! lastWasUppercase) && (! lastWasDash))
          if (buffer.length() > 0 && !lastWasUppercase && !lastWasDash)
          {
            buffer.append('-');
          }
@@ -255,7 +255,7 @@
        lastWasUppercase = false;
        lastWasDash = false;
      }
      else if ((c == ' ') || (c == '_') || (c == '-'))
      else if (c == ' ' || c == '_' || c == '-')
      {
        if (! lastWasDash)
        {
opendj-server-legacy/src/main/java/org/opends/server/monitors/SystemInfoMonitorProvider.java
@@ -147,7 +147,7 @@
    // Get the JVM input arguments.
    RuntimeMXBean rtBean = ManagementFactory.getRuntimeMXBean();
    List<String> jvmArguments = rtBean.getInputArguments();
    if ((jvmArguments != null) && (! jvmArguments.isEmpty()))
    if (jvmArguments != null && ! jvmArguments.isEmpty())
    {
      StringBuilder argList = new StringBuilder();
      for (String jvmArg : jvmArguments)
opendj-server-legacy/src/main/java/org/opends/server/monitors/VersionMonitorProvider.java
@@ -178,7 +178,7 @@
                              String.valueOf(DynamicConstants.POINT_VERSION)));
    String versionQualifier = DynamicConstants.VERSION_QUALIFIER;
    if ((versionQualifier != null) && (versionQualifier.length() > 0))
    if (versionQualifier != null && versionQualifier.length() > 0)
    {
      attrs.add(createAttribute(ATTR_VERSION_QUALIFIER, versionQualifier));
    }
@@ -191,7 +191,7 @@
    }
    String fixIDs = DynamicConstants.FIX_IDS;
    if ((fixIDs != null) && (fixIDs.length() > 0))
    if (fixIDs != null && fixIDs.length() > 0)
    {
      attrs.add(createAttribute(ATTR_FIX_IDS, fixIDs));
    }
opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java
@@ -302,9 +302,9 @@
       * ignore attribute options.
       */
      final int semicolonPos = toAttr.indexOf(";");
      final String toAttrType = (semicolonPos < 0)
          && (semicolonPos < (toAttr.length() - 1)) ? toAttr : toAttr
          .substring(semicolonPos + 1);
      final String toAttrType = semicolonPos < 0 && semicolonPos < toAttr.length() - 1
          ? toAttr
          : toAttr.substring(semicolonPos + 1);
      if (DirectoryServer.getAttributeType(toLowerCase(toAttrType)) == null)
      {
opendj-server-legacy/src/main/java/org/opends/server/plugins/ChangeNumberControlPlugin.java
@@ -286,7 +286,7 @@
   */
  private void processCsnControl(PostOperationOperation operation) {
    List<Control> requestControls = operation.getRequestControls();
    if ((requestControls != null) && (! requestControls.isEmpty())) {
    if (requestControls != null && ! requestControls.isEmpty()) {
      for (Control c : requestControls) {
        if (c.getOID().equals(OID_CSN_CONTROL)) {
          OperationContext ctx = (OperationContext)
opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
@@ -455,7 +455,7 @@
    for (AttributeType t : authPasswordTypes)
    {
      attrList = entry.getAttribute(t);
      if ((attrList == null) || attrList.isEmpty())
      if (attrList == null || attrList.isEmpty())
      {
        continue;
      }
@@ -505,7 +505,7 @@
    for (AttributeType t : userPasswordTypes)
    {
      attrList = entry.getAttribute(t);
      if ((attrList == null) || attrList.isEmpty())
      if (attrList == null || attrList.isEmpty())
      {
        continue;
      }
opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -299,7 +299,7 @@
    }
    Set<DN> cfgBaseDNs = pluginCfg.getBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -322,7 +322,7 @@
      for (DN baseDN : cfgBaseDNs)
      {
        Backend<?> b = DirectoryServer.getBackend(baseDN);
        if ((b != null) && (!b.isIndexed(type, IndexType.EQUALITY)))
        if (b != null && !b.isIndexed(type, IndexType.EQUALITY))
        {
          isAcceptable = false;
          unacceptableReasons.add(ERR_PLUGIN_REFERENT_ATTR_UNINDEXED.get(
@@ -413,7 +413,7 @@
    DN newEntryDN=modifyDNOperation.getUpdatedEntry().getName();
    modDNmap.put(oldEntryDN, newEntryDN);
    processModifyDN(modDNmap, (interval != 0));
    processModifyDN(modDNmap, interval != 0);
    return PluginResult.PostOperation.continueOperationProcessing();
  }
@@ -442,7 +442,7 @@
    }
    deleteDNset.add(deleteOperation.getEntryDN());
    processDelete(deleteDNset, (interval != 0));
    processDelete(deleteDNset, interval != 0);
    return PluginResult.PostOperation.continueOperationProcessing();
  }
@@ -494,8 +494,8 @@
   */
  private boolean isAttributeSyntaxValid(AttributeType attribute)
  {
    return (attribute.getSyntax().getOID().equals(SYNTAX_DN_OID) ||
            attribute.getSyntax().getOID().equals(SYNTAX_NAME_AND_OPTIONAL_UID_OID));
    return attribute.getSyntax().getOID().equals(SYNTAX_DN_OID) ||
            attribute.getSyntax().getOID().equals(SYNTAX_NAME_AND_OPTIONAL_UID_OID);
  }
  /**
@@ -1086,8 +1086,8 @@
      /* Process only ADD and REPLACE modification types.
       */
      if ((modType != ModificationType.ADD)
          && (modType != ModificationType.REPLACE))
      if (modType != ModificationType.ADD
          && modType != ModificationType.REPLACE)
      {
        break;
      }
opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java
@@ -209,7 +209,7 @@
      //
      // fill the current word
      //
      while ((xBufOff != 0) && (len > 0))
      while (xBufOff != 0 && len > 0)
      {
        update(in[inOff]);
@@ -255,7 +255,7 @@
    private void finish()
    {
      final long bitLength = (byteCount << 3);
      final long bitLength = byteCount << 3;
      //
      // add the pad bytes.
@@ -400,7 +400,7 @@
     */
    private int rotateLeft(final int x, final int n)
    {
      return (x << n) | (x >>> (32 - n));
      return (x << n) | (x >>> 32 - n);
    }
@@ -478,17 +478,17 @@
    }
    key8[0] = key7[0];
    key8[1] = ((key7[0] << 7) & 0xFF | (key7[1] >> 1));
    key8[2] = ((key7[1] << 6) & 0xFF | (key7[2] >> 2));
    key8[3] = ((key7[2] << 5) & 0xFF | (key7[3] >> 3));
    key8[4] = ((key7[3] << 4) & 0xFF | (key7[4] >> 4));
    key8[5] = ((key7[4] << 3) & 0xFF | (key7[5] >> 5));
    key8[6] = ((key7[5] << 2) & 0xFF | (key7[6] >> 6));
    key8[7] = (key7[6] << 1);
    key8[1] = ((key7[0] << 7) & 0xFF) | (key7[1] >> 1);
    key8[2] = ((key7[1] << 6) & 0xFF) | (key7[2] >> 2);
    key8[3] = ((key7[2] << 5) & 0xFF) | (key7[3] >> 3);
    key8[4] = ((key7[3] << 4) & 0xFF) | (key7[4] >> 4);
    key8[5] = ((key7[4] << 3) & 0xFF) | (key7[5] >> 5);
    key8[6] = ((key7[5] << 2) & 0xFF) | (key7[6] >> 6);
    key8[7] = key7[6] << 1;
    for (int i = 0; i < 8; i++)
    {
      key64[i] = (byte) (setOddParity(key8[i]));
      key64[i] = (byte) setOddParity(key8[i]);
    }
    return key64;
@@ -600,10 +600,10 @@
   */
  private static int setOddParity(final int parity)
  {
    final boolean hasEvenBits = ((parity >>> 7) ^ (parity >>> 6)
                               ^ (parity >>> 5) ^ (parity >>> 4)
                               ^ (parity >>> 3) ^ (parity >>> 2)
                               ^ (parity >>> 1) & 0x01) == 0;
    final boolean hasEvenBits = (parity >>> 7 ^ parity >>> 6
                               ^ parity >>> 5 ^ parity >>> 4
                               ^ parity >>> 3 ^ parity >>> 2
                               ^ ((parity >>> 1) & 0x01)) == 0;
    if (hasEvenBits)
    {
      return parity | 0x01;
opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java
@@ -136,7 +136,7 @@
    }
    Set<DN> cfgBaseDNs = configuration.getBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -146,7 +146,7 @@
      for (DN baseDN : cfgBaseDNs)
      {
        Backend b = DirectoryServer.getBackend(baseDN);
        if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
        if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
        {
          throw new ConfigException(ERR_PLUGIN_UNIQUEATTR_ATTR_UNINDEXED.get(
              configuration.dn(), t.getNameOrOID(), b.getBackendID()));
@@ -578,7 +578,7 @@
  private Set<DN> getBaseDNs(UniqueAttributePluginCfg config, DN entryDN)
  {
    Set<DN> baseDNs = config.getBaseDN();
    if ((baseDNs == null) || baseDNs.isEmpty())
    if (baseDNs == null || baseDNs.isEmpty())
    {
      baseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -716,7 +716,7 @@
    }
    Set<DN> cfgBaseDNs = configuration.getBaseDN();
    if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty())
    if (cfgBaseDNs == null || cfgBaseDNs.isEmpty())
    {
      cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet();
    }
@@ -726,7 +726,7 @@
      for (DN baseDN : cfgBaseDNs)
      {
        Backend b = DirectoryServer.getBackend(baseDN);
        if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
        if (b != null && ! b.isIndexed(t, IndexType.EQUALITY))
        {
          unacceptableReasons.add(ERR_PLUGIN_UNIQUEATTR_ATTR_UNINDEXED.get(
              configuration.dn(), t.getNameOrOID(), b.getBackendID()));
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStack.java
@@ -86,7 +86,7 @@
    methodNames = new String[numFrames];
    lineNumbers = new int[numFrames];
    for (int i=0, j=(numFrames-1); i < numFrames; i++,j--)
    for (int i=0, j=numFrames-1; i < numFrames; i++,j--)
    {
      classNames[i]  = stackElements[j].getClassName();
      methodNames[i] = stackElements[j].getMethodName();
@@ -228,16 +228,12 @@
   */
  public int hashCode()
  {
    if (numFrames == 0)
    if (numFrames != 0)
    {
      return classNames[0].hashCode() + methodNames[0].hashCode() + lineNumbers[0];
    }
      return 0;
    }
    else
    {
      return (classNames[0].hashCode() + methodNames[0].hashCode() +
              lineNumbers[0]);
    }
  }
@@ -273,9 +269,9 @@
      for (int i=0; i < numFrames; i++)
      {
        if ((lineNumbers[i] != s.lineNumbers[i]) ||
            (! classNames[i].equals(s.classNames[i])) ||
            (! methodNames[i].equals(s.methodNames[i])))
        if (lineNumbers[i] != s.lineNumbers[i] ||
            !classNames[i].equals(s.classNames[i]) ||
            !methodNames[i].equals(s.methodNames[i]))
        {
          return false;
        }
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java
@@ -231,7 +231,7 @@
   */
  public boolean hasSubFrames()
  {
    return (! subordinateFrames.isEmpty());
    return !subordinateFrames.isEmpty();
  }
@@ -280,7 +280,7 @@
    }
    stackMap.put(stack, count);
    subFrame.recurseSubFrames(stack, (depth-1), count, stacksByMethod);
    subFrame.recurseSubFrames(stack, depth-1, count, stacksByMethod);
  }
@@ -294,7 +294,7 @@
  @Override
  public int hashCode()
  {
    return (className.hashCode() + methodName.hashCode());
    return className.hashCode() + methodName.hashCode();
  }
@@ -324,7 +324,7 @@
    try
    {
      ProfileStackFrame f = (ProfileStackFrame) o;
      return (className.equals(f.className) && methodName.equals(f.methodName));
      return className.equals(f.className) && methodName.equals(f.methodName);
    }
    catch (Exception e)
    {
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java
@@ -238,7 +238,7 @@
      long startTime = reader.readInteger();
      long stopTime  = reader.readInteger();
      totalDuration += (stopTime - startTime);
      totalDuration += stopTime - startTime;
      reader.readEndSequence();
@@ -643,7 +643,7 @@
                               String highlightClassAndMethod)
  {
    int numFrames = stack.getNumFrames();
    for (int i=(numFrames-1); i >= 0; i--)
    for (int i=numFrames-1; i >= 0; i--)
    {
      html.append("<BR>     ");
@@ -651,8 +651,7 @@
      String methodName = stack.getMethodName(i);
      int    lineNumber = stack.getLineNumber(i);
      String safeMethod =
           (methodName.equals("<init>") ? "&lt;init&gt;" : methodName);
      String safeMethod = methodName.equals("<init>") ? "&lt;init&gt;" : methodName;
      String classAndMethod = className + "." + methodName;
      if (classAndMethod.equals(highlightClassAndMethod))
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java
@@ -130,7 +130,7 @@
        // We'll skip over any stack that doesn't have any information.
        StackTraceElement[] threadStack = stacks.get(t);
        if ((threadStack == null) || (threadStack.length == 0))
        if (threadStack == null || threadStack.length == 0)
        {
          continue;
        }
opendj-server-legacy/src/main/java/org/opends/server/protocols/LDIFConnectionHandler.java
@@ -177,8 +177,7 @@
      {
        try
        {
          if ((connectionHandlerThread != null) &&
              (connectionHandlerThread.isAlive()))
          if (connectionHandlerThread != null && connectionHandlerThread.isAlive())
          {
            connectionHandlerThread.join(100);
            connectionHandlerThread.interrupt();
@@ -442,7 +441,7 @@
          writer.writeComment(m, 78);
          LocalizableMessageBuilder errorMessage = operation.getErrorMessage();
          if ((errorMessage != null) && (errorMessage.length() > 0))
          if (errorMessage != null && errorMessage.length() > 0)
          {
            m = INFO_LDIF_CONNHANDLER_ERROR_MESSAGE.get(errorMessage);
            writer.writeComment(m, 78);
@@ -456,7 +455,7 @@
          }
          List<String> referralURLs = operation.getReferralURLs();
          if ((referralURLs != null) && (! referralURLs.isEmpty()))
          if (referralURLs != null && !referralURLs.isEmpty())
          {
            for (String url : referralURLs)
            {
@@ -485,7 +484,7 @@
      close(reader, writer);
    }
    if (errorEncountered || (! fullyProcessed))
    if (errorEncountered || !fullyProcessed)
    {
      String renamedPath = inputPath + ".errors-encountered." +
                           TimeThread.getGMTTime();
opendj-server-legacy/src/main/java/org/opends/server/protocols/asn1/GSERParser.java
@@ -22,13 +22,11 @@
 *
 *
 *      Copyright 2013-2014 Manuel Gaupp
 *      Copyright 2014 ForgeRock AS
 *      Copyright 2014-2015 ForgeRock AS
 *      Portions Copyright 2014 ForgeRock AS
 */
package org.opends.server.protocols.asn1;
import java.math.BigInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -36,8 +34,6 @@
import static org.opends.messages.ProtocolMessages.*;
import static org.forgerock.util.Reject.*;
/**
 * This class implements a parser for strings which are encoded using the
 * Generic String Encoding Rules (GSER) defined in RFC 3641.
@@ -50,9 +46,7 @@
{
  private String gserValue;
  private int pos;
  private int length;
  /**
@@ -184,7 +178,7 @@
   */
  public boolean hasNext()
  {
    return (pos < length);
    return pos < length;
  }
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java
@@ -524,7 +524,7 @@
  {
    HTTPConnectionHandlerCfg config = (HTTPConnectionHandlerCfg) configuration;
    if ((currentConfig == null) || (!this.enabled && config.isEnabled()))
    if (currentConfig == null || (!this.enabled && config.isEnabled()))
    {
      // Attempt to bind to the listen port on all configured addresses to
      // verify whether the connection handler will be able to start.
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
@@ -238,7 +238,7 @@
  private static AuthenticationInfo getAuthInfoForDN(DN userDN)
          throws DirectoryException
  {
    if ((userDN == null) || userDN.isRootDN())
    if (userDN == null || userDN.isRootDN())
    {
      return new AuthenticationInfo();
    }
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPInputStream.java
@@ -146,7 +146,7 @@
   * from this input stream without blocking.
   *
   * @return  The number of bytes that can be read (or skipped over)
   *          from this input stream wihtout blocking.
   *          from this input stream without blocking.
   * @throws IOException if an I/O error occurs.
   */
  @Override
@@ -155,7 +155,7 @@
    if (messageReader.remaining() < 1)
    {
      LDAPMessage message = messageQueue.poll();
      if ((message == null) || (message instanceof NullLDAPMessage))
      if (message == null || message instanceof NullLDAPMessage)
      {
        if (message != null)
        {
@@ -222,7 +222,7 @@
  /**
   * Marks the current position in the input stream.  This will not
   * have any effect, as this input stream inplementation does not
   * have any effect, as this input stream implementation does not
   * support marking.
   *
   * @param  readLimit  The maximum limit of bytes that can be read
@@ -237,7 +237,7 @@
  /**
   * Indicates whether this input stream inplementation supports the
   * Indicates whether this input stream implementation supports the
   * use of the {@code mark} and {@code reset} methods.  This
   * implementation does not support that functionality.
   *
@@ -280,7 +280,7 @@
        message = new NullLDAPMessage();
      }
      if ((message == null) || (message instanceof NullLDAPMessage))
      if (message == null || message instanceof NullLDAPMessage)
      {
        if (message instanceof NullLDAPMessage)
        {
@@ -299,7 +299,7 @@
      }
    }
    return (0xFF & messageReader.get());
    return 0xFF & messageReader.get();
  }
@@ -362,7 +362,7 @@
        message = new NullLDAPMessage();
      }
      if ((message == null) || (message instanceof NullLDAPMessage))
      if (message == null || message instanceof NullLDAPMessage)
      {
        if (message instanceof NullLDAPMessage)
        {
@@ -391,7 +391,7 @@
  /**
   * Repositions this stream to the position at the time that the
   * {@code mark} method was called on this stream.  This will not
   * have any effect, as this input stream inplementation does not
   * have any effect, as this input stream implementation does not
   * support marking.
   */
  @Override
@@ -465,7 +465,6 @@
  @Override
  public String toString()
  {
    return "InternalLDAPInputStream";
    return getClass().getSimpleName();
  }
}
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPOutputStream.java
@@ -738,7 +738,7 @@
    }
    catch (DirectoryException e)
    {
      final String cause = (baseDN == null ? "baseDN" : "filter");
      final String cause = baseDN == null ? "baseDN" : "filter";
      throw error(LocalizableMessage.raw("Could not decode " + cause), e);
    }
    SearchRequest sr = newSearchRequest(baseDN, request.getScope(), filter)
@@ -791,20 +791,16 @@
         new SearchResultEntryProtocolOp(searchEntry);
    socket.getInputStream().addLDAPMessage(
         new LDAPMessage(searchOperation.getMessageID(), entry,
                         entryControls));
         new LDAPMessage(searchOperation.getMessageID(), entry, entryControls));
  }
  /**
   * Performs any processing necessary for the provided search result
   * reference.
   * Performs any processing necessary for the provided search result reference.
   *
   * @param  searchOperation  The internal search operation being
   *                          processed.
   * @param  searchReference  The search result reference to be
   *                          processed.
   * @param  searchOperation  The internal search operation being processed.
   * @param  searchReference  The search result reference to be processed.
   */
  @Override
  @org.opends.server.types.PublicAPI(
@@ -836,7 +832,6 @@
  @Override
  public String toString()
  {
    return "InternalLDAPOutputStream";
    return getClass().getSimpleName();
  }
}
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPSocket.java
@@ -612,7 +612,7 @@
  @Override
  public boolean isConnected()
  {
    return (! closed);
    return !closed;
  }
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/DirectoryRMIServerSocketFactory.java
@@ -169,7 +169,7 @@
    }
    DirectoryRMIServerSocketFactory that =
      (DirectoryRMIServerSocketFactory) obj;
    return (getClass().equals(that.getClass()) && checkParameters(that));
    return getClass().equals(that.getClass()) && checkParameters(that);
  }
  /**
@@ -193,8 +193,7 @@
  public int hashCode()
  {
    return getClass().hashCode()
        + (needClientCertificate ? Boolean.TRUE.hashCode() : Boolean.FALSE
            .hashCode()) + (sslSocketFactory.hashCode());
        + Boolean.valueOf(needClientCertificate).hashCode()
        + sslSocketFactory.hashCode();
  }
}
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxConnectionHandler.java
@@ -130,12 +130,8 @@
      rmiConnectorRestart = true;
    }
    if (((currentConfig.getSSLCertNickname() != null) &&
          !currentConfig.getSSLCertNickname().equals(
          config.getSSLCertNickname())) ||
        ((config.getSSLCertNickname() != null) &&
          !config.getSSLCertNickname().equals(
          currentConfig.getSSLCertNickname()))) {
    if (notEqualsNotNull(config.getSSLCertNickname(), currentConfig.getSSLCertNickname())
        || notEqualsNotNull(config.getSSLCertNickname(), currentConfig.getSSLCertNickname())) {
      rmiConnectorRestart = true;
    }
@@ -179,6 +175,10 @@
  }
  private boolean notEqualsNotNull(String o1, String o2)
  {
    return o1 != null && !o1.equals(o2);
  }
  /** {@inheritDoc} */
  @Override
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddRequestProtocolOp.java
@@ -262,7 +262,7 @@
    }
    int dnLength = dnString.length();
    if ((dnLength <= colsRemaining) || (colsRemaining <= 0))
    if (dnLength <= colsRemaining || colsRemaining <= 0)
    {
      buffer.append(dnString);
      buffer.append(EOL);
@@ -273,13 +273,13 @@
      buffer.append(EOL);
      int startPos = colsRemaining;
      while ((dnLength - startPos) > (wrapColumn - 1))
      while (dnLength - startPos > wrapColumn - 1)
      {
        buffer.append(" ");
        buffer.append(dnString, startPos, (startPos+wrapColumn-1));
        buffer.append(dnString, startPos, startPos+wrapColumn-1);
        buffer.append(EOL);
        startPos += (wrapColumn-1);
        startPos += wrapColumn-1;
      }
      if (startPos < dnLength)
@@ -318,7 +318,7 @@
        }
        int valueLength = valueString.length();
        if ((valueLength <= colsRemaining) || (colsRemaining <= 0))
        if (valueLength <= colsRemaining || colsRemaining <= 0)
        {
          buffer.append(valueString);
          buffer.append(EOL);
@@ -329,13 +329,13 @@
          buffer.append(EOL);
          int startPos = colsRemaining;
          while ((valueLength - startPos) > (wrapColumn - 1))
          while (valueLength - startPos > wrapColumn - 1)
          {
            buffer.append(" ");
            buffer.append(valueString, startPos, (startPos+wrapColumn-1));
            buffer.append(valueString, startPos, startPos+wrapColumn-1);
            buffer.append(EOL);
            startPos += (wrapColumn-1);
            startPos += wrapColumn-1;
          }
          if (startPos < valueLength)
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddResponseProtocolOp.java
@@ -25,22 +25,20 @@
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.forgerock.util.Utils;
import org.opends.server.types.DN;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP add response
 * protocol op, which is used to provide information about the result of
@@ -219,7 +217,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && ! referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -245,31 +243,19 @@
    buffer.append("AddResponse(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
      buffer.append(", errorMessage=").append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
      buffer.append(", matchedDN=").append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
@@ -319,7 +305,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && ! referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/BindResponseProtocolOp.java
@@ -27,21 +27,18 @@
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.opends.server.types.DN;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.util.Utils;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP delete response
 * protocol op, which is used to provide information about the result of
@@ -263,7 +260,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -295,31 +292,20 @@
    buffer.append("BindResponse(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
@@ -375,7 +361,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/CompareResponseProtocolOp.java
@@ -25,22 +25,20 @@
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.forgerock.util.Utils;
import org.opends.server.types.DN;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP compare response
 * protocol op, which is used to provide information about the result of
@@ -220,7 +218,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -246,31 +244,20 @@
    buffer.append("CompareResponse(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
@@ -320,7 +307,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && ! referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/DeleteResponseProtocolOp.java
@@ -25,22 +25,20 @@
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.forgerock.util.Utils;
import org.opends.server.types.DN;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP delete response
 * protocol op, which is used to provide information about the result of
@@ -223,7 +221,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -249,31 +247,20 @@
    buffer.append("DeleteResponse(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
@@ -323,7 +310,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ExtendedResponseProtocolOp.java
@@ -25,23 +25,21 @@
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.opends.server.types.DN;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.util.Utils;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP extended response
 * protocol op, which is used to provide information about the result of
@@ -283,7 +281,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -293,7 +291,7 @@
      stream.writeEndSequence();
    }
    if ((oid != null) && (oid.length() > 0))
    if (oid != null && oid.length() > 0)
    {
      stream.writeOctetString(TYPE_EXTENDED_RESPONSE_OID, oid);
    }
@@ -319,40 +317,27 @@
    buffer.append("ExtendedResponse(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
    if ((oid != null) && (oid.length() > 0))
    if (oid != null && oid.length() > 0)
    {
      buffer.append(", oid=");
      buffer.append(oid);
    }
    if (value != null)
    {
      buffer.append(", value=");
@@ -405,7 +390,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
@@ -420,7 +405,7 @@
      }
    }
    if ((oid != null) && (oid.length() > 0))
    if (oid != null && oid.length() > 0)
    {
      buffer.append(indentBuf);
      buffer.append("  Response OID:  ");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java
@@ -209,7 +209,7 @@
          // fall back to a more inefficient way that will work without a
          // selector.
          while (byteBuffer.hasRemaining()
              && (System.currentTimeMillis() < stopTime))
              && System.currentTimeMillis() < stopTime)
          {
            bytesWritten = clientChannel.write(byteBuffer);
            if (bytesWritten < 0)
@@ -770,7 +770,7 @@
      }
      List<String> opReferrals = operation.getReferralURLs();
      if ((opReferrals != null) && (!opReferrals.isEmpty()))
      if (opReferrals != null && !opReferrals.isEmpty())
      {
        StringBuilder referralsStr = new StringBuilder();
        Iterator<String> iterator = opReferrals.iterator();
@@ -1075,9 +1075,8 @@
    // See if we should send a notification to the client. If so, then
    // construct and send a notice of disconnection unsolicited
    // response. Note that we cannot send this notification to an LDAPv2
    // client.
    if (sendNotification && (ldapVersion != 2))
    // response. Note that we cannot send this notification to an LDAPv2 client.
    if (sendNotification && ldapVersion != 2)
    {
      try
      {
@@ -1561,7 +1560,7 @@
    {
      logger.traceException(e);
      if (asn1Reader.hasRemainingData() || (e instanceof SSLException))
      if (asn1Reader.hasRemainingData() || e instanceof SSLException)
      {
        // The connection failed, but there was an unread partial message so
        // interpret this as an IO error.
@@ -1722,11 +1721,9 @@
   *         connection has been closed as a result (it is the
   *         responsibility of this method to close the connection).
   */
  private boolean processAbandonRequest(LDAPMessage message,
      List<Control> controls)
  private boolean processAbandonRequest(LDAPMessage message, List<Control> controls)
  {
    if ((ldapVersion == 2) && (controls != null)
        && (!controls.isEmpty()))
    if (ldapVersion == 2 && controls != null && !controls.isEmpty())
    {
      // LDAPv2 clients aren't allowed to send controls.
      disconnect(DisconnectReason.PROTOCOL_ERROR, false,
@@ -1772,11 +1769,9 @@
   *         connection has been closed as a result (it is the
   *         responsibility of this method to close the connection).
   */
  private boolean processAddRequest(LDAPMessage message,
      List<Control> controls)
  private boolean processAddRequest(LDAPMessage message, List<Control> controls)
  {
    if ((ldapVersion == 2) && (controls != null)
        && (!controls.isEmpty()))
    if (ldapVersion == 2 && controls != null && !controls.isEmpty())
    {
      // LDAPv2 clients aren't allowed to send controls.
      AddResponseProtocolOp responseOp =
@@ -1858,7 +1853,7 @@
        return false;
      }
      if ((controls != null) && (!controls.isEmpty()))
      if (controls != null && !controls.isEmpty())
      {
        // LDAPv2 clients aren't allowed to send controls.
        BindResponseProtocolOp responseOp =
@@ -1963,11 +1958,9 @@
   *         connection has been closed as a result (it is the
   *         responsibility of this method to close the connection).
   */
  private boolean processCompareRequest(LDAPMessage message,
      List<Control> controls)
  private boolean processCompareRequest(LDAPMessage message, List<Control> controls)
  {
    if ((ldapVersion == 2) && (controls != null)
        && (!controls.isEmpty()))
    if (ldapVersion == 2 && controls != null && !controls.isEmpty())
    {
      // LDAPv2 clients aren't allowed to send controls.
      CompareResponseProtocolOp responseOp =
@@ -2023,11 +2016,9 @@
   *         connection has been closed as a result (it is the
   *         responsibility of this method to close the connection).
   */
  private boolean processDeleteRequest(LDAPMessage message,
      List<Control> controls)
  private boolean processDeleteRequest(LDAPMessage message, List<Control> controls)
  {
    if ((ldapVersion == 2) && (controls != null)
        && (!controls.isEmpty()))
    if (ldapVersion == 2 && controls != null && !controls.isEmpty())
    {
      // LDAPv2 clients aren't allowed to send controls.
      DeleteResponseProtocolOp responseOp =
@@ -2147,11 +2138,9 @@
   *         connection has been closed as a result (it is the
   *         responsibility of this method to close the connection).
   */
  private boolean processModifyRequest(LDAPMessage message,
      List<Control> controls)
  private boolean processModifyRequest(LDAPMessage message, List<Control> controls)
  {
    if ((ldapVersion == 2) && (controls != null)
        && (!controls.isEmpty()))
    if (ldapVersion == 2 && controls != null && !controls.isEmpty())
    {
      // LDAPv2 clients aren't allowed to send controls.
      ModifyResponseProtocolOp responseOp =
@@ -2208,11 +2197,9 @@
   *         connection has been closed as a result (it is the
   *         responsibility of this method to close the connection).
   */
  private boolean processModifyDNRequest(LDAPMessage message,
      List<Control> controls)
  private boolean processModifyDNRequest(LDAPMessage message, List<Control> controls)
  {
    if ((ldapVersion == 2) && (controls != null)
        && (!controls.isEmpty()))
    if (ldapVersion == 2 && controls != null && !controls.isEmpty())
    {
      // LDAPv2 clients aren't allowed to send controls.
      ModifyDNResponseProtocolOp responseOp =
@@ -2271,8 +2258,7 @@
  private boolean processSearchRequest(LDAPMessage message,
      List<Control> controls)
  {
    if ((ldapVersion == 2) && (controls != null)
        && (!controls.isEmpty()))
    if (ldapVersion == 2 && controls != null && !controls.isEmpty())
    {
      // LDAPv2 clients aren't allowed to send controls.
      SearchResultDoneProtocolOp responseOp =
@@ -2483,7 +2469,7 @@
    if (operationsInProgress.isEmpty()
        && getPersistentSearches().isEmpty())
    {
      return (TimeThread.getTime() - lastCompletionTime.get());
      return TimeThread.getTime() - lastCompletionTime.get();
    }
    else
    {
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -771,7 +771,7 @@
  {
    LDAPConnectionHandlerCfg config = (LDAPConnectionHandlerCfg) configuration;
    if ((currentConfig == null)
    if (currentConfig == null
        || (!currentConfig.isEnabled() && config.isEnabled()))
    {
      // Attempt to bind to the listen port on all configured addresses to
@@ -982,7 +982,7 @@
        // Enter a loop, waiting for new connections to arrive and
        // then accepting them as they come in.
        boolean lastIterationFailed = false;
        while (enabled && (!shutdownRequested))
        while (enabled && !shutdownRequested)
        {
          try
          {
@@ -1082,7 +1082,7 @@
        }
      }
      if (selectorState == 0 && enabled && (!shutdownRequested)
      if (selectorState == 0 && enabled && !shutdownRequested
          && logger.isTraceEnabled())
      {
        // Selected keys was non empty but select() returned 0.
@@ -1163,7 +1163,7 @@
    InetAddress clientAddr = clientConnection.getRemoteAddress();
    // Check to see if the client is on the denied list.
    // If so, then reject it immediately.
    if ((!deniedClients.isEmpty())
    if (!deniedClients.isEmpty()
        && AddressMask.matchesAny(deniedClients, clientAddr))
    {
      clientConnection.disconnect(DisconnectReason.CONNECTION_REJECTED,
@@ -1175,8 +1175,8 @@
    // Check to see if there is an allowed list and if
    // there is whether the client is on that list. If
    // not, then reject the connection.
    if ((!allowedClients.isEmpty())
        && (!AddressMask.matchesAny(allowedClients, clientAddr)))
    if (!allowedClients.isEmpty()
        && !AddressMask.matchesAny(allowedClients, clientAddr))
    {
      clientConnection.disconnect(DisconnectReason.CONNECTION_REJECTED,
          currentConfig.isSendRejectionNotice(),
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPControl.java
@@ -111,7 +111,7 @@
   */
  public final boolean hasValue()
  {
    return (value != null);
    return value != null;
  }
  /** {@inheritDoc} */
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
@@ -579,7 +579,7 @@
          {
            // The next two bytes must be the hex characters that comprise the
            // binary value.
            if ((i + 2) >= valueBytes.length)
            if (i + 2 >= valueBytes.length)
            {
              LocalizableMessage message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
                  filterString, equalPos+i+1);
@@ -778,8 +778,8 @@
    // The first and last characters must be parentheses.  If not, then that's
    // an error.
    if ((filterString.charAt(startPos) != '(') ||
        (filterString.charAt(endPos-1) != ')'))
    if (filterString.charAt(startPos) != '(' ||
        filterString.charAt(endPos-1) != ')')
    {
      LocalizableMessage message = ERR_LDAP_FILTER_COMPOUND_MISSING_PARENTHESES.get(
          filterString, startPos, endPos);
@@ -933,7 +933,7 @@
          {
            // The next two bytes must be the hex characters that comprise the
            // binary value.
            if ((i + 2) >= valueBytes.length)
            if (i + 2 >= valueBytes.length)
            {
              LocalizableMessage message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
                  filterString, equalPos+i+1);
@@ -1095,7 +1095,7 @@
          {
            // The next two bytes must be the hex characters that comprise the
            // binary value.
            if ((i + 2) >= valueBytes.length)
            if (i + 2 >= valueBytes.length)
            {
              LocalizableMessage message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
                  filterString, equalPos+i+1);
@@ -1266,7 +1266,7 @@
          {
            // The next two bytes must be the hex characters that comprise the
            // binary value.
            if ((i + 2) >= valueBytes.length)
            if (i + 2 >= valueBytes.length)
            {
              LocalizableMessage message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
                  filterString, equalPos+i+1);
@@ -1461,7 +1461,7 @@
      {
        dnAttributes = true;
        if((startPos+4) < (equalPos-1))
        if(startPos+4 < equalPos-1)
        {
          matchingRuleID = filterString.substring(startPos+4, equalPos-1);
        }
@@ -1487,13 +1487,13 @@
      // If there is anything left, then it should be ":dn" and/or ":" followed
      // by the matching rule ID.
      if (colonPos < (equalPos-1))
      if (colonPos < equalPos-1)
      {
        if (lowerLeftStr.startsWith(":dn:", colonPos - startPos))
        {
          dnAttributes = true;
          if ((colonPos+4) < (equalPos-1))
          if (colonPos+4 < equalPos-1)
          {
            matchingRuleID = filterString.substring(colonPos+4, equalPos-1);
          }
@@ -1528,7 +1528,7 @@
        {
          // The next two bytes must be the hex characters that comprise the
          // binary value.
          if ((i + 2) >= valueBytes.length)
          if (i + 2 >= valueBytes.length)
          {
            LocalizableMessage message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
                filterString, equalPos+i+1);
@@ -1676,7 +1676,7 @@
    // Make sure that the filter has at least one of an attribute description
    // and/or a matching rule ID.
    if ((attributeType == null) && (matchingRuleID == null))
    if (attributeType == null && matchingRuleID == null)
    {
      LocalizableMessage message = ERR_LDAP_FILTER_EXTENSIBLE_MATCH_NO_AD_OR_MR.get(
          filterString, startPos);
@@ -2002,7 +2002,7 @@
          valueToFilterString(buffer, subInitialElement);
        }
        if ((subAnyElements != null) && (! subAnyElements.isEmpty()))
        if (subAnyElements != null && !subAnyElements.isEmpty())
        {
          for (ByteString s : subAnyElements)
          {
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPRequestHandler.java
@@ -136,7 +136,7 @@
    catch (IOException ioe)
    {
      StackTraceElement[] stackElements = ioe.getStackTrace();
      if ((stackElements != null) && (stackElements.length > 0))
      if (stackElements != null && stackElements.length > 0)
      {
        StackTraceElement ste = stackElements[0];
        if (ste.getClassName().equals("sun.nio.ch.DevPollArrayWrapper")
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyDNResponseProtocolOp.java
@@ -25,22 +25,20 @@
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.forgerock.util.Utils;
import org.opends.server.types.DN;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP modify DN response
 * protocol op, which is used to provide information about the result of
@@ -219,7 +217,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -245,31 +243,20 @@
    buffer.append("ModifyDNResponse(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && ! referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
@@ -319,7 +306,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && ! referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyResponseProtocolOp.java
@@ -25,22 +25,20 @@
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.forgerock.util.Utils;
import org.opends.server.types.DN;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP modify response
 * protocol op, which is used to provide information about the result of
@@ -217,7 +215,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -243,31 +241,20 @@
    buffer.append("ModifyResponse(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && ! referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
@@ -317,7 +304,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && ! referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java
@@ -27,7 +27,6 @@
package org.opends.server.protocols.ldap;
import java.io.IOException;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -36,6 +35,7 @@
import org.forgerock.opendj.ldap.DereferenceAliasesPolicy;
import org.opends.server.types.RawFilter;
import org.forgerock.opendj.ldap.SearchScope;
import org.forgerock.util.Utils;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
@@ -282,16 +282,9 @@
    filter.toString(buffer);
    buffer.append(", attributes={");
    if ((attributes != null) && (! attributes.isEmpty()))
    if (attributes != null && ! attributes.isEmpty())
    {
      Iterator<String> iterator = attributes.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", attributes));
    }
    buffer.append("})");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java
@@ -25,22 +25,20 @@
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.forgerock.util.Utils;
import org.opends.server.types.DN;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP search result done
 * protocol op, which is used to provide information about the result of
@@ -220,7 +218,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -246,31 +244,20 @@
    buffer.append("SearchResultDone(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
@@ -320,7 +307,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && ! referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java
@@ -433,7 +433,7 @@
    }
    int dnLength = dnString.length();
    if ((dnLength <= colsRemaining) || (colsRemaining <= 0))
    if (dnLength <= colsRemaining || colsRemaining <= 0)
    {
      buffer.append(dnString);
      buffer.append(EOL);
@@ -444,13 +444,13 @@
      buffer.append(EOL);
      int startPos = colsRemaining;
      while ((dnLength - startPos) > (wrapColumn - 1))
      while (dnLength - startPos > wrapColumn - 1)
      {
        buffer.append(" ");
        buffer.append(dnString, startPos, (startPos+wrapColumn-1));
        buffer.append(dnString, startPos, startPos+wrapColumn-1);
        buffer.append(EOL);
        startPos += (wrapColumn-1);
        startPos += wrapColumn-1;
      }
      if (startPos < dnLength)
@@ -489,7 +489,7 @@
        }
        int valueLength = valueString.length();
        if ((valueLength <= colsRemaining) || (colsRemaining <= 0))
        if (valueLength <= colsRemaining || colsRemaining <= 0)
        {
          buffer.append(valueString);
          buffer.append(EOL);
@@ -500,13 +500,13 @@
          buffer.append(EOL);
          int startPos = colsRemaining;
          while ((valueLength - startPos) > (wrapColumn - 1))
          while (valueLength - startPos > wrapColumn - 1)
          {
            buffer.append(" ");
            buffer.append(valueString, startPos, (startPos+wrapColumn-1));
            buffer.append(valueString, startPos, startPos+wrapColumn-1);
            buffer.append(EOL);
            startPos += (wrapColumn-1);
            startPos += wrapColumn-1;
          }
          if (startPos < valueLength)
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java
@@ -254,8 +254,8 @@
    // on another master server and this operation has a potential
    // conflict with some more recent operations on this same entry
    // we need to take the more complex path to solve them
    if ((CSN.compare(csn, getLastUpdateTime()) < 0) ||
        (m.getModificationType() != ModificationType.REPLACE))
    if (CSN.compare(csn, getLastUpdateTime()) < 0 ||
        m.getModificationType() != ModificationType.REPLACE)
    {
      // the attribute was modified after this change -> conflict
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalSingle.java
@@ -163,8 +163,8 @@
            conflict = true;
            modsIterator.remove();
          }
          else if ((newValue != null) &&
              (!modifiedEntry.hasValue(type, modAttr.getOptions(), newValue)))
          else if (newValue != null &&
              !modifiedEntry.hasValue(type, modAttr.getOptions(), newValue))
          {
            conflict = true;
            modsIterator.remove();
@@ -184,8 +184,8 @@
      }
      else if (csn.equals(addTime))
      {
        if ((lastMod == HistAttrModificationKey.ADD)
            || (lastMod == HistAttrModificationKey.REPL))
        if (lastMod == HistAttrModificationKey.ADD
            || lastMod == HistAttrModificationKey.REPL)
        {
          if (csn.isNewerThan(deleteTime))
          {
@@ -220,7 +220,7 @@
      else
      {
        if (csn.isNewerThanOrEqualTo(deleteTime)
            && ((addTime == null ) || addTime.isOlderThan(deleteTime)))
            && (addTime == null || addTime.isOlderThan(deleteTime)))
        {
          // no conflict : don't do anything beside setting the addTime
          addTime = csn;
@@ -231,7 +231,7 @@
        {
          // Case where CSN = addTime = deleteTime
          if (csn.equals(deleteTime) && csn.equals(addTime)
              && (lastMod == HistAttrModificationKey.DEL))
              && lastMod == HistAttrModificationKey.DEL)
          {
            // No conflict, record the new value.
            value = newValue;
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrValueHistorical.java
@@ -64,7 +64,7 @@
    if (obj instanceof AttrValueHistorical)
    {
      AttrValueHistorical objVal = (AttrValueHistorical) obj;
      return (value.equals(objVal.getAttributeValue()));
      return value.equals(objVal.getAttributeValue());
    }
    return false;
  }
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/GenerationIdChecksum.java
@@ -53,7 +53,7 @@
     * the same checksum value on every platforms, we always exclude the CR and
     * LF characters from the computation.
     */
    if ((b != 0x0D) && (b != 0x0A)) // CR=0D and LF=0A
    if (b != 0x0D && b != 0x0A) // CR=0D and LF=0A
    {
      checksum += b;
    }
@@ -68,7 +68,7 @@
  /** {@inheritDoc} */
  public void update(byte[] b, int off, int len)
  {
    for (int i = off; i < (off + len); i++)
    for (int i = off; i < off + len; i++)
    {
      updateWithOneByte(b[i]);
    }
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
@@ -124,7 +124,7 @@
      // This HistVal is used to store the date when the entry
      // was added to the directory or when it was last renamed.
      attrType = null;
      if ((token.length >= 3) && (token[2].compareTo("moddn") == 0))
      if (token.length >= 3 && token[2].compareTo("moddn") == 0)
      {
        ismodDN = true;
      }
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -2283,7 +2283,7 @@
        boolean replayDone = false;
        int retryCount = 10;
        while (!dependency && !replayDone && (retryCount-- > 0))
        while (!dependency && !replayDone && retryCount-- > 0)
        {
          if (shutdown.get())
          {
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/ReplLDIFOutputStream.java
@@ -100,11 +100,11 @@
        entryBuffer = ebytes.substring(0, endOfEntryIndex);
        // Send the entry
        if ((numEntries>0) && (getNumExportedEntries() > numEntries))
        if (numEntries>0 && getNumExportedEntries() > numEntries)
        {
          // This outputstream has reached the total number
          // of entries to export.
          throw(new IOException());
          throw new IOException();
        }
        // Add the entry bytes to the checksum
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java
@@ -176,7 +176,7 @@
    ASN1Reader reader = ASN1.getReader(in);
    while (reader.hasNextElement())
    {
      mods.add((LDAPModification.decode(reader)).toModification());
      mods.add(LDAPModification.decode(reader).toModification());
    }
    return mods;
  }
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ProtocolVersion.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;
@@ -128,7 +128,6 @@
   */
  public static short getCompatibleVersion(short version)
  {
    return (version < CURRENT_VERSION ? version : CURRENT_VERSION);
    return version < CURRENT_VERSION ? version : CURRENT_VERSION;
  }
}
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/StartSessionMsg.java
@@ -217,7 +217,7 @@
      safeDataLevel = asn1Reader.readOctetString().byteAt(0);
      */
      status = ServerStatus.valueOf(reader.get());
      assuredFlag = (reader.get() == 1);
      assuredFlag = reader.get() == 1;
      assuredMode = AssuredMode.valueOf(reader.get());
      safeDataLevel = reader.get();
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java
@@ -147,8 +147,7 @@
    // Only allow monitor recalculation at a time.
    synchronized (pendingMonitorLock)
    {
      if ((monitorDataLastBuildDate + monitorDataLifeTime) < TimeThread
          .getTime())
      if (monitorDataLastBuildDate + monitorDataLifeTime < TimeThread.getTime())
      {
        try
        {
opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java
@@ -196,7 +196,7 @@
      numKnownAckStatus++;
    }
    return (numKnownAckStatus == expectedServersAckStatus.size());
    return numKnownAckStatus == expectedServersAckStatus.size();
  }
  /** {@inheritDoc} */
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ServerHandler.java
@@ -746,7 +746,7 @@
    final Random random = new Random();
    final int randomTime = random.nextInt(6); // Random from 0 to 5
    // Wait at least 3 seconds + (0 to 5 seconds)
    final long timeout = 3000 + (randomTime * 1000);
    final long timeout = 3000 + randomTime * 1000;
    final boolean lockAcquired = replicationServerDomain.tryLock(timeout);
    if (!lockAcquired)
    {
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEReplicaDBCursor.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.server.replication.server.changelog.je;
@@ -127,7 +127,7 @@
    }
    // For ON_MATCHING_KEY, do not call next() if the cursor has just been initialized.
    if (positionStrategy == ON_MATCHING_KEY && previousCursor != null
    if ((positionStrategy == ON_MATCHING_KEY && previousCursor != null)
        || positionStrategy == AFTER_MATCHING_KEY)
    {
      cursor.next();
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java
@@ -891,7 +891,7 @@
  {
    // replication server may be null in tests
    logger.trace("In %s, %s",
        (replicationServer != null ? replicationServer.getMonitorInstanceName() : "[test]"),
        replicationServer != null ? replicationServer.getMonitorInstanceName() : "[test]",
        message);
  }
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java
@@ -929,7 +929,7 @@
         * also need to make sure that we don't overflow the semaphore by
         * releasing too many permits.
         */
        final int MAX_PERMITS = (Integer.MAX_VALUE >>> 2);
        final int MAX_PERMITS = Integer.MAX_VALUE >>> 2;
        if (sendWindow.availablePermits() < MAX_PERMITS)
        {
          /*
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java
@@ -2005,7 +2005,7 @@
    int count = 0;
    while (count<=length-2)
    {
      if ((entryBytes[pos+count] == '\n') && (entryBytes[pos+count+1] == '\n'))
      if (entryBytes[pos+count] == '\n' && entryBytes[pos+count+1] == '\n')
      {
        entryCount++;
        count++;
@@ -2070,7 +2070,7 @@
            " our=" + ourLastExportedCnt + " slowest=" + slowestCnt);
      }
      if ((ourLastExportedCnt - slowestCnt) > ieCtx.initWindow)
      if (ourLastExportedCnt - slowestCnt > ieCtx.initWindow)
      {
        if (logger.isTraceEnabled())
        {
@@ -3327,7 +3327,7 @@
          break;
        }
        // Timeout ?
        if ((System.currentTimeMillis() - startTime) >= getAssuredTimeout())
        if (System.currentTimeMillis() - startTime >= getAssuredTimeout())
        {
          /*
          Timeout occurred, be sure that ack is not being received and if so,
opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java
@@ -203,7 +203,7 @@
    // whitespace.
    int pos    = 0;
    int length = valueStr.length();
    while (pos < length && (valueStr.charAt(pos) == ' '))
    while (pos < length && valueStr.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -1395,7 +1395,7 @@
    }
    // Skip over any trailing spaces.
    while (startPos < length && (valueStr.charAt(startPos) == ' '))
    while (startPos < length && valueStr.charAt(startPos) == ' ')
    {
      startPos++;
    }
opendj-server-legacy/src/main/java/org/opends/server/schema/AuthPasswordSyntax.java
@@ -122,7 +122,7 @@
    // First, ignore any leading whitespace.
    int length = authPasswordValue.length();
    int  pos   = 0;
    while ((pos < length) && (authPasswordValue.charAt(pos) == ' '))
    while (pos < length && authPasswordValue.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -204,12 +204,12 @@
    // Ignore any spaces before the dollar sign separator.  Then read the dollar
    // sign and ignore any trailing spaces.
    while ((pos < length) && (authPasswordValue.charAt(pos) == ' '))
    while (pos < length && authPasswordValue.charAt(pos) == ' ')
    {
      pos++;
    }
    if ((pos < length) && (authPasswordValue.charAt(pos) == '$'))
    if (pos < length && authPasswordValue.charAt(pos) == '$')
    {
      pos++;
    }
@@ -220,7 +220,7 @@
              message);
    }
    while ((pos < length) && (authPasswordValue.charAt(pos) == ' '))
    while (pos < length && authPasswordValue.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -232,7 +232,7 @@
    while (pos < length)
    {
      char c = authPasswordValue.charAt(pos);
      if ((c == ' ') || (c == '$'))
      if (c == ' ' || c == '$')
      {
        break readAuthInfo;
      }
@@ -262,12 +262,12 @@
    // Ignore any spaces before the dollar sign separator.  Then read the dollar
    // sign and ignore any trailing spaces.
    while ((pos < length) && (authPasswordValue.charAt(pos) == ' '))
    while (pos < length && authPasswordValue.charAt(pos) == ' ')
    {
      pos++;
    }
    if ((pos < length) && (authPasswordValue.charAt(pos) == '$'))
    if (pos < length && authPasswordValue.charAt(pos) == '$')
    {
      pos++;
    }
@@ -278,7 +278,7 @@
              ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    while ((pos < length) && (authPasswordValue.charAt(pos) == ' '))
    while (pos < length && authPasswordValue.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -289,7 +289,7 @@
    while (pos < length)
    {
      char c = authPasswordValue.charAt(pos);
      if ((c == ' ') || (c == '$'))
      if (c == ' ' || c == '$')
      {
        break ;
      }
opendj-server-legacy/src/main/java/org/opends/server/schema/DITContentRuleSyntax.java
@@ -134,7 +134,7 @@
    // whitespace.
    int pos    = 0;
    int length = valueStr.length();
    while ((pos < length) && (valueStr.charAt(pos) == ' '))
    while (pos < length && valueStr.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -154,13 +154,13 @@
    char c = valueStr.charAt(pos++);
    if (c != '(')
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_EXPECTED_OPEN_PARENTHESIS.get(valueStr, (pos-1), c);
      LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_EXPECTED_OPEN_PARENTHESIS.get(valueStr, pos-1, c);
      throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    // Skip over any spaces immediately following the opening parenthesis.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -185,26 +185,23 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
      while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
      {
        if (c == '.')
        {
          if (lastWasPeriod)
          {
            LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_DOUBLE_PERIOD_IN_NUMERIC_OID.
                get(valueStr, (pos-1));
                get(valueStr, pos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
          }
          else
          {
            lastWasPeriod = true;
          }
        }
        else if (! isDigit(c))
        {
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR_IN_NUMERIC_OID.get(valueStr, c, (pos-1));
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR_IN_NUMERIC_OID.get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        else
@@ -217,17 +214,17 @@
    {
      // This must be a "fake" OID.  In this case, we will only accept
      // alphabetic characters, numeric digits, and the hyphen.
      while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
      while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && DirectoryServer.allowAttributeNameExceptions()))
        {
          // This is fine.  It is an acceptable character.
        }
        else
        {
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR_IN_STRING_OID.get(valueStr, c, (pos-1));
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR_IN_STRING_OID.get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
@@ -236,18 +233,14 @@
    // If we're at the end of the value, then it isn't a valid DIT content rule
    // description.  Otherwise, parse out the OID.
    String oid;
    if (pos >= length)
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_TRUNCATED_VALUE.get(valueStr);
      throw new DirectoryException(
              ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    else
    {
      oid = lowerStr.substring(oidStartPos, (pos-1));
    }
    String oid = lowerStr.substring(oidStartPos, pos-1);
    // Get the objectclass with the specified OID.  If it does not exist or is
    // not structural, then fail.
@@ -275,7 +268,7 @@
    // Skip over the space(s) after the OID.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -319,7 +312,7 @@
        if (pos < length)
        {
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_UNEXPECTED_CLOSE_PARENTHESIS.
              get(valueStr, (pos-1));
              get(valueStr, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -336,8 +329,7 @@
        {
          StringBuilder userBuffer  = new StringBuilder();
          StringBuilder lowerBuffer = new StringBuilder();
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer,
                                 (pos-1));
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer, pos-1);
          names.put(lowerBuffer.toString(), userBuffer.toString());
        }
        else if (c == '(')
@@ -355,7 +347,7 @@
            {
              // Skip over any spaces after the parenthesis.
              pos++;
              while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
              while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
              {
                pos++;
              }
@@ -376,7 +368,7 @@
        else
        {
          // This is an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
@@ -409,7 +401,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            ObjectClass oc = schema.getObjectClass(woidBuffer.toString());
            if (oc == null)
@@ -451,7 +443,7 @@
            else if (c != '$')
            {
              LocalizableMessage message =
                  ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
                  ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
            }
          }
@@ -459,7 +451,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          ObjectClass oc = schema.getObjectClass(woidBuffer.toString());
          if (oc == null)
@@ -504,7 +496,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            attrs.add(getAttribute(schema, allowUnknownElements, valueStr, woidBuffer,
                ERR_ATTR_SYNTAX_DCR_UNKNOWN_REQUIRED_ATTR));
@@ -518,7 +510,7 @@
            else if (c != '$')
            {
              LocalizableMessage message =
                  ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
                  ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
            }
          }
@@ -526,7 +518,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          attrs.add(getAttribute(schema, allowUnknownElements, valueStr, woidBuffer,
              ERR_ATTR_SYNTAX_DCR_UNKNOWN_REQUIRED_ATTR));
        }
@@ -547,7 +539,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            attrs.add(getAttribute(schema, allowUnknownElements, valueStr, woidBuffer,
                ERR_ATTR_SYNTAX_DCR_UNKNOWN_OPTIONAL_ATTR));
@@ -561,7 +553,7 @@
            else if (c != '$')
            {
              LocalizableMessage message =
                  ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
                  ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
            }
          }
@@ -569,7 +561,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          attrs.add(getAttribute(schema, allowUnknownElements, valueStr, woidBuffer,
              ERR_ATTR_SYNTAX_DCR_UNKNOWN_OPTIONAL_ATTR));
        }
@@ -590,7 +582,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            attrs.add(getAttribute(schema, allowUnknownElements, valueStr, woidBuffer,
                ERR_ATTR_SYNTAX_DCR_UNKNOWN_PROHIBITED_ATTR));
@@ -604,7 +596,7 @@
            else if (c != '$')
            {
              LocalizableMessage message =
                  ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
                  ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
            }
          }
@@ -612,7 +604,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          attrs.add(getAttribute(schema, allowUnknownElements, valueStr, woidBuffer,
              ERR_ATTR_SYNTAX_DCR_UNKNOWN_PROHIBITED_ATTR));
        }
@@ -705,7 +697,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -719,14 +711,14 @@
    // Read until we find the next space.
    while ((startPos < length) && ((c = valueStr.charAt(startPos++)) != ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos++)) != ' '))
    {
      tokenName.append(c);
    }
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -761,7 +753,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -786,7 +778,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
    {
      valueBuffer.append(c);
      startPos++;
@@ -795,7 +787,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -844,7 +836,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -869,7 +861,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) != '\''))
    {
      lowerBuffer.append(c);
      userBuffer.append(valueStr.charAt(startPos));
@@ -879,7 +871,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -921,7 +913,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -941,14 +933,14 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (c == '.')
        {
          if (lastWasPeriod)
          {
            LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_DOUBLE_PERIOD_IN_NUMERIC_OID.
                get(lowerStr, (startPos-1));
                get(lowerStr, startPos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
          }
@@ -968,12 +960,12 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR_IN_NUMERIC_OID.get(
              lowerStr, c, (startPos-1));
              lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        else
@@ -986,12 +978,11 @@
    else if (isAlpha(c))
    {
      // This must be an attribute type/objectclass description.  In this case,
      // we will only accept alphabetic characters, numeric digits, and the
      // hyphen.
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      // we will only accept alphabetic characters, numeric digits, and the hyphen.
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && DirectoryServer.allowAttributeNameExceptions()))
        {
          woidBuffer.append(c);
        }
@@ -1005,12 +996,12 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_CHAR_IN_STRING_OID.get(
              lowerStr, c, (startPos-1));
              lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
@@ -1023,7 +1014,7 @@
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -1065,7 +1056,7 @@
    // Skip over any leading spaces.
    int length = valueStr.length();
    char c = '\u0000';
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -1088,7 +1079,7 @@
      // Parse until the closing quote.
      StringBuilder valueBuffer = new StringBuilder();
      startPos++;
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
      {
        valueBuffer.append(c);
        startPos++;
@@ -1103,7 +1094,7 @@
      while (true)
      {
        // Skip over any leading spaces;
        while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
        while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
        {
          startPos++;
        }
@@ -1134,7 +1125,7 @@
          // We have a quoted string
          StringBuilder valueBuffer = new StringBuilder();
          startPos++;
          while ((startPos < length) &&
          while (startPos < length &&
              ((c = valueStr.charAt(startPos)) != '\''))
          {
            valueBuffer.append(c);
@@ -1148,7 +1139,7 @@
        {
          //Consider unquoted string
          StringBuilder valueBuffer = new StringBuilder();
          while ((startPos < length) &&
          while (startPos < length &&
              ((c = valueStr.charAt(startPos)) != ' '))
          {
            valueBuffer.append(c);
@@ -1171,7 +1162,7 @@
    {
      // Parse until the next space.
      StringBuilder valueBuffer = new StringBuilder();
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != ' '))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
      {
        valueBuffer.append(c);
        startPos++;
@@ -1181,7 +1172,7 @@
    }
    // Skip over any trailing spaces.
    while ((startPos < length) && (valueStr.charAt(startPos) == ' '))
    while (startPos < length && valueStr.charAt(startPos) == ' ')
    {
      startPos++;
    }
opendj-server-legacy/src/main/java/org/opends/server/schema/DITStructureRuleSyntax.java
@@ -132,7 +132,7 @@
    // whitespace.
    int pos    = 0;
    int length = valueStr.length();
    while ((pos < length) && (valueStr.charAt(pos) == ' '))
    while (pos < length && valueStr.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -153,13 +153,13 @@
    if (c != '(')
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_EXPECTED_OPEN_PARENTHESIS.get(
          valueStr, (pos-1), c);
          valueStr, pos-1, c);
      throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    // Skip over any spaces immediately following the opening parenthesis.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -176,12 +176,12 @@
    // The next set of characters must be the rule ID, which is an integer.
    int ruleIDStartPos = pos;
    while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
    while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
    {
      if (! isDigit(c))
      {
        LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR_IN_RULE_ID.get(
            valueStr, c, (pos-1));
            valueStr, c, pos-1);
        throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                     message);
      }
@@ -203,7 +203,7 @@
    // Skip over the space(s) after the rule ID.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -246,7 +246,7 @@
        if (pos < length)
        {
          LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_UNEXPECTED_CLOSE_PARENTHESIS.
              get(valueStr, (pos-1));
              get(valueStr, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -263,8 +263,7 @@
        {
          StringBuilder userBuffer  = new StringBuilder();
          StringBuilder lowerBuffer = new StringBuilder();
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer,
                                 (pos-1));
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer, pos-1);
          names.put(lowerBuffer.toString(), userBuffer.toString());
        }
        else if (c == '(')
@@ -282,7 +281,7 @@
            {
              // Skip over any spaces after the parenthesis.
              pos++;
              while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
              while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
              {
                pos++;
              }
@@ -304,9 +303,8 @@
        {
          // This is an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
              ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR.get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
      else if (lowerTokenName.equals("desc"))
@@ -331,7 +329,7 @@
        nameFormGiven = true;
        nameForm = schema.getNameForm(woidBuffer.toString());
        if ((nameForm == null) && (! allowUnknownElements))
        if (nameForm == null && ! allowUnknownElements)
        {
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
              ERR_ATTR_SYNTAX_DSR_UNKNOWN_NAME_FORM.get(valueStr, woidBuffer));
@@ -350,7 +348,7 @@
          while (true)
          {
            // Skip over any leading spaces.
            while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
            while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
            {
              pos++;
            }
@@ -365,12 +363,12 @@
            // Read the next integer value.
            ruleIDStartPos = pos;
            while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
            while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
            {
              if (! isDigit(c))
              {
                LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR_IN_RULE_ID.
                    get(valueStr, c, (pos-1));
                    get(valueStr, c, pos-1);
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
              }
@@ -413,7 +411,7 @@
            // Skip over any trailing spaces.
            while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
            while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
            {
              pos++;
            }
@@ -432,7 +430,7 @@
            if (c == ')')
            {
              pos++;
              while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
              while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
              {
                pos++;
              }
@@ -460,11 +458,11 @@
          // Read the next integer value.
          ruleIDStartPos = pos - 1;
          while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
          while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
          {
            if (! isDigit(c))
            {
              LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR_IN_RULE_ID.get(valueStr, c, (pos-1));
              LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR_IN_RULE_ID.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                           message);
            }
@@ -505,7 +503,7 @@
          // Skip over any trailing spaces.
          while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
          while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
          {
            pos++;
          }
@@ -533,7 +531,7 @@
    }
    if ((nameForm == null) && (! nameFormGiven))
    if (nameForm == null && !nameFormGiven)
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_NO_NAME_FORM.get(valueStr);
      throw new DirectoryException(
@@ -569,7 +567,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -583,14 +581,14 @@
    // Read until we find the next space.
    while ((startPos < length) && ((c = valueStr.charAt(startPos++)) != ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos++)) != ' '))
    {
      tokenName.append(c);
    }
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -625,7 +623,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -650,7 +648,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
    {
      valueBuffer.append(c);
      startPos++;
@@ -659,7 +657,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -708,7 +706,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -733,7 +731,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) != '\''))
    {
      lowerBuffer.append(c);
      userBuffer.append(valueStr.charAt(startPos));
@@ -743,7 +741,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -785,7 +783,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -805,14 +803,14 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (c == '.')
        {
          if (lastWasPeriod)
          {
            LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_DOUBLE_PERIOD_IN_NUMERIC_OID.
                get(lowerStr, (startPos-1));
                get(lowerStr, startPos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
          }
@@ -832,11 +830,11 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR_IN_NUMERIC_OID.get(lowerStr, c, (startPos-1));
          LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR_IN_NUMERIC_OID.get(lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        else
@@ -851,10 +849,10 @@
      // This must be an attribute type/objectclass description.  In this case,
      // we will only accept alphabetic characters, numeric digits, and the
      // hyphen.
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && DirectoryServer.allowAttributeNameExceptions()))
        {
          woidBuffer.append(c);
        }
@@ -868,11 +866,11 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR_IN_STRING_OID.get(lowerStr, c, (startPos-1));
          LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_CHAR_IN_STRING_OID.get(lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
@@ -885,7 +883,7 @@
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -927,7 +925,7 @@
    // Skip over any leading spaces.
    int length = valueStr.length();
    char c = '\u0000';
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -950,7 +948,7 @@
      // Parse until the closing quote.
      StringBuilder valueBuffer = new StringBuilder();
      startPos++;
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
      {
        valueBuffer.append(c);
        startPos++;
@@ -965,7 +963,7 @@
      while (true)
      {
        // Skip over any leading spaces;
        while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
        while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
        {
          startPos++;
        }
@@ -995,8 +993,7 @@
          // We have a quoted string
          StringBuilder valueBuffer = new StringBuilder();
          startPos++;
          while ((startPos < length) &&
              ((c = valueStr.charAt(startPos)) != '\''))
          while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
          {
            valueBuffer.append(c);
            startPos++;
@@ -1009,8 +1006,7 @@
        {
          //Consider unquoted string
          StringBuilder valueBuffer = new StringBuilder();
          while ((startPos < length) &&
              ((c = valueStr.charAt(startPos)) != ' '))
          while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
          {
            valueBuffer.append(c);
            startPos++;
@@ -1023,8 +1019,7 @@
        {
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_DSR_TRUNCATED_VALUE.get(valueStr);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
    }
@@ -1032,7 +1027,7 @@
    {
      // Parse until the next space.
      StringBuilder valueBuffer = new StringBuilder();
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != ' '))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
      {
        valueBuffer.append(c);
        startPos++;
@@ -1042,7 +1037,7 @@
    }
    // Skip over any trailing spaces.
    while ((startPos < length) && (valueStr.charAt(startPos) == ' '))
    while (startPos < length && valueStr.charAt(startPos) == ' ')
    {
      startPos++;
    }
opendj-server-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeSyntax.java
@@ -864,7 +864,7 @@
      case '-':
        // These are fine only if there are exactly two or four more digits that
        // specify a valid offset.
        if ((length == 13) || (length == 15))
        if (length == 13 || length == 15)
        {
          try
          {
@@ -1036,7 +1036,7 @@
      case '-':
        // These are fine only if there are exactly two or four more digits that
        // specify a valid offset.
        if ((length == 15) || (length == 17))
        if (length == 15 || length == 17)
        {
          try
          {
@@ -1126,7 +1126,7 @@
      case '-':
        // These are fine only if there are exactly two or four more digits that
        // specify a valid offset.
        if ((length == 17) || (length == 19))
        if (length == 17 || length == 19)
        {
          try
          {
@@ -1224,7 +1224,7 @@
        case 'Z':
          // This is only acceptable if we're at the end of the value.
          if (i != (value.length() - 1))
          if (i != value.length() - 1)
          {
            LocalizableMessage message =
                WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_FRACTION_CHAR.
@@ -1307,7 +1307,8 @@
          throws DirectoryException
  {
    String offSetStr = value.substring(startPos);
    if ((offSetStr.length() != 3) && (offSetStr.length() != 5))
    int len = offSetStr.length();
    if (len != 3 && len != 5)
    {
      LocalizableMessage message = WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(
          value, offSetStr);
@@ -1389,7 +1390,7 @@
    // If there are two more characters, then they must be an integer between
    // 00 and 59.
    if (offSetStr.length() == 5)
    if (len == 5)
    {
      switch (offSetStr.charAt(3))
      {
opendj-server-legacy/src/main/java/org/opends/server/schema/GuideSyntax.java
@@ -153,7 +153,7 @@
            else
            {
              c = criteria.charAt(i+1);
              if ((c == '|') || (c == '&'))
              if (c == '|' || c == '&')
              {
                return criteriaIsValid(criteria.substring(i+2), valueStr,
                                       invalidReason);
@@ -162,7 +162,7 @@
              {
                invalidReason.append(
                        ERR_ATTR_SYNTAX_GUIDE_ILLEGAL_CHAR.get(
                                valueStr, criteria, c, (i+1)));
                                valueStr, criteria, c, i+1));
                return false;
              }
            }
@@ -198,7 +198,7 @@
        {
          // The only characters allowed next are a pipe or an ampersand.
          c = criteria.charAt(5);
          if ((c == '|') || (c == '&'))
          if (c == '|' || c == '&')
          {
            return criteriaIsValid(criteria.substring(6), valueStr,
                                   invalidReason);
@@ -221,7 +221,7 @@
        {
          // The only characters allowed next are a pipe or an ampersand.
          c = criteria.charAt(6);
          if ((c == '|') || (c == '&'))
          if (c == '|' || c == '&')
          {
            return criteriaIsValid(criteria.substring(7), valueStr,
                                   invalidReason);
@@ -370,7 +370,7 @@
    else
    {
      c = criteria.charAt(endPos);
      if ((c == '|') || (c == '&'))
      if (c == '|' || c == '&')
      {
        return criteriaIsValid(criteria.substring(endPos+1), valueStr,
                               invalidReason);
opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
@@ -217,7 +217,7 @@
    // whitespace.
    int pos    = 0;
    int length = valueStr.length();
    while ((pos < length) && (valueStr.charAt(pos) == ' '))
    while (pos < length && valueStr.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -239,14 +239,14 @@
    if (c != '(')
    {
      LocalizableMessage message =
              ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_OPEN_PARENTHESIS.get(valueStr, (pos-1), c);
              ERR_ATTR_SYNTAX_LDAPSYNTAX_EXPECTED_OPEN_PARENTHESIS.get(valueStr, pos-1, c);
      throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
              message);
    }
    // Skip over any spaces immediately following the opening parenthesis.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -267,7 +267,7 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((pos < length) && ((c = valueStr.charAt(pos)) != ' ')
      while (pos < length && ((c = valueStr.charAt(pos)) != ' ')
              && (c = valueStr.charAt(pos)) != ')')
      {
        if (c == '.')
@@ -276,7 +276,7 @@
          {
            LocalizableMessage message =
              ERR_ATTR_SYNTAX_LDAPSYNTAX_DOUBLE_PERIOD_IN_NUMERIC_OID.
                  get(valueStr, (pos-1));
                  get(valueStr, pos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
          }
@@ -290,7 +290,7 @@
          // This must have been an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_LDAPSYNTAX_ILLEGAL_CHAR_IN_NUMERIC_OID.
                get(valueStr, c, (pos-1));
                get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -305,11 +305,11 @@
    {
      // This must be a "fake" OID.  In this case, we will only accept
      // alphabetic characters, numeric digits, and the hyphen.
      while ((pos < length) && ((c = valueStr.charAt(pos)) != ' ')
      while (pos < length && ((c = valueStr.charAt(pos)) != ' ')
              && (c=valueStr.charAt(pos))!=')')
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && DirectoryServer.allowAttributeNameExceptions()))
        {
          // This is fine.  It is an acceptable character.
          pos++;
@@ -319,7 +319,7 @@
          // This must have been an illegal character.
          LocalizableMessage message =
                  ERR_ATTR_SYNTAX_LDAPSYNTAX_ILLEGAL_CHAR_IN_STRING_OID.
              get(valueStr, c, (pos-1));
              get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -339,7 +339,7 @@
    oid = toLowerCase(valueStr.substring(oidStartPos, pos));
    // Skip over the space(s) after the OID.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -378,10 +378,8 @@
        if (pos < length)
        {
          LocalizableMessage message =
            ERR_ATTR_SYNTAX_LDAPSYNTAX_UNEXPECTED_CLOSE_PARENTHESIS.
                get(valueStr, (pos-1));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
            ERR_ATTR_SYNTAX_LDAPSYNTAX_UNEXPECTED_CLOSE_PARENTHESIS.get(valueStr, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        break;
@@ -556,7 +554,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -571,14 +569,14 @@
    // Read until we find the next space.
    while ((startPos < length) && ((c = valueStr.charAt(startPos++)) != ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos++)) != ' '))
    {
      tokenName.append(c);
    }
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -613,7 +611,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -638,7 +636,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
    {
      valueBuffer.append(c);
      startPos++;
@@ -647,7 +645,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -691,7 +689,7 @@
    // Skip over any leading spaces.
    int length = valueStr.length();
    char c = '\u0000';
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -714,7 +712,7 @@
      // Parse until the closing quote.
      StringBuilder valueBuffer = new StringBuilder();
      startPos++;
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
      {
        valueBuffer.append(c);
        startPos++;
@@ -729,7 +727,7 @@
      while (true)
      {
        // Skip over any leading spaces;
        while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
        while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
        {
          startPos++;
        }
@@ -762,8 +760,7 @@
          // We have a quoted string
          StringBuilder valueBuffer = new StringBuilder();
          startPos++;
          while ((startPos < length) &&
              ((c = valueStr.charAt(startPos)) != '\''))
          while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
          {
            valueBuffer.append(c);
            startPos++;
@@ -776,8 +773,7 @@
        {
          //Consider unquoted string
          StringBuilder valueBuffer = new StringBuilder();
          while ((startPos < length) &&
              ((c = valueStr.charAt(startPos)) != ' '))
          while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
          {
            valueBuffer.append(c);
            startPos++;
@@ -799,7 +795,7 @@
    {
      // Parse until the next space.
      StringBuilder valueBuffer = new StringBuilder();
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != ' '))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
      {
        valueBuffer.append(c);
        startPos++;
@@ -809,7 +805,7 @@
    }
    // Skip over any trailing spaces.
    while ((startPos < length) && (valueStr.charAt(startPos) == ' '))
    while (startPos < length && valueStr.charAt(startPos) == ' ')
    {
      startPos++;
    }
opendj-server-legacy/src/main/java/org/opends/server/schema/MatchingRuleUseSyntax.java
@@ -133,7 +133,7 @@
    // whitespace.
    int pos    = 0;
    int length = valueStr.length();
    while ((pos < length) && (valueStr.charAt(pos) == ' '))
    while (pos < length && valueStr.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -153,13 +153,13 @@
    char c = valueStr.charAt(pos++);
    if (c != '(')
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_EXPECTED_OPEN_PARENTHESIS.get(valueStr, (pos-1), c);
      LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_EXPECTED_OPEN_PARENTHESIS.get(valueStr, pos-1, c);
      throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    // Skip over any spaces immediately following the opening parenthesis.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -184,27 +184,22 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
      while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
      {
        if (c == '.')
        {
          if (lastWasPeriod)
          {
            LocalizableMessage message =
                ERR_ATTR_SYNTAX_MRUSE_DOUBLE_PERIOD_IN_NUMERIC_OID.
                  get(valueStr, (pos-1));
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
                ERR_ATTR_SYNTAX_MRUSE_DOUBLE_PERIOD_IN_NUMERIC_OID.get(valueStr, pos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
          }
          else
          {
            lastWasPeriod = true;
          }
        }
        else if (! isDigit(c))
        {
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR_IN_NUMERIC_OID.get(valueStr, c, (pos-1));
          LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR_IN_NUMERIC_OID.get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        else
@@ -217,10 +212,10 @@
    {
      // This must be a "fake" OID.  In this case, we will only accept
      // alphabetic characters, numeric digits, and the hyphen.
      while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
      while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && DirectoryServer.allowAttributeNameExceptions()))
        {
          // This is fine.  It is an acceptable character.
        }
@@ -228,7 +223,7 @@
        {
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR_IN_STRING_OID.
              get(valueStr, c, (pos-1));
              get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
@@ -237,18 +232,14 @@
    // If we're at the end of the value, then it isn't a valid matching rule use
    // description.  Otherwise, parse out the OID.
    String oid;
    if (pos >= length)
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_TRUNCATED_VALUE.get(valueStr);
      throw new DirectoryException(
              ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    else
    {
      oid = lowerStr.substring(oidStartPos, (pos-1));
    }
    String oid = lowerStr.substring(oidStartPos, pos-1);
    // Get the matching rule with the specified OID.
    MatchingRule matchingRule = schema.getMatchingRule(oid);
@@ -264,7 +255,7 @@
    // Skip over the space(s) after the OID.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -304,9 +295,8 @@
        if (pos < length)
        {
          LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_UNEXPECTED_CLOSE_PARENTHESIS.
              get(valueStr, (pos-1));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
              get(valueStr, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        break;
@@ -321,8 +311,7 @@
        {
          StringBuilder userBuffer  = new StringBuilder();
          StringBuilder lowerBuffer = new StringBuilder();
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer,
                                 (pos-1));
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer, pos-1);
          names.put(lowerBuffer.toString(), userBuffer.toString());
        }
        else if (c == '(')
@@ -340,7 +329,7 @@
            {
              // Skip over any spaces after the parenthesis.
              pos++;
              while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
              while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
              {
                pos++;
              }
@@ -361,7 +350,7 @@
        else
        {
          // This is an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
          LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR.get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
@@ -394,7 +383,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer));
            // The next character must be either a dollar sign or a closing parenthesis.
@@ -407,7 +396,7 @@
            else if (c != '$')
            {
              LocalizableMessage message =
                  ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
                  ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
            }
          }
@@ -415,7 +404,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer));
        }
@@ -490,7 +479,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -504,14 +493,14 @@
    // Read until we find the next space.
    while ((startPos < length) && ((c = valueStr.charAt(startPos++)) != ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos++)) != ' '))
    {
      tokenName.append(c);
    }
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -546,7 +535,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -571,7 +560,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
    {
      valueBuffer.append(c);
      startPos++;
@@ -580,7 +569,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -629,7 +618,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -653,7 +642,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) != '\''))
    {
      lowerBuffer.append(c);
      userBuffer.append(valueStr.charAt(startPos));
@@ -663,7 +652,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -705,7 +694,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -725,24 +714,19 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (c == '.')
        {
          if (lastWasPeriod)
          {
            LocalizableMessage message =
                ERR_ATTR_SYNTAX_MRUSE_DOUBLE_PERIOD_IN_NUMERIC_OID.
                  get(lowerStr, (startPos-1));
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
                ERR_ATTR_SYNTAX_MRUSE_DOUBLE_PERIOD_IN_NUMERIC_OID.get(lowerStr, startPos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
          }
          else
          {
            woidBuffer.append(c);
            lastWasPeriod = true;
          }
        }
        else if (! isDigit(c))
        {
          // Technically, this must be an illegal character.  However, it is
@@ -753,12 +737,12 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR_IN_NUMERIC_OID.
              get(lowerStr, c, (startPos-1));
              get(lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        else
@@ -772,10 +756,10 @@
    {
      // This must be an attribute type description.  In this case, we will only
      // accept alphabetic characters, numeric digits, and the hyphen.
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && DirectoryServer.allowAttributeNameExceptions()))
        {
          woidBuffer.append(c);
        }
@@ -789,12 +773,12 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_CHAR_IN_STRING_OID.
              get(lowerStr, c, (startPos-1));
              get(lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
@@ -807,7 +791,7 @@
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -849,7 +833,7 @@
    // Skip over any leading spaces.
    int length = valueStr.length();
    char c = '\u0000';
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -872,7 +856,7 @@
      // Parse until the closing quote.
      StringBuilder valueBuffer = new StringBuilder();
      startPos++;
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
      {
        valueBuffer.append(c);
        startPos++;
@@ -887,7 +871,7 @@
      while (true)
      {
        // Skip over any leading spaces;
        while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
        while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
        {
          startPos++;
        }
@@ -917,8 +901,7 @@
          // We have a quoted string
          StringBuilder valueBuffer = new StringBuilder();
          startPos++;
          while ((startPos < length) &&
              ((c = valueStr.charAt(startPos)) != '\''))
          while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
          {
            valueBuffer.append(c);
            startPos++;
@@ -931,8 +914,7 @@
        {
          //Consider unquoted string
          StringBuilder valueBuffer = new StringBuilder();
          while ((startPos < length) &&
              ((c = valueStr.charAt(startPos)) != ' '))
          while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
          {
            valueBuffer.append(c);
            startPos++;
@@ -954,7 +936,7 @@
    {
      // Parse until the next space.
      StringBuilder valueBuffer = new StringBuilder();
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != ' '))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
      {
        valueBuffer.append(c);
        startPos++;
@@ -964,7 +946,7 @@
    }
    // Skip over any trailing spaces.
    while ((startPos < length) && (valueStr.charAt(startPos) == ' '))
    while (startPos < length && valueStr.charAt(startPos) == ' ')
    {
      startPos++;
    }
opendj-server-legacy/src/main/java/org/opends/server/schema/NameFormSyntax.java
@@ -131,11 +131,10 @@
    String lowerStr = toLowerCase(valueStr);
    // We'll do this a character at a time.  First, skip over any leading
    // whitespace.
    // We'll do this a character at a time.  First, skip over any leading whitespace.
    int pos    = 0;
    int length = valueStr.length();
    while ((pos < length) && (valueStr.charAt(pos) == ' '))
    while (pos < length && valueStr.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -145,8 +144,7 @@
      // This means that the value was empty or contained only whitespace.  That
      // is illegal.
      LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_EMPTY_VALUE.get();
      throw new DirectoryException(
              ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
      throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
@@ -156,14 +154,13 @@
    if (c != '(')
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_EXPECTED_OPEN_PARENTHESIS.get(
          valueStr, (pos-1), c);
      throw new DirectoryException(
              ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
          valueStr, pos-1, c);
      throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    // Skip over any spaces immediately following the opening parenthesis.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -188,7 +185,7 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
      while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
      {
        if (c == '.')
        {
@@ -196,7 +193,7 @@
          {
            LocalizableMessage message =
                ERR_ATTR_SYNTAX_NAME_FORM_DOUBLE_PERIOD_IN_NUMERIC_OID.
                  get(valueStr, (pos-1));
                  get(valueStr, pos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
          }
@@ -210,7 +207,7 @@
          // This must have been an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_CHAR_IN_NUMERIC_OID.
                get(valueStr, c, (pos-1));
                get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -224,10 +221,10 @@
    {
      // This must be a "fake" OID.  In this case, we will only accept
      // alphabetic characters, numeric digits, and the hyphen.
      while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
      while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && DirectoryServer.allowAttributeNameExceptions()))
        {
          // This is fine.  It is an acceptable character.
        }
@@ -236,7 +233,7 @@
          // This must have been an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_CHAR_IN_STRING_OID.
                get(valueStr, c, (pos-1));
                get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -253,14 +250,11 @@
      throw new DirectoryException(
              ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    else
    {
      oid = lowerStr.substring(oidStartPos, (pos-1));
    }
    oid = lowerStr.substring(oidStartPos, pos-1);
    // Skip over the space(s) after the OID.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -304,7 +298,7 @@
        {
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_NAME_FORM_UNEXPECTED_CLOSE_PARENTHESIS.
                get(valueStr, (pos-1));
                get(valueStr, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -321,8 +315,7 @@
        {
          StringBuilder userBuffer  = new StringBuilder();
          StringBuilder lowerBuffer = new StringBuilder();
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer,
                                 (pos-1));
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer, pos-1);
          names.put(lowerBuffer.toString(), userBuffer.toString());
        }
        else if (c == '(')
@@ -340,7 +333,7 @@
            {
              // Skip over any spaces after the parenthesis.
              pos++;
              while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
              while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
              {
                pos++;
              }
@@ -362,9 +355,8 @@
        {
          // This is an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
              ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_CHAR.get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
      else if (lowerTokenName.equals("desc"))
@@ -432,7 +424,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer,
                ERR_ATTR_SYNTAX_NAME_FORM_UNKNOWN_REQUIRED_ATTR));
@@ -446,7 +438,7 @@
            else if (c != '$')
            {
              LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_CHAR.get(
                  valueStr, c, (pos-1));
                  valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                           message);
            }
@@ -455,7 +447,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer,
              ERR_ATTR_SYNTAX_NAME_FORM_UNKNOWN_REQUIRED_ATTR));
        }
@@ -476,7 +468,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer,
                ERR_ATTR_SYNTAX_NAME_FORM_UNKNOWN_OPTIONAL_ATTR));
@@ -490,16 +482,15 @@
            else if (c != '$')
            {
              LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_CHAR.get(
                  valueStr, c, (pos-1));
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                           message);
                  valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
            }
          }
        }
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer,
              ERR_ATTR_SYNTAX_NAME_FORM_UNKNOWN_OPTIONAL_ATTR));
        }
@@ -576,7 +567,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -590,14 +581,14 @@
    // Read until we find the next space.
    while ((startPos < length) && ((c = valueStr.charAt(startPos++)) != ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos++)) != ' '))
    {
      tokenName.append(c);
    }
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -632,7 +623,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -657,7 +648,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
    {
      valueBuffer.append(c);
      startPos++;
@@ -666,7 +657,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -715,7 +706,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -740,7 +731,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) != '\''))
    {
      lowerBuffer.append(c);
      userBuffer.append(valueStr.charAt(startPos));
@@ -750,7 +741,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -792,7 +783,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -812,7 +803,7 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (c == '.')
        {
@@ -820,16 +811,12 @@
          {
            LocalizableMessage message =
                ERR_ATTR_SYNTAX_NAME_FORM_DOUBLE_PERIOD_IN_NUMERIC_OID.
                  get(lowerStr, (startPos-1));
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
                  get(lowerStr, startPos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
          }
          else
          {
            woidBuffer.append(c);
            lastWasPeriod = true;
          }
        }
        else if (! isDigit(c))
        {
          // Technically, this must be an illegal character.  However, it is
@@ -840,15 +827,14 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_CHAR_IN_NUMERIC_OID.
                get(lowerStr, c, (startPos-1));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
                get(lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        else
        {
@@ -861,10 +847,10 @@
    {
      // This must be an attribute type description.  In this case, we will only
      // accept alphabetic characters, numeric digits, and the hyphen.
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && DirectoryServer.allowAttributeNameExceptions()))
        {
          woidBuffer.append(c);
        }
@@ -878,15 +864,14 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_CHAR_IN_STRING_OID.
                get(lowerStr, c, (startPos-1));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
                get(lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
    }
@@ -900,7 +885,7 @@
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -942,7 +927,7 @@
    // Skip over any leading spaces.
    int length = valueStr.length();
    char c = '\u0000';
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -965,7 +950,7 @@
      // Parse until the closing quote.
      StringBuilder valueBuffer = new StringBuilder();
      startPos++;
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
      {
        valueBuffer.append(c);
        startPos++;
@@ -980,7 +965,7 @@
      while (true)
      {
        // Skip over any leading spaces;
        while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
        while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
        {
          startPos++;
        }
@@ -1013,8 +998,7 @@
          // We have a quoted string
          StringBuilder valueBuffer = new StringBuilder();
          startPos++;
          while ((startPos < length) &&
              ((c = valueStr.charAt(startPos)) != '\''))
          while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
          {
            valueBuffer.append(c);
            startPos++;
@@ -1027,8 +1011,7 @@
        {
          //Consider unquoted string
          StringBuilder valueBuffer = new StringBuilder();
          while ((startPos < length) &&
              ((c = valueStr.charAt(startPos)) != ' '))
          while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
          {
            valueBuffer.append(c);
            startPos++;
@@ -1050,7 +1033,7 @@
    {
      // Parse until the next space.
      StringBuilder valueBuffer = new StringBuilder();
      while ((startPos < length) && ((c = valueStr.charAt(startPos)) != ' '))
      while (startPos < length && ((c = valueStr.charAt(startPos)) != ' '))
      {
        valueBuffer.append(c);
        startPos++;
@@ -1060,7 +1043,7 @@
    }
    // Skip over any trailing spaces.
    while ((startPos < length) && (valueStr.charAt(startPos) == ' '))
    while (startPos < length && valueStr.charAt(startPos) == ' ')
    {
      startPos++;
    }
opendj-server-legacy/src/main/java/org/opends/server/schema/ObjectClassSyntax.java
@@ -139,7 +139,7 @@
    // whitespace.
    int pos    = 0;
    int length = valueStr.length();
    while ((pos < length) && (valueStr.charAt(pos) == ' '))
    while (pos < length && valueStr.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -160,13 +160,13 @@
    if (c != '(')
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_EXPECTED_OPEN_PARENTHESIS.
          get(valueStr, (pos-1), c);
          get(valueStr, pos-1, c);
      throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    // Skip over any spaces immediately following the opening parenthesis.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -192,7 +192,7 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
      while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
      {
        if (c == '.')
        {
@@ -200,21 +200,17 @@
          {
            LocalizableMessage message =
                ERR_ATTR_SYNTAX_OBJECTCLASS_DOUBLE_PERIOD_IN_NUMERIC_OID.
                  get(valueStr, (pos-1));
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
                  get(valueStr, pos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
          }
          else
          {
            lastWasPeriod = true;
          }
        }
        else if (! isDigit(c))
        {
          // This must have been an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR_IN_NUMERIC_OID.
                get(valueStr, c, (pos-1));
                get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        else
@@ -227,10 +223,10 @@
    {
      // This must be a "fake" OID.  In this case, we will only accept
      // alphabetic characters, numeric digits, and the hyphen.
      while ((pos < length) && ((c = valueStr.charAt(pos++)) != ' '))
      while (pos < length && ((c = valueStr.charAt(pos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && allowExceptions))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && allowExceptions))
        {
          // This is fine.  It is an acceptable character.
        }
@@ -239,7 +235,7 @@
          // This must have been an illegal character.
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR_IN_STRING_OID.
                get(valueStr, c, (pos-1));
                get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -249,7 +245,6 @@
    // If we're at the end of the value, then it isn't a valid objectclass
    // description.  Otherwise, parse out the OID.
    String oid;
    if (pos >= length)
    {
      LocalizableMessage message =
@@ -257,14 +252,11 @@
      throw new DirectoryException(
              ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
    }
    else
    {
      oid = lowerStr.substring(oidStartPos, (pos-1));
    }
    String oid = lowerStr.substring(oidStartPos, pos-1);
    // Skip over the space(s) after the OID.
    while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
    while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -312,7 +304,7 @@
        {
          LocalizableMessage message =
              ERR_ATTR_SYNTAX_OBJECTCLASS_UNEXPECTED_CLOSE_PARENTHESIS.
                get(valueStr, (pos-1));
                get(valueStr, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -329,8 +321,7 @@
        {
          StringBuilder userBuffer  = new StringBuilder();
          StringBuilder lowerBuffer = new StringBuilder();
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer,
                                 (pos-1));
          pos = readQuotedString(valueStr, lowerStr, userBuffer, lowerBuffer, pos-1);
          primaryName = userBuffer.toString();
          names.add(primaryName);
        }
@@ -350,7 +341,7 @@
            {
              // Skip over any spaces after the parenthesis.
              pos++;
              while ((pos < length) && ((c = valueStr.charAt(pos)) == ' '))
              while (pos < length && ((c = valueStr.charAt(pos)) == ' '))
              {
                pos++;
              }
@@ -371,7 +362,7 @@
        else
        {
          // This is an illegal character.
          LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
          LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR.get(valueStr, c, pos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
        }
@@ -496,7 +487,7 @@
            }
            else if (c != '$')
            {
              LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
              LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                           message);
            }
@@ -505,7 +496,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          ObjectClass superiorClass =
                  schema.getObjectClass(woidBuffer.toString());
          if (superiorClass == null)
@@ -561,7 +552,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer,
                WARN_ATTR_SYNTAX_OBJECTCLASS_UNKNOWN_REQUIRED_ATTR));
@@ -574,7 +565,7 @@
            }
            else if (c != '$')
            {
              LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
              LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                           message);
            }
@@ -583,7 +574,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer,
              WARN_ATTR_SYNTAX_OBJECTCLASS_UNKNOWN_REQUIRED_ATTR));
        }
@@ -604,7 +595,7 @@
          while (true)
          {
            StringBuilder woidBuffer = new StringBuilder();
            pos = readWOID(lowerStr, woidBuffer, (pos));
            pos = readWOID(lowerStr, woidBuffer, pos);
            attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer,
                WARN_ATTR_SYNTAX_OBJECTCLASS_UNKNOWN_OPTIONAL_ATTR));
@@ -617,7 +608,7 @@
            }
            else if (c != '$')
            {
              LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR.get(valueStr, c, (pos-1));
              LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR.get(valueStr, c, pos-1);
              throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                           message);
            }
@@ -626,7 +617,7 @@
        else
        {
          StringBuilder woidBuffer = new StringBuilder();
          pos = readWOID(lowerStr, woidBuffer, (pos-1));
          pos = readWOID(lowerStr, woidBuffer, pos-1);
          attrs.add(getAttributeType(schema, allowUnknownElements, oid, woidBuffer,
              WARN_ATTR_SYNTAX_OBJECTCLASS_UNKNOWN_OPTIONAL_ATTR));
        }
@@ -674,8 +665,8 @@
          case AUXILIARY:
            // Auxiliary classes may only inherit from abstract classes or other
            // auxiliary classes.
            if ((superiorType != ObjectClassType.ABSTRACT) &&
                (superiorType != ObjectClassType.AUXILIARY))
            if (superiorType != ObjectClassType.ABSTRACT &&
                superiorType != ObjectClassType.AUXILIARY)
            {
              LocalizableMessage message =
                WARN_ATTR_SYNTAX_OBJECTCLASS_INVALID_SUPERIOR_TYPE.
@@ -689,8 +680,8 @@
          case STRUCTURAL:
            // Structural classes may only inherit from abstract classes or
            // other structural classes.
            if ((superiorType != ObjectClassType.ABSTRACT) &&
                (superiorType != ObjectClassType.STRUCTURAL))
            if (superiorType != ObjectClassType.ABSTRACT &&
                superiorType != ObjectClassType.STRUCTURAL)
            {
              LocalizableMessage message =
                WARN_ATTR_SYNTAX_OBJECTCLASS_INVALID_SUPERIOR_TYPE.
@@ -764,7 +755,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -779,14 +770,14 @@
    // Read until we find the next space.
    while ((startPos < length) && ((c = valueStr.charAt(startPos++)) != ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos++)) != ' '))
    {
      tokenName.append(c);
    }
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -821,7 +812,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = valueStr.length();
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -847,7 +838,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = valueStr.charAt(startPos)) != '\''))
    {
      valueBuffer.append(c);
      startPos++;
@@ -856,7 +847,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -906,7 +897,7 @@
    // Skip over any spaces at the beginning of the value.
    char c = '\u0000';
    int  length = lowerStr.length();
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -932,7 +923,7 @@
    // Read until we find the closing quote.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) != '\''))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) != '\''))
    {
      lowerBuffer.append(c);
      userBuffer.append(valueStr.charAt(startPos));
@@ -942,7 +933,7 @@
    // Skip over any trailing spaces after the value.
    startPos++;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -987,7 +978,7 @@
    int  length = lowerStr.length();
    boolean allowExceptions = DirectoryServer.isRunning()?
                        DirectoryServer.allowAttributeNameExceptions():true;
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -1008,7 +999,7 @@
      // This must be a numeric OID.  In that case, we will accept only digits
      // and periods, but not consecutive periods.
      boolean lastWasPeriod = false;
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (c == '.')
        {
@@ -1016,17 +1007,13 @@
          {
            LocalizableMessage message =
              ERR_ATTR_SYNTAX_OBJECTCLASS_DOUBLE_PERIOD_IN_NUMERIC_OID.
                  get(lowerStr, (startPos-1));
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message);
                  get(lowerStr, startPos-1);
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
          }
          else
          {
            woidBuffer.append(c);
            lastWasPeriod = true;
          }
        }
        else if ((!isDigit(c) && (!allowExceptions || (!isAlpha(c) && (c != '-') && (c != '_')))))
        else if (!isDigit(c) && (!allowExceptions || (!isAlpha(c) && c != '-' && c != '_')))
        {
          // Technically, this must be an illegal character.  However, it is
          // possible that someone just got sloppy and did not include a space
@@ -1036,15 +1023,14 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message =
            ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR_IN_NUMERIC_OID.
                get(lowerStr, c, (startPos-1));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
                get(lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
        else
        {
@@ -1057,10 +1043,10 @@
    {
      // This must be an objectclass description.  In this case, we will only
      // accept alphabetic characters, numeric digits, and the hyphen.
      while ((startPos < length) && ((c = lowerStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = lowerStr.charAt(startPos++)) != ' '))
      {
        if (isAlpha(c) || isDigit(c) || (c == '-') ||
            ((c == '_') && allowExceptions))
        if (isAlpha(c) || isDigit(c) || c == '-' ||
            (c == '_' && allowExceptions))
        {
          woidBuffer.append(c);
        }
@@ -1074,15 +1060,14 @@
          // additional characters.
          if (c == ')')
          {
            return (startPos-1);
            return startPos-1;
          }
          // This must have been an illegal character.
          LocalizableMessage message =
            ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_CHAR_IN_STRING_OID.
                get(lowerStr, c, (startPos-1));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message);
                get(lowerStr, c, startPos-1);
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
        }
      }
    }
@@ -1096,7 +1081,7 @@
    // Skip over any trailing spaces after the value.
    while ((startPos < length) && ((c = lowerStr.charAt(startPos)) == ' '))
    while (startPos < length && ((c = lowerStr.charAt(startPos)) == ' '))
    {
      startPos++;
    }
@@ -1139,7 +1124,7 @@
    // Skip over any leading spaces.
    int length = valueStr.length();
    char c = valueStr.charAt(startPos++);
    while ((startPos < length) && (c == ' '))
    while (startPos < length && c == ' ')
    {
      c = valueStr.charAt(startPos++);
    }
@@ -1161,7 +1146,7 @@
    {
      // Parse until the closing quote.
      StringBuilder valueBuffer = new StringBuilder();
      while ((startPos < length) && ((c = valueStr.charAt(startPos++)) != '\''))
      while (startPos < length && ((c = valueStr.charAt(startPos++)) != '\''))
      {
        valueBuffer.append(c);
      }
@@ -1174,7 +1159,7 @@
      while (true)
      {
        // Skip over any leading spaces;
        while ((startPos < length) && ((c = valueStr.charAt(startPos)) == ' '))
        while (startPos < length && ((c = valueStr.charAt(startPos)) == ' '))
        {
          startPos++;
        }
@@ -1212,7 +1197,7 @@
    {
      // Parse until the next space.
      StringBuilder valueBuffer = new StringBuilder();
      while ((startPos < length) && ((c = valueStr.charAt(startPos++)) != ' '))
      while (startPos < length && ((c = valueStr.charAt(startPos++)) != ' '))
      {
        valueBuffer.append(c);
      }
@@ -1221,7 +1206,7 @@
    }
    // Skip over any trailing spaces.
    while ((startPos < length) && (valueStr.charAt(startPos) == ' '))
    while (startPos < length && valueStr.charAt(startPos) == ' ')
    {
      startPos++;
    }
opendj-server-legacy/src/main/java/org/opends/server/schema/UserPasswordSyntax.java
@@ -131,7 +131,7 @@
         throws DirectoryException
  {
    // Make sure that there actually is a value to decode.
    if ((userPasswordValue == null) || (userPasswordValue.length() == 0))
    if (userPasswordValue == null || userPasswordValue.length() == 0)
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_USERPW_NO_VALUE.get();
      throw new DirectoryException(
opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
@@ -95,7 +95,7 @@
    Entry taskEntry = getTaskEntry();
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_ADDSCHEMAFILE_FILENAME);
    List<Attribute> attrList = taskEntry.getAttribute(attrType);
    if ((attrList == null) || attrList.isEmpty())
    if (attrList == null || attrList.isEmpty())
    {
      LocalizableMessage message = ERR_TASK_ADDSCHEMAFILE_NO_FILENAME.get(
          ATTR_TASK_ADDSCHEMAFILE_FILENAME, taskEntry.getName());
opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java
@@ -256,7 +256,7 @@
    // If the signHash option was provided, then make sure that the hash option
    // was given.
    if (signHash && (! hash))
    if (signHash && !hash)
    {
      logger.error(ERR_BACKUPDB_SIGN_REQUIRES_HASH, ATTR_TASK_BACKUP_SIGN_HASH, ATTR_TASK_BACKUP_HASH);
      return false;
@@ -532,7 +532,7 @@
    else
    {
      // See if there are multiple backends to archive.
      multiple = (backendsToArchive.size() > 1);
      multiple = backendsToArchive.size() > 1;
    }
opendj-server-legacy/src/main/java/org/opends/server/tasks/EnterLockdownModeTask.java
@@ -64,16 +64,15 @@
    if (operation != null)
    {
      DN authzDN = operation.getAuthorizationDN();
      if ((authzDN == null) || (! operation.getClientConnection().hasPrivilege(
          Privilege.SERVER_LOCKDOWN, operation)))
      if (authzDN == null || !operation.getClientConnection().hasPrivilege(
          Privilege.SERVER_LOCKDOWN, operation))
      {
        LocalizableMessage message = ERR_TASK_ENTERLOCKDOWN_NOT_ROOT.get();
        throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message);
      }
      InetAddress clientAddress =
           operation.getClientConnection().getRemoteAddress();
      if ((clientAddress != null) && (! clientAddress.isLoopbackAddress()))
      InetAddress clientAddress = operation.getClientConnection().getRemoteAddress();
      if (clientAddress != null && !clientAddress.isLoopbackAddress())
      {
        LocalizableMessage message = ERR_TASK_ENTERLOCKDOWN_NOT_LOOPBACK.get();
        throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message);
opendj-server-legacy/src/main/java/org/opends/server/tasks/LeaveLockdownModeTask.java
@@ -64,16 +64,15 @@
    if (operation != null)
    {
      DN authzDN = operation.getAuthorizationDN();
      if ((authzDN == null) || (! operation.getClientConnection().hasPrivilege(
          Privilege.SERVER_LOCKDOWN, operation)))
      if (authzDN == null || !operation.getClientConnection().hasPrivilege(
          Privilege.SERVER_LOCKDOWN, operation))
      {
        LocalizableMessage message = ERR_TASK_LEAVELOCKDOWN_NOT_ROOT.get();
        throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message);
      }
      InetAddress clientAddress =
           operation.getClientConnection().getRemoteAddress();
      if ((clientAddress != null) && (! clientAddress.isLoopbackAddress()))
      InetAddress clientAddress = operation.getClientConnection().getRemoteAddress();
      if (clientAddress != null && !clientAddress.isLoopbackAddress())
      {
        LocalizableMessage message = ERR_TASK_LEAVELOCKDOWN_NOT_LOOPBACK.get();
        throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message);
@@ -90,4 +89,3 @@
    return TaskState.COMPLETED_SUCCESSFULLY;
  }
}
opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java
@@ -338,7 +338,7 @@
        finally
        {
          // Release the exclusive lock on the backend.
          if ( (!verifyOnly) && !unlockBackend(backend))
          if (!verifyOnly && !unlockBackend(backend))
          {
            errorsEncountered = true;
          }
opendj-server-legacy/src/main/java/org/opends/server/tasks/ShutdownTask.java
@@ -115,8 +115,8 @@
      if (!attr.isEmpty())
      {
        String valueString = toLowerCase(attr.iterator().next().toString());
        restart = (valueString.equals("true") || valueString.equals("yes")
            || valueString.equals("on") || valueString.equals("1"));
        restart = valueString.equals("true") || valueString.equals("yes")
            || valueString.equals("on") || valueString.equals("1");
      }
    }
opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java
@@ -312,7 +312,7 @@
  public static boolean getBoolean(List<Attribute> attrList,
                                   boolean defaultValue)
  {
    if ((attrList == null) || attrList.isEmpty())
    if (attrList == null || attrList.isEmpty())
    {
      return defaultValue;
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java
@@ -392,7 +392,7 @@
    // If the signHash option was provided, then make sure that the hash option
    // was given.
    if (signHash.isPresent() && (! hash.isPresent()))
    if (signHash.isPresent() && !hash.isPresent())
    {
      LocalizableMessage message = ERR_BACKUPDB_SIGN_REQUIRES_HASH.get(
              signHash.getLongIdentifier(),
@@ -688,7 +688,7 @@
      // See if there are multiple backends to archive.
      multiple = (backendsToArchive.size() > 1);
      multiple = backendsToArchive.size() > 1;
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java
@@ -765,7 +765,7 @@
    exportConfig.setIncludeFilters(includeFilters);
    exportConfig.setSignHash(signHash.isPresent());
    exportConfig.setIncludeOperationalAttributes(
                      (! excludeOperationalAttrs.isPresent()));
                      !excludeOperationalAttrs.isPresent());
    // FIXME -- Should this be conditional?
    exportConfig.setInvokeExportPlugins(true);
opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesTool.java
@@ -414,12 +414,12 @@
        else if (key != null)
        {
          int index = line.indexOf('=');
          if ((index != -1) && ((index + 1) < line.length()))
          if (index != -1 && index + 1 < line.length())
          {
            lineValue = line.substring(index+1);
          }
        }
        if ((lineValue != null) && (lineValue.length() > 0))
        if (lineValue != null && lineValue.length() > 0)
        {
          if (sbValue == null)
          {
@@ -427,7 +427,7 @@
          }
          sbValue.append(lineValue);
        }
        if (!hasSlash && (key != null) && (sbValue != null))
        if (!hasSlash && key != null && sbValue != null)
        {
          properties.put(key, sbValue.toString());
        }
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java
@@ -363,7 +363,7 @@
    // See if there are any controls in the response.  If so, then add them to
    // the response controls list.
    List<Control> respControls = responseMessage.getControls();
    if ((respControls != null) && (! respControls.isEmpty()))
    if (respControls != null && !respControls.isEmpty())
    {
      responseControls.addAll(respControls);
    }
@@ -372,34 +372,7 @@
    // Look at the protocol op from the response.  If it's a bind response, then
    // continue.  If it's an extended response, then it could be a notice of
    // disconnection so check for that.  Otherwise, generate an error.
    switch (responseMessage.getProtocolOpType())
    {
      case OP_TYPE_BIND_RESPONSE:
        // We'll deal with this later.
        break;
      case OP_TYPE_EXTENDED_RESPONSE:
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
            responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
              get(extendedResponse.getResultCode(),
                  extendedResponse.getErrorMessage());
          throw new LDAPException(extendedResponse.getResultCode(), message);
        }
        else
        {
          LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_EXTENDED_RESPONSE.get(extendedResponse);
          throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
        }
      default:
        LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_RESPONSE.get(responseMessage.getProtocolOp());
        throw new ClientException( ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
    }
    generateError(responseMessage);
    BindResponseProtocolOp bindResponse =
@@ -466,7 +439,7 @@
      bindDN = ByteString.empty();
    }
    if ((mechanism == null) || (mechanism.length() == 0))
    if (mechanism == null || mechanism.length() == 0)
    {
      LocalizableMessage message = ERR_LDAPAUTH_NO_SASL_MECHANISM.get();
      throw new ClientException(
@@ -551,17 +524,14 @@
    // Evaluate the properties provided.  The only one we'll allow is the trace
    // property, but it is not required.
    if ((saslProperties == null) || saslProperties.isEmpty())
    if (saslProperties == null || saslProperties.isEmpty())
    {
      // This is fine because there are no required properties for this
      // mechanism.
      // This is fine because there are no required properties for this mechanism.
    }
    else
    {
      Iterator<String> propertyNames = saslProperties.keySet().iterator();
      while (propertyNames.hasNext())
      for (String name : saslProperties.keySet())
      {
        String name = propertyNames.next();
        if (name.equalsIgnoreCase(SASL_PROPERTY_TRACE))
        {
          // This is acceptable, and we'll take any single value.
@@ -574,8 +544,7 @@
            if (iterator.hasNext())
            {
              LocalizableMessage message = ERR_LDAPAUTH_TRACE_SINGLE_VALUED.get();
              throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR,
                                        message);
              throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR, message);
            }
          }
        }
@@ -665,7 +634,7 @@
    // See if there are any controls in the response.  If so, then add them to
    // the response controls list.
    List<Control> respControls = responseMessage.getControls();
    if ((respControls != null) && (! respControls.isEmpty()))
    if (respControls != null && ! respControls.isEmpty())
    {
      responseControls.addAll(respControls);
    }
@@ -674,34 +643,7 @@
    // Look at the protocol op from the response.  If it's a bind response, then
    // continue.  If it's an extended response, then it could be a notice of
    // disconnection so check for that.  Otherwise, generate an error.
    switch (responseMessage.getProtocolOpType())
    {
      case OP_TYPE_BIND_RESPONSE:
        // We'll deal with this later.
        break;
      case OP_TYPE_EXTENDED_RESPONSE:
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
            responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
              get(extendedResponse.getResultCode(),
                  extendedResponse.getErrorMessage());
          throw new LDAPException(extendedResponse.getResultCode(), message);
        }
        else
        {
          LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_EXTENDED_RESPONSE.get(extendedResponse);
          throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
        }
      default:
        LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_RESPONSE.get(responseMessage.getProtocolOp());
        throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
    }
    generateError(responseMessage);
    BindResponseProtocolOp bindResponse =
@@ -782,7 +724,7 @@
    // Evaluate the properties provided.  The authID is required, no other
    // properties are allowed.
    if ((saslProperties == null) || saslProperties.isEmpty())
    if (saslProperties == null || saslProperties.isEmpty())
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_NO_SASL_PROPERTIES.get(SASL_MECHANISM_CRAM_MD5);
@@ -790,27 +732,13 @@
              ReturnCode.CLIENT_SIDE_PARAM_ERROR, message);
    }
    Iterator<String> propertyNames = saslProperties.keySet().iterator();
    while (propertyNames.hasNext())
    for (String name : saslProperties.keySet())
    {
      String name      = propertyNames.next();
      String lowerName = toLowerCase(name);
      if (lowerName.equals(SASL_PROPERTY_AUTHID))
      {
        List<String> values = saslProperties.get(name);
        Iterator<String> iterator = values.iterator();
        if (iterator.hasNext())
        {
          authID = iterator.next();
          if (iterator.hasNext())
          {
            LocalizableMessage message = ERR_LDAPAUTH_AUTHID_SINGLE_VALUED.get();
            throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR,
                                      message);
          }
        }
        authID = getAuthID(saslProperties, authID, name);
      }
      else
      {
@@ -823,7 +751,7 @@
    // Make sure that the authID was provided.
    if ((authID == null) || (authID.length() == 0))
    if (authID == null || authID.length() == 0)
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_SASL_AUTHID_REQUIRED.get(SASL_MECHANISM_CRAM_MD5);
@@ -918,7 +846,7 @@
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage1.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
        if (responseOID != null &&
            responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
@@ -1044,7 +972,7 @@
    // See if there are any controls in the response.  If so, then add them to
    // the response controls list.
    List<Control> respControls = responseMessage2.getControls();
    if ((respControls != null) && (! respControls.isEmpty()))
    if (respControls != null && ! respControls.isEmpty())
    {
      responseControls.addAll(respControls);
    }
@@ -1063,7 +991,7 @@
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage2.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
        if (responseOID != null &&
            responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
@@ -1104,6 +1032,32 @@
  /**
   * @param saslProperties
   * @param authID
   * @param name
   * @return
   * @throws ClientException
   */
  private String getAuthID(Map<String, List<String>> saslProperties, String authID, String name) throws ClientException
  {
    List<String> values = saslProperties.get(name);
    Iterator<String> iterator = values.iterator();
    if (iterator.hasNext())
    {
      authID = iterator.next();
      if (iterator.hasNext())
      {
        LocalizableMessage message = ERR_LDAPAUTH_AUTHID_SINGLE_VALUED.get();
        throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR, message);
      }
    }
    return authID;
  }
  /**
   * Generates the appropriate HMAC-MD5 digest for a CRAM-MD5 authentication
   * with the given information.
   *
@@ -1261,35 +1215,20 @@
    // Evaluate the properties provided.  The authID is required.  The realm,
    // QoP, digest URI, and authzID are optional.
    if ((saslProperties == null) || saslProperties.isEmpty())
    if (saslProperties == null || saslProperties.isEmpty())
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_NO_SASL_PROPERTIES.get(SASL_MECHANISM_DIGEST_MD5);
      throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR,
              message);
      throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR, message);
    }
    Iterator<String> propertyNames = saslProperties.keySet().iterator();
    while (propertyNames.hasNext())
    for (String name : saslProperties.keySet())
    {
      String name      = propertyNames.next();
      String lowerName = toLowerCase(name);
      if (lowerName.equals(SASL_PROPERTY_AUTHID))
      {
        List<String> values = saslProperties.get(name);
        Iterator<String> iterator = values.iterator();
        if (iterator.hasNext())
        {
          authID = iterator.next();
          if (iterator.hasNext())
          {
            LocalizableMessage message = ERR_LDAPAUTH_AUTHID_SINGLE_VALUED.get();
            throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR,
                                      message);
          }
        }
        authID = getAuthID(saslProperties, authID, name);
      }
      else if (lowerName.equals(SASL_PROPERTY_REALM))
      {
@@ -1386,7 +1325,7 @@
    // Make sure that the authID was provided.
    if ((authID == null) || (authID.length() == 0))
    if (authID == null || authID.length() == 0)
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_SASL_AUTHID_REQUIRED.get(SASL_MECHANISM_DIGEST_MD5);
@@ -1482,7 +1421,7 @@
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage1.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
        if (responseOID != null &&
            responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
@@ -1648,7 +1587,7 @@
    // Generate the response digest, and initialize the necessary remaining
    // variables to use in the generation of that digest.
    String nonceCount = "00000001";
    String charset    = (useUTF8 ? "UTF-8" : "ISO-8859-1");
    String charset    = useUTF8 ? "UTF-8" : "ISO-8859-1";
    String responseDigest;
    try
    {
@@ -1777,7 +1716,7 @@
    // See if there are any controls in the response.  If so, then add them to
    // the response controls list.
    List<Control> respControls = responseMessage2.getControls();
    if ((respControls != null) && (! respControls.isEmpty()))
    if (respControls != null && ! respControls.isEmpty())
    {
      responseControls.addAll(respControls);
    }
@@ -1796,7 +1735,7 @@
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage2.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
        if (responseOID != null &&
            responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
@@ -2005,7 +1944,7 @@
              // We found the closing quote before the end of the token.  This
              // is not fine.
              LocalizableMessage message =
                  ERR_LDAPAUTH_DIGESTMD5_INVALID_CLOSING_QUOTE_POS.get((pos-2));
                  ERR_LDAPAUTH_DIGESTMD5_INVALID_CLOSING_QUOTE_POS.get(pos-2);
              throw new LDAPException(ReturnCode.INVALID_CREDENTIALS.get(),
                                      message);
            }
@@ -2357,7 +2296,7 @@
         throws ClientException, LDAPException
  {
    // Make sure that no SASL properties were provided.
    if ((saslProperties != null) && (! saslProperties.isEmpty()))
    if (saslProperties != null && ! saslProperties.isEmpty())
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_NO_ALLOWED_SASL_PROPERTIES.get(SASL_MECHANISM_EXTERNAL);
@@ -2433,7 +2372,7 @@
    // See if there are any controls in the response.  If so, then add them to
    // the response controls list.
    List<Control> respControls = responseMessage.getControls();
    if ((respControls != null) && (! respControls.isEmpty()))
    if (respControls != null && ! respControls.isEmpty())
    {
      responseControls.addAll(respControls);
    }
@@ -2452,7 +2391,7 @@
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
        if (responseOID != null &&
            responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
@@ -2563,7 +2502,7 @@
    // Evaluate the properties provided.  The authID is required.  The authzID,
    // KDC, QoP, and realm are optional.
    if ((saslProperties == null) || saslProperties.isEmpty())
    if (saslProperties == null || saslProperties.isEmpty())
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_NO_SASL_PROPERTIES.get(SASL_MECHANISM_GSSAPI);
@@ -2571,10 +2510,8 @@
              ReturnCode.CLIENT_SIDE_PARAM_ERROR, message);
    }
    Iterator<String> propertyNames = saslProperties.keySet().iterator();
    while (propertyNames.hasNext())
    for (String name : saslProperties.keySet())
    {
      String name      = propertyNames.next();
      String lowerName = toLowerCase(name);
      if (lowerName.equals(SASL_PROPERTY_AUTHID))
@@ -2588,8 +2525,7 @@
          if (iterator.hasNext())
          {
            LocalizableMessage message = ERR_LDAPAUTH_AUTHID_SINGLE_VALUED.get();
            throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR,
                                      message);
            throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR, message);
          }
        }
      }
@@ -2689,7 +2625,7 @@
    // Make sure that the authID was provided.
    if ((gssapiAuthID == null) || (gssapiAuthID.length() == 0))
    if (gssapiAuthID == null || gssapiAuthID.length() == 0)
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_SASL_AUTHID_REQUIRED.get(SASL_MECHANISM_GSSAPI);
@@ -2867,7 +2803,7 @@
    // Evaluate the properties provided.  The authID is required, and authzID is
    // optional.
    if ((saslProperties == null) || saslProperties.isEmpty())
    if (saslProperties == null || saslProperties.isEmpty())
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_NO_SASL_PROPERTIES.get(SASL_MECHANISM_PLAIN);
@@ -2875,27 +2811,13 @@
              ReturnCode.CLIENT_SIDE_PARAM_ERROR, message);
    }
    Iterator<String> propertyNames = saslProperties.keySet().iterator();
    while (propertyNames.hasNext())
    for (String name : saslProperties.keySet())
    {
      String name      = propertyNames.next();
      String lowerName = toLowerCase(name);
      if (lowerName.equals(SASL_PROPERTY_AUTHID))
      {
        List<String> values = saslProperties.get(name);
        Iterator<String> iterator = values.iterator();
        if (iterator.hasNext())
        {
          authID = iterator.next();
          if (iterator.hasNext())
          {
            LocalizableMessage message = ERR_LDAPAUTH_AUTHID_SINGLE_VALUED.get();
            throw new ClientException(ReturnCode.CLIENT_SIDE_PARAM_ERROR,
                                      message);
          }
        }
        authID = getAuthID(saslProperties, authID, name);
      }
      else if (lowerName.equals(SASL_PROPERTY_AUTHZID))
      {
@@ -2924,7 +2846,7 @@
    // Make sure that at least the authID was provided.
    if ((authID == null) || (authID.length() == 0))
    if (authID == null || authID.length() == 0)
    {
      LocalizableMessage message =
          ERR_LDAPAUTH_SASL_AUTHID_REQUIRED.get(SASL_MECHANISM_PLAIN);
@@ -3018,7 +2940,7 @@
    // See if there are any controls in the response.  If so, then add them to
    // the response controls list.
    List<Control> respControls = responseMessage.getControls();
    if ((respControls != null) && (! respControls.isEmpty()))
    if (respControls != null && !respControls.isEmpty())
    {
      responseControls.addAll(respControls);
    }
@@ -3027,34 +2949,7 @@
    // Look at the protocol op from the response.  If it's a bind response, then
    // continue.  If it's an extended response, then it could be a notice of
    // disconnection so check for that.  Otherwise, generate an error.
    switch (responseMessage.getProtocolOpType())
    {
      case OP_TYPE_BIND_RESPONSE:
        // We'll deal with this later.
        break;
      case OP_TYPE_EXTENDED_RESPONSE:
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
            responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
              get(extendedResponse.getResultCode(),
                  extendedResponse.getErrorMessage());
          throw new LDAPException(extendedResponse.getResultCode(), message);
        }
        else
        {
          LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_EXTENDED_RESPONSE.get(extendedResponse);
          throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
        }
      default:
        LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_RESPONSE.get(responseMessage.getProtocolOp());
        throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
    }
    generateError(responseMessage);
    BindResponseProtocolOp bindResponse =
@@ -3241,34 +3136,7 @@
      // Look at the protocol op from the response.  If it's a bind response,
      // then continue.  If it's an extended response, then it could be a notice
      // of disconnection so check for that.  Otherwise, generate an error.
      switch (responseMessage.getProtocolOpType())
      {
        case OP_TYPE_BIND_RESPONSE:
          // We'll deal with this later.
          break;
        case OP_TYPE_EXTENDED_RESPONSE:
          ExtendedResponseProtocolOp extendedResponse =
               responseMessage.getExtendedResponseProtocolOp();
          String responseOID = extendedResponse.getOID();
          if ((responseOID != null) &&
              responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
          {
            LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
                get(extendedResponse.getResultCode(),
                    extendedResponse.getErrorMessage());
            throw new LDAPException(extendedResponse.getResultCode(), message);
          }
          else
          {
            LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_EXTENDED_RESPONSE.get(extendedResponse);
            throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
          }
        default:
          LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_RESPONSE.get(responseMessage.getProtocolOp());
          throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
      }
      generateError(responseMessage);
      while (true)
@@ -3408,35 +3276,7 @@
          // response, then continue.  If it's an extended response, then it
          // could be a notice of disconnection so check for that.  Otherwise,
          // generate an error.
          switch (responseMessage.getProtocolOpType())
          {
            case OP_TYPE_BIND_RESPONSE:
              // We'll deal with this later.
              break;
            case OP_TYPE_EXTENDED_RESPONSE:
              ExtendedResponseProtocolOp extendedResponse =
                   responseMessage.getExtendedResponseProtocolOp();
              String responseOID = extendedResponse.getOID();
              if ((responseOID != null) &&
                  responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
              {
                LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
                    get(extendedResponse.getResultCode(),
                        extendedResponse.getErrorMessage());
                throw new LDAPException(extendedResponse.getResultCode(),
                        message);
              }
              else
              {
                LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_EXTENDED_RESPONSE.get(extendedResponse);
                throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
              }
            default:
              LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_RESPONSE.get(responseMessage.getProtocolOp());
              throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
          }
          generateError(responseMessage);
        }
        else
        {
@@ -3462,7 +3302,35 @@
    return null;
  }
  private void generateError(LDAPMessage responseMessage) throws LDAPException, ClientException
  {
    switch (responseMessage.getProtocolOpType())
    {
      case OP_TYPE_BIND_RESPONSE:
        // We'll deal with this later.
        break;
      case OP_TYPE_EXTENDED_RESPONSE:
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if (OID_NOTICE_OF_DISCONNECTION.equals(responseOID))
        {
          LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.
              get(extendedResponse.getResultCode(), extendedResponse.getErrorMessage());
          throw new LDAPException(extendedResponse.getResultCode(), message);
        }
        else
        {
          LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_EXTENDED_RESPONSE.get(extendedResponse);
          throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
        }
      default:
        LocalizableMessage message = ERR_LDAPAUTH_UNEXPECTED_RESPONSE.get(responseMessage.getProtocolOp());
        throw new ClientException(ReturnCode.CLIENT_SIDE_LOCAL_ERROR, message);
    }
  }
  /**
   * Handles the authentication callbacks to provide information needed by the
@@ -3617,8 +3485,7 @@
    ExtendedResponseProtocolOp extendedResponse =
         responseMessage.getExtendedResponseProtocolOp();
    String responseOID = extendedResponse.getOID();
    if ((responseOID != null) &&
        responseOID.equals(OID_NOTICE_OF_DISCONNECTION))
    if (OID_NOTICE_OF_DISCONNECTION.equals(responseOID))
    {
      LocalizableMessage message = ERR_LDAPAUTH_SERVER_DISCONNECT.get(
          extendedResponse.getResultCode(), extendedResponse.getErrorMessage());
@@ -3641,13 +3508,13 @@
    // Get the authorization ID (if there is one) and return it to the caller.
    ByteString authzID = extendedResponse.getValue();
    if ((authzID == null) || (authzID.length() == 0))
    if (authzID == null || authzID.length() == 0)
    {
      return null;
    }
    String valueString = authzID.toString();
    if ((valueString == null) || (valueString.length() == 0) ||
    if (valueString == null || valueString.length() == 0 ||
        valueString.equalsIgnoreCase("dn:"))
    {
      return null;
@@ -3656,4 +3523,3 @@
    return authzID;
  }
}
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPPasswordModify.java
@@ -534,7 +534,7 @@
        return CLIENT_SIDE_PARAM_ERROR;
      }
      if ((!authzID.isPresent() || (!currentPW.isPresent() && !currentPWFile.isPresent())))
      if (!authzID.isPresent() || (!currentPW.isPresent() && !currentPWFile.isPresent()))
      {
        LocalizableMessage message =
                ERR_LDAPPWMOD_ANON_REQUIRES_AUTHZID_AND_CURRENTPW.get();
@@ -807,7 +807,7 @@
      err.println(wrapText(message, MAX_LINE_WIDTH));
      LocalizableMessage errorMessage = extendedResponse.getErrorMessage();
      if ((errorMessage != null) && (errorMessage.length() > 0))
      if (errorMessage != null && errorMessage.length() > 0)
      {
        message = ERR_LDAPPWMOD_FAILURE_ERROR_MESSAGE.get(errorMessage);
        err.println(wrapText(message, MAX_LINE_WIDTH));
@@ -830,7 +830,7 @@
      out.println(wrapText(message, MAX_LINE_WIDTH));
      LocalizableMessage additionalInfo = extendedResponse.getErrorMessage();
      if ((additionalInfo != null) && (additionalInfo.length() > 0))
      if (additionalInfo != null && additionalInfo.length() > 0)
      {
        message = INFO_LDAPPWMOD_ADDITIONAL_INFO.get(additionalInfo);
        out.println(wrapText(message, MAX_LINE_WIDTH));
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java
@@ -437,7 +437,7 @@
    }
    int dnLength = dnString.length();
    if ((dnLength <= colsRemaining) || (colsRemaining <= 0))
    if (dnLength <= colsRemaining || colsRemaining <= 0)
    {
      buffer.append(dnString);
      buffer.append(EOL);
@@ -448,13 +448,13 @@
      buffer.append(EOL);
      int startPos = colsRemaining;
      while ((dnLength - startPos) > (wrapColumn - 1))
      while (dnLength - startPos > wrapColumn - 1)
      {
        buffer.append(" ");
        buffer.append(dnString, startPos, (startPos+wrapColumn-1));
        buffer.append(dnString, startPos, startPos+wrapColumn-1);
        buffer.append(EOL);
        startPos += (wrapColumn-1);
        startPos += wrapColumn-1;
      }
      if (startPos < dnLength)
@@ -500,7 +500,7 @@
          }
          int valueLength = valueString.length();
          if ((valueLength <= colsRemaining) || (colsRemaining <= 0))
          if (valueLength <= colsRemaining || colsRemaining <= 0)
          {
            buffer.append(valueString);
            buffer.append(EOL);
@@ -510,13 +510,13 @@
            buffer.append(EOL);
            int startPos = colsRemaining;
            while ((valueLength - startPos) > (wrapColumn - 1))
            while (valueLength - startPos > wrapColumn - 1)
            {
              buffer.append(" ");
              buffer.append(valueString, startPos, (startPos+wrapColumn-1));
              buffer.append(valueString, startPos, startPos+wrapColumn-1);
              buffer.append(EOL);
              startPos += (wrapColumn-1);
              startPos += wrapColumn-1;
            }
            if (startPos < valueLength)
@@ -1247,13 +1247,8 @@
      err.println(wrapText(ex1.getMessage(), MAX_LINE_WIDTH));
      return CLIENT_SIDE_PARAM_ERROR;
    }
    boolean val = searchOptions.setSearchScope(searchScope.getValue(), err);
    if(val == false)
    {
      return CLIENT_SIDE_PARAM_ERROR;
    }
    val = searchOptions.setDereferencePolicy(dereferencePolicy.getValue(), err);
    if(val == false)
    if (!searchOptions.setSearchScope(searchScope.getValue(), err)
        || !searchOptions.setDereferencePolicy(dereferencePolicy.getValue(), err))
    {
      return CLIENT_SIDE_PARAM_ERROR;
    }
@@ -1551,15 +1546,13 @@
      {
        if(saslOption.startsWith("mech="))
        {
          boolean mechValue = connectionOptions.setSASLMechanism(saslOption);
          if(mechValue == false)
          if (!connectionOptions.setSASLMechanism(saslOption))
          {
            return CLIENT_SIDE_PARAM_ERROR;
          }
        } else
        {
          boolean propValue = connectionOptions.addSASLProperty(saslOption);
          if(propValue == false)
          if (!connectionOptions.addSASLProperty(saslOption))
          {
            return CLIENT_SIDE_PARAM_ERROR;
          }
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolUtils.java
@@ -258,7 +258,7 @@
                                       int resultCode, LocalizableMessage errorMessage,
                                       DN matchedDN)
  {
    if ((explanation != null) && (explanation.length() > 0))
    if (explanation != null && explanation.length() > 0)
    {
      err.println(explanation);
    }
@@ -269,7 +269,7 @@
                             LDAPResultCode.toString(resultCode)));
    }
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      err.println(ERR_TOOL_ERROR_MESSAGE.get(errorMessage));
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFModify.java
@@ -287,7 +287,7 @@
      // If the entry is to be modified, then process the changes.
      LinkedList<Modification> mods = modifications.remove(entryDN);
      if ((mods != null) && (! mods.isEmpty()))
      if (mods != null && !mods.isEmpty())
      {
        try
        {
@@ -635,8 +635,7 @@
    boolean successful;
    try
    {
      successful = modifyLDIF(sourceReader, changeReader, targetWriter,
                              errorList);
      successful = modifyLDIF(sourceReader, changeReader, targetWriter, errorList);
    }
    catch (Exception e)
    {
@@ -650,7 +649,6 @@
    {
      err.println(s);
    }
    return (successful ? 0 : 1);
    return successful ? 0 : 1;
  }
}
opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java
@@ -333,7 +333,7 @@
    else
    {
      ArrayList<String> trailingArguments = argParser.getTrailingArguments();
      if ((trailingArguments == null) || trailingArguments.isEmpty())
      if (trailingArguments == null || trailingArguments.isEmpty())
      {
        LocalizableMessage message = ERR_LDIFSEARCH_NO_FILTER.get();
        err.println(message);
@@ -672,7 +672,7 @@
    while (true)
    {
      // If the time limit has been reached, then stop now.
      if ((timeLimitMillis > 0) && (System.currentTimeMillis() > stopTime))
      if (timeLimitMillis > 0 && System.currentTimeMillis() > stopTime)
      {
        resultCode = LDAPResultCode.TIME_LIMIT_EXCEEDED;
@@ -759,7 +759,7 @@
        writer.flush();
        matchCount++;
        if ((sizeLimitValue > 0) && (matchCount >= sizeLimitValue))
        if (sizeLimitValue > 0 && matchCount >= sizeLimitValue)
        {
          resultCode = LDAPResultCode.SIZE_LIMIT_EXCEEDED;
opendj-server-legacy/src/main/java/org/opends/server/tools/ManageAccount.java
@@ -1369,7 +1369,7 @@
    catch (LDAPConnectionException lce)
    {
      LocalizableMessage message;
      if ((lce.getCause() != null) && (lce.getCause().getCause() != null) &&
      if (lce.getCause() != null && lce.getCause().getCause() != null &&
        lce.getCause().getCause() instanceof SSLException) {
        message = ERR_PWPSTATE_CANNOT_CONNECT_SSL.get(host.getValue(),
          port.getValue());
@@ -1425,7 +1425,7 @@
    else if (subCommandName.equals(SC_SET_ACCOUNT_DISABLED_STATE))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        String valueStr = a.getValue();
        if (isTrueValue(valueStr))
@@ -1461,7 +1461,7 @@
    else if (subCommandName.equals(SC_SET_ACCOUNT_EXPIRATION_TIME))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        encode(writer, OP_SET_ACCOUNT_EXPIRATION_TIME, a.getValue());
      }
@@ -1485,7 +1485,7 @@
    else if (subCommandName.equals(SC_SET_PASSWORD_CHANGED_TIME))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        encode(writer, OP_SET_PASSWORD_CHANGED_TIME, a.getValue());
      }
@@ -1505,7 +1505,7 @@
    else if(subCommandName.equals(SC_SET_PASSWORD_EXP_WARNED_TIME))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        encode(writer, OP_SET_PASSWORD_EXPIRATION_WARNED_TIME,
                              a.getValue());
@@ -1539,7 +1539,7 @@
    else if(subCommandName.equals(SC_ADD_AUTHENTICATION_FAILURE_TIME))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        encode(writer, OP_ADD_AUTHENTICATION_FAILURE_TIME,
                              a.getValue());
@@ -1552,7 +1552,7 @@
    else if(subCommandName.equals(SC_SET_AUTHENTICATION_FAILURE_TIMES))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        ArrayList<String> valueList = new ArrayList<>(a.getValues());
        String[] values = new String[valueList.size()];
@@ -1588,7 +1588,7 @@
    else if(subCommandName.equals(SC_SET_LAST_LOGIN_TIME))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        encode(writer, OP_SET_LAST_LOGIN_TIME, a.getValue());
      }
@@ -1612,7 +1612,7 @@
    else if(subCommandName.equals(SC_SET_PASSWORD_RESET_STATE))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        String valueStr = a.getValue();
        if (isTrueValue(valueStr))
@@ -1653,7 +1653,7 @@
    else if(subCommandName.equals(SC_ADD_GRACE_LOGIN_USE_TIME))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        encode(writer, OP_ADD_GRACE_LOGIN_USE_TIME, a.getValue());
      }
@@ -1665,7 +1665,7 @@
    else if(subCommandName.equals(SC_SET_GRACE_LOGIN_USE_TIMES))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        ArrayList<String> valueList = new ArrayList<>(a.getValues());
        String[] values = new String[valueList.size()];
@@ -1694,7 +1694,7 @@
    else if(subCommandName.equals(SC_SET_PASSWORD_CHANGED_BY_REQUIRED_TIME))
    {
      Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
      if ((a != null) && a.isPresent())
      if (a != null && a.isPresent())
      {
        encode(writer, OP_SET_PASSWORD_CHANGED_BY_REQUIRED_TIME,
                              a.getValue());
@@ -1746,7 +1746,7 @@
  private static void printLabelAndValues(LocalizableMessage msg, ArrayList<String> values)
  {
    String label = String.valueOf(msg);
    if ((values == null) || values.isEmpty())
    if (values == null || values.isEmpty())
    {
      out.print(label);
      out.println(":");
opendj-server-legacy/src/main/java/org/opends/server/tools/PromptTrustManager.java
@@ -122,7 +122,7 @@
  public void checkServerTrusted(X509Certificate[] chain, String authType)
         throws CertificateException
  {
    if ((chain == null) || (chain.length == 0))
    if (chain == null || chain.length == 0)
    {
      System.out.println(WARN_PROMPTTM_NO_SERVER_CERT_CHAIN.get());
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
@@ -595,7 +595,7 @@
    catch (LDAPConnectionException lce)
    {
      LocalizableMessage message = null;
      if ((lce.getCause() != null) && (lce.getCause().getCause() != null) &&
      if (lce.getCause() != null && lce.getCause().getCause() != null &&
        lce.getCause().getCause() instanceof SSLException) {
      message = ERR_STOPDS_CANNOT_CONNECT_SSL.get(host.getValue(),
        port.getValue());
@@ -689,8 +689,7 @@
        ExtendedResponseProtocolOp extendedResponse =
             responseMessage.getExtendedResponseProtocolOp();
        String responseOID = extendedResponse.getOID();
        if ((responseOID != null) &&
            (responseOID.equals(LDAPConstants.OID_NOTICE_OF_DISCONNECTION)))
        if (LDAPConstants.OID_NOTICE_OF_DISCONNECTION.equals(responseOID))
        {
          LocalizableMessage message = extendedResponse.getErrorMessage();
          if (message != null)
@@ -739,7 +738,7 @@
    boolean quietMode = false;
    Argument quietArg = argParser.getArgumentForLongID(ArgumentConstants.OPTION_LONG_QUIET);
    if ((quietArg != null) && quietArg.isPresent())
    if (quietArg != null && quietArg.isPresent())
    {
      quietMode = true;
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/AttributeValueTag.java
@@ -113,7 +113,7 @@
                                  List<LocalizableMessage> warnings)
         throws InitializationException
  {
    if ((arguments.length < 1) || (arguments.length > 2))
    if (arguments.length < 1 || arguments.length > 2)
    {
      LocalizableMessage message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
          getName(), lineNumber, 1, 2, arguments.length);
@@ -176,7 +176,7 @@
                                    int lineNumber, List<LocalizableMessage> warnings)
         throws InitializationException
  {
    if ((arguments.length < 1) || (arguments.length > 2))
    if (arguments.length < 1 || arguments.length > 2)
    {
      LocalizableMessage message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
          getName(), lineNumber, 1, 2, arguments.length);
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Branch.java
@@ -402,9 +402,9 @@
    for (TemplateLine l : extraLines)
    {
      TagResult r = l.generateLine(entry);
      if ((!r.keepProcessingEntry()
      if (!r.keepProcessingEntry()
          || !r.keepProcessingParent()
          || !r.keepProcessingTemplateFile()))
          || !r.keepProcessingTemplateFile())
      {
        return r;
      }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/DNTag.java
@@ -191,7 +191,7 @@
                                 TemplateValue templateValue)
  {
    DN dn = templateEntry.getDN();
    if ((dn == null) || dn.isRootDN())
    if (dn == null || dn.isRootDN())
    {
      return TagResult.SUCCESS_RESULT;
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/FileTag.java
@@ -176,7 +176,7 @@
    // There must be at least one argument, and possibly two.
    if ((arguments.length < 1) || (arguments.length > 2))
    if (arguments.length < 1 || arguments.length > 2)
    {
      LocalizableMessage message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
          getName(), lineNumber, 1, 2, arguments.length);
@@ -186,7 +186,7 @@
    // The first argument should be the path to the file.
    dataFile = templateFile.getFile(arguments[0]);
    if ((dataFile == null) || (! dataFile.exists()))
    if (dataFile == null || !dataFile.exists())
    {
      LocalizableMessage message = ERR_MAKELDIF_TAG_CANNOT_FIND_FILE.get(
          arguments[0], getName(), lineNumber);
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfAbsentTag.java
@@ -113,7 +113,7 @@
                                  List<LocalizableMessage> warnings)
         throws InitializationException
  {
    if ((arguments.length < 1) || (arguments.length > 2))
    if (arguments.length < 1 || arguments.length > 2)
    {
      LocalizableMessage message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
          getName(), lineNumber, 1, 2, arguments.length);
@@ -161,7 +161,7 @@
                                    int lineNumber, List<LocalizableMessage> warnings)
         throws InitializationException
  {
    if ((arguments.length < 1) || (arguments.length > 2))
    if (arguments.length < 1 || arguments.length > 2)
    {
      LocalizableMessage message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
          getName(), lineNumber, 1, 2, arguments.length);
@@ -203,7 +203,7 @@
                                 TemplateValue templateValue)
  {
    List<TemplateValue> values = templateEntry.getValues(attributeType);
    if ((values == null) || values.isEmpty())
    if (values == null || values.isEmpty())
    {
      return TagResult.SUCCESS_RESULT;
    }
@@ -212,8 +212,7 @@
    {
      return TagResult.OMIT_FROM_ENTRY;
    }
    else
    {
      for (TemplateValue v : values)
      {
        if (assertionValue.equals(v.getValue().toString()))
@@ -221,9 +220,7 @@
          return TagResult.OMIT_FROM_ENTRY;
        }
      }
      return TagResult.SUCCESS_RESULT;
    }
  }
}
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfPresentTag.java
@@ -113,7 +113,7 @@
                                  List<LocalizableMessage> warnings)
         throws InitializationException
  {
    if ((arguments.length < 1) || (arguments.length > 2))
    if (arguments.length < 1 || arguments.length > 2)
    {
      LocalizableMessage message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
          getName(), lineNumber, 1, 2, arguments.length);
@@ -161,7 +161,7 @@
                                    int lineNumber, List<LocalizableMessage> warnings)
         throws InitializationException
  {
    if ((arguments.length < 1) || (arguments.length > 2))
    if (arguments.length < 1 || arguments.length > 2)
    {
      LocalizableMessage message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
          getName(), lineNumber, 1, 2, arguments.length);
@@ -202,7 +202,7 @@
                                 TemplateValue templateValue)
  {
    List<TemplateValue> values = templateEntry.getValues(attributeType);
    if ((values == null) || values.isEmpty())
    if (values == null || values.isEmpty())
    {
      return TagResult.OMIT_FROM_ENTRY;
    }
@@ -211,8 +211,7 @@
    {
      return TagResult.SUCCESS_RESULT;
    }
    else
    {
      for (TemplateValue v : values)
      {
        if (assertionValue.equals(v.getValue().toString()))
@@ -220,9 +219,6 @@
          return TagResult.SUCCESS_RESULT;
        }
      }
      return TagResult.OMIT_FROM_ENTRY;
    }
  }
}
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java
@@ -160,7 +160,7 @@
      return -1;
    }
    return (0xFF & entryBytes.get());
    return 0xFF & entryBytes.get();
  }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/ParentDNTag.java
@@ -22,13 +22,12 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.tools.makeldif;
import org.forgerock.i18n.LocalizableMessage;
import java.util.List;
import org.opends.server.types.DN;
@@ -36,8 +35,6 @@
import static org.opends.messages.ToolMessages.*;
/**
 * This class defines a tag that is used to include the DN of the parent entry
 * in the attribute value.
@@ -124,7 +121,7 @@
                                 TemplateValue templateValue)
  {
    DN parentDN = templateEntry.getParentDN();
    if ((parentDN == null) || parentDN.isRootDN())
    if (parentDN == null || parentDN.isRootDN())
    {
      return TagResult.SUCCESS_RESULT;
    }
@@ -133,4 +130,3 @@
    return TagResult.SUCCESS_RESULT;
  }
}
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/RandomTag.java
@@ -315,7 +315,7 @@
    // There must be at least one argument, to specify the type of random value
    // to generate.
    if ((arguments == null) || (arguments.length == 0))
    if (arguments == null || arguments.length == 0)
    {
      LocalizableMessage message =
          ERR_MAKELDIF_TAG_NO_RANDOM_TYPE_ARGUMENT.get(lineNumber);
@@ -361,7 +361,7 @@
          throw new InitializationException(message, nfe);
        }
      }
      else if ((numArgs == 3) || (numArgs == 4))
      else if (numArgs == 3 || numArgs == 4)
      {
        randomType = RANDOM_TYPE_NUMERIC;
@@ -427,7 +427,7 @@
    }
    else if (randomTypeString.equals("chars"))
    {
      if ((numArgs < 3) || (numArgs > 4))
      if (numArgs < 3 || numArgs > 4)
      {
        LocalizableMessage message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
            getName(), lineNumber, 3, 4, numArgs);
@@ -647,7 +647,7 @@
      case RANDOM_TYPE_MONTH:
        String month = MONTHS[random.nextInt(MONTHS.length)];
        if ((maxLength == 0) || (month.length() <= maxLength))
        if (maxLength == 0 || month.length() <= maxLength)
        {
          buffer.append(month);
        }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
@@ -344,7 +344,7 @@
    // Get the information necessary to write the LDIF.
    BufferedWriter writer     = exportConfig.getWriter();
    int            wrapColumn = exportConfig.getWrapColumn();
    boolean        wrapLines  = (wrapColumn > 1);
    boolean        wrapLines  = wrapColumn > 1;
    // First, write the DN.  It will always be included.
@@ -381,8 +381,7 @@
      {
        for (Attribute a : userAttributes.get(attrType))
        {
          if (a.isVirtual() &&
              (! exportConfig.includeVirtualAttributes()))
          if (a.isVirtual() && !exportConfig.includeVirtualAttributes())
          {
            continue;
          }
@@ -425,8 +424,7 @@
        {
          for (Attribute a : operationalAttributes.get(attrType))
          {
            if (a.isVirtual() &&
                (! exportConfig.includeVirtualAttributes()))
            if (a.isVirtual() && !exportConfig.includeVirtualAttributes())
            {
              continue;
            }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java
@@ -563,7 +563,7 @@
  {
    templatePath = null;
    File f = getFile(filename);
    if ((f == null) || (! f.exists()))
    if (f == null || !f.exists())
    {
      LocalizableMessage message = ERR_MAKELDIF_COULD_NOT_FIND_TEMPLATE_FILE.get(filename);
      throw new IOException(message.toString());
@@ -650,7 +650,7 @@
                              templateFileConstants, warnings);
      String lowerLine = toLowerCase(line);
      if ((line.length() == 0) || line.startsWith("#"))
      if (line.length() == 0 || line.startsWith("#"))
      {
        // This is a comment or a blank line, so we'll ignore it.
        continue;
@@ -866,8 +866,8 @@
        StringBuilder lineBuffer = new StringBuilder(line);
        int openPos = line.lastIndexOf('[', closePos);
        // Find the opening bracket. If it's escaped, then it's not a constant
        if ((openPos > 0 && line.charAt(openPos - 1) != '\\') ||
            (openPos == 0))
        if ((openPos > 0 && line.charAt(openPos - 1) != '\\')
            || openPos == 0)
        {
          String constantName =
              toLowerCase(line.substring(openPos+1, closePos));
@@ -1273,7 +1273,7 @@
      }
    }
    //  Then, find the position of the first non-blank character in the line.
    while ((pos < length) && (lowerLine.charAt(pos) == ' '))
    while (pos < length && lowerLine.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -1673,7 +1673,7 @@
    for (Branch b : branches.values())
    {
      TagResult result = b.writeEntries(entryWriter);
      if (! (result.keepProcessingTemplateFile()))
      if (!result.keepProcessingTemplateFile())
      {
        return result;
      }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/UnderscoreDNTag.java
@@ -191,7 +191,7 @@
                                 TemplateValue templateValue)
  {
    DN dn = templateEntry.getDN();
    if ((dn == null) || dn.isRootDN())
    if (dn == null || dn.isRootDN())
    {
      return TagResult.SUCCESS_RESULT;
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/UnderscoreParentDNTag.java
@@ -22,13 +22,12 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.tools.makeldif;
import org.forgerock.i18n.LocalizableMessage;
import java.util.List;
import org.opends.server.types.DN;
@@ -36,8 +35,6 @@
import static org.opends.messages.ToolMessages.*;
/**
 * This class defines a tag that is used to include the DN of the parent entry
 * in the attribute value, with underscores in place of commas.
@@ -124,7 +121,7 @@
                                 TemplateValue templateValue)
  {
    DN parentDN = templateEntry.getParentDN();
    if ((parentDN == null) || parentDN.isRootDN())
    if (parentDN == null || parentDN.isRootDN())
    {
      return TagResult.SUCCESS_RESULT;
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java
@@ -191,7 +191,7 @@
    ocValues.add("top");
    ocValues.add(ConfigConstants.OC_TASK);
    if (scheduleRecurring) {
      ocValues.add((ConfigConstants.OC_RECURRING_TASK));
      ocValues.add(ConfigConstants.OC_RECURRING_TASK);
    }
    ocValues.add(information.getTaskObjectclass());
    attributes.add(new LDAPAttribute(ATTR_OBJECTCLASS, ocValues));
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskEntry.java
@@ -385,25 +385,23 @@
   * @return boolean where true means this task supports being canceled.
   */
  public boolean isCancelable() {
    boolean cancelable = false;
    TaskState state = getTaskState();
    if (state != null) {
      Task task = getTask();
      cancelable = (TaskState.isPending(state) ||
        TaskState.isRecurring(state) ||
              (TaskState.isRunning(state) &&
                      task != null &&
                      task.isInterruptable()));
      return TaskState.isPending(state)
          || TaskState.isRecurring(state)
          || (TaskState.isRunning(state)
              && task != null
              && task.isInterruptable());
    }
    return cancelable;
    return false;
  }
  /**
   * Gets a mapping of attributes that are specific to the implementing
   * task as opposed to the superior, or base, task.
   *
   * @return mapping of atribute field labels to lists of string values for
   *         each field.
   * @return mapping of attribute field labels to lists of string values for each field.
   */
  public Map<LocalizableMessage, List<String>> getTaskSpecificAttributeValuePairs() {
    return taskSpecificAttrValues;
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java
@@ -282,12 +282,12 @@
      {
        return false;
      }
      while ((descendant != null) && !ancestor.equals(descendant))
      while (descendant != null && !ancestor.equals(descendant))
      {
        descendant = descendant.getParentFile();
      }
    }
    return (ancestor != null) && (descendant != null);
    return ancestor != null && descendant != null;
  }
  /**
@@ -300,17 +300,16 @@
   * either of the files are null
   */
  static boolean isDescendant(File descendant, File path) {
    boolean isDescendant = false;
    if (descendant != null && path != null) {
      File parent = descendant.getParentFile();
      while ((parent != null) && !isDescendant) {
        isDescendant = path.equals(parent);
        if (!isDescendant) {
      while (parent != null) {
        if (path.equals(parent)) {
          return true;
        }
          parent = parent.getParentFile();
        }
      }
    }
    return isDescendant;
    return false;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/server/types/AccountStatusNotification.java
@@ -262,12 +262,11 @@
      props.put(PASSWORD_EXPIRATION_TIME, newArrayList(new Date(expTime).toString()));
    }
    if ((oldPasswords != null) && (! oldPasswords.isEmpty()))
    if (oldPasswords != null && !oldPasswords.isEmpty())
    {
      props.put(OLD_PASSWORD, toStrings(oldPasswords));
    }
    if ((newPasswords != null) && (! newPasswords.isEmpty()))
    if (newPasswords != null && !newPasswords.isEmpty())
    {
      props.put(NEW_PASSWORD, toStrings(newPasswords));
    }
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
@@ -528,7 +528,7 @@
    @Override
    public boolean hasAllOptions(Collection<String> options)
    {
      return (options == null || options.isEmpty());
      return options == null || options.isEmpty();
    }
@@ -555,7 +555,7 @@
    @Override
    public boolean optionsEqual(Set<String> options)
    {
      return (options == null || options.isEmpty());
      return options == null || options.isEmpty();
    }
  }
@@ -814,7 +814,7 @@
        return elements.contains(o);
      }
      return (firstElement != null && firstElement.equals(o));
      return firstElement != null && firstElement.equals(o);
    }
    /**
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java
@@ -86,7 +86,7 @@
    }
    private static boolean isEmpty(final Attribute attribute) {
        return (attribute == null) || attribute.isEmpty();
        return attribute == null || attribute.isEmpty();
    }
    private final Attribute attribute;
opendj-server-legacy/src/main/java/org/opends/server/types/AuthenticationInfo.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS
 *      Portions Copyright 2013-2015 ForgeRock AS
 */
package org.opends.server.types;
@@ -107,7 +107,7 @@
    this.authenticationEntry = authenticationEntry;
    this.isRoot              = isRoot;
    isAuthenticated     = (authenticationEntry != null);
    isAuthenticated     = authenticationEntry != null;
    mustChangePassword  = false;
    simpleBindDN        = authenticationEntry != null ?
        authenticationEntry.getName() : null;
opendj-server-legacy/src/main/java/org/opends/server/types/CacheEntry.java
@@ -142,7 +142,7 @@
    }
    CacheEntry e = (CacheEntry) o;
    return ((e.entryID == entryID) && (e.entry.equals(entry)));
    return e.entryID == entryID && e.entry.equals(entry);
  }
}
opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java
@@ -486,7 +486,7 @@
    ifNull(name);
    if ((values == null) || values.isEmpty())
    if (values == null || values.isEmpty())
    {
      extraProperties.remove(name);
    }
opendj-server-legacy/src/main/java/org/opends/server/types/DITContentRule.java
@@ -166,7 +166,7 @@
      this.definition = definition;
    }
    if ((names == null) || names.isEmpty())
    if (names == null || names.isEmpty())
    {
      this.names = new LinkedHashMap<>(0);
    }
@@ -175,7 +175,7 @@
      this.names = new LinkedHashMap<>(names);
    }
    if ((auxiliaryClasses == null) || auxiliaryClasses.isEmpty())
    if (auxiliaryClasses == null || auxiliaryClasses.isEmpty())
    {
      this.auxiliaryClasses = new LinkedHashSet<>(0);
    }
@@ -184,7 +184,7 @@
      this.auxiliaryClasses = new LinkedHashSet<>(auxiliaryClasses);
    }
    if ((requiredAttributes == null) || requiredAttributes.isEmpty())
    if (requiredAttributes == null || requiredAttributes.isEmpty())
    {
      this.requiredAttributes = new LinkedHashSet<>(0);
    }
@@ -193,7 +193,7 @@
      this.requiredAttributes = new LinkedHashSet<>(requiredAttributes);
    }
    if ((optionalAttributes == null) || optionalAttributes.isEmpty())
    if (optionalAttributes == null || optionalAttributes.isEmpty())
    {
      this.optionalAttributes = new LinkedHashSet<>(0);
    }
@@ -202,8 +202,7 @@
      this.optionalAttributes = new LinkedHashSet<>(optionalAttributes);
    }
    if ((prohibitedAttributes == null) ||
        prohibitedAttributes.isEmpty())
    if (prohibitedAttributes == null || prohibitedAttributes.isEmpty())
    {
      this.prohibitedAttributes = new LinkedHashSet<>(0);
    }
@@ -212,7 +211,7 @@
      this.prohibitedAttributes = new LinkedHashSet<>(prohibitedAttributes);
    }
    if ((extraProperties == null) || extraProperties.isEmpty())
    if (extraProperties == null || extraProperties.isEmpty())
    {
      this.extraProperties = new LinkedHashMap<>(0);
    }
@@ -380,8 +379,8 @@
   */
  public boolean isRequiredOrOptional(AttributeType attributeType)
  {
    return (requiredAttributes.contains(attributeType) ||
            optionalAttributes.contains(attributeType));
    return requiredAttributes.contains(attributeType) ||
            optionalAttributes.contains(attributeType);
  }
@@ -450,8 +449,7 @@
    {
      return true;
    }
    if ((o == null) || (! (o instanceof DITContentRule)))
    if (!(o instanceof DITContentRule))
    {
      return false;
    }
opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java
@@ -144,7 +144,7 @@
      this.definition = definition;
    }
    if ((names == null) || names.isEmpty())
    if (names == null || names.isEmpty())
    {
      this.names = new LinkedHashMap<>(0);
    }
@@ -153,7 +153,7 @@
      this.names = new LinkedHashMap<>(names);
    }
    if ((superiorRules == null) || superiorRules.isEmpty())
    if (superiorRules == null || superiorRules.isEmpty())
    {
      this.superiorRules = new LinkedHashSet<>(0);
    }
@@ -162,7 +162,7 @@
      this.superiorRules = new LinkedHashSet<>(superiorRules);
    }
    if ((extraProperties == null) || extraProperties.isEmpty())
    if (extraProperties == null || extraProperties.isEmpty())
    {
      this.extraProperties = new LinkedHashMap<>(0);
    }
opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
@@ -144,7 +144,7 @@
   */
  public DN(List<RDN> rdnComponents)
  {
    if ((rdnComponents == null) || rdnComponents.isEmpty())
    if (rdnComponents == null || rdnComponents.isEmpty())
    {
      this.rdnComponents = new RDN[0];
    }
@@ -213,7 +213,7 @@
   */
  public boolean isRootDN()
  {
    return (numComponents == 0);
    return numComponents == 0;
  }
@@ -340,15 +340,13 @@
   */
  public DN getParentDNInSuffix()
  {
    if ((numComponents <= 1) ||
        DirectoryServer.isNamingContext(this))
    if (numComponents <= 1 || DirectoryServer.isNamingContext(this))
    {
      return null;
    }
    RDN[] parentComponents = new RDN[numComponents-1];
    System.arraycopy(rdnComponents, 1, parentComponents, 0,
                     numComponents-1);
    System.arraycopy(rdnComponents, 1, parentComponents, 0, numComponents-1);
    return new DN(parentComponents);
  }
@@ -523,7 +521,7 @@
      case SUBORDINATES:
        // This DN must be a descendant of the provided base DN, but
        // not equal to it.
        return ((! equals(baseDN)) && isDescendantOf(baseDN));
        return !equals(baseDN) && isDescendantOf(baseDN);
      default:
        // This is a scope that we don't recognize.
@@ -566,7 +564,7 @@
    for (int i = 0; i < length; i++)
    {
      b = dnString.byteAt(i);
      if (((b & 0x7F) != b) || (b == '\\'))
      if ((b & 0x7F) != b || b == '\\')
      {
        return valueOf(dnString.toString());
      }
@@ -610,8 +608,7 @@
      }
      // Skip over any spaces between the attribute name and its
      // value.
      // Skip over any spaces between the attribute name and its value.
      b = ' ';
      while (dnReader.remaining() > 0 && (b = dnReader.get()) == ' ')
      {}
@@ -699,7 +696,7 @@
        rdnComponents.add(rdn);
        return new DN(rdnComponents);
      }
      else if ((b == ',') || (b == ';'))
      else if (b == ',' || b == ';')
      {
        // We're at the end of the RDN component, so add it to the
        // list, skip over the comma/semicolon, and start on the next
@@ -743,8 +740,7 @@
        }
        // Skip over any spaces between the attribute name and its
        // value.
        // Skip over any spaces between the attribute name and its value.
        b = ' ';
        while (dnReader.remaining() > 0 &&
            (b = dnReader.get()) == ' ')
@@ -830,10 +826,8 @@
        rdn.addValue(attrType, attributeNameString, parsedValue);
        // Skip over any spaces that might be after the attribute
        // value.
        // Skip over any spaces that might be after the attribute
        // value.
        // Skip over any spaces that might be after the attribute value.
        // Skip over any spaces that might be after the attribute value.
        b = ' ';
        while (dnReader.remaining() > 0 &&
            (b = dnReader.get()) == ' ')
@@ -850,7 +844,7 @@
          rdnComponents.add(rdn);
          return new DN(rdnComponents);
        }
        else if ((b == ',') || (b == ';'))
        else if (b == ',' || b == ';')
        {
          // We're at the end of the RDN component, so add it to the
          // list, skip over the comma/semicolon, and start on the
@@ -939,8 +933,7 @@
      }
      // Skip over any spaces between the attribute name and its
      // value.
      // Skip over any spaces between the attribute name and its value.
      c = dnString.charAt(pos);
      while (c == ' ')
      {
@@ -953,11 +946,8 @@
          throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
              ERR_ATTR_SYNTAX_DN_END_WITH_ATTR_NAME.get(dnString, attributeName));
        }
        else
        {
          c = dnString.charAt(pos);
        }
      }
      // The next character must be an equal sign.  If it is not, then
@@ -974,7 +964,7 @@
      // Skip over any spaces after the equal sign.
      while ((pos < length) && ((c = dnString.charAt(pos)) == ' '))
      while (pos < length && ((c = dnString.charAt(pos)) == ' '))
      {
        pos++;
      }
@@ -1008,7 +998,7 @@
      // Skip over any spaces that might be after the attribute value.
      while ((pos < length) && ((c = dnString.charAt(pos)) == ' '))
      while (pos < length && ((c = dnString.charAt(pos)) == ' '))
      {
        pos++;
      }
@@ -1024,7 +1014,7 @@
        rdnComponents.add(rdn);
        return new DN(rdnComponents);
      }
      else if ((c == ',') || (c == ';'))
      else if (c == ',' || c == ';')
      {
        // We're at the end of the RDN component, so add it to the
        // list, skip over the comma/semicolon, and start on the next
@@ -1052,7 +1042,7 @@
        // Skip over the plus sign and any spaces that may follow it
        // before the next attribute name.
        pos++;
        while ((pos < length) && (dnString.charAt(pos) == ' '))
        while (pos < length && dnString.charAt(pos) == ' ')
        {
          pos++;
        }
@@ -1073,8 +1063,7 @@
        }
        // Skip over any spaces between the attribute name and its
        // value.
        // Skip over any spaces between the attribute name and its value.
        c = dnString.charAt(pos);
        while (c == ' ')
        {
@@ -1087,11 +1076,8 @@
            throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
                ERR_ATTR_SYNTAX_DN_END_WITH_ATTR_NAME.get(dnString, attributeName));
          }
          else
          {
            c = dnString.charAt(pos);
          }
        }
        // The next character must be an equal sign.  If it is not,
@@ -1108,7 +1094,7 @@
        // Skip over any spaces after the equal sign.
        while ((pos < length) && ((c = dnString.charAt(pos)) == ' '))
        while (pos < length && ((c = dnString.charAt(pos)) == ' '))
        {
          pos++;
        }
@@ -1163,9 +1149,8 @@
        rdn.addValue(attrType, name, parsedValue.toByteString());
        // Skip over any spaces that might be after the attribute
        // value.
        while ((pos < length) && ((c = dnString.charAt(pos)) == ' '))
        // Skip over any spaces that might be after the attribute value.
        while (pos < length && ((c = dnString.charAt(pos)) == ' '))
        {
          pos++;
        }
@@ -1181,7 +1166,7 @@
          rdnComponents.add(rdn);
          return new DN(rdnComponents);
        }
        else if ((c == ',') || (c == ';'))
        else if (c == ',' || c == ';')
        {
          // We're at the end of the RDN component, so add it to the
          // list, skip over the comma/semicolon, and start on the
@@ -1514,27 +1499,25 @@
        }
      }
      while (validOID && (namePos < nameLength))
      while (validOID && namePos < nameLength)
      {
        byte ch = nameBytes.byteAt(namePos++);
        if (isDigit((char)ch))
        {
          while (validOID && (namePos < nameLength) &&
          while (validOID && namePos < nameLength &&
                 isDigit((char)nameBytes.byteAt(namePos)))
          {
            namePos++;
          }
          if ((namePos < nameLength) &&
              (nameBytes.byteAt(namePos) != '.'))
          if (namePos < nameLength && nameBytes.byteAt(namePos) != '.')
          {
            validOID = false;
          }
        }
        else if (ch == '.')
        {
          if ((namePos == 1) ||
              (nameBytes.byteAt(namePos-2) == '.'))
          if (namePos == 1 || nameBytes.byteAt(namePos-2) == '.')
          {
            validOID = false;
          }
@@ -1546,7 +1529,7 @@
      }
      if (validOID && (nameBytes.byteAt(nameLength-1) == '.'))
      if (validOID && nameBytes.byteAt(nameLength-1) == '.')
      {
        validOID = false;
      }
@@ -1558,10 +1541,10 @@
            ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_PERIOD.get(dnBytes, nameBytes));
      }
    }
    else if (isDigit((char)nameBytes.byteAt(0)) && (!allowExceptions))
    else if (isDigit((char)nameBytes.byteAt(0)) && !allowExceptions)
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_INITIAL_DIGIT.
          get(dnBytes, ((char)nameBytes.byteAt(0)),
          get(dnBytes, (char)nameBytes.byteAt(0),
              ATTR_ALLOW_ATTRIBUTE_NAME_EXCEPTIONS);
      throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX, message);
    }
@@ -1919,27 +1902,25 @@
        }
      }
      while (validOID && (namePos < nameLength))
      while (validOID && namePos < nameLength)
      {
        char ch = attributeName.charAt(namePos++);
        if (isDigit(ch))
        {
          while (validOID && (namePos < nameLength) &&
          while (validOID && namePos < nameLength &&
                 isDigit(attributeName.charAt(namePos)))
          {
            namePos++;
          }
          if ((namePos < nameLength) &&
              (attributeName.charAt(namePos) != '.'))
          if (namePos < nameLength && attributeName.charAt(namePos) != '.')
          {
            validOID = false;
          }
        }
        else if (ch == '.')
        {
          if ((namePos == 1) ||
              (attributeName.charAt(namePos-2) == '.'))
          if (namePos == 1 || attributeName.charAt(namePos-2) == '.')
          {
            validOID = false;
          }
@@ -1951,7 +1932,7 @@
      }
      if (validOID && (attributeName.charAt(nameLength-1) == '.'))
      if (validOID && attributeName.charAt(nameLength-1) == '.')
      {
        validOID = false;
      }
@@ -1962,8 +1943,7 @@
            ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_PERIOD.get(dnString, attributeName));
      }
    }
    else if (isDigit(attributeName.charAt(0)) &&
             (! allowExceptions))
    else if (isDigit(attributeName.charAt(0)) && !allowExceptions)
    {
      LocalizableMessage message = ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_INITIAL_DIGIT.
          get(dnString, attributeName.charAt(0),
@@ -2058,7 +2038,7 @@
                ERR_ATTR_SYNTAX_DN_HEX_VALUE_TOO_SHORT.get(dnBytes));
          }
        }
        else if ((b == ' ') || (b == ',') || (b == ';') || (b == '+'))
        else if (b == ' ' || b == ',' || b == ';' || b == '+')
        {
          // This denotes the end of the value.
          dnBytes.skip(-1);
@@ -2140,13 +2120,12 @@
      {
        if (dnBytes.remaining() <= 0)
        {
          // This is the end of the DN and therefore the end of the
          // value.
          // This is the end of the DN and therefore the end of the value.
          break;
        }
        b = dnBytes.get();
        if ((b == ',') || (b == ';') || (b == '+'))
        if (b == ',' || b == ';' || b == '+')
        {
          dnBytes.skip(-1);
          break;
@@ -2207,7 +2186,7 @@
    {
      // The first two characters must be hex characters.
      StringBuilder hexString = new StringBuilder();
      if ((pos+2) > length)
      if (pos+2 > length)
      {
        LocalizableMessage message =
            ERR_ATTR_SYNTAX_DN_HEX_VALUE_TOO_SHORT.get(dnString);
@@ -2265,7 +2244,7 @@
                                         message);
          }
        }
        else if ((c == ' ') || (c == ',') || (c == ';'))
        else if (c == ' ' || c == ',' || c == ';')
        {
          // This denotes the end of the value.
          pos--;
@@ -2341,8 +2320,7 @@
        }
        else
        {
          // This is just a regular character that should be in the
          // value.
          // This is just a regular character that should be in the value.
          valueString.append(c);
        }
      }
@@ -2410,8 +2388,7 @@
            // containing one or more multi-byte UTF-8 characters so
            // we can't just treat this byte in isolation.  Collect
            // all the bytes together and make sure to take care of
            // these hex bytes before appending anything else to the
            // value.
            // these hex bytes before appending anything else to the value.
            if (pos >= length)
            {
              LocalizableMessage message =
@@ -2450,7 +2427,7 @@
        {
          escaped = true;
        }
        else if ((c == ',') || (c == ';'))
        else if (c == ',' || c == ';')
        {
          appendHexChars(dnString, valueString, hexChars);
          pos--;
@@ -2470,8 +2447,7 @@
      }
      // Strip off any unescaped spaces that may be at the end of the
      // value.
      // Strip off any unescaped spaces that may be at the end of the value.
      if (pos > 2 && dnString.charAt(pos-1) == ' ' &&
           dnString.charAt(pos-2) != '\\')
      {
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
@@ -1754,7 +1754,7 @@
    else
    {
      ditContentRule = DirectoryServer.getDITContentRule(structuralClass);
      if ((ditContentRule != null) && ditContentRule.isObsolete())
      if (ditContentRule != null && ditContentRule.isObsolete())
      {
        ditContentRule = null;
      }
@@ -1809,10 +1809,10 @@
        }
        if (validateStructureRules && (nameForm != null))
        if (validateStructureRules && nameForm != null)
        {
          ditStructureRule = DirectoryServer.getDITStructureRule(nameForm);
          if ((ditStructureRule != null) && ditStructureRule.isObsolete())
          if (ditStructureRule != null && ditStructureRule.isObsolete())
          {
            ditStructureRule = null;
          }
@@ -1868,9 +1868,8 @@
        return false;
      }
      if ((o.getObjectClassType() == ObjectClassType.AUXILIARY) &&
          (ditContentRule != null) &&
          (! ditContentRule.getAuxiliaryClasses().contains(o)))
      if (o.getObjectClassType() == ObjectClassType.AUXILIARY
          && ditContentRule != null && !ditContentRule.getAuxiliaryClasses().contains(o))
      {
        LocalizableMessage message =
                ERR_ENTRY_SCHEMA_DISALLOWED_AUXILIARY_CLASS.get(
@@ -1945,7 +1944,7 @@
            invalidReason.append(ERR_ENTRY_SCHEMA_ATTR_NO_VALUES.get(dn, t.getNameOrOID()));
            return false;
          }
          else if (t.isSingleValue() && (a.size() != 1))
          else if (t.isSingleValue() && a.size() != 1)
          {
            invalidReason.append(ERR_ENTRY_SCHEMA_ATTR_SINGLE_VALUED.get(dn, t.getNameOrOID()));
            return false;
opendj-server-legacy/src/main/java/org/opends/server/types/FilePermission.java
@@ -273,7 +273,7 @@
   */
  public boolean isOwnerReadable()
  {
    return ((encodedPermission & OWNER_READABLE) == OWNER_READABLE);
    return is(encodedPermission, OWNER_READABLE);
  }
@@ -287,7 +287,7 @@
   */
  public boolean isOwnerWritable()
  {
    return ((encodedPermission & OWNER_WRITABLE) == OWNER_WRITABLE);
    return is(encodedPermission, OWNER_WRITABLE);
  }
@@ -301,8 +301,7 @@
   */
  public boolean isOwnerExecutable()
  {
    return ((encodedPermission & OWNER_EXECUTABLE) ==
            OWNER_EXECUTABLE);
    return is(encodedPermission, OWNER_EXECUTABLE);
  }
@@ -316,7 +315,7 @@
   */
  public boolean isGroupReadable()
  {
    return ((encodedPermission & GROUP_READABLE) == GROUP_READABLE);
    return is(encodedPermission, GROUP_READABLE);
  }
@@ -330,7 +329,7 @@
   */
  public boolean isGroupWritable()
  {
    return ((encodedPermission & GROUP_WRITABLE) == GROUP_WRITABLE);
    return is(encodedPermission, GROUP_WRITABLE);
  }
@@ -344,8 +343,7 @@
   */
  public boolean isGroupExecutable()
  {
    return ((encodedPermission & GROUP_EXECUTABLE) ==
            GROUP_EXECUTABLE);
    return is(encodedPermission, GROUP_EXECUTABLE);
  }
@@ -359,7 +357,7 @@
   */
  public boolean isOtherReadable()
  {
    return ((encodedPermission & OTHER_READABLE) == OTHER_READABLE);
    return is(encodedPermission, OTHER_READABLE);
  }
@@ -373,7 +371,7 @@
   */
  public boolean isOtherWritable()
  {
    return ((encodedPermission & OTHER_WRITABLE) == OTHER_WRITABLE);
    return is(encodedPermission, OTHER_WRITABLE);
  }
@@ -387,11 +385,13 @@
   */
  public boolean isOtherExecutable()
  {
    return ((encodedPermission & OTHER_EXECUTABLE) ==
            OTHER_EXECUTABLE);
    return is(encodedPermission, OTHER_EXECUTABLE);
  }
  private boolean is(int encodedPermissions, int permission)
  {
    return (encodedPermissions & permission) == permission;
  }
  /**
   * Attempts to set the given permissions on the specified file.  If
@@ -538,7 +538,7 @@
  public static FilePermission decodeUNIXMode(String modeString)
         throws DirectoryException
  {
    if ((modeString == null) || (modeString.length() != 3))
    if (modeString == null || modeString.length() != 3)
    {
      LocalizableMessage message = ERR_FILEPERM_INVALID_UNIX_MODE_STRING.get(modeString);
      throw new DirectoryException(ResultCode.OTHER, message);
opendj-server-legacy/src/main/java/org/opends/server/types/InvokableMethod.java
@@ -359,7 +359,7 @@
    buffer.append(name);
    buffer.append('(');
    if ((arguments != null) && (arguments.length > 0))
    if (arguments != null && arguments.length > 0)
    {
      buffer.append(arguments[0].getDataType());
      buffer.append(' ');
opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java
@@ -113,7 +113,7 @@
      this.definition = definition;
    }
    if ((extraProperties == null) || extraProperties.isEmpty())
    if (extraProperties == null || extraProperties.isEmpty())
    {
      this.extraProperties = new LinkedHashMap<>(0);
    }
@@ -208,7 +208,7 @@
  {
    ifNull(name);
    if ((values == null) || values.isEmpty())
    if (values == null || values.isEmpty())
    {
      extraProperties.remove(name);
    }
opendj-server-legacy/src/main/java/org/opends/server/types/LDAPURL.java
@@ -162,14 +162,7 @@
      this.scheme = toLowerCase(scheme);
    }
    if ((port <= 0) || (port > 65535))
    {
      this.port = DEFAULT_PORT;
    }
    else
    {
      this.port = port;
    }
    this.port = toPort(port);
    if (rawBaseDN == null)
    {
@@ -249,14 +242,7 @@
      this.scheme = toLowerCase(scheme);
    }
    if ((port <= 0) || (port > 65535))
    {
      this.port = DEFAULT_PORT;
    }
    else
    {
      this.port = port;
    }
    this.port = toPort(port);
    if (baseDN == null)
    {
@@ -1013,17 +999,17 @@
   */
  public void setPort(int port)
  {
    if ((port <= 0) || (port > 65535))
    {
      this.port = DEFAULT_PORT;
    }
    else
    {
      this.port = port;
    }
    this.port = toPort(port);
  }
  private int toPort(int port)
  {
    if (0 < port && port <= 65535)
    {
      return port;
    }
    return DEFAULT_PORT;
  }
  /**
   * Retrieve the raw, unprocessed base DN for this LDAP URL.
@@ -1066,7 +1052,7 @@
  {
    if (baseDN == null)
    {
      if ((rawBaseDN == null) || (rawBaseDN.length() == 0))
      if (rawBaseDN == null || rawBaseDN.length() == 0)
      {
        return DEFAULT_BASE_DN;
      }
opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java
@@ -147,7 +147,7 @@
      this.definition = definition;
    }
    if ((names == null) || names.isEmpty())
    if (names == null || names.isEmpty())
    {
      this.names = new LinkedHashMap<>(0);
    }
@@ -156,7 +156,7 @@
      this.names = new LinkedHashMap<>(names);
    }
    if ((attributes == null) || attributes.isEmpty())
    if (attributes == null || attributes.isEmpty())
    {
      this.attributes = new LinkedHashSet<>(0);
    }
@@ -165,7 +165,7 @@
      this.attributes = new LinkedHashSet<>(attributes);
    }
    if ((extraProperties == null) || extraProperties.isEmpty())
    if (extraProperties == null || extraProperties.isEmpty())
    {
      this.extraProperties = new LinkedHashMap<>(0);
    }
opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java
@@ -152,7 +152,7 @@
      this.definition = definition;
    }
    if ((names == null) || names.isEmpty())
    if (names == null || names.isEmpty())
    {
      this.names = new LinkedHashMap<>(0);
    }
@@ -161,7 +161,7 @@
      this.names = new LinkedHashMap<>(names);
    }
    if ((requiredAttributes == null) || requiredAttributes.isEmpty())
    if (requiredAttributes == null || requiredAttributes.isEmpty())
    {
      this.requiredAttributes = new LinkedHashSet<>(0);
    }
@@ -170,7 +170,7 @@
      this.requiredAttributes = new LinkedHashSet<>(requiredAttributes);
    }
    if ((optionalAttributes == null) || optionalAttributes.isEmpty())
    if (optionalAttributes == null || optionalAttributes.isEmpty())
    {
      this.optionalAttributes = new LinkedHashSet<>(0);
    }
@@ -179,7 +179,7 @@
      this.optionalAttributes = new LinkedHashSet<>(optionalAttributes);
    }
    if ((extraProperties == null) || extraProperties.isEmpty())
    if (extraProperties == null || extraProperties.isEmpty())
    {
      this.extraProperties = new LinkedHashMap<>(0);
    }
@@ -375,8 +375,8 @@
   */
  public boolean isRequiredOrOptional(AttributeType attributeType)
  {
    return (requiredAttributes.contains(attributeType) ||
            optionalAttributes.contains(attributeType));
    return requiredAttributes.contains(attributeType) ||
            optionalAttributes.contains(attributeType);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/NamedCharacterSet.java
@@ -81,7 +81,7 @@
    random     = new Random();
    if ((name == null) || (name.length() == 0))
    if (name == null || name.length() == 0)
    {
      LocalizableMessage message = ERR_CHARSET_CONSTRUCTOR_NO_NAME.get();
      throw new ConfigException(message);
@@ -118,7 +118,7 @@
    this.characters = characters;
    this.random     = random;
    if ((name == null) || (name.length() == 0))
    if (name == null || name.length() == 0)
    {
      LocalizableMessage message = ERR_CHARSET_CONSTRUCTOR_NO_NAME.get();
      throw new ConfigException(message);
@@ -167,7 +167,7 @@
   */
  public char getRandomCharacter()
  {
    if ((characters == null) || (characters.length == 0))
    if (characters == null || characters.length == 0)
    {
      return 0;
    }
@@ -188,7 +188,7 @@
   */
  public void getRandomCharacters(StringBuilder buffer, int count)
  {
    if ((characters == null) || (characters.length == 0))
    if (characters == null || characters.length == 0)
    {
      return;
    }
opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java
@@ -416,8 +416,7 @@
    // FIXME -- Do we need to do any other checks here, like whether
    // the attribute type is actually defined in the schema?
    return (isExtensibleObject ||
            requiredAndOptionalChain.contains(attributeType));
    return isExtensibleObject || requiredAndOptionalChain.contains(attributeType);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java
@@ -452,7 +452,7 @@
    needsEscaping: {
      char c = value.charAt(0);
      if ((c == ' ') || (c == '#')) {
      if (c == ' ' || c == '#') {
        needsEscaping = true;
        break needsEscaping;
      }
@@ -494,7 +494,7 @@
    // If the lead character is a space or a # it must be escaped.
    int start = 0;
    char c = value.charAt(0);
    if ((c == ' ') || (c == '#')) {
    if (c == ' ' || c == '#') {
      buffer.append('\\');
      buffer.append(c);
      start = 1;
@@ -635,7 +635,7 @@
    // Skip over any spaces between the equal sign and the value.
    while ((pos < length) && ((c = rdnString.charAt(pos)) == ' '))
    while (pos < length && ((c = rdnString.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -678,7 +678,7 @@
    // Skip over any spaces that might be after the attribute value.
    while ((pos < length) && ((c = rdnString.charAt(pos)) == ' '))
    while (pos < length && ((c = rdnString.charAt(pos)) == ' '))
    {
      pos++;
    }
@@ -693,7 +693,7 @@
    // If the next character is a comma or semicolon, then that is not
    // allowed.  It would be legal for a DN but not an RDN.
    if ((c == ',') || (c == ';'))
    if (c == ',' || c == ';')
    {
      LocalizableMessage message = ERR_RDN_UNEXPECTED_COMMA.get(rdnString, pos);
      throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX, message);
@@ -716,7 +716,7 @@
      // Skip over the plus sign and any spaces that may follow it
      // before the next attribute name.
      pos++;
      while ((pos < length) && ((c = rdnString.charAt(pos)) == ' '))
      while (pos < length && ((c = rdnString.charAt(pos)) == ' '))
      {
        pos++;
      }
@@ -768,7 +768,7 @@
      // Skip over any spaces after the equal sign.
      while ((pos < length) && ((c = rdnString.charAt(pos)) == ' '))
      while (pos < length && ((c = rdnString.charAt(pos)) == ' '))
      {
        pos++;
      }
@@ -822,7 +822,7 @@
      // Skip over any spaces that might be after the attribute value.
      while ((pos < length) && ((c = rdnString.charAt(pos)) == ' '))
      while (pos < length && ((c = rdnString.charAt(pos)) == ' '))
      {
        pos++;
      }
@@ -837,7 +837,7 @@
      // If the next character is a comma or semicolon, then that is
      // not allowed.  It would be legal for a DN but not an RDN.
      if ((c == ',') || (c == ';'))
      if (c == ',' || c == ';')
      {
        LocalizableMessage message = ERR_RDN_UNEXPECTED_COMMA.get(rdnString, pos);
        throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX, message);
opendj-server-legacy/src/main/java/org/opends/server/types/RawAttribute.java
@@ -206,7 +206,7 @@
    stream.writeStartSet();
    List<ByteString> values = getValues();
    if ((values != null))
    if (values != null)
    {
      for(ByteString value : values)
      {
opendj-server-legacy/src/main/java/org/opends/server/types/RawFilter.java
@@ -470,7 +470,7 @@
        }
        ArrayList<ByteString> subAnyElements = getSubAnyElements();
        if ((subAnyElements != null) && (! subAnyElements.isEmpty()))
        if (subAnyElements != null && !subAnyElements.isEmpty())
        {
          for (ByteString s : subAnyElements)
          {
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
@@ -1822,8 +1822,7 @@
      for (AttributeType at : attributeTypes.values())
      {
        if ((at.getSuperiorType() != null) &&
            at.getSuperiorType().equals(t))
        if (at.getSuperiorType() != null && at.getSuperiorType().equals(t))
        {
          AttributeType newAT = recreateFromDefinition(at);
          deregisterAttributeType(at);
@@ -2266,7 +2265,7 @@
        {
          break;
        }
        else if (line.startsWith("#") || (line.length() == 0))
        else if (line.startsWith("#") || line.length() == 0)
        {
          continue;
        }
opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
@@ -530,7 +530,7 @@
                                  boolean dnAttributes)
         throws DirectoryException
  {
    if ((attributeType == null) && (matchingRuleID == null))
    if (attributeType == null && matchingRuleID == null)
    {
      LocalizableMessage message =
          ERR_SEARCH_FILTER_CREATE_EXTENSIBLE_MATCH_NO_AT_OR_MR.get();
@@ -575,7 +575,7 @@
                                  boolean dnAttributes)
         throws DirectoryException
  {
    if ((attributeType == null) && (matchingRuleID == null))
    if (attributeType == null && matchingRuleID == null)
    {
      LocalizableMessage message =
          ERR_SEARCH_FILTER_CREATE_EXTENSIBLE_MATCH_NO_AT_OR_MR.get();
@@ -838,7 +838,7 @@
          {
            // The next two bytes must be the hex characters that
            // comprise the binary value.
            if ((i + 2) >= valueBytes.length)
            if (i + 2 >= valueBytes.length)
            {
              LocalizableMessage message =
                  ERR_SEARCH_FILTER_INVALID_ESCAPED_BYTE.
@@ -1046,8 +1046,8 @@
    // The first and last characters must be parentheses.  If not,
    // then that's an error.
    if ((filterString.charAt(startPos) != '(') ||
        (filterString.charAt(endPos-1) != ')'))
    if (filterString.charAt(startPos) != '(' ||
        filterString.charAt(endPos-1) != ')')
    {
      LocalizableMessage message =
          ERR_SEARCH_FILTER_COMPOUND_MISSING_PARENTHESES.
@@ -1226,7 +1226,7 @@
          {
            // The next two bytes must be the hex characters that
            // comprise the binary value.
            if ((i + 2) >= valueBytes.length)
            if (i + 2 >= valueBytes.length)
            {
              LocalizableMessage message =
                  ERR_SEARCH_FILTER_INVALID_ESCAPED_BYTE.
@@ -1394,7 +1394,7 @@
          {
            // The next two bytes must be the hex characters that
            // comprise the binary value.
            if ((i + 2) >= valueBytes.length)
            if (i + 2 >= valueBytes.length)
            {
              LocalizableMessage message =
                  ERR_SEARCH_FILTER_INVALID_ESCAPED_BYTE.
@@ -1571,7 +1571,7 @@
          {
            // The next two bytes must be the hex characters that
            // comprise the binary value.
            if ((i + 2) >= valueBytes.length)
            if (i + 2 >= valueBytes.length)
            {
              LocalizableMessage message =
                  ERR_SEARCH_FILTER_INVALID_ESCAPED_BYTE.
@@ -1833,13 +1833,13 @@
      // If there is anything left, then it should be ":dn" and/or ":"
      // followed by the matching rule ID.
      if (colonPos < (equalPos-1))
      if (colonPos < equalPos-1)
      {
        if (lowerLeftStr.startsWith(":dn:", colonPos))
        {
          dnAttributes = true;
          if ((colonPos+4) < (equalPos-1))
          if (colonPos+4 < equalPos-1)
          {
            matchingRuleID =
                 filterString.substring(colonPos+4, equalPos-1);
@@ -1878,7 +1878,7 @@
        {
          // The next two bytes must be the hex characters that
          // comprise the binary value.
          if ((i + 2) >= valueBytes.length)
          if (i + 2 >= valueBytes.length)
          {
            LocalizableMessage message = ERR_SEARCH_FILTER_INVALID_ESCAPED_BYTE.
                get(filterString, equalPos+i+1);
@@ -2639,7 +2639,7 @@
    // See if the entry has an attribute with the requested type.
    List<Attribute> attrs = entry.getAttribute(attributeType,
                                               attributeOptions);
    if ((attrs == null) || (attrs.isEmpty()))
    if (attrs == null || attrs.isEmpty())
    {
      if (logger.isTraceEnabled())
      {
@@ -2730,11 +2730,10 @@
      throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
    }
    // Make sure that at least one substring element has been
    // defined.
    if ((subInitialElement == null) &&
        (subFinalElement == null) &&
        ((subAnyElements == null) || subAnyElements.isEmpty()))
    // Make sure that at least one substring element has been defined.
    if (subInitialElement == null &&
        subFinalElement == null &&
        (subAnyElements == null || subAnyElements.isEmpty()))
    {
      LocalizableMessage message =
          ERR_SEARCH_FILTER_SUBSTRING_NO_SUBSTRING_COMPONENTS.
@@ -2743,9 +2742,8 @@
    }
    // See if the entry has an attribute with the requested type.
    List<Attribute> attrs =
         entry.getAttribute(attributeType, attributeOptions);
    if ((attrs == null) || (attrs.isEmpty()))
    List<Attribute> attrs = entry.getAttribute(attributeType, attributeOptions);
    if (attrs == null || attrs.isEmpty())
    {
      if (logger.isTraceEnabled())
      {
@@ -2845,9 +2843,8 @@
    }
    // See if the entry has an attribute with the requested type.
    List<Attribute> attrs =
         entry.getAttribute(attributeType, attributeOptions);
    if ((attrs == null) || (attrs.isEmpty()))
    List<Attribute> attrs = entry.getAttribute(attributeType, attributeOptions);
    if (attrs == null || attrs.isEmpty())
    {
      if (logger.isTraceEnabled())
      {
@@ -2947,7 +2944,7 @@
    // See if the entry has an attribute with the requested type.
    List<Attribute> attrs =
         entry.getAttribute(attributeType, attributeOptions);
    if ((attrs == null) || (attrs.isEmpty()))
    if (attrs == null || attrs.isEmpty())
    {
      if (logger.isTraceEnabled())
      {
@@ -3092,7 +3089,7 @@
    // See if the entry has an attribute with the requested type.
    List<Attribute> attrs =
         entry.getAttribute(attributeType, attributeOptions);
    if ((attrs == null) || (attrs.isEmpty()))
    if (attrs == null || attrs.isEmpty())
    {
      if (logger.isTraceEnabled())
      {
@@ -3452,8 +3449,7 @@
        {
          try
          {
            if ((attributeType == null) ||
                attributeType.equals(rdn.getAttributeType(i)))
            if (attributeType == null || attributeType.equals(rdn.getAttributeType(i)))
            {
              ByteString v = rdn.getAttributeValue(i);
              ByteString nv = matchingRule.normalizeAttributeValue(v);
@@ -3546,8 +3542,8 @@
      case LESS_OR_EQUAL:
        return typeAndOptionsAndAssertionEqual(f);
      case PRESENT:
        return (attributeType.equals(f.attributeType) &&
                optionsEqual(attributeOptions, f.attributeOptions));
        return attributeType.equals(f.attributeType) &&
                optionsEqual(attributeOptions, f.attributeOptions);
      case APPROXIMATE_MATCH:
        return typeAndOptionsAndAssertionEqual(f);
      case EXTENSIBLE_MATCH:
@@ -3735,11 +3731,11 @@
  private static boolean optionsEqual(Set<String> options1,
                                      Set<String> options2)
  {
    if ((options1 == null) || options1.isEmpty())
    if (options1 == null || options1.isEmpty())
    {
      return ((options2 == null) || options2.isEmpty());
      return options2 == null || options2.isEmpty();
    }
    else if ((options2 == null) || options2.isEmpty())
    else if (options2 == null || options2.isEmpty())
    {
      return false;
    }
@@ -3934,7 +3930,7 @@
          valueToFilterString(buffer, subInitialElement);
        }
        if ((subAnyElements != null) && (! subAnyElements.isEmpty()))
        if (subAnyElements != null && !subAnyElements.isEmpty())
        {
          for (ByteString s : subAnyElements)
          {
opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultReference.java
@@ -145,7 +145,7 @@
   */
  public String getReferralURLString()
  {
    if ((referralURLs == null) || (referralURLs.isEmpty()))
    if (referralURLs == null || referralURLs.isEmpty())
    {
      return "";
    }
opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java
@@ -290,7 +290,7 @@
      {
        List<Attribute> attrList = entry.getAttribute(
                ATTR_INHERIT_COLLECTIVE_FROM_DN);
        if ((attrList != null) && !attrList.isEmpty())
        if (attrList != null && !attrList.isEmpty())
        {
          for (Attribute attr : attrList)
          {
@@ -307,7 +307,7 @@
      if (this.isInheritedFromRDNCollective)
      {
        List<Attribute> attrList = entry.getAttribute(ATTR_INHERIT_COLLECTIVE_FROM_RDN);
        if ((attrList != null) && !attrList.isEmpty())
        if (attrList != null && !attrList.isEmpty())
        {
          for (Attribute attr : attrList)
          {
@@ -320,7 +320,7 @@
          }
        }
        attrList = entry.getAttribute(ATTR_INHERIT_COLLECTIVE_FROM_RDN_TYPE);
        if ((attrList != null) && !attrList.isEmpty())
        if (attrList != null && !attrList.isEmpty())
        {
          for (Attribute attr : attrList)
          {
@@ -332,7 +332,7 @@
          }
        }
        attrList = entry.getAttribute(ATTR_INHERIT_COLLECTIVE_FROM_BASE);
        if ((attrList != null) && !attrList.isEmpty())
        if (attrList != null && !attrList.isEmpty())
        {
          for (Attribute attr : attrList)
          {
@@ -349,7 +349,7 @@
      List<Attribute> attrList = entry.getAttribute(
              ATTR_INHERIT_COLLECTIVE_ATTR);
      if ((attrList != null) && !attrList.isEmpty())
      if (attrList != null && !attrList.isEmpty())
      {
        for (Attribute attr : attrList)
        {
@@ -369,7 +369,7 @@
    {
      List<Attribute> attrList = entry.getAttribute(
              ATTR_COLLECTIVE_CONFLICT_BEHAVIOR);
      if ((attrList != null) && !attrList.isEmpty())
      if (attrList != null && !attrList.isEmpty())
      {
        for (Attribute attr : attrList)
        {
opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java
@@ -123,7 +123,7 @@
    {
      for (final Refinement refinement : refinementSet)
      {
        if (refinement.matches(entry) == false)
        if (!refinement.matches(entry))
        {
          return false;
        }
@@ -469,7 +469,7 @@
    {
      for (final Refinement refinement : refinementSet)
      {
        if (refinement.matches(entry) == true)
        if (refinement.matches(entry))
        {
          return true;
        }
@@ -1569,8 +1569,8 @@
    final Iterable<DN> chopBefore = getChopBefore();
    final Iterable<DN> chopAfter = getChopAfter();
    if ((chopBefore.iterator().hasNext())
        || (chopAfter.iterator().hasNext()))
    if (chopBefore.iterator().hasNext()
        || chopAfter.iterator().hasNext())
    {
      if (!isFirstElement)
      {
opendj-server-legacy/src/main/java/org/opends/server/util/BSDMD5Crypt.java
@@ -61,7 +61,7 @@
    while (--length >= 0)
    {
      output.append(itoa64.charAt((value & 0x3f)));
      output.append(itoa64.charAt(value & 0x3f));
      value >>= 6;
    }
@@ -197,11 +197,11 @@
      {
        ctx1.update(digest);
      }
      if ((i % 3) != 0)
      if (i % 3 != 0)
      {
        ctx1.update(salt.getBytes());
      }
      if ((i % 7) != 0)
      if (i % 7 != 0)
      {
        ctx1.update(plaintextBytes);
      }
@@ -232,7 +232,7 @@
    l = ((digest[4] & 0xff) << 16) | ((digest[10] & 0xff) << 8)
            | (digest[5] & 0xff);
    output.append(intTo64(l, 4));
    l = (digest[11] & 0xff);
    l = digest[11] & 0xff;
    output.append(intTo64(l, 2));
    /* Don't leave anything around in vm they could use. */
@@ -263,7 +263,7 @@
   */
  public static void main(String argv[])
  {
    if ((argv.length < 1) || (argv.length > 2))
    if (argv.length < 1 || argv.length > 2)
    {
      System.err.println("Usage: BSDMD5Crypt password salt");
      System.exit(1);
opendj-server-legacy/src/main/java/org/opends/server/util/Base64.java
@@ -197,7 +197,7 @@
    // The encoded value must have  length that is a multiple of four bytes.
    int length = encodedData.length();
    if ((length % 4) != 0)
    if (length % 4 != 0)
    {
      LocalizableMessage message = ERR_BASE64_DECODE_INVALID_LENGTH.get(encodedData);
      throw new ParseException(message.toString(), 0);
opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java
@@ -149,8 +149,7 @@
        }
      } else {
        final File keyStoreDirectory = keyStoreFile.getParentFile();
        if ((keyStoreDirectory == null) || (! keyStoreDirectory.exists()) ||
            (! keyStoreDirectory.isDirectory())) {
        if (keyStoreDirectory == null || !keyStoreDirectory.exists() || !keyStoreDirectory.isDirectory()) {
          LocalizableMessage msg = ERR_CERTMGR_INVALID_PARENT.get(keyStorePath);
          throw new IllegalArgumentException(msg.toString());
        }
@@ -303,8 +302,7 @@
  throws  KeyStoreException, IllegalArgumentException {
    ensureValid(alias, CERT_ALIAS_MSG);
    ensureFileValid(certificateFile, CERT_REQUEST_FILE_MSG);
    if ((! certificateFile.exists()) ||
        (! certificateFile.isFile())) {
    if (!certificateFile.exists() || !certificateFile.isFile()) {
      LocalizableMessage msg = ERR_CERTMGR_INVALID_CERT_FILE.get(
          certificateFile.getAbsolutePath());
      throw new IllegalArgumentException(msg.toString());
opendj-server-legacy/src/main/java/org/opends/server/util/Crypt.java
@@ -500,6 +500,6 @@
    {
      _c._iobuf[1] = _c._iobuf[0];
    }
    return (_c._iobuf);
    return _c._iobuf;
  }
}
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
@@ -509,7 +509,7 @@
        // This is a comment.  Ignore it.
        continue;
      }
      else if ((line.charAt(0) == ' ') || (line.charAt(0) == '\t'))
      else if (line.charAt(0) == ' ' || line.charAt(0) == '\t')
      {
        // This is a continuation of the previous line.  If there is no
        // previous line, then that's a problem.  Note that while RFC 2849
@@ -633,7 +633,7 @@
  {
    final int length = line.length();
    int pos = startPos;
    while ((pos < length) && (line.charAt(pos) == ' '))
    while (pos < length && line.charAt(pos) == ' ')
    {
      pos++;
    }
@@ -862,16 +862,14 @@
        throw new LDIFException(message, lastEntryLineNumber,true);
      }
      if (checkSchema &&
          (DirectoryServer.getSyntaxEnforcementPolicy() !=
               AcceptRejectWarn.ACCEPT))
          DirectoryServer.getSyntaxEnforcementPolicy() != AcceptRejectWarn.ACCEPT)
      {
        LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
        if (! attrType.getSyntax().valueIsAcceptable(value, invalidReason))
        {
          LocalizableMessage message = WARN_LDIF_VALUE_VIOLATES_SYNTAX.get(
              entryDN, lastEntryLineNumber, value, attrName, invalidReason);
          if (DirectoryServer.getSyntaxEnforcementPolicy() ==
                   AcceptRejectWarn.WARN)
          if (DirectoryServer.getSyntaxEnforcementPolicy() == AcceptRejectWarn.WARN)
          {
            logger.error(message);
          }
@@ -916,7 +914,7 @@
              logToRejectWriter(lines, message);
            throw new LDIFException(message, lastEntryLineNumber, true);
          }
          if (attrType.isSingleValue() && (a.size() > 1)  && checkSchema)
          if (attrType.isSingleValue() && a.size() > 1 && checkSchema)
          {
            LocalizableMessage message = ERR_LDIF_MULTIPLE_VALUES_FOR_SINGLE_VALUED_ATTR
                    .get(entryDN, lastEntryLineNumber, attrName);
@@ -1019,7 +1017,7 @@
    {
      try
      {
        if ((message != null) && (message.length() > 0))
        if (message != null && message.length() > 0)
        {
          rejectWriter.write("# ");
          rejectWriter.write(message.toString());
@@ -1060,7 +1058,7 @@
    entriesRejected.incrementAndGet();
    if (rejectWriter != null) {
      try {
        if ((message != null) && (message.length() > 0)) {
        if (message != null && message.length() > 0) {
          rejectWriter.write("# ");
          rejectWriter.write(message.toString());
          rejectWriter.newLine();
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java
@@ -794,7 +794,7 @@
   */
  public static char byteToASCII(byte b)
  {
    if ((b >= 32) && (b <= 126))
    if (32 <= b && b <= 126)
    {
      return (char) b;
    }
@@ -814,7 +814,7 @@
   */
  public static String bytesToHexNoSpace(byte[] b)
  {
    if ((b == null) || (b.length == 0))
    if (b == null || b.length == 0)
    {
      return "";
    }
@@ -842,7 +842,7 @@
   */
  public static String bytesToHex(byte[] b)
  {
    if ((b == null) || (b.length == 0))
    if (b == null || b.length == 0)
    {
      return "";
    }
@@ -870,7 +870,7 @@
   */
  public static String bytesToHex(ByteSequence b)
  {
    if ((b == null) || (b.length() == 0))
    if (b == null || b.length() == 0)
    {
      return "";
    }
@@ -901,7 +901,7 @@
   */
  public static String bytesToColonDelimitedHex(byte[] b)
  {
    if ((b == null) || (b.length == 0))
    if (b == null || b.length == 0)
    {
      return "";
    }
@@ -986,7 +986,7 @@
    int length = b.length;
    int pos    = 0;
    while ((length - pos) >= 16)
    while (length - pos >= 16)
    {
      StringBuilder asciiBuf = new StringBuilder(17);
@@ -1014,7 +1014,7 @@
    }
    int remaining = (length - pos);
    int remaining = length - pos;
    if (remaining > 0)
    {
      StringBuilder asciiBuf = new StringBuilder(remaining+1);
@@ -1084,7 +1084,7 @@
    int limit    = b.limit();
    int length   = limit - position;
    int pos      = 0;
    while ((length - pos) >= 16)
    while (length - pos >= 16)
    {
      StringBuilder asciiBuf = new StringBuilder(17);
@@ -1114,7 +1114,7 @@
    }
    int remaining = (length - pos);
    int remaining = length - pos;
    if (remaining > 0)
    {
      StringBuilder asciiBuf = new StringBuilder(remaining+1);
@@ -1474,7 +1474,7 @@
      }
    }
    return (a.length - a2.length);
    return a.length - a2.length;
  }
@@ -1496,7 +1496,7 @@
  {
    if (list1 == null)
    {
      return (list2 == null);
      return list2 == null;
    }
    else if (list2 == null)
    {
@@ -1550,14 +1550,7 @@
   */
  public static boolean objectsAreEqual(Object o1, Object o2)
  {
    if (o1 == null)
    {
      return (o2 == null);
    }
    else
    {
      return o1.equals(o2);
    }
    return Objects.equals(o1, o2);
  }
@@ -1608,8 +1601,7 @@
      message.append(")");
      return message.toMessage();
    }
    else if ((t instanceof InvocationTargetException) &&
             (t.getCause() != null))
    else if (t instanceof InvocationTargetException && t.getCause() != null)
    {
      return getExceptionMessage(t.getCause());
    }
@@ -2082,7 +2074,7 @@
         throws ParseException
  {
    int length;
    if ((hexString == null) || ((length = hexString.length()) == 0))
    if (hexString == null || ((length = hexString.length()) == 0))
    {
      return new byte[0];
    }
@@ -2096,7 +2088,7 @@
    int pos = 0;
    int arrayLength = (length / 2);
    int arrayLength = length / 2;
    byte[] returnArray = new byte[arrayLength];
    for (int i=0; i < arrayLength; i++)
    {
@@ -2243,7 +2235,7 @@
  public static boolean needsBase64Encoding(ByteSequence valueBytes)
  {
    int length;
    if ((valueBytes == null) || ((length = valueBytes.length()) == 0))
    if (valueBytes == null || ((length = valueBytes.length()) == 0))
    {
      return false;
    }
@@ -2261,7 +2253,7 @@
    // If the value ends with a space, then it needs to be base64-encoded.
    if ((length > 1) && (valueBytes.byteAt(length-1) == 0x20))
    if (length > 1 && valueBytes.byteAt(length-1) == 0x20)
    {
      return true;
    }
@@ -2273,7 +2265,7 @@
    for (int i = 0; i < valueBytes.length(); i++)
    {
      b = valueBytes.byteAt(i);
      if ((b > 127) || (b < 0))
      if (b < 0 || 127 < b)
      {
        return true;
      }
@@ -2307,7 +2299,7 @@
  public static boolean needsBase64Encoding(String valueString)
  {
    int length;
    if ((valueString == null) || ((length = valueString.length()) == 0))
    if (valueString == null || ((length = valueString.length()) == 0))
    {
      return false;
    }
@@ -2325,7 +2317,7 @@
    // If the value ends with a space, then it needs to be base64-encoded.
    if ((length > 1) && (valueString.charAt(length-1) == ' '))
    if (length > 1 && valueString.charAt(length-1) == ' ')
    {
      return true;
    }
@@ -2336,7 +2328,7 @@
    for (int i=0; i < length; i++)
    {
      char c = valueString.charAt(i);
      if ((c <= 0) || (c == 0x0A) || (c == 0x0D) || (c > 127))
      if (c <= 0 || c == 0x0A || c == 0x0D || c > 127)
      {
        return true;
      }
@@ -2360,7 +2352,7 @@
   */
  public static boolean mayUseExec()
  {
    return (! DirectoryServer.getEnvironmentConfig().disableExec());
    return !DirectoryServer.getEnvironmentConfig().disableExec();
  }
@@ -2418,12 +2410,12 @@
    ProcessBuilder processBuilder = new ProcessBuilder(commandAndArgs);
    processBuilder.redirectErrorStream(true);
    if ((workingDirectory != null) && workingDirectory.isDirectory())
    if (workingDirectory != null && workingDirectory.isDirectory())
    {
      processBuilder.directory(workingDirectory);
    }
    if ((environment != null) && (! environment.isEmpty()))
    if (environment != null && !environment.isEmpty())
    {
      processBuilder.environment().putAll(environment);
    }
@@ -2499,7 +2491,7 @@
                                             int endPos,
                                             LocalizableMessageBuilder invalidReason)
  {
    if ((element == null) || (startPos >= endPos))
    if (element == null || startPos >= endPos)
    {
      invalidReason.append(ERR_SCHEMANAME_EMPTY_VALUE.get());
      return false;
@@ -2530,7 +2522,7 @@
      // This should indicate an OID, but it may also be a name if name
      // exceptions are enabled.  Since we don't know for sure, we'll just
      // hold off until we know for sure.
      boolean isKnown    = (! DirectoryServer.allowAttributeNameExceptions());
      boolean isKnown    = !DirectoryServer.allowAttributeNameExceptions();
      boolean isNumeric  = true;
      boolean lastWasDot = false;
@@ -2577,7 +2569,7 @@
        {
          lastWasDot = false;
          if (isAlpha(c) || (c == '-') || (c == '_'))
          if (isAlpha(c) || c == '-' || c == '_')
          {
            if (isKnown)
            {
@@ -2880,9 +2872,8 @@
      {
        case ' ':
          // If we don't care about trimming, then we can always append the
          // space.  Otherwise, only do so if there are other characters in the
          // value.
          if (trim && (bufferLength == 0))
          // space.  Otherwise, only do so if there are other characters in the value.
          if (trim && bufferLength == 0)
          {
            break;
          }
@@ -3178,9 +3169,8 @@
      {
        case ' ':
          // If we don't care about trimming, then we can always append the
          // space.  Otherwise, only do so if there are other characters in the
          // value.
          if (trim && (bufferLength == 0))
          // space.  Otherwise, only do so if there are other characters in the value.
          if (trim && bufferLength == 0)
          {
            break;
          }
@@ -3408,7 +3398,7 @@
        }
      }
      return (successful & file.delete());
      return successful & file.delete();
    }
    return false;
  }
@@ -3529,7 +3519,7 @@
  public static boolean isRelativePath(String path)
  {
    File f = new File(path);
    return (! f.isAbsolute());
    return !f.isAbsolute();
  }
@@ -3617,7 +3607,7 @@
  {
    // If the provided DN was null or empty, then return null because we don't
    // support it.
    if ((dn == null) || dn.isRootDN())
    if (dn == null || dn.isRootDN())
    {
      return null;
    }
@@ -3651,8 +3641,7 @@
      // First, see if this type is allowed by the untypedObject class.  If not,
      // then we'll need to include the extensibleObject class.
      if ((! structuralClass.isRequiredOrOptional(attrType)) &&
          (! extensibleObjectAdded))
      if (!structuralClass.isRequiredOrOptional(attrType) && !extensibleObjectAdded)
      {
        ObjectClass extensibleObjectOC =
             DirectoryServer.getObjectClass(OC_EXTENSIBLE_OBJECT_LC);
@@ -3926,7 +3915,7 @@
      // fall back
      // to a more inefficient way that will work without a selector.
      while (buffer.hasRemaining()
          && (System.currentTimeMillis() < stopTime))
          && System.currentTimeMillis() < stopTime)
      {
        if (socketChannel.write(buffer) < 0)
        {
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
@@ -48,6 +48,7 @@
import static org.opends.messages.CoreMessages.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.types.Privilege.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -221,7 +222,7 @@
    // Update the authentication information for the user.
    AuthenticationInfo authInfo = getAuthenticationInfo();
    if ((getResultCode() == ResultCode.SUCCESS) && (authInfo != null))
    if (getResultCode() == ResultCode.SUCCESS && authInfo != null)
    {
      clientConnection.setAuthenticationInfo(authInfo);
      clientConnection.setSizeLimit(sizeLimit);
@@ -421,7 +422,7 @@
    // See if this is an anonymous bind.  If so, then determine whether
    // to allow it.
    ByteString simplePassword = getSimplePassword();
    if ((simplePassword == null) || (simplePassword.length() == 0))
    if (simplePassword == null || simplePassword.length() == 0)
    {
      return processAnonymousSimpleBind();
    }
@@ -484,7 +485,7 @@
      AttributeType pwType = policy.getPasswordAttribute();
      List<Attribute> pwAttr = userEntry.getAttribute(pwType);
      if ((pwAttr == null) || (pwAttr.isEmpty()))
      if (pwAttr == null || pwAttr.isEmpty())
      {
        throw new DirectoryException(ResultCode.INVALID_CREDENTIALS,
            ERR_BIND_OPERATION_NO_PASSWORD.get());
@@ -509,8 +510,7 @@
        checkVerifiedPasswordPolicyState(userEntry, null);
        if (DirectoryServer.lockdownMode()
            && (!ClientConnection.hasPrivilege(userEntry,
                Privilege.BYPASS_LOCKDOWN)))
            && !ClientConnection.hasPrivilege(userEntry, BYPASS_LOCKDOWN))
        {
          throw new DirectoryException(ResultCode.INVALID_CREDENTIALS,
              ERR_BIND_REJECTED_LOCKDOWN_MODE.get());
@@ -579,8 +579,7 @@
        setResultCode(ResultCode.SUCCESS);
        if (DirectoryServer.lockdownMode()
            && (!ClientConnection.hasPrivilege(userEntry,
                Privilege.BYPASS_LOCKDOWN)))
            && !ClientConnection.hasPrivilege(userEntry, BYPASS_LOCKDOWN))
        {
          throw new DirectoryException(ResultCode.INVALID_CREDENTIALS,
              ERR_BIND_REJECTED_LOCKDOWN_MODE.get());
@@ -689,7 +688,7 @@
      if (resultCode != ResultCode.SASL_BIND_IN_PROGRESS
          && (resultCode != ResultCode.SUCCESS
              || saslAuthUserEntry == null
              || !ClientConnection.hasPrivilege(saslAuthUserEntry, Privilege.BYPASS_LOCKDOWN)))
              || !ClientConnection.hasPrivilege(saslAuthUserEntry, BYPASS_LOCKDOWN)))
      {
        throw new DirectoryException(ResultCode.INVALID_CREDENTIALS,
                                     ERR_BIND_REJECTED_LOCKDOWN_MODE.get());
@@ -862,7 +861,7 @@
    PasswordPolicyState pwPolicyState = (PasswordPolicyState) authPolicyState;
    PasswordPolicy policy = pwPolicyState.getAuthenticationPolicy();
    boolean isSASLBind = (saslHandler != null);
    boolean isSASLBind = saslHandler != null;
    // If the password policy is configured to track authentication failures or
    // keep the last login time and the associated backend is disabled, then we
@@ -888,7 +887,7 @@
    // Check to see if the authentication must be done in a secure
    // manner.  If so, then the client connection must be secure.
    if (policy.isRequireSecureAuthentication()
        && (!clientConnection.isSecure()))
        && !clientConnection.isSecure())
    {
      if (isSASLBind)
      {
@@ -924,7 +923,7 @@
    PasswordPolicyState pwPolicyState = (PasswordPolicyState) authPolicyState;
    PasswordPolicy policy = pwPolicyState.getAuthenticationPolicy();
    boolean isSASLBind = (saslHandler != null);
    boolean isSASLBind = saslHandler != null;
    // Check to see if the user is administratively disabled or locked.
    if (pwPolicyState.isDisabled())
@@ -971,7 +970,7 @@
    // If it's a simple bind, or if it's a password-based SASL bind, then
    // perform a number of password-based checks.
    if ((! isSASLBind) || saslHandler.isPasswordBased(saslMechanism))
    if (!isSASLBind || saslHandler.isPasswordBased(saslMechanism))
    {
      // Check to see if the account is locked due to the maximum reset age.
      if (pwPolicyState.lockedDueToMaximumResetAge())
@@ -1001,11 +1000,11 @@
        }
        int maxGraceLogins = policy.getGraceLoginCount();
        if ((maxGraceLogins > 0) && pwPolicyState.mayUseGraceLogin())
        if (maxGraceLogins > 0 && pwPolicyState.mayUseGraceLogin())
        {
          List<Long> graceLoginTimes = pwPolicyState.getGraceLoginTimes();
          if ((graceLoginTimes == null) ||
              (graceLoginTimes.size() < maxGraceLogins))
          if (graceLoginTimes == null ||
              graceLoginTimes.size() < maxGraceLogins)
          {
            isGraceLogin       = true;
            mustChangePassword = true;
@@ -1129,7 +1128,7 @@
  {
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attributeTypeName);
    List<Attribute> attrList = userEntry.getAttribute(attrType);
    if ((attrList != null) && (attrList.size() == 1))
    if (attrList != null && attrList.size() == 1)
    {
      Attribute a = attrList.get(0);
      if (a.size() == 1)
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java
@@ -265,7 +265,7 @@
      AttributeType attrType = getAttributeType();
      List<Attribute> attrList = entry.getAttribute(attrType, options);
      if ((attrList == null) || attrList.isEmpty())
      if (attrList == null || attrList.isEmpty())
      {
        setResultCode(ResultCode.NO_SUCH_ATTRIBUTE);
        if (options == null)
opendj-server-legacy/src/test/java/org/opends/quicksetup/util/FileManagerTest.java
@@ -342,7 +342,7 @@
    fileManager.deleteRecursively(dir, killChildFileFilter,
            FileManager.DeletionPolicy.DELETE_IMMEDIATELY);
    assertTrue(dir.exists());
    assertEquals((childCount -1), countSelfAndAllChildren(dir));
    assertEquals(childCount - 1, countSelfAndAllChildren(dir));
    assertFalse(f2b1.exists());
  }
opendj-server-legacy/src/test/java/org/opends/server/api/AlertHandlerTestCase.java
@@ -97,9 +97,8 @@
  {
    int count = DummyAlertHandler.getAlertCount();
    DirectoryServer.sendAlertNotification(this, ALERT_TYPE,
                                          ALERT_MESSAGE);
    assertEquals(DummyAlertHandler.getAlertCount(), (count+1));
    DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_MESSAGE);
    assertEquals(DummyAlertHandler.getAlertCount(), count+1);
  }
@@ -119,9 +118,8 @@
    {
      int count = DummyAlertHandler.getAlertCount();
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE,
                                            ALERT_MESSAGE);
      assertEquals(DummyAlertHandler.getAlertCount(), (count+1));
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_MESSAGE);
      assertEquals(DummyAlertHandler.getAlertCount(), count+1);
    }
    finally
    {
@@ -150,8 +148,7 @@
    {
      int count = DummyAlertHandler.getAlertCount();
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE,
                                            ALERT_MESSAGE);
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_MESSAGE);
      assertEquals(DummyAlertHandler.getAlertCount(), count);
    }
    finally
@@ -181,8 +178,7 @@
    {
      int count = DummyAlertHandler.getAlertCount();
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE,
                                            ALERT_MESSAGE);
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_MESSAGE);
      assertEquals(DummyAlertHandler.getAlertCount(), count);
    }
    finally
@@ -212,9 +208,8 @@
    {
      int count = DummyAlertHandler.getAlertCount();
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE,
                                            ALERT_MESSAGE);
      assertEquals(DummyAlertHandler.getAlertCount(), (count+1));
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_MESSAGE);
      assertEquals(DummyAlertHandler.getAlertCount(), count+1);
    }
    finally
    {
@@ -244,8 +239,7 @@
    {
      int count = DummyAlertHandler.getAlertCount();
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE,
                                            ALERT_MESSAGE);
      DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_MESSAGE);
      assertEquals(DummyAlertHandler.getAlertCount(), count);
    }
    finally
opendj-server-legacy/src/test/java/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java
@@ -155,8 +155,7 @@
      System.err.println();
    }
    if ((! newAbstractMethods.isEmpty()) ||
        (! expectedAbstractMethods.isEmpty()))
    if (!newAbstractMethods.isEmpty() || !expectedAbstractMethods.isEmpty())
    {
      fail("It appears that set of abstract methods defined in the plugin " +
           "API have been altered.  This will only be allowed under " +
@@ -657,8 +656,8 @@
        continue;
      }
      if (Modifier.isPublic(m.getModifiers()) &&
          (! Modifier.isAbstract(m.getModifiers())))
      if (Modifier.isPublic(m.getModifiers())
          && !Modifier.isAbstract(m.getModifiers()))
      {
        LinkedList<String> foundList = new LinkedList<>();
        foundList.add(m.getName());
opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTests.java
@@ -861,8 +861,8 @@
      // Add this test only if the mask tells us we haven't seen it before.
      // Also guard against ArrayIndexOutOfBoundsExceptions in case the
      // mask isn't long enough.
      if ((i < mask.length()) &&
              ((mask.charAt(i) == '-') || (mask.charAt(i) == '\"'))) {
      if (i < mask.length()
          && (mask.charAt(i) == '-' || mask.charAt(i) == '\"')) {
        acisMissingOneChar.add("aci: " + aci.substring(0, i) + aci.substring(i + 1, aci.length()));
      }
    }
@@ -2155,7 +2155,7 @@
     * @return  An ACI string.
     */
    private static String buildGlobalAciValue(String... aciFields) {
     return(_buildAciValue(ATTR_AUTHZ_GLOBAL_ACI + ": ", aciFields));
     return _buildAciValue(ATTR_AUTHZ_GLOBAL_ACI + ": ", aciFields);
    }
  /**
@@ -2164,7 +2164,7 @@
   * to more easily generate combinations of acis.
   */
  private static String buildAciValue(String... aciFields) {
     return(_buildAciValue("aci:", aciFields));
     return _buildAciValue("aci:", aciFields);
  }
  /**
@@ -2275,7 +2275,7 @@
  private void ldapModify(String[] args, boolean expectSuccess) throws Exception {
    clearOutputStream();
    int retVal = LDAPModify.mainModify(args, false, getOutputStream(), getOutputStream());
    assertEquals((retVal == 0), expectSuccess, "Return value = " + retVal);
    assertEquals(retVal == 0, expectSuccess, "Return value = " + retVal);
  }
  private String ldapSearch(String[] args) throws Exception {
opendj-server-legacy/src/test/java/org/opends/server/backends/task/TaskBackendTestCase.java
@@ -161,7 +161,7 @@
    while (TaskState.isPending(task.getTaskState()))
    {
      Thread.sleep(10);
      if (System.currentTimeMillis() > (startTime + 300000L))
      if (System.currentTimeMillis() > startTime + 300000L)
      {
        throw new AssertionError("Waited too long for the task to start");
      }
@@ -308,7 +308,7 @@
    while (TaskState.isPending(task.getTaskState()))
    {
      Thread.sleep(10);
      if (System.currentTimeMillis() > (startTime + 300000L))
      if (System.currentTimeMillis() > startTime + 300000L)
      {
        throw new AssertionError("Waited too long for the task to start");
      }
@@ -338,7 +338,7 @@
    // We may have to wait for the task to register as done, but it should
    // definitely be done before it would have stopped normally.
    task = TasksTestCase.getCompletedTask(DN.valueOf(taskDN));
    assertTrue((System.currentTimeMillis() - startTime) < 300000L);
    assertTrue(System.currentTimeMillis() - startTime < 300000L);
    assertTrue(TaskState.isDone(task.getTaskState()));
opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
@@ -156,7 +156,7 @@
    // As we provide dummy type and value string, attType and attVal
    // could
    // be null.
    if ((attType != null) && (attVal != null))
    if (attType != null && attVal != null)
    {
      mvf = MatchedValuesFilter.createEqualityFilter(attType, attVal);
      assertNotNull(mvf);
@@ -247,7 +247,7 @@
      {
        rawAttTypeTestCurrent = null ;
      }
      boolean exceptionExpected = (attTypeCurrent == null);
      boolean exceptionExpected = attTypeCurrent == null;
      try
      {
@@ -358,9 +358,8 @@
    }
    // Check type, value
    // As we provide dummy type and value string, attType and attVal could
    // be null.
    if ((type != null) && (value != null))
    // As we provide dummy type and value string, attType and attVal could be null.
    if (type != null && value != null)
    {
      MatchedValuesFilter mvf;
      mvf = MatchedValuesFilter.createGreaterOrEqualFilter(type,
@@ -411,7 +410,7 @@
    }
    // Check type, value
    if ((attType != null) && (attVal != null))
    if (attType != null && attVal != null)
    {
      MatchedValuesFilter mvf;
      mvf = MatchedValuesFilter.createGreaterOrEqualFilter(attType, attVal);
@@ -507,9 +506,8 @@
    }
    // Check type, value
    // As we provide dummy type and value string, attType and attVal could
    // be null.
    if ((attType != null) && (attVal != null))
    // As we provide dummy type and value string, attType and attVal could be null.
    if (attType != null && attVal != null)
    {
      mvf = MatchedValuesFilter.createLessOrEqualFilter(attType, attVal);
      assertNotNull(mvf);
@@ -653,9 +651,8 @@
    }
    // Check type, value
    // As we provide dummy type and value string, attType and attVal could
    // be null.
    if ((attType != null) && (attVal != null))
    // As we provide dummy type and value string, attType and attVal could be null.
    if (attType != null && attVal != null)
    {
      mvf = MatchedValuesFilter.createApproximateFilter(attType, attVal);
      assertNotNull(mvf);
@@ -742,8 +739,9 @@
        attValueTestCurrent = attValueTest;
      }
      boolean exceptionExpected = (attTypeTestCurrent == null)
          || (attValueTestCurrent == null) || (matchingRuleidTestCurrent == null);
      boolean exceptionExpected = attTypeTestCurrent == null
          || attValueTestCurrent == null
          || matchingRuleidTestCurrent == null;
      MatchedValuesFilter mvf = null;
      try
opendj-server-legacy/src/test/java/org/opends/server/core/PasswordPolicyTestCase.java
@@ -3319,7 +3319,7 @@
      "--set", "min-password-age:24 hours");
    p = DirectoryServer.getDefaultPasswordPolicy();
    assertEquals(p.getMinPasswordAge(), (24*60*60));
    assertEquals(p.getMinPasswordAge(), 24*60*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3350,7 +3350,7 @@
      "--set", "min-password-age:24 hours");
    p = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy(dn);
    assertEquals(p.getMinPasswordAge(), (24*60*60));
    assertEquals(p.getMinPasswordAge(), 24*60*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3379,7 +3379,7 @@
      "--set", "max-password-age:90 days");
    p = DirectoryServer.getDefaultPasswordPolicy();
    assertEquals(p.getMaxPasswordAge(), (90*60*60*24));
    assertEquals(p.getMaxPasswordAge(), 90*60*60*24);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3410,7 +3410,7 @@
      "--set", "max-password-age:90 days");
    p = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy(dn);
    assertEquals(p.getMaxPasswordAge(), (90*60*60*24));
    assertEquals(p.getMaxPasswordAge(), 90*60*60*24);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3439,7 +3439,7 @@
      "--set", "max-password-reset-age:24 hours");
    p = DirectoryServer.getDefaultPasswordPolicy();
    assertEquals(p.getMaxPasswordResetAge(), (24*60*60));
    assertEquals(p.getMaxPasswordResetAge(), 24*60*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3470,7 +3470,7 @@
      "--set", "max-password-reset-age:24 hours");
    p = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy(dn);
    assertEquals(p.getMaxPasswordResetAge(), (24*60*60));
    assertEquals(p.getMaxPasswordResetAge(), 24*60*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3491,7 +3491,7 @@
         throws Exception
  {
    PasswordPolicy p = DirectoryServer.getDefaultPasswordPolicy();
    assertEquals(p.getPasswordExpirationWarningInterval(), (5*60*60*24));
    assertEquals(p.getPasswordExpirationWarningInterval(), 5*60*60*24);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3499,7 +3499,7 @@
      "--set", "password-expiration-warning-interval:24 hours");
    p = DirectoryServer.getDefaultPasswordPolicy();
    assertEquals(p.getPasswordExpirationWarningInterval(), (24*60*60));
    assertEquals(p.getPasswordExpirationWarningInterval(), 24*60*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3522,7 +3522,7 @@
    DN dn = DN.valueOf("cn=SHA1 AuthPassword Policy,cn=Password Policies," +
                      "cn=config");
    PasswordPolicy p = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy(dn);
    assertEquals(p.getPasswordExpirationWarningInterval(), (5*60*60*24));
    assertEquals(p.getPasswordExpirationWarningInterval(), 5*60*60*24);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3530,7 +3530,7 @@
      "--set", "password-expiration-warning-interval:24 hours");
    p = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy(dn);
    assertEquals(p.getPasswordExpirationWarningInterval(), (24*60*60));
    assertEquals(p.getPasswordExpirationWarningInterval(), 24*60*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3799,7 +3799,7 @@
      "--set", "lockout-duration:15 minutes");
    p = DirectoryServer.getDefaultPasswordPolicy();
    assertEquals(p.getLockoutDuration(), (15*60));
    assertEquals(p.getLockoutDuration(), 15*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3830,7 +3830,7 @@
      "--set", "lockout-duration:15 minutes");
    p = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy(dn);
    assertEquals(p.getLockoutDuration(), (15*60));
    assertEquals(p.getLockoutDuration(), 15*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3859,7 +3859,7 @@
      "--set", "lockout-failure-expiration-interval:10 minutes");
    p = DirectoryServer.getDefaultPasswordPolicy();
    assertEquals(p.getLockoutFailureExpirationInterval(), (10*60));
    assertEquals(p.getLockoutFailureExpirationInterval(), 10*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -3890,7 +3890,7 @@
      "--set", "lockout-failure-expiration-interval:10 minutes");
    p = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy(dn);
    assertEquals(p.getLockoutFailureExpirationInterval(), (10*60));
    assertEquals(p.getLockoutFailureExpirationInterval(), 10*60);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -4163,7 +4163,7 @@
      "--set", "idle-lockout-interval:90 days");
    p = DirectoryServer.getDefaultPasswordPolicy();
    assertEquals(p.getIdleLockoutInterval(), (90*60*60*24));
    assertEquals(p.getIdleLockoutInterval(), 90*60*60*24);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
@@ -4194,7 +4194,7 @@
      "--set", "idle-lockout-interval:90 days");
    p = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy(dn);
    assertEquals(p.getIdleLockoutInterval(), (90*60*60*24));
    assertEquals(p.getIdleLockoutInterval(), 90*60*60*24);
    TestCaseUtils.dsconfig(
      "set-password-policy-prop",
opendj-server-legacy/src/test/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandlerTestCase.java
@@ -267,8 +267,8 @@
      Date date = new Date(System.currentTimeMillis() + 86400000L);
      notificationProperties.put(PASSWORD_EXPIRATION_TIME, newArrayList(date.toString()));
    }
    else if ((notificationType == PASSWORD_CHANGED) ||
             (notificationType == PASSWORD_RESET))
    else if (notificationType == PASSWORD_CHANGED ||
             notificationType == PASSWORD_RESET)
    {
      notificationProperties.put(OLD_PASSWORD, newArrayList("oldpassword"));
      notificationProperties.put(NEW_PASSWORD,  newArrayList("newpassword"));
opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java
@@ -435,11 +435,9 @@
      ModifyOperationBasis op = newModifyOperation(buffer);
      LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
      assertEquals((buffer.length() >= 10),
                   validator.passwordIsAcceptable(password,
                                                  new HashSet<ByteString>(0),
                                                  op, userEntry,
                                                  invalidReason));
      boolean actual = validator.passwordIsAcceptable(
          password, new HashSet<ByteString>(0), op, userEntry, invalidReason);
      assertEquals(buffer.length() >= 10, actual);
    }
    validator.finalizePasswordValidator();
@@ -500,11 +498,9 @@
      ModifyOperationBasis op = newModifyOperation(buffer);
      LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
      assertEquals((buffer.length() <= 10),
                   validator.passwordIsAcceptable(password,
                                                  new HashSet<ByteString>(0),
                                                  op, userEntry,
                                                  invalidReason));
      boolean actual = validator.passwordIsAcceptable(
          password, new HashSet<ByteString>(0), op, userEntry, invalidReason);
      assertEquals(buffer.length() <= 10, actual);
    }
    validator.finalizePasswordValidator();
@@ -565,11 +561,9 @@
      ModifyOperationBasis op = newModifyOperation(buffer);
      LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
      assertEquals(((buffer.length() >= 6) && (buffer.length() <= 10)),
                   validator.passwordIsAcceptable(password,
                                                  new HashSet<ByteString>(0),
                                                  op, userEntry,
                                                  invalidReason));
      boolean actual = validator.passwordIsAcceptable(
          password, new HashSet<ByteString>(0), op, userEntry, invalidReason);
      assertEquals(buffer.length() >= 6 && buffer.length() <= 10, actual);
    }
    validator.finalizePasswordValidator();
opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java
@@ -366,11 +366,9 @@
                               DN.valueOf("cn=uid=test.user,o=test"), mods);
      LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
      assertEquals((buffer.length() >= 6),
                   validator.passwordIsAcceptable(password,
                                                  currentPassword,
                                                  op, userEntry,
                                                  invalidReason));
      boolean actual = validator.passwordIsAcceptable(
          password, currentPassword, op, userEntry, invalidReason);
      assertEquals(buffer.length() >= 6, actual);
    }
    validator.finalizePasswordValidator();
opendj-server-legacy/src/test/java/org/opends/server/extensions/TraditionalWorkQueueTestCase.java
@@ -143,7 +143,7 @@
    long startTime = System.currentTimeMillis();
    assertTrue(DirectoryServer.getWorkQueue().waitUntilIdle(10000));
    long stopTime = System.currentTimeMillis();
    assertTrue((stopTime - startTime) <= 1000);
    assertTrue(stopTime - startTime <= 1000);
  }
@@ -163,7 +163,7 @@
    long startTime = System.currentTimeMillis();
    assertTrue(DirectoryServer.getWorkQueue().waitUntilIdle(0));
    long stopTime = System.currentTimeMillis();
    assertTrue((stopTime - startTime) <= 1000);
    assertTrue(stopTime - startTime <= 1000);
  }
@@ -189,7 +189,7 @@
    long startTime = System.currentTimeMillis();
    assertTrue(DirectoryServer.getWorkQueue().waitUntilIdle(10000));
    long stopTime = System.currentTimeMillis();
    assertTrue((stopTime - startTime) >= 4000);
    assertTrue(stopTime - startTime >= 4000);
  }
  /**
@@ -213,7 +213,7 @@
    long startTime = System.currentTimeMillis();
    assertFalse(DirectoryServer.getWorkQueue().waitUntilIdle(1000));
    long stopTime = System.currentTimeMillis();
    assertTrue((stopTime - startTime) <= 2000);
    assertTrue(stopTime - startTime <= 2000);
  }
}
opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
@@ -143,7 +143,7 @@
  {
    long opID1 = InternalClientConnection.nextOperationID();
    long opID2 = InternalClientConnection.nextOperationID();
    assertEquals(opID2, (opID1 + 1));
    assertEquals(opID2, opID1 + 1);
  }
@@ -158,7 +158,7 @@
  {
    int msgID1 = InternalClientConnection.nextMessageID();
    int msgID2 = InternalClientConnection.nextMessageID();
    assertEquals(msgID2, (msgID1 + 1));
    assertEquals(msgID2, msgID1 + 1);
  }
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxConnectTest.java
@@ -189,7 +189,7 @@
      boolean expectedResult) throws Exception {
    OpendsJmxConnector connector = connect(user, password,
        TestCaseUtils.getServerJmxPort());
    assertEquals((connector != null), expectedResult);
    assertEquals(connector != null, expectedResult);
    if (connector != null) {
      connector.close();
    }
@@ -507,7 +507,7 @@
    // Provide the credentials required by the server to successfully
    // perform user authentication
    String[] credentials;
    if ((user == null) && (password == null)) {
    if (user == null && password == null) {
      credentials = null;
    }
    else
@@ -544,7 +544,7 @@
    // Provide the credentials required by the server to successfully
    // perform user authentication
    String[] credentials;
    if ((user == null) && (password == null)) {
    if (user == null && password == null) {
      credentials = null;
    }
    else
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/PostConnectedDisconnectTest.java
@@ -129,8 +129,8 @@
    long endTime = System.currentTimeMillis() + 5000;
    int postConnectAfter = postConnectBefore;
    while ((System.currentTimeMillis() < endTime)
        && (postConnectAfter == postConnectBefore))
    while (System.currentTimeMillis() < endTime
        && postConnectAfter == postConnectBefore)
    {
      Thread.sleep(10);
      postConnectAfter = InvocationCounterPlugin.getPostConnectCount();
@@ -148,8 +148,8 @@
    // Don't wait more than 5 seconds
    endTime = System.currentTimeMillis() + 5000;
    postDisconnectAfter = postDisconnectBefore;
    while ((System.currentTimeMillis() < endTime)
        && (postDisconnectAfter == postDisconnectBefore))
    while (System.currentTimeMillis() < endTime
        && postDisconnectAfter == postDisconnectBefore)
    {
      Thread.sleep(10);
      postDisconnectAfter = InvocationCounterPlugin.getPostDisconnectCount();
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/ASN1ReaderTestCase.java
@@ -348,12 +348,12 @@
  {
    // First, test with the standard Boolean type.
    byte[] elementArray = new byte[] { 0x01, 0x01, b[0] };
    assertEquals(getReader(elementArray, 0).readBoolean(), (b[0] != 0x00));
    assertEquals(getReader(elementArray, 0).readBoolean(), b[0] != 0x00);
    // Next, test with a nonstandard Boolean type.
    elementArray[0] = 0x50;
    assertEquals(getReader(elementArray, 0).readBoolean(), (b[0] != 0x00));
    assertEquals(getReader(elementArray, 0).readBoolean(), b[0] != 0x00);
  }
@@ -372,12 +372,12 @@
  {
    // First, test with the standard Boolean type.
    byte[] elementArray = new byte[] { 0x01, (byte) 0x81, 0x01, b[0] };
    assertEquals(getReader(elementArray, 0).readBoolean(), (b[0] != 0x00));
    assertEquals(getReader(elementArray, 0).readBoolean(), b[0] != 0x00);
    // Next, test with a nonstandard Boolean type.
    elementArray[0] = 0x50;
    assertEquals(getReader(elementArray, 0).readBoolean(), (b[0] != 0x00));
    assertEquals(getReader(elementArray, 0).readBoolean(), b[0] != 0x00);
  }
opendj-server-legacy/src/test/java/org/opends/server/replication/InitOnLineTest.java
@@ -458,7 +458,7 @@
    int count = 0;
    while (count<=entryBytes.length-2)
    {
      if ((entryBytes[count] == '\n') && (entryBytes[count+1] == '\n'))
      if (entryBytes[count] == '\n' && entryBytes[count+1] == '\n')
      {
        entryCount++;
        count++;
opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -524,7 +524,7 @@
      }
      op = connection.processSearch(newSearchRequest("cn=replication,cn=monitor", WHOLE_SUBTREE, monitorFilter));
    }
    while (op.getSearchEntries().isEmpty() && (count<100));
    while (op.getSearchEntries().isEmpty() && count<100);
    assertFalse(op.getSearchEntries().isEmpty(), "Could not read monitoring information");
    SearchResultEntry entry = op.getSearchEntries().getFirst();
@@ -551,7 +551,7 @@
      if (newEntry != null)
      {
        List<Attribute> tmpAttrList = newEntry.getAttribute(attrTypeStr);
        if ((tmpAttrList != null) && (!tmpAttrList.isEmpty()))
        if (tmpAttrList != null && !tmpAttrList.isEmpty())
        {
          Attribute tmpAttr = tmpAttrList.get(0);
          found = tmpAttr.contains(ByteString.valueOf(valueString));
@@ -562,7 +562,7 @@
      {
        Thread.sleep(100);
      }
    } while ((--count > 0) && (found != hasAttribute));
    } while (--count > 0 && found != hasAttribute);
    return found;
  }
@@ -579,7 +579,7 @@
    }
    Thread.sleep(50);
    boolean found = DirectoryServer.entryExists(dn);
    while ((count> 0) && (found != exist))
    while (count> 0 && found != exist)
    {
      Thread.sleep(200);
@@ -612,7 +612,7 @@
  protected long getMonitorDelta() throws Exception
  {
    long currentCount = getMonitorAttrValue(monitorDN, monitorAttr);
    long delta = (currentCount - lastCount);
    long delta = currentCount - lastCount;
    lastCount = currentCount;
    return delta;
  }
@@ -757,7 +757,7 @@
    while (taskState != expectedTaskState
        && taskState != TaskState.STOPPED_BY_ERROR
        && taskState != TaskState.COMPLETED_SUCCESSFULLY
        && (System.currentTimeMillis() - startTime < maxWaitTimeInMillis));
        && System.currentTimeMillis() - startTime < maxWaitTimeInMillis);
    // Check that the task contains some log messages.
    Set<String> logMessages = resultEntry.parseAttribute(
@@ -917,7 +917,7 @@
      }
      logger.trace("waitForSpecificMsg received : " + replMsg);
      msgs.add(replMsg);
      timedOut = (System.currentTimeMillis() - startTime) > timeOut;
      timedOut = System.currentTimeMillis() - startTime > timeOut;
    }
    // Timeout
    fail("Failed to receive an expected " + msgType + " message after 5 seconds."
opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java
@@ -293,7 +293,7 @@
      synchronized (this)
      {
        int i = 20;
        while ((finished != true) && (i-- >0))
        while (!finished && (i-- >0))
        {
          try
          {
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java
@@ -452,7 +452,7 @@
        sslEncryption = serverStartMsg.getSSLEncryption();
        // Send replication server start
        String serverURL = ("localhost:" + port);
        String serverURL = "localhost:" + port;
        ReplServerStartMsg replServerStartMsg = new ReplServerStartMsg(serverId,
          serverURL, baseDN, windowSize, serverState, generationId, sslEncryption,
          groupId, degradedStatusThreshold);
@@ -812,7 +812,7 @@
      else
      {
        // RS has a different group id, addEntry should have returned quickly
        assertTrue((endTime - startTime) < 3000);
        assertTrue(endTime - startTime < 3000);
        // No error should be seen in monitoring and update should have not been
        // sent in assured mode
@@ -925,7 +925,7 @@
      else
      {
        // RS has a different group id, addEntry should have returned quickly
        assertTrue((endTime - startTime) < 3000);
        assertTrue(endTime - startTime < 3000);
        // No error should be seen in monitoring and update should have not been
        // sent in assured mode
@@ -1341,7 +1341,7 @@
   */
  private void assertBlockedLongerThanTimeout(long startTime, long endTime, int TIMEOUT)
  {
    assertTrue((endTime - startTime) >= TIMEOUT);
    assertTrue(endTime - startTime >= TIMEOUT);
  }
  /**
@@ -1535,8 +1535,8 @@
  private void waitOpResult(Operation operation, ResultCode expectedResult) throws Exception
  {
    int ii=0;
    while((operation.getResultCode()==ResultCode.UNDEFINED) ||
        (operation.getResultCode()!=expectedResult))
    while (operation.getResultCode() == ResultCode.UNDEFINED ||
        operation.getResultCode() != expectedResult)
    {
      Thread.sleep(50);
      ii++;
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/FractionalReplicationTest.java
@@ -463,7 +463,7 @@
          else
          {
            // Other strings are attributes
            String endString = (addSynchroAttribute ? ("," + SYNCHRO_OPTIONAL_ATTR + "\n") : "\n");
            String endString = addSynchroAttribute ? ("," + SYNCHRO_OPTIONAL_ATTR + "\n") : "\n";
            topEntryLdif += fracCfgValue + ( (i<size-1) ? "," : endString);
          }
          i++;
@@ -503,7 +503,7 @@
        else
        {
          // Other strings are attributes
          String endString = (addSynchroAttribute ? ("," + SYNCHRO_OPTIONAL_ATTR + "\n") : "\n");
          String endString = addSynchroAttribute ? ("," + SYNCHRO_OPTIONAL_ATTR + "\n") : "\n";
          configEntryLdif += fracCfgValue + ( (i<size-1) ? "," : endString);
        }
          i++;
opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java
@@ -1486,7 +1486,7 @@
      // Wait for connections to be finished
      // DS must see expected numbers of fake DSs and RSs
      final FakeReplicationDomain fakeRd1 = fakeRDs[1];
      waitForStableTopo(fakeRd1, (otherFakeDS ? 1 : 0), 4);
      waitForStableTopo(fakeRd1, otherFakeDS ? 1 : 0, 4);
      /***********************************************************************
       * Send update from DS 1 (3 fake RSs available) and check what happened
@@ -1521,7 +1521,7 @@
      // Wait for disconnection to be finished
      // DS must see expected numbers of fake DSs and RSs
      waitForStableTopo(fakeRd1, (otherFakeDS ? 1 : 0), 3);
      waitForStableTopo(fakeRd1, otherFakeDS ? 1 : 0, 3);
      // Keep track of monitoring values for incremental test step
      acknowledgedUpdates = fakeRd1.getAssuredSdAcknowledgedUpdates();
@@ -1552,7 +1552,7 @@
      // Wait for disconnection to be finished
      // DS must see expected numbers of fake DSs and RSs
      waitForStableTopo(fakeRd1, (otherFakeDS ? 1 : 0), 2);
      waitForStableTopo(fakeRd1, otherFakeDS ? 1 : 0, 2);
      // Keep track of monitoring values for incremental test step
      acknowledgedUpdates = fakeRd1.getAssuredSdAcknowledgedUpdates();
@@ -1583,7 +1583,7 @@
      // Wait for disconnection to be finished
      // DS must see expected numbers of fake DSs and RSs
      waitForStableTopo(fakeRd1, (otherFakeDS ? 1 : 0), 1);
      waitForStableTopo(fakeRd1, otherFakeDS ? 1 : 0, 1);
      // Keep track of monitoring values for incremental test step
      acknowledgedUpdates = fakeRd1.getAssuredSdAcknowledgedUpdates();
@@ -1948,8 +1948,8 @@
      /*
       * Now check timeout or not according to test configuration parameters
       */
      if ( (sdLevel == 1) || (fakeRsGid != DEFAULT_GID) ||
        (fakeRsGenId != DEFAULT_GENID) || (!sendInAssured) )
      if (sdLevel == 1 || fakeRsGid != DEFAULT_GID
          || fakeRsGenId != DEFAULT_GENID || !sendInAssured )
      {
        // Should have timed out (no ack)
        assertTrue(timeout);
@@ -2431,8 +2431,8 @@
      // Check monitoring values in DS 1
      final SafeReadAssertions srAssertsRD1 = fakeRd1.newSafeReadAssertions().sentUpdates(1);
      if (( (otherFakeDsGid == DEFAULT_GID) && (otherFakeDsGenId == DEFAULT_GENID) && (otherFakeDsScen != REPLY_OK_DS_SCENARIO) )
         || ( (otherFakeRsGid == DEFAULT_GID) && (otherFakeRsGenId == DEFAULT_GENID) && (otherFakeRsScen != REPLY_OK_RS_SCENARIO) ))
      if ((otherFakeDsGid == DEFAULT_GID && otherFakeDsGenId == DEFAULT_GENID && otherFakeDsScen != REPLY_OK_DS_SCENARIO)
         || (otherFakeRsGid == DEFAULT_GID && otherFakeRsGenId == DEFAULT_GENID && otherFakeRsScen != REPLY_OK_RS_SCENARIO))
      {
        srAssertsRD1.notAcknowledgedUpdates(1);
      }
@@ -2908,7 +2908,7 @@
      boolean fakeDsIsEligible = areGroupAndGenerationIdOk(fakeDsGid, fakeDsGenId);
      // Check call time
      if (fakeDsIsEligible && (fakeDsScen == TIMEOUT_DS_SCENARIO))
      if (fakeDsIsEligible && fakeDsScen == TIMEOUT_DS_SCENARIO)
      {
        assertBetweenInclusive(sendUpdateTime, SMALL_TIMEOUT, SMALL_TIMEOUT + 1000);
      }
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java
@@ -507,8 +507,7 @@
       */
      for (int i =0; i< CLIENT_THREADS; i++)
      {
        clientBroker[i] = openReplicationSession(TEST_ROOT_DN,
            (100+i), 100, replicationServerPort, 1000);
        clientBroker[i] = openReplicationSession(TEST_ROOT_DN, 100+i, 100, replicationServerPort, 1000);
        client[i] = new BrokerReader(clientBroker[i], TOTAL_MSG);
      }
opendj-server-legacy/src/test/java/org/opends/server/schema/GenericSchemaTestCase.java
@@ -384,14 +384,14 @@
  private boolean isNumericOID(String oid)
  {
    // It must not be null, and it must not be empty.
    if ((oid == null) || (oid.length() == 0))
    if (oid == null || oid.length() == 0)
    {
      return false;
    }
    // It must start and end with numeric digits.
    if ((! Character.isDigit(oid.charAt(0))) ||
        (! Character.isDigit(oid.charAt(oid.length()-1))))
    if (!Character.isDigit(oid.charAt(0)) ||
        !Character.isDigit(oid.charAt(oid.length()-1)))
    {
      return false;
    }
opendj-server-legacy/src/test/java/org/opends/server/tasks/DummyTask.java
@@ -90,8 +90,7 @@
  protected TaskState runTask()
  {
    long stopTime = System.currentTimeMillis() + sleepTime;
    while ((interruptedState == null) &&
           (System.currentTimeMillis() < stopTime))
    while (interruptedState == null && System.currentTimeMillis() < stopTime)
    {
      try
      {
@@ -99,14 +98,11 @@
      } catch (Exception e) {}
    }
    if (interruptedState == null)
    {
      return TaskState.COMPLETED_SUCCESSFULLY;
    }
    else
    if (interruptedState != null)
    {
      return interruptedState;
    }
    return TaskState.COMPLETED_SUCCESSFULLY;
  }
opendj-server-legacy/src/test/java/org/opends/server/tasks/TestImportAndExport.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.server.tasks;
@@ -375,22 +375,20 @@
    // Use a big timeout since this test is sensitive to host environment (e.g.
    // low memory, etc). See issue OPENDJ-256.
    testTask(taskEntry, expectedState, 600);
     if ((expectedState == TaskState.COMPLETED_SUCCESSFULLY) ||
        (expectedState == TaskState.COMPLETED_WITH_ERRORS))
     if (expectedState == TaskState.COMPLETED_SUCCESSFULLY ||
        expectedState == TaskState.COMPLETED_WITH_ERRORS)
    {
      if (taskEntry.hasObjectClass(exportClass))
      {
        assertEquals(TestTaskListener.exportBeginCount.get(),
                     (exportBeginCount+1));
        assertEquals(TestTaskListener.exportEndCount.get(), (exportEndCount+1));
        assertEquals(TestTaskListener.exportBeginCount.get(), exportBeginCount+1);
        assertEquals(TestTaskListener.exportEndCount.get(), exportEndCount+1);
        assertEquals(TestTaskListener.exportBeginCount.get(),
                     TestTaskListener.exportEndCount.get());
      }
      else
      {
        assertEquals(TestTaskListener.importBeginCount.get(),
                     (importBeginCount+1));
        assertEquals(TestTaskListener.importEndCount.get(), (importEndCount+1));
        assertEquals(TestTaskListener.importBeginCount.get(), importBeginCount+1);
        assertEquals(TestTaskListener.importEndCount.get(), importEndCount+1);
        assertEquals(TestTaskListener.importBeginCount.get(),
                     TestTaskListener.importEndCount.get());
      }
opendj-server-legacy/src/test/java/org/opends/server/tools/EncodePasswordTestCase.java
@@ -220,7 +220,7 @@
  @Test(dataProvider = "invalidArgs")
  public void testInvalidArguments(String[] args, String invalidReason)
  {
    assertFalse((EncodePassword.encodePassword(args, false, null, null) == 0),
    assertFalse(EncodePassword.encodePassword(args, false, null, null) == 0,
                "Should have been invalid because:  " + invalidReason);
  }
opendj-server-legacy/src/test/java/org/opends/server/tools/LDIFDiffTestCase.java
@@ -432,7 +432,7 @@
  {
    // If the command is expected to fail, or if there aren't any differences,
    // then bail out now.
    if ((normalDiffFile == null) || normalDiffFile.equals(noDiffsFile))
    if (normalDiffFile == null || normalDiffFile.equals(noDiffsFile))
    {
      return;
    }
@@ -539,7 +539,7 @@
  {
    // If the command is expected to fail, or if there aren't any differences,
    // then bail out now.
    if ((normalDiffFile == null) || singleValueDiffFile.equals(noDiffsFile))
    if (normalDiffFile == null || singleValueDiffFile.equals(noDiffsFile))
    {
      return;
    }
opendj-server-legacy/src/test/java/org/opends/server/tools/ListBackendsTestCase.java
@@ -182,7 +182,7 @@
  @Test(dataProvider = "invalidArgs")
  public void testInvalidArguments(String[] args, String invalidReason)
  {
    assertFalse((ListBackends.listBackends(args, false, null, null) == 0),
    assertFalse(ListBackends.listBackends(args, false, null, null) == 0,
                "Should have been invalid because:  " + invalidReason);
  }
opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
@@ -2441,7 +2441,7 @@
    if (task == null)
    {
      long stopWaitingTime = System.currentTimeMillis() + 10000L;
      while ((task == null) && (System.currentTimeMillis() < stopWaitingTime))
      while (task == null && System.currentTimeMillis() < stopWaitingTime)
      {
        Thread.sleep(10);
        task = taskBackend.getScheduledTask(taskEntryDN);
@@ -2453,8 +2453,8 @@
    if (! TaskState.isDone(task.getTaskState()))
    {
      long stopWaitingTime = System.currentTimeMillis() + 20000L;
      while ((! TaskState.isDone(task.getTaskState())) &&
             (System.currentTimeMillis() < stopWaitingTime))
      while (!TaskState.isDone(task.getTaskState())
          && System.currentTimeMillis() < stopWaitingTime)
      {
        Thread.sleep(10);
      }
opendj-server-legacy/src/test/java/org/opends/server/types/TestAttributeType.java
@@ -228,7 +228,7 @@
        for (String property : extraProperties.keySet())
        {
          List<String> values = extraProperties.get(property);
          if ((values == null) || values.isEmpty())
          if (values == null || values.isEmpty())
          {
            continue;
          }
opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java
@@ -519,7 +519,7 @@
  public void testGetParent(String s, String p, String r)
      throws Exception {
    DN dn = DN.valueOf(s);
    DN parent = (p != null ? DN.valueOf(p) : null);
    DN parent = p != null ? DN.valueOf(p) : null;
    assertEquals(dn.parent(), parent, "For DN " + s);
  }
@@ -628,7 +628,7 @@
  public void testGetRDN(String s, String p, String r)
      throws Exception {
    DN dn = DN.valueOf(s);
    RDN rdn = (r != null ? RDN.decode(r) : null);
    RDN rdn = r != null ? RDN.decode(r) : null;
    assertEquals(dn.rdn(), rdn, "For DN " + s);
  }
opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java
@@ -190,7 +190,7 @@
        for (String property : extraProperties.keySet())
        {
          List<String> values = extraProperties.get(property);
          if ((values == null) || values.isEmpty())
          if (values == null || values.isEmpty())
          {
            continue;
          }
@@ -231,10 +231,9 @@
    private void append(StringBuilder definition, String word,
        Set<AttributeType> attrTypes)
    private void append(StringBuilder definition, String word, Set<AttributeType> attrTypes)
    {
      if ((attrTypes != null) && (!attrTypes.isEmpty()))
      if (attrTypes != null && !attrTypes.isEmpty())
      {
        definition.append(" ");
        definition.append(word);
opendj-server-legacy/src/test/java/org/opends/server/util/TestBase64.java
@@ -172,7 +172,7 @@
  private byte[] getBytes(String hexData) {
    int sz = hexData.length();
    if ((sz % 2) != 0) {
    if (sz % 2 != 0) {
      throw new IllegalArgumentException(
          "Hex string does not contain an even number of hex digits");
    }