From a89f7014aeb71dba5c94404dfea7eb89e7eeee74 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 08 Jul 2015 06:48:02 +0000
Subject: [PATCH] AutoRefactor'ed Use Diamond Operator
---
opendj-server-legacy/src/main/java/org/opends/server/schema/DITContentRuleSyntax.java | 27
opendj-server-legacy/src/main/java/org/opends/server/loggers/ParallelTextWriter.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java | 6
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AckMsg.java | 2
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java | 8
opendj-server-legacy/src/test/java/org/opends/server/extensions/TLSByteChannelTestCase.java | 7
opendj-server-legacy/src/test/java/org/opends/server/util/TestAddChangeRecordEntry.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeDataExpectedAcksInfo.java | 4
opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java | 8
opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java | 4
opendj-server-legacy/src/main/java/org/opends/server/loggers/MultifileTextWriter.java | 6
opendj-server-legacy/src/main/java/org/opends/server/monitors/StackTraceMonitorProvider.java | 10
opendj-server-legacy/src/main/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskEntry.java | 18
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java | 13
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Record.java | 2
opendj-server-legacy/src/test/java/org/opends/server/api/AlertHandlerTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/CompositeDBCursor.java | 3
opendj-server-legacy/src/test/java/org/opends/server/plugins/PasswordPolicyImportPluginTestCase.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java | 63
opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java | 14
opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java | 15
opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java | 20
opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java | 3
opendj-server-legacy/src/test/java/org/opends/server/core/GroupManagerTestCase.java | 58
opendj-server-legacy/src/test/java/org/opends/server/types/TestCommonSchemaElements.java | 6
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java | 14
opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java | 30
opendj-server-legacy/src/test/java/org/opends/server/extensions/SoftReferenceEntryCacheTestCase.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPInputStream.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/server/DataServerHandler.java | 6
opendj-server-legacy/src/test/java/org/opends/server/plugins/SambaPasswordPluginTestCase.java | 20
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java | 10
opendj-server-legacy/src/main/java/org/opends/server/extensions/DictionaryPasswordValidator.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java | 14
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeCli.java | 2
opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java | 16
opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java | 40
opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java | 16
opendj-server-legacy/src/test/java/org/opends/server/util/PackageInfoTestCase.java | 14
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/TopologyMsg.java | 15
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleInteraction.java | 32
opendj-server-legacy/src/main/java/org/opends/server/tools/RebuildIndex.java | 10
opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java | 19
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PendingChanges.java | 3
opendj-server-legacy/src/main/java/org/opends/server/util/VersionCompatibilityIssue.java | 20
opendj-server-legacy/src/test/java/org/opends/server/tools/VerifyIndexTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java | 21
opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java | 6
opendj-server-legacy/src/test/java/org/opends/server/TestTextWriter.java | 12
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FakeModifyOperation.java | 2
opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java | 2
opendj-server-legacy/src/test/java/org/opends/server/extensions/TestAlertGenerator.java | 2
opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java | 14
opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java | 3
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java | 17
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationUserData.java | 8
opendj-server-legacy/src/test/java/org/opends/server/extensions/ConfigFileHandlerTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPMessage.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java | 51
opendj-server-legacy/src/main/java/org/opends/server/types/AbstractOperation.java | 13
opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java | 18
opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/loggers/LoggingCategoryNames.java | 6
opendj-server-legacy/src/main/java/org/opends/server/types/RawAttribute.java | 4
opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java | 11
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPStatistics.java | 2
opendj-server-legacy/src/test/java/org/opends/server/core/PluginConfigManagerTestCase.java | 5
opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapperTestCase.java | 19
opendj-server-legacy/src/main/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java | 13
opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java | 12
opendj-server-legacy/src/test/java/org/opends/server/types/SmallMapTest.java | 28
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/RemotePendingChanges.java | 16
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxConnectTest.java | 6
opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/MultimasterReplication.java | 38
opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVerifyJob.java | 2
opendj-server-legacy/src/main/java/org/opends/server/util/BackupManager.java | 13
opendj-server-legacy/src/main/java/org/opends/server/replication/server/LightweightServerHandler.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java | 21
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerHandler.java | 3
opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java | 20
opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java | 2
opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangelogDB.java | 17
opendj-server-legacy/src/main/java/org/opends/server/extensions/DiskSpaceMonitor.java | 19
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java | 8
opendj-server-legacy/src/main/java/org/opends/server/schema/NameFormSyntax.java | 17
opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/ModifyEntryMockLDAPConnection.java | 2
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPReader.java | 31
opendj-server-legacy/src/main/java/org/opends/server/types/LockManager.java | 6
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java | 2
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java | 16
opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java | 20
opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java | 2
opendj-server-legacy/src/main/java/org/opends/server/plugins/LDAPADListPlugin.java | 2
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java | 8
opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java | 9
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/StartSessionMsg.java | 8
opendj-server-legacy/src/test/java/org/opends/server/admin/RelativeInheritedDefaultBehaviorProviderTest.java | 2
opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/monitors/TraditionalWorkQueueMonitor.java | 80
opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java | 4
opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java | 8
opendj-server-legacy/src/test/java/org/opends/server/extensions/DefaultEntryCacheTestCase.java | 14
opendj-server-legacy/src/test/java/org/opends/server/extensions/FingerprintCertificateMapperTestCase.java | 14
opendj-server-legacy/src/main/java/org/opends/server/schema/CollationMatchingRuleFactory.java | 12
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ExpectedAcksInfo.java | 3
opendj-server-legacy/src/test/java/org/opends/server/schema/GenericSchemaTestCase.java | 10
opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java | 2
opendj-server-legacy/src/test/java/org/opends/server/admin/TestParentCfgDefn.java | 11
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java | 4
opendj-server-legacy/src/test/java/org/opends/server/types/TestAttributeType.java | 2
opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java | 14
opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java | 5
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java | 5
opendj-server-legacy/src/main/java/org/opends/server/util/AddChangeRecordEntry.java | 2
opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java | 9
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Branch.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java | 8
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java | 55
opendj-server-legacy/src/main/java/org/opends/server/schema/MatchingRuleUseSyntax.java | 11
opendj-server-legacy/src/test/java/org/opends/server/tools/EncodePasswordTestCase.java | 4
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java | 8
opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/FileReplicaDBTest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java | 49
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/AbstractRequestImpl.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java | 83
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java | 4
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalSearchOperation.java | 4
opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTests.java | 32
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java | 8
opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java | 4
opendj-server-legacy/src/test/java/org/opends/server/core/SubtreeSpecificationTestCase.java | 7
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java | 6
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogReader.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java | 13
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/Session.java | 3
opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java | 814 +++----
opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultReference.java | 12
opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/MockLDAPConnection.java | 8
opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFModify.java | 31
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextErrorLogPublisher.java | 4
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java | 32
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/SearchRequest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIF.java | 11
opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJLoggerFactory.java | 8
opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java | 15
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPClientConnection.java | 5
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationMonitor.java | 2
opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/schema/DITStructureRuleSyntax.java | 13
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java | 4
opendj-server-legacy/src/main/java/org/opends/server/monitors/SystemInfoMonitorProvider.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/PostConnectedDisconnectTest.java | 7
opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java | 11
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java | 9
opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java | 12
opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeRuleTestCase.java | 20
opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java | 24
opendj-server-legacy/src/test/java/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java | 160
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxConnectionHandler.java | 6
opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFDiff.java | 26
opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/SSFTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAlertHandler.java | 3
opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java | 16
opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java | 10
opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java | 20
opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationBrokerTest.java | 7
opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/LogTest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java | 24
opendj-server-legacy/src/test/java/org/opends/server/tools/ListBackendsTestCase.java | 4
opendj-server-legacy/src/messages/src/org/opends/messages/Category.java | 2
opendj-server-legacy/src/test/java/org/opends/server/admin/server/DNBuilderTest.java | 3
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxClientConnection.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnectionOptions.java | 15
opendj-server-legacy/src/main/java/org/opends/server/types/LDIFExportConfig.java | 38
opendj-server-legacy/src/main/java/org/opends/server/types/HostPort.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ChangeNumberIndexerTest.java | 6
opendj-server-legacy/src/test/java/org/opends/server/types/DirectoryExceptionTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleUserData.java | 13
opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java | 16
opendj-server-legacy/src/test/java/org/opends/server/controls/ServerSideSortControlTestCase.java | 15
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPRequestHandler.java | 14
opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/InitOnLineTest.java | 2
opendj-server-legacy/src/messages/src/org/opends/messages/Severity.java | 4
opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java | 14
opendj-server-legacy/src/test/java/org/opends/server/loggers/AbstractTextAccessLogPublisherTest.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Template.java | 9
opendj-server-legacy/src/main/java/org/opends/server/loggers/FileNumberRetentionPolicy.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java | 211 -
opendj-server-legacy/src/main/java/org/opends/server/types/LDAPURL.java | 12
opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java | 14
opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/SequentialDBCursor.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java | 24
opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ECLMultiDomainDBCursorTest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java | 125
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java | 28
opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogPublisher.java | 7
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java | 8
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/LDAPUpdateMsg.java | 6
opendj-server-legacy/src/test/java/org/opends/server/replication/SchemaReplicationTest.java | 8
opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPPasswordModifyTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/ManageAccount.java | 10
opendj-server-legacy/src/test/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandlerTestCase.java | 22
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/LogFile.java | 12
opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java | 8
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java | 2
opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java | 10
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/DomainFakeCfg.java | 6
opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPCompareTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEReplicaDB.java | 2
opendj-server-legacy/src/test/java/org/opends/server/extensions/TraditionalWorkQueueTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ChangelogState.java | 10
opendj-server-legacy/src/test/java/org/opends/server/tools/RebuildIndexTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/StateMachineTest.java | 4
opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogger.java | 8
opendj-server-legacy/src/test/java/org/opends/server/plugins/LDAPADListPluginTestCase.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/DependencyTest.java | 8
opendj-server-legacy/src/main/java/org/opends/server/protocols/LDIFConnectionHandler.java | 2
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java | 8
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java | 10
opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java | 10
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java | 15
opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java | 6
opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java | 19
opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java | 4
opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java | 25
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TopologyViewTest.java | 25
opendj-server-legacy/src/test/java/org/opends/server/util/TestModifyChangeRecordEntry.java | 2
opendj-server-legacy/src/test/java/org/opends/server/types/AttributesTest.java | 6
opendj-server-legacy/src/main/java/org/opends/server/extensions/DigestMD5SASLMechanismHandler.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TestSynchronousReplayQueue.java | 5
opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java | 27
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPPasswordModify.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolOptions.java | 2
opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPDeleteTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddRequestProtocolOp.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalScheduleInformation.java | 2
opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java | 38
opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java | 9
opendj-server-legacy/src/main/java/org/opends/server/schema/TimeBasedMatchingRuleFactory.java | 4
opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/ProxyBindTestCase.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironmentTest.java | 4
opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java | 43
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangelogDB.java | 17
opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java | 20
opendj-server-legacy/src/main/java/org/opends/server/schema/ObjectClassSyntax.java | 19
opendj-server-legacy/src/main/java/org/opends/server/extensions/UniqueCharactersPasswordValidator.java | 2
opendj-server-legacy/src/main/java/org/opends/server/types/LDIFImportConfig.java | 14
opendj-server-legacy/src/main/java/org/opends/server/util/Base64.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java | 33
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java | 10
opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java | 23
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangeNumberIndexDB.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java | 2
opendj-server-legacy/src/test/java/org/opends/server/admin/TestChildCfgDefn.java | 6
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java | 15
opendj-server-legacy/src/test/java/org/opends/server/core/BackendConfigManagerTestCase.java | 10
opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/UpdateOperationTest.java | 10
opendj-server-legacy/src/test/java/org/opends/server/extensions/FIFOEntryCacheTestCase.java | 2
opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java | 15
opendj-server-legacy/src/test/java/org/opends/server/schema/LDAPSyntaxTest.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalWithOptions.java | 3
opendj-server-legacy/src/test/java/org/opends/server/TestListener.java | 14
opendj-server-legacy/src/test/java/org/opends/server/admin/client/spi/PropertySetTest.java | 36
opendj-server-legacy/src/test/java/org/opends/server/schema/CollationMatchingRuleTest.java | 18
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicaCursor.java | 3
opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/CreateEntryMockLDAPConnection.java | 2
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java | 10
opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java | 10
opendj-server-legacy/src/main/java/org/opends/server/loggers/AccessLogger.java | 5
opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java | 2
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java | 30
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java | 17
opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java | 14
opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java | 12
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java | 41
opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java | 2
opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkQueue.java | 19
opendj-server-legacy/src/test/java/org/opends/server/replication/service/ComputeBestServerTest.java | 55
opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java | 28
opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java | 10
opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogger.java | 5
opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java | 5
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java | 12
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java | 57
opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java | 4
opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPModifyTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskTool.java | 2
opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java | 98
opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java | 24
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java | 15
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java | 24
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java | 21
opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java | 4
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java | 8
opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java | 23
opendj-server-legacy/src/main/java/org/opends/server/tools/RestoreDB.java | 8
opendj-server-legacy/src/test/java/org/opends/server/api/ConfigChangeListenerTestCase.java | 10
opendj-server-legacy/src/main/java/org/opends/server/monitors/VersionMonitorProvider.java | 2
opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java | 4
opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java | 9
opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractLogger.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java | 9
opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java | 6
opendj-server-legacy/src/main/java/org/opends/server/types/RawFilter.java | 7
opendj-server-legacy/src/main/java/org/opends/server/types/Privilege.java | 19
opendj-server-legacy/src/main/java/org/opends/server/extensions/TLSByteChannel.java | 2
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextHTTPAccessLogPublisher.java | 6
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalConnectionHandler.java | 4
opendj-server-legacy/src/test/java/org/opends/server/admin/ValidateConfigDefinitionsTest.java | 8
opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java | 8
opendj-server-legacy/src/main/java/org/opends/server/replication/server/MsgQueue.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java | 6
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java | 76
opendj-server-legacy/src/main/java/org/opends/server/plugins/ChangeNumberControlPlugin.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FractionalLDIFImportPlugin.java | 5
opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java | 48
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileReplicaDB.java | 2
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java | 6
opendj-server-legacy/src/main/java/org/opends/server/tools/InstallDSArgumentParser.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java | 6
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java | 2
opendj-server-legacy/src/test/java/org/opends/server/api/DITCacheMapTestCase.java | 14
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java | 2
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java | 20
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java | 10
opendj-server-legacy/src/main/java/org/opends/server/monitors/DatabaseEnvironmentMonitor.java | 7
opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java | 11
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java | 2
opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java | 2
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java | 133
opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java | 2
opendj-server-legacy/src/main/java/org/opends/server/types/BackupInfo.java | 29
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java | 58
opendj-server-legacy/src/main/java/org/opends/server/types/IntermediateResponse.java | 2
opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java | 6
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxTestCase.java | 4
opendj-server-legacy/src/test/java/org/opends/server/admin/server/AggregationServerTest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/VerifyIndex.java | 6
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java | 4
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java | 26
opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java | 2
opendj-server-legacy/src/test/java/org/opends/server/plugins/EntryUUIDPluginTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java | 14
opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/SynchronizationMsgTest.java | 34
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java | 27
opendj-server-legacy/src/main/java/org/opends/server/util/TimeThread.java | 5
opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java | 20
opendj-server-legacy/src/main/java/org/opends/server/tools/ConfigureDS.java | 4
opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java | 11
opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCliArgumentParser.java | 16
opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java | 11
opendj-server-legacy/src/main/java/org/opends/server/loggers/HTTPAccessLogger.java | 6
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java | 2
opendj-server-legacy/src/main/java/org/opends/server/util/ModifyChangeRecordEntry.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationDomainTest.java | 10
opendj-server-legacy/src/main/java/org/opends/server/loggers/AsynchronousTextWriter.java | 4
opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java | 12
opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java | 10
opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapperTestCase.java | 22
opendj-server-legacy/src/main/java/org/opends/server/monitors/ParallelWorkQueueMonitor.java | 66
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java | 10
opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java | 14
opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java | 20
opendj-server-legacy/src/main/java/org/opends/server/monitors/MemoryUsageMonitorProvider.java | 19
opendj-server-legacy/src/test/java/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java | 6
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/GroupIdHandshakeTest.java | 8
opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryEnvironmentConfig.java | 6
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java | 7
opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java | 6
opendj-server-legacy/src/main/java/org/opends/server/types/AccountStatusNotification.java | 33
opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java | 12
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironment.java | 6
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerDomain.java | 46
opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java | 7
opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultEntry.java | 4
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java | 96
opendj-server-legacy/src/test/java/org/opends/server/extensions/SASLOverTLSTestCase.java | 11
opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java | 31
opendj-server-legacy/src/main/java/org/opends/server/types/DITContentRule.java | 30
opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java | 21
opendj-server-legacy/src/main/java/org/opends/server/extensions/GSSAPISASLMechanismHandler.java | 2
opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/BlockLogReaderWriterTest.java | 4
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java | 9
opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/AggregationClientTest.java | 2
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java | 69
opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java | 2
opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/JebTestCase.java | 6
opendj-server-legacy/src/main/java/org/opends/server/replication/service/DSRSShutdownSync.java | 6
opendj-server-legacy/src/main/java/org/opends/server/tools/ListBackends.java | 11
opendj-server-legacy/src/main/java/org/opends/server/extensions/JMXAlertHandler.java | 3
opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java | 2
opendj-server-legacy/src/test/java/org/opends/server/plugins/UpdatePreOpPlugin.java | 12
opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkQueue.java | 9
opendj-server-legacy/src/main/java/org/opends/server/types/DN.java | 4
opendj-server-legacy/src/main/java/org/opends/server/util/SetupUtils.java | 4
opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPSearchTestCase.java | 6
opendj-server-legacy/src/test/java/org/opends/server/extensions/JMXAlertHandlerTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java | 12
opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java | 32
opendj-server-legacy/src/main/java/org/opends/server/loggers/FreeDiskSpaceRetentionPolicy.java | 2
opendj-server-legacy/src/test/java/org/opends/server/DirectoryServerTestCase.java | 6
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/FractionalReplicationTest.java | 4
opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java | 4
opendj-server-legacy/src/main/java/org/opends/server/types/SmallMap.java | 8
opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFWriter.java | 6
opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java | 12
opendj-server-legacy/src/main/java/org/opends/server/monitors/ClientConnectionMonitorProvider.java | 5
opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java | 4
opendj-server-legacy/src/test/java/org/opends/server/types/LockManagerTest.java | 2
opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java | 5
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiConnector.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/TestInternalSearchListener.java | 4
442 files changed, 2,694 insertions(+), 3,797 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java b/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
index f6ff265..ddb7c1e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -752,7 +752,7 @@
private TreeMap<String, Backend<?>> backends;
/** The set of supported controls registered with the Directory Server. */
- private final TreeSet<String> supportedControls = new TreeSet<String>(Arrays.asList(
+ private final TreeSet<String> supportedControls = new TreeSet<>(Arrays.asList(
OID_LDAP_ASSERTION,
OID_LDAP_READENTRY_PREREAD,
OID_LDAP_READENTRY_POSTREAD,
@@ -773,7 +773,7 @@
OID_NS_PASSWORD_EXPIRING));
/** The set of supported feature OIDs registered with the Directory Server. */
- private final TreeSet<String> supportedFeatures = new TreeSet<String>(Arrays.asList(
+ private final TreeSet<String> supportedFeatures = new TreeSet<>(Arrays.asList(
OID_ALL_OPERATIONAL_ATTRS_FEATURE,
OID_MODIFY_INCREMENT_FEATURE,
OID_TRUE_FALSE_FILTERS_FEATURE));
@@ -1069,71 +1069,42 @@
// Perform any additional initialization that might be necessary before
// loading the configuration.
- directoryServer.alertHandlers = new CopyOnWriteArrayList<AlertHandler>();
- directoryServer.passwordStorageSchemes =
- new ConcurrentHashMap<String,PasswordStorageScheme>();
- directoryServer.passwordStorageSchemesByDN =
- new ConcurrentHashMap<DN,PasswordStorageScheme>();
- directoryServer.passwordGenerators =
- new ConcurrentHashMap<DN,PasswordGenerator>();
- directoryServer.authPasswordStorageSchemes =
- new ConcurrentHashMap<String,PasswordStorageScheme>();
- directoryServer.passwordValidators =
- new ConcurrentHashMap<DN,
- PasswordValidator<? extends PasswordValidatorCfg>>();
- directoryServer.accountStatusNotificationHandlers =
- new ConcurrentHashMap<DN,AccountStatusNotificationHandler>();
- directoryServer.rootDNs = new CopyOnWriteArraySet<DN>();
- directoryServer.alternateRootBindDNs = new ConcurrentHashMap<DN,DN>();
- directoryServer.keyManagerProviders =
- new ConcurrentHashMap<DN,KeyManagerProvider>();
- directoryServer.trustManagerProviders =
- new ConcurrentHashMap<DN,TrustManagerProvider>();
- directoryServer.rotationPolicies =
- new ConcurrentHashMap<DN, RotationPolicy>();
- directoryServer.retentionPolicies =
- new ConcurrentHashMap<DN, RetentionPolicy>();
- directoryServer.certificateMappers =
- new ConcurrentHashMap<DN,CertificateMapper>();
- directoryServer.authenticationPolicies =
- new ConcurrentHashMap<DN,AuthenticationPolicy>();
+ directoryServer.alertHandlers = new CopyOnWriteArrayList<>();
+ directoryServer.passwordStorageSchemes = new ConcurrentHashMap<>();
+ directoryServer.passwordStorageSchemesByDN = new ConcurrentHashMap<>();
+ directoryServer.passwordGenerators = new ConcurrentHashMap<>();
+ directoryServer.authPasswordStorageSchemes = new ConcurrentHashMap<>();
+ directoryServer.passwordValidators = new ConcurrentHashMap<>();
+ directoryServer.accountStatusNotificationHandlers = new ConcurrentHashMap<>();
+ directoryServer.rootDNs = new CopyOnWriteArraySet<>();
+ directoryServer.alternateRootBindDNs = new ConcurrentHashMap<>();
+ directoryServer.keyManagerProviders = new ConcurrentHashMap<>();
+ directoryServer.trustManagerProviders = new ConcurrentHashMap<>();
+ directoryServer.rotationPolicies = new ConcurrentHashMap<>();
+ directoryServer.retentionPolicies = new ConcurrentHashMap<>();
+ directoryServer.certificateMappers = new ConcurrentHashMap<>();
+ directoryServer.authenticationPolicies = new ConcurrentHashMap<>();
directoryServer.defaultPasswordPolicyDN = null;
directoryServer.defaultPasswordPolicy = null;
- directoryServer.monitorProviders =
- new ConcurrentHashMap<String,
- MonitorProvider<? extends MonitorProviderCfg>>();
- directoryServer.backends = new TreeMap<String, Backend<?>>();
- directoryServer.backendInitializationListeners =
- new CopyOnWriteArraySet<BackendInitializationListener>();
+ directoryServer.monitorProviders = new ConcurrentHashMap<>();
+ directoryServer.backends = new TreeMap<>();
+ directoryServer.backendInitializationListeners = new CopyOnWriteArraySet<>();
directoryServer.baseDnRegistry = new BaseDnRegistry();
- directoryServer.initializationCompletedListeners =
- new CopyOnWriteArrayList<InitializationCompletedListener>();
- directoryServer.shutdownListeners =
- new CopyOnWriteArrayList<ServerShutdownListener>();
- directoryServer.synchronizationProviders =
- new CopyOnWriteArrayList<SynchronizationProvider
- <SynchronizationProviderCfg>>();
- directoryServer.supportedLDAPVersions =
- new ConcurrentHashMap<Integer,List<ConnectionHandler>>();
- directoryServer.connectionHandlers =
- new CopyOnWriteArrayList<ConnectionHandler>();
- directoryServer.identityMappers =
- new ConcurrentHashMap<DN,IdentityMapper>();
- directoryServer.extendedOperationHandlers =
- new ConcurrentHashMap<String,ExtendedOperationHandler>();
- directoryServer.saslMechanismHandlers =
- new ConcurrentHashMap<String,SASLMechanismHandler>();
- directoryServer.offlineSchemaChanges = new LinkedList<Modification>();
- directoryServer.backupTaskListeners =
- new CopyOnWriteArrayList<BackupTaskListener>();
- directoryServer.restoreTaskListeners =
- new CopyOnWriteArrayList<RestoreTaskListener>();
- directoryServer.exportTaskListeners =
- new CopyOnWriteArrayList<ExportTaskListener>();
- directoryServer.importTaskListeners =
- new CopyOnWriteArrayList<ImportTaskListener>();
- directoryServer.allowedTasks = new LinkedHashSet<String>(0);
- directoryServer.disabledPrivileges = new LinkedHashSet<Privilege>(0);
+ directoryServer.initializationCompletedListeners = new CopyOnWriteArrayList<>();
+ directoryServer.shutdownListeners = new CopyOnWriteArrayList<>();
+ directoryServer.synchronizationProviders = new CopyOnWriteArrayList<>();
+ directoryServer.supportedLDAPVersions = new ConcurrentHashMap<>();
+ directoryServer.connectionHandlers = new CopyOnWriteArrayList<>();
+ directoryServer.identityMappers = new ConcurrentHashMap<>();
+ directoryServer.extendedOperationHandlers = new ConcurrentHashMap<>();
+ directoryServer.saslMechanismHandlers = new ConcurrentHashMap<>();
+ directoryServer.offlineSchemaChanges = new LinkedList<>();
+ directoryServer.backupTaskListeners = new CopyOnWriteArrayList<>();
+ directoryServer.restoreTaskListeners = new CopyOnWriteArrayList<>();
+ directoryServer.exportTaskListeners = new CopyOnWriteArrayList<>();
+ directoryServer.importTaskListeners = new CopyOnWriteArrayList<>();
+ directoryServer.allowedTasks = new LinkedHashSet<>(0);
+ directoryServer.disabledPrivileges = new LinkedHashSet<>(0);
directoryServer.returnBindErrorMessages = false;
directoryServer.idleTimeLimit = 0L;
}
@@ -1188,7 +1159,7 @@
// Initialize the variables that will be used for connection tracking.
- establishedConnections = new LinkedHashSet<ClientConnection>(1000);
+ establishedConnections = new LinkedHashSet<>(1000);
currentConnections = 0;
maxConnections = 0;
totalConnections = 0;
@@ -1236,7 +1207,7 @@
directoryServer.mBeanServer = MBeanServerFactory.newMBeanServer();
}
- directoryServer.mBeans = new ConcurrentHashMap<DN,JMXMBean>();
+ directoryServer.mBeans = new ConcurrentHashMap<>();
registerAlertGenerator(directoryServer);
}
catch (Exception e)
@@ -1898,12 +1869,9 @@
// preserve any configuration add/delete/change listeners that might have
// been registered with the old configuration (which will primarily be
// schema elements) so they can be re-registered with the new configuration.
- Map<String, List<ConfigAddListener>> addListeners =
- new LinkedHashMap<String,List<ConfigAddListener>>();
- Map<String, List<ConfigDeleteListener>> deleteListeners =
- new LinkedHashMap<String,List<ConfigDeleteListener>>();
- Map<String, List<ConfigChangeListener>> changeListeners =
- new LinkedHashMap<String,List<ConfigChangeListener>>();
+ Map<String, List<ConfigAddListener>> addListeners = new LinkedHashMap<>();
+ Map<String, List<ConfigDeleteListener>> deleteListeners = new LinkedHashMap<>();
+ Map<String, List<ConfigChangeListener>> changeListeners = new LinkedHashMap<>();
getChangeListeners(configHandler.getConfigRootEntry(), addListeners,
deleteListeners, changeListeners);
@@ -3507,9 +3475,7 @@
*/
public static List<VirtualAttributeRule> getVirtualAttributes(Entry entry)
{
- List<VirtualAttributeRule> ruleList =
- new LinkedList<VirtualAttributeRule>();
-
+ List<VirtualAttributeRule> ruleList = new LinkedList<>();
for (VirtualAttributeRule rule : getVirtualAttributes())
{
if (rule.appliesToEntry(entry))
@@ -3517,7 +3483,6 @@
ruleList.add(rule);
}
}
-
return ruleList;
}
@@ -5128,8 +5093,7 @@
synchronized (directoryServer)
{
- TreeMap<String, Backend<?>> newBackends =
- new TreeMap<String, Backend<?>>(directoryServer.backends);
+ TreeMap<String, Backend<?>> newBackends = new TreeMap<>(directoryServer.backends);
if (newBackends.containsKey(backendID))
{
LocalizableMessage message = ERR_REGISTER_BACKEND_ALREADY_EXISTS.get(backendID);
@@ -5174,8 +5138,7 @@
synchronized (directoryServer)
{
- TreeMap<String, Backend<?>> newBackends =
- new TreeMap<String, Backend<?>>(directoryServer.backends);
+ TreeMap<String, Backend<?>> newBackends = new TreeMap<>(directoryServer.backends);
newBackends.remove(backend.getBackendID());
directoryServer.backends = newBackends;
@@ -5791,7 +5754,7 @@
directoryServer.supportedLDAPVersions.get(supportedLDAPVersion);
if (handlers == null)
{
- handlers = new LinkedList<ConnectionHandler>();
+ handlers = new LinkedList<>();
handlers.add(connectionHandler);
directoryServer.supportedLDAPVersions.put(supportedLDAPVersion, handlers);
}
@@ -6020,8 +5983,8 @@
*/
private void startConnectionHandlers() throws ConfigException
{
- Set<HostPort> usedListeners = new LinkedHashSet<HostPort>();
- Set<LocalizableMessage> errorMessages = new LinkedHashSet<LocalizableMessage>();
+ Set<HostPort> usedListeners = new LinkedHashSet<>();
+ Set<LocalizableMessage> errorMessages = new LinkedHashSet<>();
// Check that the port specified in the connection handlers is available.
for (ConnectionHandler<?> c : connectionHandlers)
{
@@ -7768,7 +7731,7 @@
@Override
public Map<String, String> getAlerts()
{
- Map<String, String> alerts = new LinkedHashMap<String, String>();
+ Map<String, String> alerts = new LinkedHashMap<>();
alerts.put(ALERT_TYPE_SERVER_STARTED, ALERT_DESCRIPTION_SERVER_STARTED);
alerts.put(ALERT_TYPE_SERVER_SHUTDOWN, ALERT_DESCRIPTION_SERVER_SHUTDOWN);
@@ -7958,7 +7921,7 @@
// We're not really trying to start, so rebuild the argument list
// without the "--checkStartability" argument and try again. Exit with
// whatever that exits with.
- List<String> newArgList = new LinkedList<String>();
+ List<String> newArgList = new LinkedList<>();
for (String arg : args)
{
if (!"--checkstartability".equalsIgnoreCase(arg))
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java b/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
index ae63376..74b54af 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
@@ -83,12 +83,6 @@
import org.opends.server.tools.LDAPReader;
import org.opends.server.tools.LDAPWriter;
import org.opends.server.types.*;
-import org.opends.server.types.Attribute;
-import org.opends.server.types.Attributes;
-import org.opends.server.types.DN;
-import org.opends.server.types.Entry;
-import org.opends.server.types.Modification;
-import org.opends.server.types.RDN;
import org.opends.server.util.Base64;
import org.opends.server.util.SelectableCertificateKeyManager;
import org.opends.server.util.ServerConstants;
@@ -179,15 +173,13 @@
* The map from encryption key ID to CipherKeyEntry (cache). The cache is
* accessed by methods that request, publish, and import keys.
*/
- private final Map<KeyEntryID, CipherKeyEntry> cipherKeyEntryCache
- = new ConcurrentHashMap<KeyEntryID, CipherKeyEntry>();
+ private final Map<KeyEntryID, CipherKeyEntry> cipherKeyEntryCache = new ConcurrentHashMap<>();
/**
* The map from encryption key ID to MacKeyEntry (cache). The cache is
* accessed by methods that request, publish, and import keys.
*/
- private final Map<KeyEntryID, MacKeyEntry> macKeyEntryCache
- = new ConcurrentHashMap<KeyEntryID, MacKeyEntry>();
+ private final Map<KeyEntryID, MacKeyEntry> macKeyEntryCache = new ConcurrentHashMap<>();
/** The preferred key wrapping transformation. */
@@ -296,7 +288,7 @@
}
// CryptoMangager crypto config parameters.
- List<LocalizableMessage> why = new LinkedList<LocalizableMessage>();
+ List<LocalizableMessage> why = new LinkedList<>();
if (! isConfigurationChangeAcceptable(config, why)) {
throw new InitializationException(why.get(0));
}
@@ -678,7 +670,7 @@
@see org.opends.admin.ads.ADSContext#getTrustedCertificates()
*/
private Map<String, byte[]> getTrustedCertificates() throws CryptoManagerException {
- final Map<String, byte[]> certificateMap = new HashMap<String, byte[]>();
+ final Map<String, byte[]> certificateMap = new HashMap<>();
try {
// Construct the search filter.
final String FILTER_OC_INSTANCE_KEY = "(objectclass=" + ocInstanceKey.getNameOrOID() + ")";
@@ -1006,11 +998,9 @@
OID_GET_SYMMETRIC_KEY_EXTENDED_OP,
requestValue);
- ArrayList<Control> controls =
- new ArrayList<Control>();
- LDAPMessage requestMessage =
- new LDAPMessage(nextMessageID.getAndIncrement(),
- extendedRequest, controls);
+ ArrayList<Control> controls = new ArrayList<>();
+ LDAPMessage requestMessage = new LDAPMessage(
+ nextMessageID.getAndIncrement(), extendedRequest, controls);
writer.writeMessage(requestMessage);
LDAPMessage responseMessage = reader.readMessage();
@@ -1111,8 +1101,7 @@
// Write the value to the entry.
InternalClientConnection internalConnection =
InternalClientConnection.getRootConnection();
- List<Modification> modifications =
- new ArrayList<Modification>(1);
+ List<Modification> modifications = new ArrayList<>(1);
Attribute attribute = Attributes.create(
ConfigConstants.ATTR_CRYPTO_SYMMETRIC_KEY, symmetricKey);
modifications.add(
@@ -1204,18 +1193,11 @@
isCompromised);
// Write the value to the entry.
- InternalClientConnection internalConnection =
- InternalClientConnection.getRootConnection();
- List<Modification> modifications =
- new ArrayList<Modification>(1);
- Attribute attribute = Attributes.create(
- ConfigConstants.ATTR_CRYPTO_SYMMETRIC_KEY, symmetricKey);
- modifications.add(
- new Modification(ModificationType.ADD, attribute,
- false));
+ List<Modification> modifications = new ArrayList<>(1);
+ Attribute attribute = Attributes.create(ATTR_CRYPTO_SYMMETRIC_KEY, symmetricKey);
+ modifications.add(new Modification(ModificationType.ADD, attribute, false));
ModifyOperation internalModify =
- internalConnection.processModify(entry.getName(),
- modifications);
+ getRootConnection().processModify(entry.getName(), modifications);
if (internalModify.getResultCode() != ResultCode.SUCCESS)
{
throw new CryptoManagerException(
@@ -1543,9 +1525,14 @@
Map<AttributeType, List<Attribute>> attrs, AttributeType type,
String value)
{
- ArrayList<Attribute> attrList = new ArrayList<Attribute>(1);
- attrList.add(Attributes.create(type, value));
- attrs.put(type, attrList);
+ attrs.put(type, asList(Attributes.create(type, value)));
+ }
+
+ private static <T> List<T> asList(T element)
+ {
+ ArrayList<T> attrList = new ArrayList<>(1);
+ attrList.add(element);
+ return attrList;
}
/**
@@ -1629,21 +1616,16 @@
RDN.create(attrKeyID, distinguishedValue));
// Set the entry object classes.
- LinkedHashMap<ObjectClass,String> ocMap =
- new LinkedHashMap<ObjectClass,String>(2);
+ LinkedHashMap<ObjectClass,String> ocMap = new LinkedHashMap<>(2);
ocMap.put(DirectoryServer.getTopObjectClass(), OC_TOP);
- ocMap.put(ocCipherKey, ConfigConstants.OC_CRYPTO_CIPHER_KEY);
+ ocMap.put(ocCipherKey, OC_CRYPTO_CIPHER_KEY);
// Create the operational and user attributes.
- LinkedHashMap<AttributeType,List<Attribute>> opAttrs =
- new LinkedHashMap<AttributeType,List<Attribute>>(0);
- LinkedHashMap<AttributeType,List<Attribute>> userAttrs =
- new LinkedHashMap<AttributeType,List<Attribute>>();
+ LinkedHashMap<AttributeType,List<Attribute>> opAttrs = new LinkedHashMap<>(0);
+ LinkedHashMap<AttributeType,List<Attribute>> userAttrs = new LinkedHashMap<>();
// Add the key ID attribute.
- ArrayList<Attribute> attrList = new ArrayList<Attribute>(1);
- attrList.add(Attributes.create(attrKeyID, distinguishedValue));
- userAttrs.put(attrKeyID, attrList);
+ userAttrs.put(attrKeyID, asList(Attributes.create(attrKeyID, distinguishedValue)));
// Add the transformation name attribute.
putSingleValueAttribute(userAttrs, attrTransformation, keyEntry.getType());
@@ -1676,16 +1658,12 @@
builder.add(symmetricKey);
}
- attrList = new ArrayList<Attribute>(1);
- attrList.add(builder.toAttribute());
- userAttrs.put(attrSymmetricKey, attrList);
+ userAttrs.put(attrSymmetricKey, asList(builder.toAttribute()));
// Create the entry.
Entry entry = new Entry(entryDN, ocMap, userAttrs, opAttrs);
- InternalClientConnection connection =
- InternalClientConnection.getRootConnection();
- AddOperation addOperation = connection.processAdd(entry);
+ AddOperation addOperation = getRootConnection().processAdd(entry);
if (addOperation.getResultCode() != ResultCode.SUCCESS)
{
throw new CryptoManagerException(
@@ -2159,21 +2137,16 @@
RDN.create(attrKeyID, distinguishedValue));
// Set the entry object classes.
- LinkedHashMap<ObjectClass,String> ocMap =
- new LinkedHashMap<ObjectClass,String>(2);
+ LinkedHashMap<ObjectClass,String> ocMap = new LinkedHashMap<>(2);
ocMap.put(DirectoryServer.getTopObjectClass(), OC_TOP);
- ocMap.put(ocMacKey, ConfigConstants.OC_CRYPTO_MAC_KEY);
+ ocMap.put(ocMacKey, OC_CRYPTO_MAC_KEY);
// Create the operational and user attributes.
- LinkedHashMap<AttributeType,List<Attribute>> opAttrs =
- new LinkedHashMap<AttributeType,List<Attribute>>(0);
- LinkedHashMap<AttributeType,List<Attribute>> userAttrs =
- new LinkedHashMap<AttributeType,List<Attribute>>();
+ LinkedHashMap<AttributeType,List<Attribute>> opAttrs = new LinkedHashMap<>(0);
+ LinkedHashMap<AttributeType,List<Attribute>> userAttrs = new LinkedHashMap<>();
// Add the key ID attribute.
- ArrayList<Attribute> attrList = new ArrayList<Attribute>(1);
- attrList.add(Attributes.create(attrKeyID, distinguishedValue));
- userAttrs.put(attrKeyID, attrList);
+ userAttrs.put(attrKeyID, asList(Attributes.create(attrKeyID, distinguishedValue)));
// Add the mac algorithm name attribute.
putSingleValueAttribute(userAttrs, attrMacAlgorithm, keyEntry.getType());
@@ -2182,8 +2155,7 @@
putSingleValueAttribute(userAttrs, attrKeyLength, String.valueOf(keyEntry.getKeyLengthBits()));
// Get the trusted certificates.
- Map<String, byte[]> trustedCerts =
- cryptoManager.getTrustedCertificates();
+ Map<String, byte[]> trustedCerts = cryptoManager.getTrustedCertificates();
// Need to add our own instance certificate.
byte[] instanceKeyCertificate =
@@ -2204,9 +2176,7 @@
builder.add(symmetricKey);
}
- attrList = new ArrayList<Attribute>(1);
- attrList.add(builder.toAttribute());
- userAttrs.put(attrSymmetricKey, attrList);
+ userAttrs.put(attrSymmetricKey, asList(builder.toAttribute()));
// Create the entry.
Entry entry = new Entry(entryDN, ocMap, userAttrs, opAttrs);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java
index dc1e0a5..9d86adc 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java
@@ -125,8 +125,8 @@
// Process the provided password.
String password = newPassword.toString();
- HashMap<String,Integer> setCounts = new HashMap<String,Integer>();
- HashMap<String,Integer> rangeCounts = new HashMap<String,Integer>();
+ HashMap<String,Integer> setCounts = new HashMap<>();
+ HashMap<String,Integer> rangeCounts = new HashMap<>();
for (int i=0; i < password.length(); i++)
{
char c = password.charAt(i);
@@ -313,9 +313,9 @@
boolean apply)
throws ConfigException
{
- HashMap<String,Integer> characterSets = new HashMap<String,Integer>();
- HashMap<String,Integer> characterRanges = new HashMap<String,Integer>();
- HashSet<Character> usedCharacters = new HashSet<Character>();
+ HashMap<String,Integer> characterSets = new HashMap<>();
+ HashMap<String,Integer> characterRanges = new HashMap<>();
+ HashSet<Character> usedCharacters = new HashSet<>();
int mandatoryCharacterSets = 0;
for (String definition : configuration.getCharacterSet())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
index 1730ca1..c7a9b68 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
@@ -371,7 +371,7 @@
// Convert the entry to a configuration entry and put it in the config
// hash.
- configEntries = new ConcurrentHashMap<DN,ConfigEntry>();
+ configEntries = new ConcurrentHashMap<>();
configRootEntry = new ConfigEntry(entry, null);
configEntries.put(entry.getName(), configRootEntry);
@@ -706,7 +706,7 @@
// Apply the changes and make sure there were no errors.
- List<LocalizableMessage> errorList = new LinkedList<LocalizableMessage>();
+ List<LocalizableMessage> errorList = new LinkedList<>();
boolean successful = LDIFModify.modifyLDIF(sourceReader, changesReader,
targetWriter, errorList);
@@ -1670,7 +1670,7 @@
int numToDelete = archivedFileList.length - maxConfigArchiveSize;
if (numToDelete > 0)
{
- Set<String> archiveSet = new TreeSet<String>();
+ Set<String> archiveSet = new TreeSet<>();
for (String name : archivedFileList)
{
if (! name.startsWith("config-"))
@@ -1937,8 +1937,7 @@
// See if the entry has any children. If so, then iterate through them and
// write them and their children. We'll copy the entries into a tree map
// so that we have a sensible order in the resulting LDIF.
- TreeMap<DN,ConfigEntry> childMap =
- new TreeMap<DN,ConfigEntry>(configEntry.getChildren());
+ TreeMap<DN,ConfigEntry> childMap = new TreeMap<>(configEntry.getChildren());
for (ConfigEntry childEntry : childMap.values())
{
writeEntryAndChildren(writer, childEntry);
@@ -1993,7 +1992,7 @@
@Override
public Map<String,String> getAlerts()
{
- Map<String,String> alerts = new LinkedHashMap<String,String>();
+ Map<String,String> alerts = new LinkedHashMap<>();
alerts.put(ALERT_TYPE_CANNOT_WRITE_CONFIGURATION,
ALERT_DESCRIPTION_CANNOT_WRITE_CONFIGURATION);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DictionaryPasswordValidator.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DictionaryPasswordValidator.java
index a37cdea..84120d8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DictionaryPasswordValidator.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DictionaryPasswordValidator.java
@@ -187,7 +187,7 @@
// Read the contents of file into the dictionary as per the configuration.
BufferedReader reader = null;
- HashSet<String> dictionary = new HashSet<String>();
+ HashSet<String> dictionary = new HashSet<>();
try
{
reader = new BufferedReader(new FileReader(dictionaryFile));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DigestMD5SASLMechanismHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DigestMD5SASLMechanismHandler.java
index 4cfbd75..a0cd7dd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DigestMD5SASLMechanismHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DigestMD5SASLMechanismHandler.java
@@ -109,7 +109,7 @@
LocalizableMessage msg= NOTE_DIGEST_MD5_SERVER_FQDN.get(serverFQDN);
logger.info(msg);
String QOP = getQOP(configuration);
- saslProps = new HashMap<String,String>();
+ saslProps = new HashMap<>();
saslProps.put(Sasl.QOP, QOP);
String realm=getRealm(configuration);
if(realm != null) {
@@ -224,7 +224,7 @@
LocalizableMessage msg = NOTE_DIGEST_MD5_SERVER_FQDN.get(serverFQDN);
logger.info(msg);
String QOP = getQOP(configuration);
- saslProps = new HashMap<String,String>();
+ saslProps = new HashMap<>();
saslProps.put(Sasl.QOP, QOP);
String realm=getRealm(configuration);
if(realm != null) {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DiskSpaceMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DiskSpaceMonitor.java
index 05f22e6..3b48992 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DiskSpaceMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DiskSpaceMonitor.java
@@ -113,7 +113,7 @@
/** {@inheritDoc} */
@Override
public List<Attribute> getMonitorData() {
- final List<Attribute> monitorAttrs = new ArrayList<Attribute>();
+ final List<Attribute> monitorAttrs = new ArrayList<>();
monitorAttrs.add(attr("disk-dir", getDefaultStringSyntax(), directory.getPath()));
monitorAttrs.add(attr("disk-free", getDefaultIntegerSyntax(), getFreeSpace()));
monitorAttrs.add(attr("disk-state", getDefaultStringSyntax(), getState()));
@@ -175,7 +175,7 @@
private int state;
/** printable list of handlers names, for reporting backend names in alert messages */
private final StringBuilder diskNames = new StringBuilder();
- private final List<MonitoredDirectory> allHandlers = new ArrayList<MonitoredDirectory>();
+ private final List<MonitoredDirectory> allHandlers = new ArrayList<>();
private HandlerNotifier(File directory, int state)
{
@@ -235,8 +235,7 @@
private static final int LOW = 1;
private static final int FULL = 2;
private static final String INSTANCENAME = "Disk Space Monitor";
- private final HashMap<File, List<MonitoredDirectory>> monitoredDirs =
- new HashMap<File, List<MonitoredDirectory>>();
+ private final HashMap<File, List<MonitoredDirectory>> monitoredDirs = new HashMap<>();
/**
* Constructs a new DiskSpaceMonitor that will notify registered DiskSpaceMonitorHandler objects when filesystems
@@ -288,7 +287,7 @@
List<MonitoredDirectory> diskHelpers = monitoredDirs.get(fsMountPoint);
if (diskHelpers == null)
{
- List<MonitoredDirectory> newList = new ArrayList<MonitoredDirectory>();
+ List<MonitoredDirectory> newList = new ArrayList<>();
newList.add(newDSH);
monitoredDirs.put(fsMountPoint, newList);
}
@@ -379,16 +378,16 @@
/** {@inheritDoc} */
@Override
public List<Attribute> getMonitorData() {
- return new ArrayList<Attribute>();
+ return new ArrayList<>();
}
/** {@inheritDoc} */
@Override
public void run()
{
- List<HandlerNotifier> diskFull = new ArrayList<HandlerNotifier>();
- List<HandlerNotifier> diskLow = new ArrayList<HandlerNotifier>();
- List<HandlerNotifier> diskRestored = new ArrayList<HandlerNotifier>();
+ List<HandlerNotifier> diskFull = new ArrayList<>();
+ List<HandlerNotifier> diskLow = new ArrayList<>();
+ List<HandlerNotifier> diskRestored = new ArrayList<>();
synchronized (monitoredDirs)
{
@@ -491,7 +490,7 @@
@Override
public Map<String, String> getAlerts()
{
- Map<String, String> alerts = new LinkedHashMap<String, String>();
+ Map<String, String> alerts = new LinkedHashMap<>();
alerts.put(ALERT_TYPE_DISK_SPACE_LOW, ALERT_DESCRIPTION_DISK_SPACE_LOW);
alerts.put(ALERT_TYPE_DISK_FULL, ALERT_DESCRIPTION_DISK_FULL);
return alerts;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java
index 7e83174..237c5f9 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java
@@ -137,7 +137,7 @@
// Get the memberURL attribute from the entry, if there is one, and parse
// out the LDAP URLs that it contains.
- LinkedHashSet<LDAPURL> memberURLs = new LinkedHashSet<LDAPURL>();
+ LinkedHashSet<LDAPURL> memberURLs = new LinkedHashSet<>();
AttributeType memberURLType =
DirectoryConfig.getAttributeType(ATTR_MEMBER_URL_LC, true);
List<Attribute> attrList = groupEntry.getAttribute(memberURLType);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java
index 489ab06..8e9cfab 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java
@@ -132,15 +132,14 @@
}
searchesCompleted = false;
- resultQueue = new LinkedBlockingQueue<Object>(10);
+ resultQueue = new LinkedBlockingQueue<>(10);
// We're going to have to perform one or more internal searches in order to
// get the results. We need to be careful about the way that we construct
// them in order to avoid the possibility of getting duplicate results, so
// searches with overlapping bases will need to be combined.
- LinkedHashMap<DN,LinkedList<LDAPURL>> baseDNs =
- new LinkedHashMap<DN,LinkedList<LDAPURL>>();
+ LinkedHashMap<DN,LinkedList<LDAPURL>> baseDNs = new LinkedHashMap<>();
for (LDAPURL memberURL : memberURLs)
{
// First, determine the base DN for the search. It needs to be evaluated
@@ -168,7 +167,7 @@
// the same hierarchy.
if (baseDNs.isEmpty())
{
- LinkedList<LDAPURL> urlList = new LinkedList<LDAPURL>();
+ LinkedList<LDAPURL> urlList = new LinkedList<>();
urlList.add(memberURL);
baseDNs.put(urlBaseDN, urlList);
}
@@ -213,7 +212,7 @@
if (! found)
{
- urlList = new LinkedList<LDAPURL>();
+ urlList = new LinkedList<>();
urlList.add(memberURL);
baseDNs.put(urlBaseDN, urlList);
}
@@ -232,13 +231,11 @@
// create the filter to use with that base DN. There are some special-case
// optimizations that we can do here, but in general the filter will look
// like "(&(filter)(|(urlFilters)))".
- LinkedHashMap<DN,SearchFilter> searchMap =
- new LinkedHashMap<DN,SearchFilter>();
+ LinkedHashMap<DN,SearchFilter> searchMap = new LinkedHashMap<>();
for (DN urlBaseDN : baseDNs.keySet())
{
LinkedList<LDAPURL> urlList = baseDNs.get(urlBaseDN);
- LinkedHashSet<SearchFilter> urlFilters =
- new LinkedHashSet<SearchFilter>();
+ LinkedHashSet<SearchFilter> urlFilters = new LinkedHashSet<>();
for (LDAPURL url : urlList)
{
urlFilters.add(url.getFilter());
@@ -267,8 +264,7 @@
}
else
{
- LinkedHashSet<SearchFilter> filterSet =
- new LinkedHashSet<SearchFilter>();
+ LinkedHashSet<SearchFilter> filterSet = new LinkedHashSet<>();
filterSet.add(filter);
filterSet.add(urlFilter);
combinedFilter = SearchFilter.createANDFilter(filterSet);
@@ -282,8 +278,7 @@
}
else
{
- LinkedHashSet<SearchFilter> filterSet =
- new LinkedHashSet<SearchFilter>();
+ LinkedHashSet<SearchFilter> filterSet = new LinkedHashSet<>();
filterSet.add(filter);
filterSet.add(SearchFilter.createORFilter(urlFilters));
combinedFilter = SearchFilter.createANDFilter(filterSet);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java
index bf2fe8a..7e133a6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java
@@ -234,7 +234,7 @@
SearchOperation searchOperation)
{
SearchFilter filter = searchOperation.getFilter();
- LinkedHashSet<DN> dnSet = new LinkedHashSet<DN>();
+ LinkedHashSet<DN> dnSet = new LinkedHashSet<>();
extractDNs(rule.getAttributeType(), filter, dnSet);
if (dnSet.isEmpty())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java
index 309a879..ea03f2f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java
@@ -68,13 +68,10 @@
* The set of names for the account status notification types that may be
* logged by this notification handler.
*/
- private static final HashSet<String> NOTIFICATION_TYPE_NAMES =
- new HashSet<String>();
-
+ private static final HashSet<String> NOTIFICATION_TYPE_NAMES = new HashSet<>();
static
{
- for (AccountStatusNotificationType t :
- AccountStatusNotificationType.values())
+ for (AccountStatusNotificationType t : AccountStatusNotificationType.values())
{
NOTIFICATION_TYPE_NAMES.add(t.getName());
}
@@ -201,11 +198,9 @@
boolean isAcceptable = true;
// The set of notification types that should generate log messages.
- HashSet<AccountStatusNotificationType> newNotificationTypes =
- new HashSet<AccountStatusNotificationType>();
+ HashSet<AccountStatusNotificationType> newNotificationTypes = new HashSet<>();
- // Initialize the set of notification types that should generate log
- // messages.
+ // Initialize the set of notification types that should generate log messages.
for (ErrorLogAccountStatusNotificationHandlerCfgDefn.
AccountStatusNotificationType configNotificationType:
configuration.getAccountStatusNotificationType())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java
index 56bde9e..48f5970 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExactMatchIdentityMapper.java
@@ -136,7 +136,7 @@
// Create the attribute list to include in search requests. We want to
// include all user and operational attributes.
- requestedAttributes = new LinkedHashSet<String>(2);
+ requestedAttributes = new LinkedHashSet<>(2);
requestedAttributes.add("*");
requestedAttributes.add("+");
}
@@ -186,8 +186,7 @@
}
else
{
- ArrayList<SearchFilter> filterComps =
- new ArrayList<SearchFilter>(attributeTypes.length);
+ ArrayList<SearchFilter> filterComps = new ArrayList<>(attributeTypes.length);
for (AttributeType t : attributeTypes)
{
ByteString value = ByteString.valueOf(id);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java
index bc0f795..fdd32e1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/FingerprintCertificateMapper.java
@@ -141,7 +141,7 @@
// Create the attribute list to include in search requests. We want to
// include all user and operational attributes.
- requestedAttributes = new LinkedHashSet<String>(2);
+ requestedAttributes = new LinkedHashSet<>(2);
requestedAttributes.add("*");
requestedAttributes.add("+");
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/GSSAPISASLMechanismHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/GSSAPISASLMechanismHandler.java
index 2a00706..48ee88b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/GSSAPISASLMechanismHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/GSSAPISASLMechanismHandler.java
@@ -557,7 +557,7 @@
identityMapper = DirectoryServer.getIdentityMapper(identityMapperDN);
serverFQDN = getFQDN(config);
logger.error(INFO_GSSAPI_SERVER_FQDN, serverFQDN);
- saslProps = new HashMap<String, String>();
+ saslProps = new HashMap<>();
saslProps.put(Sasl.QOP, getQOP(config));
saslProps.put(Sasl.REUSE, "false");
String configFileName = configureLoginConfFile(config);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java
index 16e154b..802a9c1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java
@@ -263,7 +263,7 @@
Set<ByteString> returnedDNs = null;
if (!nestedGroupsDNs.isEmpty())
{
- returnedDNs = new HashSet<ByteString>();
+ returnedDNs = new HashSet<>();
}
if (!returnGroupMembers(searchOperation, group.getMembers(), returnedDNs))
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/JMXAlertHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/JMXAlertHandler.java
index befed8f..370add5 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/JMXAlertHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/JMXAlertHandler.java
@@ -217,8 +217,7 @@
*/
public MBeanNotificationInfo[] getNotificationInfo()
{
- ArrayList<MBeanNotificationInfo> notifications =
- new ArrayList<MBeanNotificationInfo>();
+ ArrayList<MBeanNotificationInfo> notifications = new ArrayList<>();
ConcurrentHashMap<DN,JMXMBean> mBeans = DirectoryServer.getJMXMBeans();
for (JMXMBean mBean : mBeans.values())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
index 77d5db5..f5d871f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -727,8 +727,7 @@
private final ConnectionFactory factory;
private final int poolSize = Runtime.getRuntime().availableProcessors() * 2;
private final Semaphore availableConnections = new Semaphore(poolSize);
- private final Queue<Connection> connectionPool =
- new ConcurrentLinkedQueue<Connection>();
+ private final Queue<Connection> connectionPool = new ConcurrentLinkedQueue<>();
@@ -1539,8 +1538,7 @@
ByteString encodedPassword = pwdStorageScheme
.encodePasswordWithScheme(newCachedPassword);
- List<RawModification> modifications =
- new ArrayList<RawModification>(2);
+ List<RawModification> modifications = new ArrayList<>(2);
modifications.add(RawModification.create(ModificationType.REPLACE,
OP_ATTR_PTAPOLICY_CACHED_PASSWORD, encodedPassword));
modifications.add(RawModification.create(ModificationType.REPLACE,
@@ -1649,8 +1647,7 @@
// determine the bind DN.
// Construct the search filter.
- final LinkedList<SearchFilter> filterComponents =
- new LinkedList<SearchFilter>();
+ final LinkedList<SearchFilter> filterComponents = new LinkedList<>();
for (final AttributeType at : cfg.getMappedAttribute())
{
final List<Attribute> attributes = userEntry.getAttribute(at);
@@ -2113,7 +2110,7 @@
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
/** Attribute list for searches requesting no attributes. */
- static final LinkedHashSet<String> NO_ATTRIBUTES = new LinkedHashSet<String>(1);
+ static final LinkedHashSet<String> NO_ATTRIBUTES = new LinkedHashSet<>(1);
static
{
NO_ATTRIBUTES.add(SchemaConstants.NO_ATTRIBUTES);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkQueue.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkQueue.java
index 200c5a9..67d600a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkQueue.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ParallelWorkQueue.java
@@ -137,11 +137,10 @@
computeNumWorkerThreads(configuration.getNumWorkerThreads());
// Create the actual work queue.
- opQueue = new ConcurrentLinkedQueue<Operation>();
+ opQueue = new ConcurrentLinkedQueue<>();
- // Create the set of worker threads that should be used to service the
- // work queue.
- workerThreads = new ArrayList<ParallelWorkerThread>(numWorkerThreads);
+ // Create the set of worker threads that should be used to service the work queue.
+ workerThreads = new ArrayList<>(numWorkerThreads);
for (lastThreadNumber = 0; lastThreadNumber < numWorkerThreads;
lastThreadNumber++)
{
@@ -179,7 +178,7 @@
// Send responses to any operations in the pending queue to indicate that
// they won't be processed because the server is shutting down.
CancelRequest cancelRequest = new CancelRequest(true, reason);
- ArrayList<Operation> pendingOperations = new ArrayList<Operation>();
+ ArrayList<Operation> pendingOperations = new ArrayList<>();
opQueue.removeAll(pendingOperations);
for (Operation o : pendingOperations)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java
index 05f75c4..99ca485 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java
@@ -631,7 +631,7 @@
// Run the new password through the set of password validators.
if (selfChange || !pwPolicyState.getAuthenticationPolicy().isSkipValidationForAdministrators())
{
- Set<ByteString> clearPasswords = new HashSet<ByteString>(pwPolicyState.getClearPasswords());
+ Set<ByteString> clearPasswords = new HashSet<>(pwPolicyState.getClearPasswords());
if (oldPassword != null)
{
clearPasswords.add(oldPassword);
@@ -676,7 +676,7 @@
List<ByteString> encodedPasswords;
if (isPreEncoded)
{
- encodedPasswords = new ArrayList<ByteString>(1);
+ encodedPasswords = new ArrayList<>(1);
encodedPasswords.add(newPassword);
}
else
@@ -698,12 +698,12 @@
// If the current password was provided, then remove all matching values from the user's entry
// and replace them with the new password. Otherwise replace all password values.
AttributeType attrType = pwPolicyState.getAuthenticationPolicy().getPasswordAttribute();
- List<Modification> modList = new ArrayList<Modification>();
+ List<Modification> modList = new ArrayList<>();
if (oldPassword != null)
{
// Remove all existing encoded values that match the old password.
Set<ByteString> existingValues = pwPolicyState.getPasswordValues();
- Set<ByteString> deleteValues = new LinkedHashSet<ByteString>(existingValues.size());
+ Set<ByteString> deleteValues = new LinkedHashSet<>(existingValues.size());
if (pwPolicyState.getAuthenticationPolicy().isAuthPasswordSyntax())
{
for (ByteString v : existingValues)
@@ -885,10 +885,10 @@
List<ByteString> currentPasswords = null;
if (oldPassword != null)
{
- currentPasswords = new ArrayList<ByteString>(1);
+ currentPasswords = new ArrayList<>(1);
currentPasswords.add(oldPassword);
}
- List<ByteString> newPasswords = new ArrayList<ByteString>(1);
+ List<ByteString> newPasswords = new ArrayList<>(1);
newPasswords.add(newPassword);
Map<AccountStatusNotificationProperty, List<String>> notifProperties =
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java
index 75f4df9..71f6857 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java
@@ -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.extensions;
@@ -288,13 +288,12 @@
userFilter = SearchFilter.objectClassPresent();
// Construct the set of request attributes.
- requestAttributes = new LinkedHashSet<String>(2);
+ requestAttributes = new LinkedHashSet<>(2);
requestAttributes.add("*");
requestAttributes.add("+");
- DirectoryServer.registerSupportedExtension(OID_PASSWORD_POLICY_STATE_EXTOP,
- this);
+ DirectoryServer.registerSupportedExtension(OID_PASSWORD_POLICY_STATE_EXTOP, this);
// FIXME registerControlAndFeatures?
}
@@ -410,7 +409,7 @@
// Create a hash set that will be used to hold the types of the return
// types that should be included in the response.
boolean returnAll;
- LinkedHashSet<Integer> returnTypes = new LinkedHashSet<Integer>();
+ LinkedHashSet<Integer> returnTypes = new LinkedHashSet<>();
try
{
if (!reader.hasNextElement())
@@ -452,7 +451,7 @@
else
{
reader.readStartSequence();
- opValues = new ArrayList<String>();
+ opValues = new ArrayList<>();
while (reader.hasNextElement())
{
opValues.add(reader.readOctetStringAsString());
@@ -1287,7 +1286,7 @@
ByteString valueString = ByteString.valueOf(opValues.get(0));
long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
List<Long> authFailureTimes = pwpState.getAuthFailureTimes();
- ArrayList<Long> newFailureTimes = new ArrayList<Long>(authFailureTimes.size()+1);
+ ArrayList<Long> newFailureTimes = new ArrayList<>(authFailureTimes.size()+1);
newFailureTimes.addAll(authFailureTimes);
newFailureTimes.add(time);
pwpState.setAuthFailureTimes(newFailureTimes);
@@ -1308,13 +1307,13 @@
case OP_SET_AUTHENTICATION_FAILURE_TIMES:
if (opValues == null)
{
- ArrayList<Long> valueList = new ArrayList<Long>(1);
+ ArrayList<Long> valueList = new ArrayList<>(1);
valueList.add(pwpState.getCurrentTime());
pwpState.setAuthFailureTimes(valueList);
}
else
{
- ArrayList<Long> valueList = new ArrayList<Long>(opValues.size());
+ ArrayList<Long> valueList = new ArrayList<>(opValues.size());
for (String value : opValues)
{
try
@@ -1468,7 +1467,7 @@
ByteString valueString = ByteString.valueOf(opValues.get(0));
long time = GeneralizedTime.valueOf(valueString.toString()).getTimeInMillis();
List<Long> authFailureTimes = pwpState.getGraceLoginTimes();
- ArrayList<Long> newGraceTimes = new ArrayList<Long>(authFailureTimes.size()+1);
+ ArrayList<Long> newGraceTimes = new ArrayList<>(authFailureTimes.size()+1);
newGraceTimes.addAll(authFailureTimes);
newGraceTimes.add(time);
pwpState.setGraceLoginTimes(newGraceTimes);
@@ -1489,13 +1488,13 @@
case OP_SET_GRACE_LOGIN_USE_TIMES:
if (opValues == null)
{
- ArrayList<Long> valueList = new ArrayList<Long>(1);
+ ArrayList<Long> valueList = new ArrayList<>(1);
valueList.add(pwpState.getCurrentTime());
pwpState.setGraceLoginTimes(valueList);
}
else
{
- ArrayList<Long> valueList = new ArrayList<Long>(opValues.size());
+ ArrayList<Long> valueList = new ArrayList<>(opValues.size());
for (String s : opValues)
{
try
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java
index 8075ad2..eadd499 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java
@@ -103,8 +103,7 @@
// Get the character sets for use in generating the password. At least one
// must have been provided.
- HashMap<String,NamedCharacterSet> charsets =
- new HashMap<String,NamedCharacterSet>();
+ HashMap<String,NamedCharacterSet> charsets = new HashMap<>();
try
{
@@ -151,8 +150,8 @@
formatString = configuration.getPasswordFormat();
StringTokenizer tokenizer = new StringTokenizer(formatString, ", ");
- ArrayList<NamedCharacterSet> setList = new ArrayList<NamedCharacterSet>();
- ArrayList<Integer> countList = new ArrayList<Integer>();
+ ArrayList<NamedCharacterSet> setList = new ArrayList<>();
+ ArrayList<Integer> countList = new ArrayList<>();
while (tokenizer.hasMoreTokens())
{
@@ -278,11 +277,9 @@
{
DN cfgEntryDN = configuration.dn();
- // Get the character sets for use in generating the password. At
- // least one
- // must have been provided.
- HashMap<String,NamedCharacterSet> charsets =
- new HashMap<String,NamedCharacterSet>();
+ // Get the character sets for use in generating the password.
+ // At least one must have been provided.
+ HashMap<String,NamedCharacterSet> charsets = new HashMap<>();
try
{
SortedSet<String> currentPasSet = configuration.getPasswordCharacterSet();
@@ -381,8 +378,7 @@
// Get the character sets for use in generating the password. At least one
// must have been provided.
SortedSet<String> newEncodedCharacterSets = null;
- HashMap<String,NamedCharacterSet> charsets =
- new HashMap<String,NamedCharacterSet>();
+ HashMap<String,NamedCharacterSet> charsets = new HashMap<>();
try
{
newEncodedCharacterSets = configuration.getPasswordCharacterSet();
@@ -424,9 +420,8 @@
// Get the value that describes which character set(s) and how many
// characters from each should be used.
- ArrayList<NamedCharacterSet> newSetList =
- new ArrayList<NamedCharacterSet>();
- ArrayList<Integer> newCountList = new ArrayList<Integer>();
+ ArrayList<NamedCharacterSet> newSetList = new ArrayList<>();
+ ArrayList<Integer> newCountList = new ArrayList<>();
String newFormatString = null;
try
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java
index 5b38097..835b8b3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/RegularExpressionIdentityMapper.java
@@ -163,7 +163,7 @@
// Create the attribute list to include in search requests. We want to
// include all user and operational attributes.
- requestedAttributes = new LinkedHashSet<String>(2);
+ requestedAttributes = new LinkedHashSet<>(2);
requestedAttributes.add("*");
requestedAttributes.add("+");
}
@@ -203,8 +203,7 @@
}
else
{
- ArrayList<SearchFilter> filterComps =
- new ArrayList<SearchFilter>(attributeTypes.length);
+ ArrayList<SearchFilter> filterComps = new ArrayList<>(attributeTypes.length);
for (AttributeType t : attributeTypes)
{
ByteString value = ByteString.valueOf(processedID);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java
index b1bbcbf..955aafd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java
@@ -171,8 +171,7 @@
SMTPAccountStatusNotificationHandlerCfg configuration)
throws ConfigException
{
- HashMap<AccountStatusNotificationType,String> map =
- new HashMap<AccountStatusNotificationType,String>();
+ HashMap<AccountStatusNotificationType,String> map = new HashMap<>();
for (String s : configuration.getMessageSubject())
{
@@ -228,9 +227,7 @@
throws ConfigException
{
HashMap<AccountStatusNotificationType,
- List<NotificationMessageTemplateElement>> map =
- new HashMap<AccountStatusNotificationType,
- List<NotificationMessageTemplateElement>>();
+ List<NotificationMessageTemplateElement>> map = new HashMap<>();
for (String s : configuration.getMessageTemplateFile())
{
@@ -295,8 +292,7 @@
private List<NotificationMessageTemplateElement> parseTemplateFile(File f)
throws ConfigException
{
- LinkedList<NotificationMessageTemplateElement> elementList =
- new LinkedList<NotificationMessageTemplateElement>();
+ LinkedList<NotificationMessageTemplateElement> elementList = new LinkedList<>();
BufferedReader reader = null;
try
@@ -520,7 +516,7 @@
// It is a notification that should be handled, so we can start generating
// the e-mail message. First, check to see if there are any mail attributes
// that would cause us to send a message to the end user.
- LinkedList<String> recipients = new LinkedList<String>();
+ LinkedList<String> recipients = new LinkedList<>();
Set<AttributeType> addressAttrs = config.getEmailAddressAttributeType();
Set<String> recipientAddrs = config.getRecipientAddress();
if ((addressAttrs != null) && (! addressAttrs.isEmpty()))
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAlertHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAlertHandler.java
index 2bb5b3a..7e2855a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAlertHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAlertHandler.java
@@ -127,8 +127,7 @@
{
SMTPAlertHandlerCfg cfg = currentConfig;
- ArrayList<String> recipients =
- new ArrayList<String>(cfg.getRecipientAddress());
+ ArrayList<String> recipients = new ArrayList<>(cfg.getRecipientAddress());
String alertIDStr;
String alertMessageStr;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java
index 3efaf73..13c93d0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java
@@ -97,7 +97,7 @@
private LinkedHashSet<CompactDn> memberDNs;
/** The list of nested group DNs for this group. */
- private LinkedList<DN> nestedGroups = new LinkedList<DN>();
+ private LinkedList<DN> nestedGroups = new LinkedList<>();
/** Passed to the group manager to see if the nested group list needs to be refreshed. */
private long nestedGroupRefreshToken = DirectoryServer.getGroupManager().refreshToken();
@@ -203,7 +203,7 @@
membersCount += a.size();
}
}
- LinkedHashSet<CompactDn> someMemberDNs = new LinkedHashSet<CompactDn>(membersCount);
+ LinkedHashSet<CompactDn> someMemberDNs = new LinkedHashSet<>(membersCount);
if (memberAttrList != null)
{
for (Attribute a : memberAttrList)
@@ -323,10 +323,10 @@
}
Attribute attr = Attributes.create(memberAttributeType, nestedGroupDN.toString());
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.ADD, attr));
- LinkedList<Control> requestControls = new LinkedList<Control>();
+ LinkedList<Control> requestControls = new LinkedList<>();
requestControls.add(new LDAPControl(OID_INTERNAL_GROUP_MEMBERSHIP_UPDATE, false));
ModifyOperationBasis modifyOperation = new ModifyOperationBasis(
@@ -339,11 +339,11 @@
throw new DirectoryException(modifyOperation.getResultCode(), msg);
}
- LinkedList<DN> newNestedGroups = new LinkedList<DN>(nestedGroups);
+ LinkedList<DN> newNestedGroups = new LinkedList<>(nestedGroups);
newNestedGroups.add(nestedGroupDN);
nestedGroups = newNestedGroups;
//Add it to the member DN list.
- LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<CompactDn>(memberDNs);
+ LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<>(memberDNs);
newMemberDNs.add(toCompactDn(nestedGroupDN));
memberDNs = newMemberDNs;
}
@@ -365,10 +365,10 @@
}
Attribute attr = Attributes.create(memberAttributeType, nestedGroupDN.toString());
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.DELETE, attr));
- LinkedList<Control> requestControls = new LinkedList<Control>();
+ LinkedList<Control> requestControls = new LinkedList<>();
requestControls.add(new LDAPControl(OID_INTERNAL_GROUP_MEMBERSHIP_UPDATE, false));
ModifyOperationBasis modifyOperation = new ModifyOperationBasis(
@@ -381,11 +381,11 @@
throw new DirectoryException(modifyOperation.getResultCode(), message);
}
- LinkedList<DN> newNestedGroups = new LinkedList<DN>(nestedGroups);
+ LinkedList<DN> newNestedGroups = new LinkedList<>(nestedGroups);
newNestedGroups.remove(nestedGroupDN);
nestedGroups = newNestedGroups;
//Remove it from the member DN list.
- LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<CompactDn>(memberDNs);
+ LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<>(memberDNs);
newMemberDNs.remove(toCompactDn(nestedGroupDN));
memberDNs = newMemberDNs;
}
@@ -445,7 +445,7 @@
throw new DirectoryException(ResultCode.NO_SUCH_ATTRIBUTE,
ERR_STATICGROUP_GROUP_INSTANCE_INVALID.get(groupEntryDN));
} else if (thisGroup != this) {
- LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<CompactDn>();
+ LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<>();
MemberList memberList = thisGroup.getMembers();
while (memberList.hasMoreMembers())
{
@@ -460,7 +460,7 @@
}
memberDNs = newMemberDNs;
}
- LinkedList<DN> newNestedGroups = new LinkedList<DN>();
+ LinkedList<DN> newNestedGroups = new LinkedList<>();
for (CompactDn compactDn : memberDNs)
{
DN dn = fromCompactDn(compactDn);
@@ -521,10 +521,10 @@
}
Attribute attr = Attributes.create(memberAttributeType, userDN.toString());
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.ADD, attr));
- LinkedList<Control> requestControls = new LinkedList<Control>();
+ LinkedList<Control> requestControls = new LinkedList<>();
requestControls.add(new LDAPControl(OID_INTERNAL_GROUP_MEMBERSHIP_UPDATE, false));
ModifyOperationBasis modifyOperation = new ModifyOperationBasis(
@@ -536,7 +536,7 @@
ERR_STATICGROUP_ADD_MEMBER_UPDATE_FAILED.get(userDN, groupEntryDN, modifyOperation.getErrorMessage()));
}
- LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<CompactDn>(memberDNs.size()+1);
+ LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<>(memberDNs.size()+1);
newMemberDNs.addAll(memberDNs);
newMemberDNs.add(compactUserDN);
memberDNs = newMemberDNs;
@@ -559,10 +559,10 @@
}
Attribute attr = Attributes.create(memberAttributeType, userDN.toString());
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.DELETE, attr));
- LinkedList<Control> requestControls = new LinkedList<Control>();
+ LinkedList<Control> requestControls = new LinkedList<>();
requestControls.add(new LDAPControl(OID_INTERNAL_GROUP_MEMBERSHIP_UPDATE, false));
ModifyOperationBasis modifyOperation = new ModifyOperationBasis(
@@ -574,12 +574,12 @@
ERR_STATICGROUP_REMOVE_MEMBER_UPDATE_FAILED.get(userDN, groupEntryDN, modifyOperation.getErrorMessage()));
}
- LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<CompactDn>(memberDNs);
+ LinkedHashSet<CompactDn> newMemberDNs = new LinkedHashSet<>(memberDNs);
newMemberDNs.remove(compactUserDN);
memberDNs = newMemberDNs;
//If it is in the nested group list remove it.
if(nestedGroups.contains(userDN)) {
- LinkedList<DN> newNestedGroups = new LinkedList<DN>(nestedGroups);
+ LinkedList<DN> newNestedGroups = new LinkedList<>(nestedGroups);
newNestedGroups.remove(userDN);
nestedGroups = newNestedGroups;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java
index f6a68aa..bdc34ed 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java
@@ -123,7 +123,7 @@
configEntryDN = configuration.dn();
// Get and validate the subject attribute to user attribute mappings.
- attributeMap = new LinkedHashMap<String,AttributeType>();
+ attributeMap = new LinkedHashMap<>();
for (String mapStr : configuration.getSubjectAttributeMapping())
{
String lowerMap = toLowerCase(mapStr);
@@ -194,7 +194,7 @@
// Create the attribute list to include in search requests. We want to
// include all user and operational attributes.
- requestedAttributes = new LinkedHashSet<String>(2);
+ requestedAttributes = new LinkedHashSet<>(2);
requestedAttributes.add("*");
requestedAttributes.add("+");
}
@@ -261,7 +261,7 @@
de);
}
- LinkedList<SearchFilter> filterComps = new LinkedList<SearchFilter>();
+ LinkedList<SearchFilter> filterComps = new LinkedList<>();
for (int i=0; i < peerDN.size(); i++)
{
RDN rdn = peerDN.getRDN(i);
@@ -385,8 +385,7 @@
DN cfgEntryDN = configuration.dn();
// Get and validate the subject attribute to user attribute mappings.
- LinkedHashMap<String,AttributeType> newAttributeMap =
- new LinkedHashMap<String,AttributeType>();
+ LinkedHashMap<String,AttributeType> newAttributeMap = new LinkedHashMap<>();
mapLoop:
for (String mapStr : configuration.getSubjectAttributeMapping())
{
@@ -455,8 +454,7 @@
// Get and validate the subject attribute to user attribute mappings.
- LinkedHashMap<String,AttributeType> newAttributeMap =
- new LinkedHashMap<String,AttributeType>();
+ LinkedHashMap<String,AttributeType> newAttributeMap = new LinkedHashMap<>();
mapLoop:
for (String mapStr : configuration.getSubjectAttributeMapping())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java
index 664d7b9..bab9149 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java
@@ -127,7 +127,7 @@
// Create the attribute list to include in search requests. We want to
// include all user and operational attributes.
- requestedAttributes = new LinkedHashSet<String>(2);
+ requestedAttributes = new LinkedHashSet<>(2);
requestedAttributes.add("*");
requestedAttributes.add("+");
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/TLSByteChannel.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/TLSByteChannel.java
index 65d78d4..0139896 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/TLSByteChannel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/TLSByteChannel.java
@@ -415,7 +415,7 @@
static final Map<String, Integer> CIPHER_MAP;
static
{
- final Map<String, Integer> map = new LinkedHashMap<String, Integer>();
+ final Map<String, Integer> map = new LinkedHashMap<>();
map.put("_WITH_AES_256_", 256);
map.put("_WITH_ARIA_256_", 256);
map.put("_WITH_CAMELLIA_256_", 256);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkQueue.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkQueue.java
index caa270a..18d6ba5 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkQueue.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkQueue.java
@@ -73,13 +73,9 @@
private static final int MAX_RETRY_COUNT = 5;
/** The set of worker threads that will be used to process this work queue. */
- private final ArrayList<TraditionalWorkerThread> workerThreads =
- new ArrayList<TraditionalWorkerThread>();
+ private final ArrayList<TraditionalWorkerThread> workerThreads = new ArrayList<>();
- /**
- * The number of operations that have been submitted to the work queue for
- * processing.
- */
+ /** The number of operations that have been submitted to the work queue for processing. */
private AtomicLong opsSubmitted;
/**
@@ -180,13 +176,13 @@
// Create the actual work queue.
if (maxCapacity > 0)
{
- opQueue = new LinkedBlockingQueue<Operation>(maxCapacity);
+ opQueue = new LinkedBlockingQueue<>(maxCapacity);
}
else
{
// This will never be the case, since the configuration definition
// ensures that the capacity is always finite.
- opQueue = new LinkedBlockingQueue<Operation>();
+ opQueue = new LinkedBlockingQueue<>();
}
// Create the set of worker threads that should be used to service the
@@ -241,7 +237,7 @@
// Send responses to any operations in the pending queue to indicate that
// they won't be processed because the server is shutting down.
CancelRequest cancelRequest = new CancelRequest(true, reason);
- ArrayList<Operation> pendingOperations = new ArrayList<Operation>();
+ ArrayList<Operation> pendingOperations = new ArrayList<>();
opQueue.removeAll(pendingOperations);
for (Operation o : pendingOperations)
{
@@ -710,12 +706,11 @@
LinkedBlockingQueue<Operation> newOpQueue = null;
if (newMaxCapacity > 0)
{
- newOpQueue = new LinkedBlockingQueue<Operation>(
- newMaxCapacity);
+ newOpQueue = new LinkedBlockingQueue<>(newMaxCapacity);
}
else
{
- newOpQueue = new LinkedBlockingQueue<Operation>();
+ newOpQueue = new LinkedBlockingQueue<>();
}
oldOpQueue = opQueue;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/UniqueCharactersPasswordValidator.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/UniqueCharactersPasswordValidator.java
index ff427e9..fb8d54d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/UniqueCharactersPasswordValidator.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/UniqueCharactersPasswordValidator.java
@@ -110,7 +110,7 @@
// Create a set that will be used to keep track of the unique characters
// contained in the proposed password.
- HashSet<Character> passwordCharacters = new HashSet<Character>();
+ HashSet<Character> passwordCharacters = new HashSet<>();
// Iterate through the characters in the new password and place them in the
// set as needed. If we should behave in a case-insensitive manner, then
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractLogger.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractLogger.java
index b16793e..3c03ba8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractLogger.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractLogger.java
@@ -91,7 +91,7 @@
* The set of loggers that have been registered with the server. It will
* initially be empty.
*/
- private Collection<P> logPublishers = new CopyOnWriteArrayList<P>();
+ private Collection<P> logPublishers = new CopyOnWriteArrayList<>();
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java
index 7f7380c..9fd3fe4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java
@@ -1271,7 +1271,7 @@
private void buildFilters(final boolean suppressInternal,
final boolean suppressSynchronization, final FilteringPolicy policy)
{
- final ArrayList<Filter> subFilters = new ArrayList<Filter>();
+ final ArrayList<Filter> subFilters = new ArrayList<>();
if (cfg != null)
{
for (final String criteriaName : cfg.listAccessLogFilteringCriteria())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/AccessLogger.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/AccessLogger.java
index 7e38683..0ae3ead 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/AccessLogger.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/AccessLogger.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.loggers;
import java.util.Collection;
@@ -49,8 +49,7 @@
private static LoggerStorage
<AccessLogPublisher<AccessLogPublisherCfg>, AccessLogPublisherCfg>
- loggerStorage = new LoggerStorage
- <AccessLogPublisher<AccessLogPublisherCfg>, AccessLogPublisherCfg>();
+ loggerStorage = new LoggerStorage<>();
/** The singleton instance of this class. */
private static final AccessLogger instance = new AccessLogger();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/AsynchronousTextWriter.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/AsynchronousTextWriter.java
index a34a1e0..e30e8a2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/AsynchronousTextWriter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/AsynchronousTextWriter.java
@@ -76,7 +76,7 @@
this.autoFlush = autoFlush;
this.writer = writer;
- this.queue = new LinkedBlockingQueue<String>(capacity);
+ this.queue = new LinkedBlockingQueue<>(capacity);
this.capacity = capacity;
this.writerThread = null;
this.stopRequested = new AtomicBoolean(false);
@@ -105,7 +105,7 @@
@Override
public void run()
{
- ArrayList<String> drainList = new ArrayList<String>(capacity);
+ ArrayList<String> drainList = new ArrayList<>(capacity);
String message = null;
while (!stopRequested.get() || !queue.isEmpty()) {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java
index 45af3a9..7e3830e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java
@@ -286,7 +286,7 @@
{
if (classTraceSettings == null)
{
- classTraceSettings = new HashMap<String, TraceSettings>();
+ classTraceSettings = new HashMap<>();
}
classTraceSettings.put(className, settings);
}
@@ -304,12 +304,12 @@
String methodName, TraceSettings settings)
{
if (methodTraceSettings == null) {
- methodTraceSettings = new HashMap<String, Map<String, TraceSettings>>();
+ methodTraceSettings = new HashMap<>();
}
Map<String, TraceSettings> methodLevels = methodTraceSettings.get(className);
if (methodLevels == null)
{
- methodLevels = new TreeMap<String, TraceSettings>();
+ methodLevels = new TreeMap<>();
methodTraceSettings.put(className, methodLevels);
}
methodLevels.put(methodName, settings);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogger.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogger.java
index 6f1c760..4717b1e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogger.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogger.java
@@ -56,8 +56,7 @@
{
/** The set of all DebugTracer instances. */
- private static Map<String, DebugTracer> classTracers =
- new ConcurrentHashMap<String, DebugTracer>();
+ private static Map<String, DebugTracer> classTracers = new ConcurrentHashMap<>();
/**
* Trace methods will use this static boolean to determine if debug is enabled
@@ -67,8 +66,7 @@
private static final LoggerStorage
<DebugLogPublisher<DebugLogPublisherCfg>, DebugLogPublisherCfg>
- loggerStorage = new LoggerStorage
- <DebugLogPublisher<DebugLogPublisherCfg>, DebugLogPublisherCfg>();
+ loggerStorage = new LoggerStorage<>();
/** The singleton instance of this class. */
static final DebugLogger instance = new DebugLogger();
@@ -182,7 +180,7 @@
private List<String> getDebugTargetsFromSystemProperties()
{
- final List<String> targets = new ArrayList<String>();
+ final List<String> targets = new ArrayList<>();
for (Map.Entry<Object, Object> entry : System.getProperties().entrySet())
{
if (((String) entry.getKey()).startsWith(PROPERTY_DEBUG_TARGET))
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogPublisher.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogPublisher.java
index f580217..4867dc4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogPublisher.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogPublisher.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS
+ * Portions Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.loggers;
@@ -61,14 +61,13 @@
* The hash map that will be used to define specific log severities for the
* various categories.
*/
- protected Map<String, Set<Severity>> definedSeverities =
- new HashMap<String, Set<Severity>>();
+ protected Map<String, Set<Severity>> definedSeverities = new HashMap<>();
/**
* The set of default log severities that will be used if no custom severities
* have been defined for the associated category.
*/
- protected Set<Severity> defaultSeverities = new HashSet<Severity>();
+ protected Set<Severity> defaultSeverities = new HashSet<>();
/** {@inheritDoc} */
@Override
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogger.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogger.java
index e2d407e..0463952 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogger.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/ErrorLogger.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS
+ * Portions Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.loggers;
@@ -49,8 +49,7 @@
private static LoggerStorage
<ErrorLogPublisher<ErrorLogPublisherCfg>, ErrorLogPublisherCfg>
- loggerStorage = new LoggerStorage
- <ErrorLogPublisher<ErrorLogPublisherCfg>, ErrorLogPublisherCfg>();
+ loggerStorage = new LoggerStorage<>();
/** The singleton instance of this class for configuration purposes. */
private static final ErrorLogger instance = new ErrorLogger();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/FileNumberRetentionPolicy.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/FileNumberRetentionPolicy.java
index f65ec2c..b3df29e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/FileNumberRetentionPolicy.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/FileNumberRetentionPolicy.java
@@ -99,7 +99,7 @@
// Sort files based on last modified time.
Arrays.sort(files, new FileComparator());
- ArrayList<File> filesToDelete = new ArrayList<File>();
+ ArrayList<File> filesToDelete = new ArrayList<>();
for (int j = numFiles; j < files.length; j++)
{
filesToDelete.add(files[j]);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/FreeDiskSpaceRetentionPolicy.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/FreeDiskSpaceRetentionPolicy.java
index d554e9a..845c5d7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/FreeDiskSpaceRetentionPolicy.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/FreeDiskSpaceRetentionPolicy.java
@@ -133,7 +133,7 @@
// Sort files based on last modified time.
Arrays.sort(files, new FileComparator());
- List<File> filesToDelete = new ArrayList<File>();
+ List<File> filesToDelete = new ArrayList<>();
long freedSpace = 0;
for (int j = files.length - 1; j < 1; j--)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/HTTPAccessLogger.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/HTTPAccessLogger.java
index 255edf7..7a04082 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/HTTPAccessLogger.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/HTTPAccessLogger.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Portions Copyright 2013-2014 ForgeRock AS
+ * Portions Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.loggers;
@@ -43,9 +43,7 @@
private static LoggerStorage
<HTTPAccessLogPublisher<HTTPAccessLogPublisherCfg>, HTTPAccessLogPublisherCfg>
- loggerStorage = new LoggerStorage
- <HTTPAccessLogPublisher<HTTPAccessLogPublisherCfg>, HTTPAccessLogPublisherCfg>
- ();
+ loggerStorage = new LoggerStorage<>();
/** The singleton instance of this class for configuration purposes. */
private static final HTTPAccessLogger instance = new HTTPAccessLogger();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/LoggingCategoryNames.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/LoggingCategoryNames.java
index 681d9f3..1bbcbac 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/LoggingCategoryNames.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/LoggingCategoryNames.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2014 ForgeRock AS.
+ * Copyright 2014-2015 ForgeRock AS.
*/
package org.opends.server.loggers;
@@ -43,9 +43,7 @@
* most case, package name is sufficient to map to a category name. It is
* valid if several entries point to the same category name.
*/
- private static final NavigableMap<String, String> NAMES =
- new TreeMap<String, String>();
-
+ private static final NavigableMap<String, String> NAMES = new TreeMap<>();
static
{
// The category used for messages associated with the core server.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/MultifileTextWriter.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/MultifileTextWriter.java
index 7bdafca..ef879c4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/MultifileTextWriter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/MultifileTextWriter.java
@@ -70,10 +70,8 @@
private static final String UTF8_ENCODING= "UTF-8";
- private CopyOnWriteArrayList<RotationPolicy> rotationPolicies =
- new CopyOnWriteArrayList<RotationPolicy>();
- private CopyOnWriteArrayList<RetentionPolicy> retentionPolicies =
- new CopyOnWriteArrayList<RetentionPolicy>();
+ private CopyOnWriteArrayList<RotationPolicy> rotationPolicies = new CopyOnWriteArrayList<>();
+ private CopyOnWriteArrayList<RetentionPolicy> retentionPolicies = new CopyOnWriteArrayList<>();
private FileNamingPolicy namingPolicy;
private FilePermission filePermissions;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJLoggerFactory.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJLoggerFactory.java
index d651c30..4762693 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJLoggerFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJLoggerFactory.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2014 ForgeRock AS.
+ * Copyright 2014-2015 ForgeRock AS.
*/
package org.opends.server.loggers;
@@ -38,11 +38,9 @@
private final ConcurrentMap<String, Logger> loggerMap;
- /**
- * Create the factory.
- */
+ /** Create the factory. */
public OpenDJLoggerFactory() {
- loggerMap = new ConcurrentHashMap<String, Logger>();
+ loggerMap = new ConcurrentHashMap<>();
}
/** {@inheritDoc} */
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/ParallelTextWriter.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/ParallelTextWriter.java
index af6a4a0..962a3fc 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/ParallelTextWriter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/ParallelTextWriter.java
@@ -78,7 +78,7 @@
this.autoFlush = autoFlush;
this.writer = writer;
- this.queue = new ConcurrentLinkedQueue<String>();
+ this.queue = new ConcurrentLinkedQueue<>();
this.writerThread = null;
this.stopRequested = new AtomicBoolean(false);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/TextErrorLogPublisher.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/TextErrorLogPublisher.java
index 7bf48c6..73c610f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/TextErrorLogPublisher.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/TextErrorLogPublisher.java
@@ -185,7 +185,7 @@
category = category.replace("-", "_").toUpperCase();
try
{
- Set<Severity> severities = new HashSet<Severity>();
+ Set<Severity> severities = new HashSet<>();
StringTokenizer sevTokenizer = new StringTokenizer(overrideSeverity.substring(equalPos + 1), ",");
while (sevTokenizer.hasMoreElements())
{
@@ -314,7 +314,7 @@
category = category.replace("-", "_").toUpperCase();
try
{
- Set<Severity> severities = new HashSet<Severity>();
+ Set<Severity> severities = new HashSet<>();
StringTokenizer sevTokenizer =
new StringTokenizer(overrideSeverity.substring(equalPos+1), ",");
while (sevTokenizer.hasMoreElements())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/TextHTTPAccessLogPublisher.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/TextHTTPAccessLogPublisher.java
index 0fa9636..e039633 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/TextHTTPAccessLogPublisher.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/TextHTTPAccessLogPublisher.java
@@ -81,7 +81,7 @@
private static final String X_DATETIME = "x-datetime";
private static final String X_ETIME = "x-etime";
- private static final Set<String> ALL_SUPPORTED_FIELDS = new HashSet<String>(
+ private static final Set<String> ALL_SUPPORTED_FIELDS = new HashSet<>(
Arrays.asList(ELF_C_IP, ELF_C_PORT, ELF_CS_HOST, ELF_CS_METHOD,
ELF_CS_URI_QUERY, ELF_CS_USER_AGENT, ELF_CS_USERNAME, ELF_CS_VERSION,
ELF_S_COMPUTERNAME, ELF_S_IP, ELF_S_PORT, ELF_SC_STATUS,
@@ -285,7 +285,7 @@
*/
private <T> Collection<T> subtract(Collection<T> a, Collection<T> b)
{
- final Collection<T> result = new ArrayList<T>();
+ final Collection<T> result = new ArrayList<>();
for (T elem : a)
{
if (!b.contains(elem))
@@ -448,7 +448,7 @@
@Override
public void logRequestInfo(HTTPRequestInfo ri)
{
- final Map<String, Object> fields = new HashMap<String, Object>();
+ final Map<String, Object> fields = new HashMap<>();
fields.put(ELF_C_IP, ri.getClientAddress());
fields.put(ELF_C_PORT, ri.getClientPort());
fields.put(ELF_CS_HOST, ri.getClientHost());
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
index dbd83e3..d499756 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
@@ -134,7 +134,7 @@
/** {@inheritDoc} */
public List<Attribute> getMonitorData()
{
- LinkedList<Attribute> attrs = new LinkedList<Attribute>();
+ LinkedList<Attribute> attrs = new LinkedList<>();
attrs.add(Attributes.create(backendIDType, backend.getBackendID()));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/ClientConnectionMonitorProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/ClientConnectionMonitorProvider.java
index ea3d20f..b811e39 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/ClientConnectionMonitorProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/ClientConnectionMonitorProvider.java
@@ -136,8 +136,7 @@
public ArrayList<Attribute> getMonitorData()
{
// Re-order the connections by connection ID.
- TreeMap<Long, ClientConnection> connMap =
- new TreeMap<Long, ClientConnection>();
+ TreeMap<Long, ClientConnection> connMap = new TreeMap<>();
if (handler == null)
{
@@ -171,7 +170,7 @@
builder.add(conn.getMonitorSummary());
}
- ArrayList<Attribute> attrs = new ArrayList<Attribute>(1);
+ ArrayList<Attribute> attrs = new ArrayList<>(1);
attrs.add(builder.toAttribute());
return attrs;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java
index 0dcf941..a06e70b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java
@@ -145,19 +145,16 @@
@Override
public List<Attribute> getMonitorData()
{
- LinkedList<Attribute> attrs = new LinkedList<Attribute>();
+ LinkedList<Attribute> attrs = new LinkedList<>();
// Configuration DN
attrs.add(Attributes.create(configDnType, connectionHandler.getComponentEntryDN().toString()));
int numConnections = 0;
- LinkedList<ClientConnection> conns = new LinkedList<ClientConnection>(
- connectionHandler.getClientConnections());
- LinkedList<HostPort> listeners = new LinkedList<HostPort>(connectionHandler
- .getListeners());
+ LinkedList<ClientConnection> conns = new LinkedList<>(connectionHandler.getClientConnections());
+ LinkedList<HostPort> listeners = new LinkedList<>(connectionHandler.getListeners());
- attrs.add(Attributes.create(protocolType, connectionHandler
- .getProtocol()));
+ attrs.add(Attributes.create(protocolType, connectionHandler.getProtocol()));
if (!listeners.isEmpty())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/DatabaseEnvironmentMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/DatabaseEnvironmentMonitor.java
index 9d443ea..6bd04a6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/DatabaseEnvironmentMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/DatabaseEnvironmentMonitor.java
@@ -108,8 +108,7 @@
private int maxEntries = 1024;
private boolean filterUseEnabled;
private String startTimeStamp;
- private final HashMap<SearchFilter, FilterStats> filterToStats =
- new HashMap<SearchFilter, FilterStats>();
+ private final HashMap<SearchFilter, FilterStats> filterToStats = new HashMap<>();
private final AtomicInteger indexedSearchCount = new AtomicInteger();
private final AtomicInteger unindexedSearchCount = new AtomicInteger();
@@ -211,7 +210,7 @@
EnvironmentStats environmentStats = null;
TransactionStats transactionStats = null;
StatsConfig statsConfig = new StatsConfig();
- ArrayList<Attribute> monitorAttrs = new ArrayList<Attribute>();
+ ArrayList<Attribute> monitorAttrs = new ArrayList<>();
try
{
@@ -235,7 +234,7 @@
AttributeBuilder needReindex = new AttributeBuilder("need-reindex");
for(EntryContainer ec : rootContainer.getEntryContainers())
{
- List<DatabaseContainer> databases = new ArrayList<DatabaseContainer>();
+ List<DatabaseContainer> databases = new ArrayList<>();
ec.listDatabases(databases);
for(DatabaseContainer dc : databases)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/MemoryUsageMonitorProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/MemoryUsageMonitorProvider.java
index 1c51616..4cf3015 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/MemoryUsageMonitorProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/MemoryUsageMonitorProvider.java
@@ -51,20 +51,13 @@
implements Runnable
{
/** A map of the last GC counts seen by this monitor for calculating recent stats. */
- private HashMap<String,Long> lastGCCounts = new HashMap<String,Long>();
-
+ private HashMap<String,Long> lastGCCounts = new HashMap<>();
/** A map of the last GC times seen by this monitor for calculating recent stats. */
- private HashMap<String,Long> lastGCTimes = new HashMap<String,Long>();
-
+ private HashMap<String,Long> lastGCTimes = new HashMap<>();
/** A map of the most recent GC durations seen by this monitor. */
- private HashMap<String,Long> recentGCDurations = new HashMap<String,Long>();
-
- /**
- * A map of the memory manager names to names that are safe for use in
- * attribute names.
- */
- private HashMap<String,String> gcSafeNames = new HashMap<String,String>();
-
+ private HashMap<String,Long> recentGCDurations = new HashMap<>();
+ /** A map of the memory manager names to names that are safe for use in attribute names. */
+ private HashMap<String,String> gcSafeNames = new HashMap<>();
/** {@inheritDoc} */
@@ -122,7 +115,7 @@
@Override
public ArrayList<Attribute> getMonitorData()
{
- ArrayList<Attribute> attrs = new ArrayList<Attribute>();
+ ArrayList<Attribute> attrs = new ArrayList<>();
for (GarbageCollectorMXBean gc :
ManagementFactory.getGarbageCollectorMXBeans())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/ParallelWorkQueueMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/ParallelWorkQueueMonitor.java
index 96cd9f2..e72e0a9 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/ParallelWorkQueueMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/ParallelWorkQueueMonitor.java
@@ -26,25 +26,20 @@
*/
package org.opends.server.monitors;
-
+import static org.opends.server.core.DirectoryServer.*;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import org.opends.server.admin.std.server.MonitorProviderCfg;
-import org.forgerock.opendj.ldap.schema.Syntax;
import org.opends.server.api.MonitorProvider;
import org.forgerock.opendj.config.server.ConfigException;
-import org.opends.server.core.DirectoryServer;
import org.opends.server.extensions.ParallelWorkQueue;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Attributes;
import org.opends.server.types.InitializationException;
-
-
-
/**
* This class defines a Directory Server monitor that can be used to provide
* information about the state of the work queue.
@@ -53,30 +48,15 @@
extends MonitorProvider<MonitorProviderCfg>
implements Runnable
{
- /**
- * The name to use for the monitor attribute that provides the current request
- * backlog.
- */
+ /** The name to use for the monitor attribute that provides the current request backlog. */
public static final String ATTR_CURRENT_BACKLOG = "currentRequestBacklog";
-
-
-
- /**
- * The name to use for the monitor attribute that provides the average request
- * backlog.
- */
+ /** The name to use for the monitor attribute that provides the average request backlog. */
public static final String ATTR_AVERAGE_BACKLOG = "averageRequestBacklog";
-
-
-
/**
* The name to use for the monitor attribute that provides the maximum
* observed request backlog.
*/
public static final String ATTR_MAX_BACKLOG = "maxRequestBacklog";
-
-
-
/**
* The name to use for the monitor attribute that provides the total number of
* operations submitted.
@@ -84,7 +64,6 @@
public static final String ATTR_OPS_SUBMITTED = "requestsSubmitted";
-
/** The maximum backlog observed by polling the queue. */
private int maxBacklog;
@@ -97,8 +76,6 @@
/** The parallel work queue instance with which this monitor is associated. */
private ParallelWorkQueue workQueue;
-
-
/**
* Initializes this monitor provider. Note that no initialization should be
* done here, since it should be performed in the
@@ -175,36 +152,21 @@
}
long averageBacklog = (long) (1.0 * totalBacklog / numPolls);
-
long opsSubmitted = workQueue.getOpsSubmitted();
- ArrayList<Attribute> monitorAttrs = new ArrayList<Attribute>();
- Syntax integerSyntax = DirectoryServer.getDefaultIntegerSyntax();
-
- // The current backlog.
- AttributeType attrType = DirectoryServer.getDefaultAttributeType(
- ATTR_CURRENT_BACKLOG, integerSyntax);
- monitorAttrs
- .add(Attributes.create(attrType, String.valueOf(backlog)));
-
- // The average backlog.
- attrType = DirectoryServer.getDefaultAttributeType(ATTR_AVERAGE_BACKLOG,
- integerSyntax);
- monitorAttrs.add(Attributes.create(attrType, String
- .valueOf(averageBacklog)));
-
- // The maximum backlog.
- attrType = DirectoryServer.getDefaultAttributeType(ATTR_MAX_BACKLOG,
- integerSyntax);
- monitorAttrs.add(Attributes.create(attrType, String
- .valueOf(maxBacklog)));
-
+ ArrayList<Attribute> monitorAttrs = new ArrayList<>();
+ putAttribute(monitorAttrs, ATTR_CURRENT_BACKLOG, backlog);
+ putAttribute(monitorAttrs, ATTR_AVERAGE_BACKLOG, averageBacklog);
+ putAttribute(monitorAttrs, ATTR_MAX_BACKLOG, maxBacklog);
// The total number of operations submitted.
- attrType = DirectoryServer.getDefaultAttributeType(ATTR_OPS_SUBMITTED,
- integerSyntax);
- monitorAttrs.add(Attributes.create(attrType, String
- .valueOf(opsSubmitted)));
+ putAttribute(monitorAttrs, ATTR_OPS_SUBMITTED, opsSubmitted);
return monitorAttrs;
}
+
+ private void putAttribute(ArrayList<Attribute> monitorAttrs, String attrName, Object value)
+ {
+ AttributeType attrType = getDefaultAttributeType(attrName, getDefaultIntegerSyntax());
+ monitorAttrs.add(Attributes.create(attrType, String.valueOf(value)));
+ }
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/StackTraceMonitorProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/StackTraceMonitorProvider.java
index d61081d..0642d4b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/StackTraceMonitorProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/StackTraceMonitorProvider.java
@@ -83,10 +83,8 @@
Map<Thread,StackTraceElement[]> threadStacks = Thread.getAllStackTraces();
- // Re-arrange all of the elements by thread ID so that there is some logical
- // order.
- TreeMap<Long,Map.Entry<Thread,StackTraceElement[]>> orderedStacks =
- new TreeMap<Long,Map.Entry<Thread,StackTraceElement[]>>();
+ // Re-arrange all of the elements by thread ID so that there is some logical order.
+ TreeMap<Long,Map.Entry<Thread,StackTraceElement[]>> orderedStacks = new TreeMap<>();
for (Map.Entry<Thread,StackTraceElement[]> e : threadStacks.entrySet())
{
orderedStacks.put(e.getKey().getId(), e);
@@ -144,10 +142,8 @@
}
}
- ArrayList<Attribute> attrs = new ArrayList<Attribute>();
+ ArrayList<Attribute> attrs = new ArrayList<>();
attrs.add(builder.toAttribute());
-
return attrs;
}
}
-
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/SystemInfoMonitorProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/SystemInfoMonitorProvider.java
index 093ece6..4f27999 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/SystemInfoMonitorProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/SystemInfoMonitorProvider.java
@@ -95,7 +95,7 @@
*/
public ArrayList<Attribute> getMonitorData()
{
- ArrayList<Attribute> attrs = new ArrayList<Attribute>(13);
+ ArrayList<Attribute> attrs = new ArrayList<>(13);
attrs.add(createAttribute("javaVersion",
System.getProperty("java.version")));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/TraditionalWorkQueueMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/TraditionalWorkQueueMonitor.java
index af7ea48..3dbeb48 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/TraditionalWorkQueueMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/TraditionalWorkQueueMonitor.java
@@ -26,25 +26,20 @@
*/
package org.opends.server.monitors;
-
+import static org.opends.server.core.DirectoryServer.*;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import org.opends.server.admin.std.server.MonitorProviderCfg;
-import org.forgerock.opendj.ldap.schema.Syntax;
import org.opends.server.api.MonitorProvider;
import org.forgerock.opendj.config.server.ConfigException;
-import org.opends.server.core.DirectoryServer;
import org.opends.server.extensions.TraditionalWorkQueue;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Attributes;
import org.opends.server.types.InitializationException;
-
-
-
/**
* This class defines a Directory Server monitor that can be used to provide
* information about the state of the work queue.
@@ -53,61 +48,38 @@
extends MonitorProvider<MonitorProviderCfg>
implements Runnable
{
- /**
- * The name to use for the monitor attribute that provides the current request
- * backlog.
- */
+ /** The name to use for the monitor attribute that provides the current request backlog. */
public static final String ATTR_CURRENT_BACKLOG = "currentRequestBacklog";
-
-
-
- /**
- * The name to use for the monitor attribute that provides the average request
- * backlog.
- */
+ /** The name to use for the monitor attribute that provides the average request backlog. */
public static final String ATTR_AVERAGE_BACKLOG = "averageRequestBacklog";
-
-
-
/**
* The name to use for the monitor attribute that provides the maximum
* observed request backlog.
*/
public static final String ATTR_MAX_BACKLOG = "maxRequestBacklog";
-
-
-
/**
* The name to use for the monitor attribute that provides the total number of
* operations submitted.
*/
public static final String ATTR_OPS_SUBMITTED = "requestsSubmitted";
-
-
/**
* The name to use for the monitor attribute that provides the total number of
* requests that have been rejected because the work queue was full.
*/
- public static final String ATTR_OPS_REJECTED_QUEUE_FULL =
- "requestsRejectedDueToQueueFull";
-
+ public static final String ATTR_OPS_REJECTED_QUEUE_FULL = "requestsRejectedDueToQueueFull";
/** The maximum backlog observed by polling the queue. */
private int maxBacklog;
-
/** The total number of times the backlog has been polled. */
private long numPolls;
-
/** The total backlog observed from periodic polling. */
private long totalBacklog;
-
/** The traditional work queue instance with which this monitor is associated. */
private TraditionalWorkQueue workQueue;
-
/**
* Initializes this monitor provider. Note that no initialization should be
* done here, since it should be performed in the
@@ -188,40 +160,20 @@
long opsSubmitted = workQueue.getOpsSubmitted();
long rejectedQueueFull = workQueue.getOpsRejectedDueToQueueFull();
- ArrayList<Attribute> monitorAttrs = new ArrayList<Attribute>();
- Syntax integerSyntax = DirectoryServer.getDefaultIntegerSyntax();
-
- // The current backlog.
- AttributeType attrType = DirectoryServer.getDefaultAttributeType(
- ATTR_CURRENT_BACKLOG, integerSyntax);
- monitorAttrs
- .add(Attributes.create(attrType, String.valueOf(backlog)));
-
- // The average backlog.
- attrType = DirectoryServer.getDefaultAttributeType(ATTR_AVERAGE_BACKLOG,
- integerSyntax);
- monitorAttrs.add(Attributes.create(attrType, String
- .valueOf(averageBacklog)));
-
- // The maximum backlog.
- attrType = DirectoryServer.getDefaultAttributeType(ATTR_MAX_BACKLOG,
- integerSyntax);
- monitorAttrs.add(Attributes.create(attrType, String
- .valueOf(maxBacklog)));
-
+ ArrayList<Attribute> monitorAttrs = new ArrayList<>();
+ putAttribute(monitorAttrs, ATTR_CURRENT_BACKLOG, backlog);
+ putAttribute(monitorAttrs, ATTR_AVERAGE_BACKLOG, averageBacklog);
+ putAttribute(monitorAttrs, ATTR_MAX_BACKLOG, maxBacklog);
// The total number of operations submitted.
- attrType = DirectoryServer.getDefaultAttributeType(ATTR_OPS_SUBMITTED,
- integerSyntax);
- monitorAttrs.add(Attributes.create(attrType, String
- .valueOf(opsSubmitted)));
-
+ putAttribute(monitorAttrs, ATTR_OPS_SUBMITTED, opsSubmitted);
// The total number of operations rejected due to a full work queue.
- attrType = DirectoryServer.getDefaultAttributeType(
- ATTR_OPS_REJECTED_QUEUE_FULL, integerSyntax);
- monitorAttrs.add(Attributes.create(attrType, String
- .valueOf(rejectedQueueFull)));
-
+ putAttribute(monitorAttrs, ATTR_OPS_REJECTED_QUEUE_FULL, rejectedQueueFull);
return monitorAttrs;
}
-}
+ private void putAttribute(ArrayList<Attribute> monitorAttrs, String attrName, Object value)
+ {
+ AttributeType attrType = getDefaultAttributeType(attrName, getDefaultIntegerSyntax());
+ monitorAttrs.add(Attributes.create(attrType, String.valueOf(value)));
+ }
+}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/VersionMonitorProvider.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/VersionMonitorProvider.java
index e64f9ac..af535ea 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/VersionMonitorProvider.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/VersionMonitorProvider.java
@@ -165,7 +165,7 @@
*/
public ArrayList<Attribute> getMonitorData()
{
- ArrayList<Attribute> attrs = new ArrayList<Attribute>(12);
+ ArrayList<Attribute> attrs = new ArrayList<>(12);
attrs.add(createAttribute(ATTR_PRODUCT_NAME,
DynamicConstants.PRODUCT_NAME));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java
index 3185133..14b85a0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java
@@ -110,7 +110,7 @@
/* Apply the change, as at this point is has been validated. */
this.config = config;
- attributesToRename = new HashMap<String, String>();
+ attributesToRename = new HashMap<>();
for (final String mapping : config.getRenameInboundAttributes())
{
final int colonPos = mapping.lastIndexOf(":");
@@ -119,7 +119,7 @@
attributesToRename.put(toLowerCase(fromAttr), toLowerCase(toAttr));
}
- attributesToRemove = new HashSet<String>();
+ attributesToRemove = new HashSet<>();
for (final String attr : config.getRemoveInboundAttributes())
{
attributesToRemove.add(toLowerCase(attr.trim()));
@@ -244,7 +244,7 @@
}
/* Verify the current configuration. */
- final List<LocalizableMessage> messages = new LinkedList<LocalizableMessage>();
+ final List<LocalizableMessage> messages = new LinkedList<>();
if (!isConfigurationChangeAcceptable(configuration, messages))
{
throw new ConfigException(messages.get(0));
@@ -286,7 +286,7 @@
* Verify that there are no duplicate mappings and that attributes are
* renamed to valid attribute types.
*/
- final Set<String> fromAttrs = new HashSet<String>();
+ final Set<String> fromAttrs = new HashSet<>();
for (final String attr : config.getRenameInboundAttributes())
{
/*
@@ -352,8 +352,7 @@
*/
private void processInboundRemove(final PreParseAddOperation addOperation)
{
- final List<RawAttribute> inAttrs = new LinkedList<RawAttribute>(
- addOperation.getRawAttributes());
+ final List<RawAttribute> inAttrs = new LinkedList<>(addOperation.getRawAttributes());
final ListIterator<RawAttribute> iterator = inAttrs.listIterator();
while (iterator.hasNext())
{
@@ -384,8 +383,7 @@
private void processInboundRemove(
final PreParseModifyOperation modifyOperation)
{
- final List<RawModification> rawMods = new LinkedList<RawModification>(
- modifyOperation.getRawModifications());
+ final List<RawModification> rawMods = new LinkedList<>(modifyOperation.getRawModifications());
final ListIterator<RawModification> iterator = rawMods.listIterator();
while (iterator.hasNext())
{
@@ -415,8 +413,7 @@
*/
private void processInboundRename(final PreParseAddOperation addOperation)
{
- final List<RawAttribute> inAttrs = new LinkedList<RawAttribute>(
- addOperation.getRawAttributes());
+ final List<RawAttribute> inAttrs = new LinkedList<>(addOperation.getRawAttributes());
final ListIterator<RawAttribute> iterator = inAttrs.listIterator();
while (iterator.hasNext())
{
@@ -448,8 +445,7 @@
private void processInboundRename(
final PreParseModifyOperation modifyOperation)
{
- final List<RawModification> rawMods = new LinkedList<RawModification>(
- modifyOperation.getRawModifications());
+ final List<RawModification> rawMods = new LinkedList<>(modifyOperation.getRawModifications());
final ListIterator<RawModification> iterator = rawMods.listIterator();
while (iterator.hasNext())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ChangeNumberControlPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ChangeNumberControlPlugin.java
index 3f65aa6..a386564 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ChangeNumberControlPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ChangeNumberControlPlugin.java
@@ -127,7 +127,7 @@
{
currentConfig = configuration;
configuration.addChangeNumberControlChangeListener(this);
- Set<PluginType> types = new TreeSet<PluginType>();
+ Set<PluginType> types = new TreeSet<>();
// Make sure that the plugin has been enabled for the appropriate types.
for (PluginType t : pluginTypes)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java
index 257b7d8..d292474 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java
@@ -168,7 +168,7 @@
UUID uuid = UUID.nameUUIDFromBytes(dnBytes);
Attribute uuidAttr = Attributes.create(entryUUIDType, uuid.toString());
- uuidList = new ArrayList<Attribute>(1);
+ uuidList = new ArrayList<>(1);
uuidList.add(uuidAttr);
entry.putAttribute(entryUUIDType, uuidList);
@@ -199,7 +199,7 @@
// Construct a new random UUID.
UUID uuid = UUID.randomUUID();
Attribute uuidAttr = Attributes.create(entryUUIDType, uuid.toString());
- uuidList = new ArrayList<Attribute>(1);
+ uuidList = new ArrayList<>(1);
uuidList.add(uuidAttr);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/LDAPADListPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/LDAPADListPlugin.java
index 48de6f7..81c3a7e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/LDAPADListPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/LDAPADListPlugin.java
@@ -97,7 +97,7 @@
if (foundOC)
{
- final LinkedHashSet<String> newAttrs = new LinkedHashSet<String>();
+ final LinkedHashSet<String> newAttrs = new LinkedHashSet<>();
for (final String attrName : attributes)
{
if (attrName.startsWith("@"))
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java
index 0e5087c..de50419 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java
@@ -164,7 +164,7 @@
builder.add(creatorDN.toString());
}
Attribute nameAttr = builder.toAttribute();
- ArrayList<Attribute> nameList = new ArrayList<Attribute>(1);
+ ArrayList<Attribute> nameList = new ArrayList<>(1);
nameList.add(nameAttr);
addOperation.setAttribute(creatorsNameType, nameList);
@@ -172,7 +172,7 @@
// Create the attribute list for the createTimestamp attribute.
Attribute timeAttr = Attributes.create(createTimestampType,
OP_ATTR_CREATE_TIMESTAMP, getGMTTime());
- ArrayList<Attribute> timeList = new ArrayList<Attribute>(1);
+ ArrayList<Attribute> timeList = new ArrayList<>(1);
timeList.add(timeAttr);
addOperation.setAttribute(createTimestampType, timeList);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
index 77048f5..5e2ea65 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
@@ -250,8 +250,8 @@
{
// Find the set of attribute types with the auth password and user password
// syntax defined in the schema.
- HashSet<AttributeType> authPWTypes = new HashSet<AttributeType>();
- HashSet<AttributeType> userPWTypes = new HashSet<AttributeType>();
+ HashSet<AttributeType> authPWTypes = new HashSet<>();
+ HashSet<AttributeType> userPWTypes = new HashSet<>();
for (AttributeType t : DirectoryServer.getAttributeTypes().values())
{
if (t.getSyntax().getOID().equals(SYNTAX_AUTH_PASSWORD_OID))
@@ -267,16 +267,14 @@
// Get the set of password policies defined in the server and get the
// attribute types associated with them.
- HashMap<DN,PasswordStorageScheme<?>[]> schemeMap =
- new HashMap<DN,PasswordStorageScheme<?>[]>();
+ HashMap<DN,PasswordStorageScheme<?>[]> schemeMap = new HashMap<>();
for (AuthenticationPolicy ap : DirectoryServer.getAuthenticationPolicies())
{
if (ap.isPasswordPolicy())
{
PasswordPolicy p = (PasswordPolicy) ap;
- List<PasswordStorageScheme<?>> schemeList = p
- .getDefaultPasswordStorageSchemes();
+ List<PasswordStorageScheme<?>> schemeList = p.getDefaultPasswordStorageSchemes();
PasswordStorageScheme<?>[] schemeArray =
new PasswordStorageScheme[schemeList.size()];
schemeList.toArray(schemeArray);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
index 3ccc1f1..2f95aea 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -105,15 +105,10 @@
/** Current plugin configuration. */
private ReferentialIntegrityPluginCfg currentConfiguration;
- /**
- * List of attribute types that will be checked during referential integrity
- * processing.
- */
- private LinkedHashSet<AttributeType>
- attributeTypes = new LinkedHashSet<AttributeType>();
-
+ /** List of attribute types that will be checked during referential integrity processing. */
+ private LinkedHashSet<AttributeType> attributeTypes = new LinkedHashSet<>();
/** List of base DNs that limit the scope of the referential integrity checking. */
- private Set<DN> baseDNs = new LinkedHashSet<DN>();
+ private Set<DN> baseDNs = new LinkedHashSet<>();
/**
* The update interval the background thread uses. If it is 0, then
@@ -171,8 +166,7 @@
* attributeTypes list) and the filter which the plugin should use
* to verify the integrity of the value of the given attribute.
*/
- private LinkedHashMap<AttributeType, SearchFilter> attrFiltMap =
- new LinkedHashMap<AttributeType, SearchFilter>();
+ private LinkedHashMap<AttributeType, SearchFilter> attrFiltMap = new LinkedHashMap<>();
/** {@inheritDoc} */
@@ -182,7 +176,7 @@
throws ConfigException
{
pluginCfg.addReferentialIntegrityChangeListener(this);
- LinkedList<LocalizableMessage> unacceptableReasons = new LinkedList<LocalizableMessage>();
+ LinkedList<LocalizableMessage> unacceptableReasons = new LinkedList<>();
if (!isConfigurationAcceptable(pluginCfg, unacceptableReasons))
{
@@ -213,15 +207,14 @@
final ConfigChangeResult ccr = new ConfigChangeResult();
//Load base DNs from new configuration.
- LinkedHashSet<DN> newConfiguredBaseDNs = new LinkedHashSet<DN>(newConfiguration.getBaseDN());
+ LinkedHashSet<DN> newConfiguredBaseDNs = new LinkedHashSet<>(newConfiguration.getBaseDN());
//Load attribute types from new configuration.
LinkedHashSet<AttributeType> newAttributeTypes =
- new LinkedHashSet<AttributeType>(newConfiguration.getAttributeType());
+ new LinkedHashSet<>(newConfiguration.getAttributeType());
// Load the attribute-filter mapping
- LinkedHashMap<AttributeType, SearchFilter> newAttrFiltMap =
- new LinkedHashMap<AttributeType, SearchFilter>();
+ LinkedHashMap<AttributeType, SearchFilter> newAttrFiltMap = new LinkedHashMap<>();
for (String attrFilt : newConfiguration.getCheckReferencesFilterCriteria())
{
@@ -413,7 +406,7 @@
(Map<DN, DN>) modifyDNOperation.getAttachment(MODIFYDN_DNS);
if(modDNmap == null)
{
- modDNmap=new LinkedHashMap<DN,DN>();
+ modDNmap = new LinkedHashMap<>();
modifyDNOperation.setAttachment(MODIFYDN_DNS, modDNmap);
}
DN oldEntryDN=modifyDNOperation.getOriginalEntry().getName();
@@ -444,7 +437,7 @@
(Set<DN>) deleteOperation.getAttachment(DELETE_DNS);
if(deleteDNset == null)
{
- deleteDNset = new HashSet<DN>();
+ deleteDNset = new HashSet<>();
deleteOperation.setAttachment(MODIFYDN_DNS, deleteDNset);
}
deleteDNset.add(deleteOperation.getEntryDN());
@@ -466,9 +459,8 @@
(Map<DN, DN>) modifyDNOperation.getAttachment(MODIFYDN_DNS);
if(modDNmap == null)
{
- //First time through, create the map and set it in the operation
- //attachment.
- modDNmap=new LinkedHashMap<DN,DN>();
+ // First time through, create the map and set it in the operation attachment.
+ modDNmap = new LinkedHashMap<>();
modifyDNOperation.setAttachment(MODIFYDN_DNS, modDNmap);
}
modDNmap.put(oldEntry.getName(), newEntry.getName());
@@ -481,15 +473,12 @@
public PluginResult.SubordinateDelete processSubordinateDelete(
DeleteOperation deleteOperation, Entry entry)
{
- // This cast gives an unchecked cast warning, suppress it
- // since the cast is ok.
- Set<DN> deleteDNset =
- (Set<DN>) deleteOperation.getAttachment(DELETE_DNS);
+ // This cast gives an unchecked cast warning, suppress it since the cast is ok.
+ Set<DN> deleteDNset = (Set<DN>) deleteOperation.getAttachment(DELETE_DNS);
if(deleteDNset == null)
{
- // First time through, create the set and set it in
- // the operation attachment.
- deleteDNset = new HashSet<DN>();
+ // First time through, create the set and set it in the operation attachment.
+ deleteDNset = new HashSet<>();
deleteOperation.setAttachment(DELETE_DNS, deleteDNset);
}
deleteDNset.add(entry.getName());
@@ -501,9 +490,7 @@
* or "name and optional UID" syntax.
*
* @param attribute The attribute to check the syntax of.
- *
* @return Returns <code>true</code> if the attribute has a valid syntax.
- *
*/
private boolean isAttributeSyntaxValid(AttributeType attribute)
{
@@ -673,7 +660,7 @@
{
//Build an equality search with all of the configured attribute types
//and the old entry DN.
- HashSet<SearchFilter> componentFilters=new HashSet<SearchFilter>();
+ HashSet<SearchFilter> componentFilters=new HashSet<>();
for(AttributeType attributeType : attributeTypes)
{
componentFilters.add(SearchFilter.createEqualityFilter(attributeType,
@@ -758,7 +745,7 @@
*/
private void deleteAddAttributesEntry(Entry e, DN oldEntryDN, DN newEntryDN)
{
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
DN entryDN=e.getName();
for(AttributeType type : attributeTypes)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java
index 88aa59c..8803d43 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java
@@ -858,7 +858,7 @@
{
// Verify config parameters.
- final LinkedList<LocalizableMessage> messages = new LinkedList<LocalizableMessage>();
+ final LinkedList<LocalizableMessage> messages = new LinkedList<>();
if (!isConfigurationAcceptable(configuration, messages))
{
for (final LocalizableMessage m : messages)
@@ -938,7 +938,7 @@
*/
private List<Modification> getModifications(final String password)
{
- ArrayList<Modification> modifications = new ArrayList<Modification>();
+ ArrayList<Modification> modifications = new ArrayList<>();
try
{
if (config.getPwdSyncPolicy().contains(PwdSyncPolicy.SYNC_NT_PASSWORD))
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java
index 882dda7..e4336b8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/UniqueAttributePlugin.java
@@ -84,7 +84,7 @@
* The set of attributes that will be requested when performing internal
* search operations. This indicates that no attributes should be returned.
*/
- private static final Set<String> SEARCH_ATTRS = new LinkedHashSet<String>(1);
+ private static final Set<String> SEARCH_ATTRS = new LinkedHashSet<>(1);
static
{
SEARCH_ATTRS.add(SchemaConstants.NO_ATTRIBUTES);
@@ -154,7 +154,7 @@
}
}
- uniqueAttrValue2Dn = new ConcurrentHashMap<ByteString,DN>();
+ uniqueAttrValue2Dn = new ConcurrentHashMap<>();
DirectoryServer.registerAlertGenerator(this);
}
@@ -186,7 +186,7 @@
}
DN entryDN = entry.getName();
- List<ByteString> recordedValues = new LinkedList<ByteString>();
+ List<ByteString> recordedValues = new LinkedList<>();
for (AttributeType t : config.getType())
{
List<Attribute> attrList = entry.getAttribute(t);
@@ -227,7 +227,7 @@
return PluginResult.PreOperation.continueOperationProcessing();
}
- List<ByteString> recordedValues = new LinkedList<ByteString>();
+ List<ByteString> recordedValues = new LinkedList<>();
for (Modification m : modifyOperation.getModifications())
{
Attribute a = m.getAttribute();
@@ -358,7 +358,7 @@
return PluginResult.PreOperation.continueOperationProcessing();
}
- List<ByteString> recordedValues = new LinkedList<ByteString>();
+ List<ByteString> recordedValues = new LinkedList<>();
RDN newRDN = modifyDNOperation.getNewRDN();
for (int i=0; i < newRDN.getNumValues(); i++)
{
@@ -629,8 +629,7 @@
}
else
{
- List<SearchFilter> equalityFilters =
- new ArrayList<SearchFilter>(attrTypes.size());
+ List<SearchFilter> equalityFilters = new ArrayList<>(attrTypes.size());
for (AttributeType t : attrTypes)
{
equalityFilters.add(SearchFilter.createEqualityFilter(t, value));
@@ -774,7 +773,7 @@
@Override
public Map<String,String> getAlerts()
{
- Map<String,String> alerts = new LinkedHashMap<String,String>(2);
+ Map<String,String> alerts = new LinkedHashMap<>(2);
alerts.put(ALERT_TYPE_UNIQUE_ATTR_SYNC_CONFLICT,
ALERT_DESCRIPTION_UNIQUE_ATTR_SYNC_CONFLICT);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java
index e16b7fb..d8f0f8f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java
@@ -81,8 +81,8 @@
this.className = className;
this.methodName = methodName;
- lineNumbers = new HashMap<Integer,Long>();
- subordinateFrames = new HashMap<ProfileStackFrame,ProfileStackFrame>();
+ lineNumbers = new HashMap<>();
+ subordinateFrames = new HashMap<>();
}
@@ -275,7 +275,7 @@
HashMap<ProfileStack,Long> stackMap = stacksByMethod.get(classAndMethod);
if (stackMap == null)
{
- stackMap = new HashMap<ProfileStack,Long>();
+ stackMap = new HashMap<>();
stacksByMethod.put(classAndMethod, stackMap);
}
stackMap.put(stack, count);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java
index 12278ff..cb3e6f6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java
@@ -206,8 +206,8 @@
*/
public ProfileViewer()
{
- rootFrames = new HashMap<ProfileStackFrame,ProfileStackFrame>();
- stacksByMethod = new HashMap<String,HashMap<ProfileStack,Long>>();
+ rootFrames = new HashMap<>();
+ stacksByMethod = new HashMap<>();
totalDuration = 0;
totalIntervals = 0;
}
@@ -273,7 +273,7 @@
stacksByMethod.get(classAndMethod);
if (stackMap == null)
{
- stackMap = new HashMap<ProfileStack,Long>();
+ stackMap = new HashMap<>();
stacksByMethod.put(classAndMethod, stackMap);
}
stackMap.put(stack, count);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java
index 46566fc..035eb5d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java
@@ -88,7 +88,7 @@
this.sampleInterval = sampleInterval;
- stackTraces = new HashMap<ProfileStack,Long>();
+ stackTraces = new HashMap<>();
numIntervals = 0;
stopProfiling = false;
captureStartTime = -1;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/LDIFConnectionHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/LDIFConnectionHandler.java
index ec3ce6d..0f18c0b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/LDIFConnectionHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/LDIFConnectionHandler.java
@@ -618,7 +618,7 @@
/** {@inheritDoc} */
public LinkedHashMap<String,String> getAlerts()
{
- LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>();
+ LinkedHashMap<String,String> alerts = new LinkedHashMap<>();
alerts.put(ALERT_TYPE_LDIF_CONNHANDLER_PARSE_ERROR,
ALERT_DESCRIPTION_LDIF_CONNHANDLER_PARSE_ERROR);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPClientConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPClientConnection.java
index 786cb80..82f5f8a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPClientConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPClientConnection.java
@@ -166,8 +166,7 @@
* The Map (messageID => {@link OperationWithPromise}) of all operations
* currently in progress on this connection.
*/
- private final Map<Integer, OperationWithPromise> operationsInProgress =
- new ConcurrentHashMap<Integer, OperationWithPromise>();
+ private final Map<Integer, OperationWithPromise> operationsInProgress = new ConcurrentHashMap<>();
/**
* The number of operations performed on this connection. Used to compare with
@@ -622,7 +621,7 @@
public Collection<Operation> getOperationsInProgress()
{
Collection<OperationWithPromise> values = operationsInProgress.values();
- Collection<Operation> results = new ArrayList<Operation>(values.size());
+ Collection<Operation> results = new ArrayList<>(values.size());
for (OperationWithPromise op : values)
{
results.add(op.operation);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java
index beddd43..f0a8aab 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java
@@ -128,7 +128,7 @@
private boolean enabled;
/** The set of listeners for this connection handler. */
- private List<HostPort> listeners = new LinkedList<HostPort>();
+ private List<HostPort> listeners = new LinkedList<>();
/** The HTTP server embedded in OpenDJ. */
private HttpServer httpServer;
@@ -141,16 +141,12 @@
* ensure no concurrent reads/writes can happen and adds/removes are fast. We
* only use the keys, so it does not matter what value is put there.
*/
- private Map<ClientConnection, ClientConnection> clientConnections =
- new ConcurrentHashMap<ClientConnection, ClientConnection>();
+ private Map<ClientConnection, ClientConnection> clientConnections = new ConcurrentHashMap<>();
/** The set of statistics collected for this connection handler. */
private HTTPStatistics statTracker;
- /**
- * The client connection monitor provider associated with this connection
- * handler.
- */
+ /** The client connection monitor provider associated with this connection handler. */
private ClientConnectionMonitorProvider connMonitor;
/** The unique name assigned to this connection handler. */
@@ -161,8 +157,7 @@
/**
* The condition variable that will be used by the start method to wait for
- * the socket port to be opened and ready to process requests before
- * returning.
+ * the socket port to be opened and ready to process requests before returning.
*/
private final Object waitListen = new Object();
@@ -342,7 +337,7 @@
@Override
public Map<String, String> getAlerts()
{
- Map<String, String> alerts = new LinkedHashMap<String, String>();
+ Map<String, String> alerts = new LinkedHashMap<>();
alerts.put(ALERT_TYPE_HTTP_CONNECTION_HANDLER_CONSECUTIVE_FAILURES,
ALERT_DESCRIPTION_HTTP_CONNECTION_HANDLER_CONSECUTIVE_FAILURES);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java
index d4dd19a..f1d08fe 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013 ForgeRock AS
+ * Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.protocols.http;
@@ -53,8 +53,7 @@
* The keys are static because they need to be listed in the schema which is
* static.
*/
- private Map<String, AtomicInteger> requestMethodsTotalCount =
- new HashMap<String, AtomicInteger>();
+ private Map<String, AtomicInteger> requestMethodsTotalCount = new HashMap<>();
/**
* Map containing the total execution time for the requests per HTTP methods.
* <p>
@@ -65,8 +64,7 @@
* The keys are static because they need to be listed in the schema which is
* static.
*/
- private Map<String, AtomicLong> requestMethodsTotalTime =
- new HashMap<String, AtomicLong>();
+ private Map<String, AtomicLong> requestMethodsTotalTime = new HashMap<>();
/**
* Total number of requests. The total number may be different than the sum of
* the supported HTTP methods above because clients could use unsupported HTTP
@@ -111,30 +109,22 @@
{
// first take a snapshot of all the data as fast as possible
final int totalCount = this.requestsTotalCount.get();
- final Map<String, Integer> totalCountsSnapshot =
- new HashMap<String, Integer>();
- for (Entry<String, AtomicInteger> entry : this.requestMethodsTotalCount
- .entrySet())
+ final Map<String, Integer> totalCountsSnapshot = new HashMap<>();
+ for (Entry<String, AtomicInteger> entry : requestMethodsTotalCount.entrySet())
{
totalCountsSnapshot.put(entry.getKey(), entry.getValue().get());
}
- final Map<String, Long> totalTimesSnapshot = new HashMap<String, Long>();
- for (Entry<String, AtomicLong> entry1 : this.requestMethodsTotalTime
- .entrySet())
+ final Map<String, Long> totalTimesSnapshot = new HashMap<>();
+ for (Entry<String, AtomicLong> entry1 : requestMethodsTotalTime.entrySet())
{
totalTimesSnapshot.put(entry1.getKey(), entry1.getValue().get());
}
// do the same with the underlying data
final List<Attribute> results = super.getMonitorData();
-
- addAll(results, totalCountsSnapshot, "ds-mon-http-",
- "-requests-total-count");
- addAll(results, totalTimesSnapshot, "ds-mon-resident-time-http-",
- "-requests-total-time");
- results.add(createAttribute("ds-mon-http-requests-total-count", Integer
- .toString(totalCount)));
-
+ addAll(results, totalCountsSnapshot, "ds-mon-http-", "-requests-total-count");
+ addAll(results, totalTimesSnapshot, "ds-mon-resident-time-http-", "-requests-total-time");
+ results.add(createAttribute("ds-mon-http-requests-total-count", Integer.toString(totalCount)));
return results;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/AbstractRequestImpl.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/AbstractRequestImpl.java
index 709fbf8..63b5014 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/AbstractRequestImpl.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/AbstractRequestImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.opends.server.protocols.internal;
@@ -63,7 +63,7 @@
return null;
}
- private final List<Control> controls = new LinkedList<Control>();
+ private final List<Control> controls = new LinkedList<>();
/** Default constructor. */
AbstractRequestImpl() {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
index dc033fc..c411377 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
@@ -114,70 +114,58 @@
String fullDNString = shortDNString + ",cn=Root DNs,cn=config";
try
{
- LinkedHashMap<ObjectClass,String> objectClasses =
- new LinkedHashMap<ObjectClass,String>();
+ LinkedHashMap<ObjectClass,String> objectClasses = new LinkedHashMap<>();
ObjectClass topOC = DirectoryServer.getTopObjectClass();
- ObjectClass personOC = DirectoryServer.getObjectClass(OC_PERSON,
- true);
- ObjectClass rootOC = DirectoryServer.getObjectClass(OC_ROOT_DN,
- true);
+ ObjectClass personOC = DirectoryServer.getObjectClass(OC_PERSON, true);
+ ObjectClass rootOC = DirectoryServer.getObjectClass(OC_ROOT_DN, true);
objectClasses.put(topOC, topOC.getPrimaryName());
objectClasses.put(personOC, personOC.getPrimaryName());
objectClasses.put(rootOC, rootOC.getPrimaryName());
- LinkedHashMap<AttributeType,List<Attribute>> userAttrs =
- new LinkedHashMap<AttributeType,List<Attribute>>();
+ LinkedHashMap<AttributeType,List<Attribute>> userAttrs = new LinkedHashMap<>();
AttributeType cnAT =
DirectoryServer.getAttributeType(ATTR_COMMON_NAME, true);
- AttributeType snAT = DirectoryServer.getAttributeType(ATTR_SN,
- true);
+ AttributeType snAT = DirectoryServer.getAttributeType(ATTR_SN, true);
AttributeType altDNAT =
DirectoryServer.getAttributeType(
ATTR_ROOTDN_ALTERNATE_BIND_DN, true);
- LinkedList<Attribute> attrList = new LinkedList<Attribute>();
- attrList.add(Attributes.create(ATTR_COMMON_NAME,
- commonName));
+ LinkedList<Attribute> attrList = new LinkedList<>();
+ attrList.add(Attributes.create(ATTR_COMMON_NAME, commonName));
userAttrs.put(cnAT, attrList);
- attrList = new LinkedList<Attribute>();
+ attrList = new LinkedList<>();
attrList.add(Attributes.create(ATTR_SN, commonName));
userAttrs.put(snAT, attrList);
- attrList = new LinkedList<Attribute>();
- attrList.add(Attributes.create(
- ATTR_ROOTDN_ALTERNATE_BIND_DN,
- shortDNString));
+ attrList = new LinkedList<>();
+ attrList.add(Attributes.create(ATTR_ROOTDN_ALTERNATE_BIND_DN, shortDNString));
userAttrs.put(altDNAT, attrList);
- LinkedHashMap<AttributeType,List<Attribute>> operationalAttrs =
- new LinkedHashMap<AttributeType,List<Attribute>>();
+ LinkedHashMap<AttributeType,List<Attribute>> operationalAttrs = new LinkedHashMap<>();
AttributeType privType =
- DirectoryServer.getAttributeType(OP_ATTR_PRIVILEGE_NAME,
- true);
+ DirectoryServer.getAttributeType(OP_ATTR_PRIVILEGE_NAME, true);
AttributeBuilder builder = new AttributeBuilder(privType);
for (Privilege p : Privilege.getDefaultRootPrivileges())
{
builder.add(p.getName());
}
- attrList = new LinkedList<Attribute>();
+ attrList = new LinkedList<>();
attrList.add(builder.toAttribute());
operationalAttrs.put(privType, attrList);
DN internalUserDN = DN.valueOf(fullDNString);
- Entry internalUserEntry =
- new Entry(internalUserDN, objectClasses, userAttrs,
- operationalAttrs);
+ Entry internalUserEntry = new Entry(
+ internalUserDN, objectClasses, userAttrs, operationalAttrs);
- this.authenticationInfo =
- new AuthenticationInfo(internalUserEntry, true);
+ this.authenticationInfo = new AuthenticationInfo(internalUserEntry, true);
super.setAuthenticationInfo(authenticationInfo);
super.setSizeLimit(0);
super.setTimeLimit(0);
@@ -862,16 +850,13 @@
*/
public AddOperation processAdd(AddChangeRecordEntry addRecord)
{
- LinkedHashMap<ObjectClass,String> objectClasses =
- new LinkedHashMap<ObjectClass,String>();
- LinkedHashMap<AttributeType,List<Attribute>> userAttrs =
- new LinkedHashMap<AttributeType,List<Attribute>>();
- LinkedHashMap<AttributeType,List<Attribute>> opAttrs =
- new LinkedHashMap<AttributeType,List<Attribute>>();
+ LinkedHashMap<ObjectClass,String> objectClasses = new LinkedHashMap<>();
+ LinkedHashMap<AttributeType,List<Attribute>> userAttrs = new LinkedHashMap<>();
+ LinkedHashMap<AttributeType,List<Attribute>> opAttrs = new LinkedHashMap<>();
Entry e = new Entry(addRecord.getDN(), objectClasses, userAttrs, opAttrs);
- ArrayList<ByteString> duplicateValues = new ArrayList<ByteString>();
+ ArrayList<ByteString> duplicateValues = new ArrayList<>();
for (Attribute a : addRecord.getAttributes())
{
if (a.getAttributeType().isObjectClass())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalConnectionHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalConnectionHandler.java
index a9f9392..377cc06 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalConnectionHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalConnectionHandler.java
@@ -85,8 +85,8 @@
// method will always be called for this method, we'll do the
// necessary "initialization" here.
protocol = "internal";
- connectionList = new LinkedList<ClientConnection>();
- listeners = new LinkedList<HostPort>();
+ connectionList = new LinkedList<>();
+ listeners = new LinkedList<>();
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPInputStream.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPInputStream.java
index f1aa21a..307afab 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPInputStream.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalLDAPInputStream.java
@@ -87,7 +87,7 @@
public InternalLDAPInputStream(InternalLDAPSocket socket)
{
this.socket = socket;
- this.messageQueue = new ArrayBlockingQueue<LDAPMessage>(10);
+ this.messageQueue = new ArrayBlockingQueue<>(10);
this.messageBuffer = new ByteStringBuilder();
this.messageReader = messageBuffer.asReader();
this.writer = ASN1.getWriter(messageBuffer);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalSearchOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalSearchOperation.java
index fa75397..d92f83d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalSearchOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalSearchOperation.java
@@ -126,8 +126,8 @@
if (searchListener == null)
{
this.searchListener = null;
- this.entryList = new LinkedList<SearchResultEntry>();
- this.referenceList = new LinkedList<SearchResultReference>();
+ this.entryList = new LinkedList<>();
+ this.referenceList = new LinkedList<>();
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/SearchRequest.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/SearchRequest.java
index d74b1e2..17b279c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/SearchRequest.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/SearchRequest.java
@@ -47,7 +47,7 @@
/**
* Use a LinkedHashSet to return the attributes in the same order as requested by the user.
*/
- private final Set<String> attributes = new LinkedHashSet<String>();
+ private final Set<String> attributes = new LinkedHashSet<>();
private DereferenceAliasesPolicy dereferenceAliasesPolicy = DereferenceAliasesPolicy.NEVER;
private SearchFilter filter;
private DN name;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxClientConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxClientConnection.java
index 49e8626..30a2a28 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxClientConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxClientConnection.java
@@ -101,7 +101,7 @@
disconnect(DisconnectReason.ADMIN_LIMIT_EXCEEDED, true,
ERR_CONNHANDLER_REJECTED_BY_SERVER.get());
}
- operationList = new LinkedList<Operation>();
+ operationList = new LinkedList<>();
// Register the Jmx Notification listener (this)
jmxConnectionHandler.getRMIConnector().jmxRmiConnectorNoClientCertificate
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxConnectionHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxConnectionHandler.java
index abdfc8f..422e7b7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxConnectionHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxConnectionHandler.java
@@ -93,7 +93,7 @@
private String protocol;
/** The set of listeners for this connection handler. */
- private final List<HostPort> listeners = new LinkedList<HostPort>();
+ private final List<HostPort> listeners = new LinkedList<>();
/**
* Creates a new instance of this JMX connection handler. It must be
@@ -102,7 +102,7 @@
public JmxConnectionHandler() {
super("JMX Connection Handler Thread");
- this.connectionList = new CopyOnWriteArrayList<ClientConnection>();
+ this.connectionList = new CopyOnWriteArrayList<>();
}
@@ -304,7 +304,7 @@
// Configuration is ok.
currentConfig = config;
- final List<LocalizableMessage> reasons = new LinkedList<LocalizableMessage>();
+ final List<LocalizableMessage> reasons = new LinkedList<>();
if (!isPortConfigurationAcceptable(String.valueOf(config.dn()),
config.getListenPort(), reasons))
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiConnector.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiConnector.java
index 6209a40..c94736c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiConnector.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiConnector.java
@@ -261,7 +261,7 @@
try
{
// Environment map
- HashMap<String, Object> env = new HashMap<String, Object>();
+ HashMap<String, Object> env = new HashMap<>();
// ---------------------
// init an ssl context
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddRequestProtocolOp.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddRequestProtocolOp.java
index 7b56625..6c0e62b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddRequestProtocolOp.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/AddRequestProtocolOp.java
@@ -67,7 +67,7 @@
public AddRequestProtocolOp(ByteString dn)
{
this.dn = dn;
- this.attributes = new ArrayList<RawAttribute>();
+ this.attributes = new ArrayList<>();
}
@@ -85,7 +85,7 @@
if (attributes == null)
{
- this.attributes = new ArrayList<RawAttribute>();
+ this.attributes = new ArrayList<>();
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java
index 1b3727c..d07e732 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPAttribute.java
@@ -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.protocols.ldap;
@@ -62,7 +62,7 @@
{
this.attributeType = attributeType;
- values = new ArrayList<ByteString>(0);
+ values = new ArrayList<>(0);
}
@@ -77,7 +77,7 @@
{
this.attributeType = attributeType;
- values = new ArrayList<ByteString>(1);
+ values = new ArrayList<>(1);
values.add(ByteString.valueOf(value));
}
@@ -93,7 +93,7 @@
{
this.attributeType = attributeType;
- values = new ArrayList<ByteString>(1);
+ values = new ArrayList<>(1);
values.add(value);
}
@@ -111,11 +111,11 @@
if (values == null)
{
- this.values = new ArrayList<ByteString>(0);
+ this.values = new ArrayList<>(0);
}
else
{
- this.values = new ArrayList<ByteString>(values.size());
+ this.values = new ArrayList<>(values.size());
for (String value : values)
{
this.values.add(ByteString.valueOf(value));
@@ -137,7 +137,7 @@
if (values == null)
{
- this.values = new ArrayList<ByteString>(0);
+ this.values = new ArrayList<>(0);
}
else
{
@@ -158,16 +158,16 @@
if (attribute.isVirtual())
{
- values = new ArrayList<ByteString>();
+ values = new ArrayList<>();
}
else if (attribute.isEmpty())
{
- values = new ArrayList<ByteString>(0);
+ values = new ArrayList<>(0);
return;
}
else
{
- values = new ArrayList<ByteString>(attribute.size());
+ values = new ArrayList<>(attribute.size());
}
for (ByteString v : attribute)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java
index 8156f8a..622dfb2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java
@@ -472,11 +472,11 @@
nextOperationID = new AtomicLong(0);
connectionValid = true;
disconnectRequested = false;
- operationsInProgress = new ConcurrentHashMap<Integer, Operation>();
+ operationsInProgress = new ConcurrentHashMap<>();
operationsPerformed = new AtomicLong(0);
keepStats = connectionHandler.keepStats();
this.protocol = protocol;
- writeSelector = new AtomicReference<Selector>();
+ writeSelector = new AtomicReference<>();
final Socket socket = clientChannel.socket();
clientAddress = socket.getInetAddress().getHostAddress();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
index b011204..3c64ba8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -434,7 +434,7 @@
@Override
public Map<String, String> getAlerts()
{
- Map<String, String> alerts = new LinkedHashMap<String, String>();
+ Map<String, String> alerts = new LinkedHashMap<>();
alerts.put(ALERT_TYPE_LDAP_CONNECTION_HANDLER_CONSECUTIVE_FAILURES,
ALERT_DESCRIPTION_LDAP_CONNECTION_HANDLER_CONSECUTIVE_FAILURES);
@@ -471,7 +471,7 @@
@Override
public Collection<ClientConnection> getClientConnections()
{
- List<ClientConnection> connectionList = new LinkedList<ClientConnection>();
+ List<ClientConnection> connectionList = new LinkedList<>();
for (LDAPRequestHandler requestHandler : requestHandlers)
{
connectionList.addAll(requestHandler.getClientConnections());
@@ -692,7 +692,7 @@
// Construct a unique name for this connection handler, and put
// together the set of listeners.
- listeners = new LinkedList<HostPort>();
+ listeners = new LinkedList<>();
StringBuilder nameBuffer = new StringBuilder();
nameBuffer.append(friendlyName);
for (InetAddress a : listenAddresses)
@@ -726,8 +726,8 @@
.newSingleThreadScheduledExecutor(new DirectoryThread.Factory(
"LDAP Connection Finalizer for connection handler " + toString()));
- connectionFinalizerActiveJobQueue = new ArrayList<Runnable>();
- connectionFinalizerPendingJobQueue = new ArrayList<Runnable>();
+ connectionFinalizerActiveJobQueue = new ArrayList<>();
+ connectionFinalizerPendingJobQueue = new ArrayList<>();
connectionFinalizer.scheduleWithFixedDelay(
new ConnectionFinalizerRunnable(), 100, 100, TimeUnit.MILLISECONDS);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
index d744703..0c1756b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
@@ -145,7 +145,7 @@
case AND:
case OR:
Collection<SearchFilter> comps = filter.getFilterComponents();
- filterComponents = new ArrayList<RawFilter>(comps.size());
+ filterComponents = new ArrayList<>(comps.size());
for (SearchFilter f : comps)
{
filterComponents.add(new LDAPFilter(f));
@@ -217,7 +217,7 @@
}
else
{
- subAnyElements = new ArrayList<ByteString>(subAnyStrings);
+ subAnyElements = new ArrayList<>(subAnyStrings);
}
filterComponents = null;
@@ -752,7 +752,7 @@
throws LDAPException
{
// Create a list to hold the returned components.
- ArrayList<RawFilter> filterComponents = new ArrayList<RawFilter>();
+ ArrayList<RawFilter> filterComponents = new ArrayList<>();
// If the end pos is equal to the start pos, then there are no components.
@@ -888,7 +888,7 @@
// see if there are any escaped values, since they will need special
// treatment.
boolean hasEscape = false;
- LinkedList<Integer> asteriskPositions = new LinkedList<Integer>();
+ LinkedList<Integer> asteriskPositions = new LinkedList<>();
for (int i=0; i < valueBytes.length; i++)
{
if (valueBytes[i] == 0x2A) // The asterisk.
@@ -1078,7 +1078,7 @@
// Next, process through the rest of the asterisks to get the subAny values.
- ArrayList<ByteString> subAny = new ArrayList<ByteString>();
+ ArrayList<ByteString> subAny = new ArrayList<>();
for (int asteriskPos : asteriskPositions)
{
int length = asteriskPos - firstPos - 1;
@@ -1875,7 +1875,7 @@
}
else
{
- subComps = new ArrayList<SearchFilter>(filterComponents.size());
+ subComps = new ArrayList<>(filterComponents.size());
for (RawFilter f : filterComponents)
{
subComps.add(f.toSearchFilter());
@@ -1913,7 +1913,7 @@
attrType = DirectoryServer.getDefaultAttributeType(baseName);
}
- options = new HashSet<String>();
+ options = new HashSet<>();
StringTokenizer tokenizer =
new StringTokenizer(attributeType.substring(semicolonPos+1), ";");
while (tokenizer.hasMoreTokens())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPMessage.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPMessage.java
index 18b52b6..72c5c87 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPMessage.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPMessage.java
@@ -511,7 +511,7 @@
// This method is not thread-safe.
if (controls == null)
{
- controls = new ArrayList<Control>(0);
+ controls = new ArrayList<>(0);
}
return controls;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPReader.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPReader.java
index f8faf3f..00330f4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPReader.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPReader.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.protocols.ldap;
@@ -339,7 +339,7 @@
try
{
reader.readStartSequence();
- attributes = new ArrayList<RawAttribute>();
+ attributes = new ArrayList<>();
while(reader.hasNextElement())
{
attributes.add(LDAPAttribute.decode(reader));
@@ -456,7 +456,7 @@
if (reader.hasNextElement())
{
reader.readStartSequence();
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
while(reader.hasNextElement())
{
@@ -709,7 +709,7 @@
try
{
reader.readStartSequence();
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
// Should have at least 1.
do
@@ -958,7 +958,7 @@
if (reader.hasNextElement())
{
reader.readStartSequence();
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
while(reader.hasNextElement())
{
@@ -1103,7 +1103,7 @@
if (reader.hasNextElement())
{
reader.readStartSequence();
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
while(reader.hasNextElement())
{
@@ -1303,7 +1303,7 @@
try
{
reader.readStartSequence();
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
while(reader.hasNextElement())
{
@@ -1652,7 +1652,7 @@
if (reader.hasNextElement())
{
reader.readStartSequence();
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
while(reader.hasNextElement())
{
@@ -1731,7 +1731,7 @@
try
{
reader.readStartSequence();
- modifications = new ArrayList<RawModification>();
+ modifications = new ArrayList<>();
while(reader.hasNextElement())
{
modifications.add(LDAPModification.decode(reader));
@@ -1849,7 +1849,7 @@
if (reader.hasNextElement())
{
reader.readStartSequence();
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
while(reader.hasNextElement())
{
@@ -2050,7 +2050,7 @@
try
{
reader.readStartSequence();
- attributes = new LinkedHashSet<String>();
+ attributes = new LinkedHashSet<>();
while(reader.hasNextElement())
{
attributes.add(reader.readOctetStringAsString());
@@ -2169,7 +2169,7 @@
if (reader.hasNextElement())
{
reader.readStartSequence();
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
while(reader.hasNextElement())
{
@@ -2250,7 +2250,7 @@
try
{
reader.readStartSequence();
- attributes = new LinkedList<LDAPAttribute>();
+ attributes = new LinkedList<>();
while(reader.hasNextElement())
{
attributes.add(LDAPAttribute.decode(reader));
@@ -2310,7 +2310,7 @@
}
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
try
{
// Should have atleast 1 URL.
@@ -2387,8 +2387,7 @@
try
{
reader.readStartSequence();
- ArrayList<Control> controls =
- new ArrayList<Control>();
+ ArrayList<Control> controls = new ArrayList<>();
while(reader.hasNextElement())
{
controls.add(readControl(reader));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPRequestHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPRequestHandler.java
index 7989128..9e0ac57 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPRequestHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPRequestHandler.java
@@ -76,15 +76,13 @@
* need to be registered with the selector.
* TODO: revisit, see Issue 4202.
*/
- private List<LDAPClientConnection> pendingConnections =
- new LinkedList<LDAPClientConnection>();
+ private List<LDAPClientConnection> pendingConnections = new LinkedList<>();
/** Lock object for synchronizing access to the pending connections queue. */
private final Object pendingConnectionsLock = new Object();
/** The list of connections ready for request processing. */
- private LinkedList<LDAPClientConnection> readyConnections =
- new LinkedList<LDAPClientConnection>();
+ private LinkedList<LDAPClientConnection> readyConnections = new LinkedList<>();
/** The selector that will be used to monitor the client connections. */
private final Selector selector;
@@ -100,10 +98,9 @@
*
* @param connectionHandler The LDAP connection handler with which this
* request handler is associated.
- * @param requestHandlerID The integer value that may be used to distingush
+ * @param requestHandlerID The integer value that may be used to distinguish
* this request handler from others associated with
* the same connection handler.
- *
* @throws InitializationException If a problem occurs while initializing
* this request handler.
*/
@@ -226,7 +223,7 @@
if (!pendingConnections.isEmpty())
{
tmp = pendingConnections;
- pendingConnections = new LinkedList<LDAPClientConnection>();
+ pendingConnections = new LinkedList<>();
}
}
@@ -471,8 +468,7 @@
*/
public Collection<LDAPClientConnection> getClientConnections()
{
- ArrayList<LDAPClientConnection> connList =
- new ArrayList<LDAPClientConnection>(keys.length);
+ ArrayList<LDAPClientConnection> connList = new ArrayList<>(keys.length);
for (SelectionKey key : keys)
{
LDAPClientConnection c = (LDAPClientConnection) key.attachment();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPStatistics.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPStatistics.java
index 49568ac..b57e9af 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPStatistics.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPStatistics.java
@@ -190,7 +190,7 @@
@Override
public List<Attribute> getMonitorData()
{
- List<Attribute> attrs = new ArrayList<Attribute>();
+ List<Attribute> attrs = new ArrayList<>();
long tmpAbandonRequests = abandonRequests.get();
long tmpAddRequests = addRequests.get();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java
index d45b63d..a98db6e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java
@@ -66,7 +66,7 @@
public ModifyRequestProtocolOp(ByteString dn)
{
this.dn = dn;
- this.modifications = new ArrayList<RawModification>();
+ this.modifications = new ArrayList<>();
}
@@ -85,7 +85,7 @@
if (modifications == null)
{
- this.modifications = new ArrayList<RawModification>();
+ this.modifications = new ArrayList<>();
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java
index a963d7e..f146611 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java
@@ -104,7 +104,7 @@
if (attributes == null)
{
- this.attributes = new LinkedHashSet<String>(0);
+ this.attributes = new LinkedHashSet<>(0);
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java
index d4ef065..064c2c2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java
@@ -166,7 +166,7 @@
LinkedList<LDAPAttribute> tmp = attributes;
if (tmp == null)
{
- tmp = new LinkedList<LDAPAttribute>();
+ tmp = new LinkedList<>();
if (entry != null)
{
if (ldapVersion == 2)
@@ -542,12 +542,9 @@
return entry;
}
- HashMap<ObjectClass,String> objectClasses =
- new HashMap<ObjectClass,String>();
- HashMap<AttributeType,List<Attribute>> userAttributes =
- new HashMap<AttributeType,List<Attribute>>();
- HashMap<AttributeType,List<Attribute>> operationalAttributes =
- new HashMap<AttributeType,List<Attribute>>();
+ HashMap<ObjectClass,String> objectClasses = new HashMap<>();
+ HashMap<AttributeType,List<Attribute>> userAttributes = new HashMap<>();
+ HashMap<AttributeType,List<Attribute>> operationalAttributes = new HashMap<>();
for (LDAPAttribute a : getAttributes())
@@ -575,7 +572,7 @@
List<Attribute> attrs = operationalAttributes.get(attrType);
if (attrs == null)
{
- attrs = new ArrayList<Attribute>(1);
+ attrs = new ArrayList<>(1);
attrs.add(attr);
operationalAttributes.put(attrType, attrs);
}
@@ -589,7 +586,7 @@
List<Attribute> attrs = userAttributes.get(attrType);
if (attrs == null)
{
- attrs = new ArrayList<Attribute>(1);
+ attrs = new ArrayList<>(1);
attrs.add(attr);
userAttributes.put(attrType, attrs);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java
index 8cf6fe9..b6fdba7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java
@@ -66,7 +66,7 @@
{
if (referralURLs == null)
{
- this.referralURLs = new ArrayList<String>();
+ this.referralURLs = new ArrayList<>();
}
else
{
@@ -88,7 +88,7 @@
referralURLs = searchReference.getReferralURLs();
if (referralURLs == null)
{
- referralURLs = new ArrayList<String>();
+ referralURLs = new ArrayList<>();
}
}
@@ -98,8 +98,7 @@
* Retrieves the set of referral URLs for this search result reference
* protocol op. The returned list may be altered by the caller.
*
- * @return The set of referral URLs for this search result reference protocol
- * op.
+ * @return The set of referral URLs for this search result reference protocol op.
*/
public List<String> getReferralURLs()
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java
index 1271271..9491a87 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java
@@ -64,7 +64,7 @@
*/
public MultiDomainServerState()
{
- list = new ConcurrentSkipListMap<DN, ServerState>();
+ list = new ConcurrentSkipListMap<>();
}
/**
@@ -74,8 +74,7 @@
*/
public MultiDomainServerState(String mdss) throws DirectoryException
{
- list = new ConcurrentSkipListMap<DN, ServerState>(
- splitGenStateToServerStates(mdss));
+ list = new ConcurrentSkipListMap<>(splitGenStateToServerStates(mdss));
}
/**
@@ -178,7 +177,7 @@
{
return Collections.emptyMap();
}
- final Map<DN, List<CSN>> map = new HashMap<DN, List<CSN>>();
+ final Map<DN, List<CSN>> map = new HashMap<>();
for (Entry<DN, ServerState> entry : list.entrySet())
{
final List<CSN> l = entry.getValue().getSnapshot();
@@ -383,7 +382,7 @@
private static Map<DN, ServerState> splitGenStateToServerStates(
String multiDomainServerState) throws DirectoryException
{
- Map<DN, ServerState> startStates = new TreeMap<DN, ServerState>();
+ Map<DN, ServerState> startStates = new TreeMap<>();
if (multiDomainServerState != null && multiDomainServerState.length() > 0)
{
try
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java
index 0d41166..51536bd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java
@@ -46,8 +46,7 @@
{
/** Associates a serverId with a CSN. */
- private final ConcurrentMap<Integer, CSN> serverIdToCSN =
- new ConcurrentSkipListMap<Integer, CSN>();
+ private final ConcurrentMap<Integer, CSN> serverIdToCSN = new ConcurrentSkipListMap<>();
/**
* Whether the state has been saved to persistent storage. It starts at true,
* and moves to false when an update is made to the current object.
@@ -193,7 +192,7 @@
*/
public Set<String> toStringSet()
{
- final Set<String> result = new HashSet<String>();
+ final Set<String> result = new HashSet<>();
for (CSN change : serverIdToCSN.values())
{
Date date = new Date(change.getTime());
@@ -210,7 +209,7 @@
*/
public ArrayList<ByteString> toASN1ArrayList()
{
- final ArrayList<ByteString> values = new ArrayList<ByteString>(0);
+ final ArrayList<ByteString> values = new ArrayList<>(0);
for (CSN csn : serverIdToCSN.values())
{
values.add(ByteString.valueOf(csn.toString()));
@@ -296,7 +295,7 @@
{
// copy to protect from concurrent updates
// that could change the number of elements in the Map
- return new HashMap<Integer, CSN>(serverIdToCSN);
+ return new HashMap<>(serverIdToCSN);
}
/** {@inheritDoc} */
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java
index 14164ad..5e9eaa9 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalMultiple.java
@@ -60,8 +60,7 @@
* LinkedHashMap</li>
* </ol>
*/
- private final Map<AttrValueHistorical, AttrValueHistorical> valuesHist =
- new LinkedHashMap<AttrValueHistorical, AttrValueHistorical>();
+ private final Map<AttrValueHistorical, AttrValueHistorical> valuesHist = new LinkedHashMap<>();
/**
* Create a new object from the provided information.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalWithOptions.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalWithOptions.java
index 7032757..e213c00 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalWithOptions.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalWithOptions.java
@@ -36,12 +36,11 @@
*/
public class AttrHistoricalWithOptions
{
- private HashMap<Set<String>, AttrHistorical> attributesInfo;
+ private final HashMap<Set<String>, AttrHistorical> attributesInfo = new HashMap<>();
/** Creates a new AttrInfoWithOptions. */
public AttrHistoricalWithOptions()
{
- attributesInfo = new HashMap<Set<String> ,AttrHistorical>();
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
index f1153d4..53af3b0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
@@ -154,8 +154,7 @@
* Contains Historical information for each attribute sorted by attribute
* type. key:AttributeType value:AttrInfoWithOptions
*/
- private HashMap<AttributeType,AttrHistoricalWithOptions> attributesHistorical
- = new HashMap<AttributeType,AttrHistoricalWithOptions>();
+ private final HashMap<AttributeType,AttrHistoricalWithOptions> attributesHistorical = new HashMap<>();
/** {@inheritDoc} */
@Override
@@ -324,7 +323,7 @@
Attribute attr = Attributes.create(historicalAttrType, attrValue);
// Set the created attribute to the operation
- List<Attribute> attrList = new LinkedList<Attribute>();
+ List<Attribute> attrList = new LinkedList<>();
attrList.add(attr);
addOperation.setAttribute(historicalAttrType, attrList);
}
@@ -629,7 +628,7 @@
public static EntryHistorical newInstanceFromEntry(Entry entry)
{
AttributeType lastAttrType = null;
- Set<String> lastOptions = new HashSet<String>();
+ Set<String> lastOptions = new HashSet<>();
AttrHistorical attrInfo = null;
AttrHistoricalWithOptions attrInfoWithOptions = null;
@@ -750,8 +749,7 @@
*/
public static Iterable<FakeOperation> generateFakeOperations(Entry entry)
{
- TreeMap<CSN, FakeOperation> operations =
- new TreeMap<CSN, FakeOperation>();
+ TreeMap<CSN, FakeOperation> operations = new TreeMap<>();
List<Attribute> attrs = getHistoricalAttr(entry);
if (attrs != null)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FakeModifyOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FakeModifyOperation.java
index 8ca1e73..a0951c6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FakeModifyOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FakeModifyOperation.java
@@ -44,7 +44,7 @@
*/
public class FakeModifyOperation extends FakeOperation
{
- private List<Modification> mods = new ArrayList<Modification>();
+ private List<Modification> mods = new ArrayList<>();
private DN dn;
private String entryuuid;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FractionalLDIFImportPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FractionalLDIFImportPlugin.java
index 22c39e2..73f246e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FractionalLDIFImportPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/FractionalLDIFImportPlugin.java
@@ -70,8 +70,7 @@
* session. This allows to potentially run man imports at the same time.
*/
private final Map<LDIFImportConfig, ImportFractionalContext>
- importSessionContexts = new Hashtable<LDIFImportConfig,
- ImportFractionalContext>();
+ importSessionContexts = new Hashtable<>();
/**
* Holds an import session fractional context.
@@ -460,7 +459,7 @@
// Now flush attribute values into entry
if (somethingToFlush)
{
- List<ByteString> duplicateValues = new ArrayList<ByteString>();
+ List<ByteString> duplicateValues = new ArrayList<>();
entry.addAttribute(attrBuilder.toAttribute(), duplicateValues);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
index 090b3fb..0655b93 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
@@ -93,7 +93,7 @@
{
String[] token = strVal.split(":", 4);
- options = new LinkedHashSet<String>();
+ options = new LinkedHashSet<>();
if (token[0].contains(";"))
{
String[] optionsToken = token[0].split(";");
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
index a99f881..6e7a86c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -116,8 +116,7 @@
* replication related operational attributes when used in a search operation.
*/
private static final Set<String> USER_AND_REPL_OPERATIONAL_ATTRS =
- new HashSet<String>(Arrays.asList(
- HISTORICAL_ATTRIBUTE_NAME, ENTRYUUID_ATTRIBUTE_NAME, "*"));
+ new HashSet<>(Arrays.asList(HISTORICAL_ATTRIBUTE_NAME, ENTRYUUID_ATTRIBUTE_NAME, "*"));
/**
* This class is used in the session establishment phase
@@ -210,8 +209,7 @@
* is not updated too early.
*/
private final PendingChanges pendingChanges;
- private final AtomicReference<RSUpdater> rsUpdater =
- new AtomicReference<RSUpdater>(null);
+ private final AtomicReference<RSUpdater> rsUpdater = new AtomicReference<>(null);
/**
* It contain the updates that were done on other servers, transmitted by the
@@ -233,8 +231,7 @@
* This list is used to temporary store operations that needs to be replayed
* at session establishment time.
*/
- private final SortedMap<CSN, FakeOperation> replayOperations =
- new TreeMap<CSN, FakeOperation>();
+ private final SortedMap<CSN, FakeOperation> replayOperations = new TreeMap<>();
private ExternalChangelogDomain eclDomain;
@@ -738,9 +735,8 @@
* attributes values
*/
- Map<String, Set<String>> storedFractionalSpecificClassesAttributes =
- new HashMap<String, Set<String>>();
- Set<String> storedFractionalAllClassesAttributes = new HashSet<String>();
+ Map<String, Set<String>> storedFractionalSpecificClassesAttributes = new HashMap<>();
+ Set<String> storedFractionalAllClassesAttributes = new HashSet<>();
int storedFractionalMode;
try
@@ -1175,8 +1171,8 @@
* - include mode : remove any attribute that is not in
* fractionalConcernedAttributes
*/
- List<List<Attribute>> newRdnAttrLists = new ArrayList<List<Attribute>>();
- List<AttributeType> rdnAttrTypes = new ArrayList<AttributeType>();
+ List<List<Attribute>> newRdnAttrLists = new ArrayList<>();
+ List<AttributeType> rdnAttrTypes = new ArrayList<>();
final Set<AttributeType> attrTypes = attributesMap.keySet();
for (Iterator<AttributeType> iter = attrTypes.iterator(); iter.hasNext();)
{
@@ -1268,14 +1264,14 @@
private static <T> ArrayList<T> newList(T elem)
{
- final ArrayList<T> list = new ArrayList<T>(1);
+ final ArrayList<T> list = new ArrayList<>(1);
list.add(elem);
return list;
}
private static <T> Set<T> newSet(T elem)
{
- final Set<T> list = new LinkedHashSet<T>(1);
+ final Set<T> list = new LinkedHashSet<>(1);
list.add(elem);
return list;
}
@@ -1348,7 +1344,7 @@
* Using a Set to avoid duplicate attributes (from 2 inheriting classes for
* instance)
*/
- Set<String> fractionalConcernedAttributes = new HashSet<String>();
+ Set<String> fractionalConcernedAttributes = new HashSet<>();
// Get object classes the entry matches
Set<String> fractionalAllClassesAttributes =
@@ -3210,7 +3206,7 @@
newList(ByteString.valueOf(Long.toString(generationId)));
LDAPAttribute attr = new LDAPAttribute(REPLICATION_GENERATION_ID, values);
- List<RawModification> mods = new ArrayList<RawModification>(1);
+ List<RawModification> mods = new ArrayList<>(1);
mods.add(new LDAPModification(ModificationType.REPLACE, attr));
ModifyOperation op = new ModifyOperationBasis(
@@ -3450,7 +3446,7 @@
{
String includeAttributeStrings[] =
{"objectclass", "sn", "cn", "entryuuid"};
- Set<AttributeType> includeAttributes = new HashSet<AttributeType>();
+ Set<AttributeType> includeAttributes = new HashSet<>();
for (String attrName : includeAttributeStrings)
{
AttributeType attrType = DirectoryServer.getAttributeType(attrName);
@@ -3856,7 +3852,7 @@
@Override
public Map<String, String> getAlerts()
{
- Map<String, String> alerts = new LinkedHashMap<String, String>();
+ Map<String, String> alerts = new LinkedHashMap<>();
alerts.put(ALERT_TYPE_REPLICATION_UNRESOLVED_CONFLICT,
ALERT_DESCRIPTION_REPLICATION_UNRESOLVED_CONFLICT);
@@ -4102,7 +4098,7 @@
// Publish and remove all the changes from the replayOperations list
// that are older than the endCSN.
- final List<FakeOperation> opsToSend = new LinkedList<FakeOperation>();
+ final List<FakeOperation> opsToSend = new LinkedList<>();
synchronized (replayOperations)
{
Iterator<FakeOperation> itOp = replayOperations.values().iterator();
@@ -4324,7 +4320,7 @@
@Override
public Collection<Attribute> getAdditionalMonitoring()
{
- List<Attribute> attributes = new ArrayList<Attribute>();
+ List<Attribute> attributes = new ArrayList<>();
// number of updates in the pending list
addMonitorData(attributes, "pending-updates", pendingChanges.size());
@@ -4435,7 +4431,7 @@
else if (names.size() == 1 && names.contains("*"))
{
// Potential fast-path for delete operations.
- List<Attribute> attributes = new LinkedList<Attribute>();
+ List<Attribute> attributes = new LinkedList<>();
for (List<Attribute> attributeList : entry.getUserAttributes().values())
{
attributes.addAll(attributeList);
@@ -4466,7 +4462,7 @@
return names;
}
- final Set<String> expandedNames = new HashSet<String>(names.size());
+ final Set<String> expandedNames = new HashSet<>(names.size());
for (String name : names)
{
if (name.startsWith("@"))
@@ -4545,21 +4541,17 @@
private boolean fractionalExclusive = true;
/**
- * Used in fractional replication: holds attributes of a specific object
- * class.
+ * Used in fractional replication: holds attributes of a specific object class.
* - key = object class (name or OID of the class)
* - value = the attributes of that class that should be taken into account
* (inclusive or exclusive fractional replication) (name or OID of the
* attribute)
* When an operation coming from the network is to be locally replayed, if
* the concerned entry has an objectClass attribute equals to 'key':
- * - inclusive mode: only the attributes in 'value' will be added/deleted/
- * modified
- * - exclusive mode: the attributes in 'value' will not be added/deleted/
- * modified
+ * - inclusive mode: only the attributes in 'value' will be added/deleted/modified
+ * - exclusive mode: the attributes in 'value' will not be added/deleted/modified
*/
- private Map<String, Set<String>> fractionalSpecificClassesAttributes =
- new HashMap<String, Set<String>>();
+ private Map<String, Set<String>> fractionalSpecificClassesAttributes = new HashMap<>();
/**
* Used in fractional replication: holds attributes of any object class.
@@ -4570,11 +4562,9 @@
* fractionalAllClassesAttributes will not be added/deleted/modified
* The attributes may be in human readable form of OID form.
*/
- private Set<String> fractionalAllClassesAttributes = new HashSet<String>();
+ private Set<String> fractionalAllClassesAttributes = new HashSet<>();
- /**
- * Base DN the fractional configuration is for.
- */
+ /** Base DN the fractional configuration is for. */
private final DN baseDN;
/**
@@ -4687,9 +4677,8 @@
Iterator<String> inclIt = configuration.getFractionalInclude().iterator();
// Get potentially new fractional configuration
- Map<String, Set<String>> newFractionalSpecificClassesAttributes =
- new HashMap<String, Set<String>>();
- Set<String> newFractionalAllClassesAttributes = new HashSet<String>();
+ Map<String, Set<String>> newFractionalSpecificClassesAttributes = new HashMap<>();
+ Set<String> newFractionalAllClassesAttributes = new HashSet<>();
int newFractionalMode = parseFractionalConfig(exclIt, inclIt,
newFractionalSpecificClassesAttributes,
@@ -4798,7 +4787,7 @@
fractionalSpecificClassesAttributes.get(classNameLower);
if (attrList == null)
{
- attrList = new LinkedHashSet<String>();
+ attrList = new LinkedHashSet<>();
fractionalSpecificClassesAttributes.put(classNameLower, attrList);
}
attrList.add(attrNameLower);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/MultimasterReplication.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/MultimasterReplication.java
index 81d5c9a..a0b66d6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/MultimasterReplication.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/MultimasterReplication.java
@@ -103,42 +103,24 @@
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
private ReplicationServerListener replicationServerListener;
- private static final Map<DN, LDAPReplicationDomain> domains =
- new ConcurrentHashMap<DN, LDAPReplicationDomain>(4);
+ private static final Map<DN, LDAPReplicationDomain> domains = new ConcurrentHashMap<>(4);
private static final DSRSShutdownSync dsrsShutdownSync = new DSRSShutdownSync();
-
- /**
- * The queue of received update messages, to be treated by the ReplayThread
- * threads.
- */
- private static final BlockingQueue<UpdateToReplay> updateToReplayQueue =
- new LinkedBlockingQueue<UpdateToReplay>(10000);
-
- /**
- * The list of ReplayThread threads.
- */
- private static final List<ReplayThread> replayThreads =
- new ArrayList<ReplayThread>();
-
- /**
- * The configurable number of replay threads.
- */
+ /** The queue of received update messages, to be treated by the ReplayThread threads. */
+ private static final BlockingQueue<UpdateToReplay> updateToReplayQueue = new LinkedBlockingQueue<>(10000);
+ /** The list of ReplayThread threads. */
+ private static final List<ReplayThread> replayThreads = new ArrayList<>();
+ /** The configurable number of replay threads. */
private static int replayThreadNumber = 10;
- /**
- * Enum that symbolizes the state of the multimaster replication.
- */
+ /** Enum that symbolizes the state of the multimaster replication. */
private static enum State
{
STARTING, RUNNING, STOPPING
}
- private static final AtomicReference<State> state =
- new AtomicReference<State>(State.STARTING);
+ private static final AtomicReference<State> state = new AtomicReference<>(State.STARTING);
- /**
- * The configurable connection/handshake timeout.
- */
+ /** The configurable connection/handshake timeout. */
private static volatile int connectionTimeoutMS = 5000;
/**
@@ -857,7 +839,7 @@
*/
public static Set<DN> getExcludedChangelogDomains() throws DirectoryException
{
- final Set<DN> disabledBaseDNs = new HashSet<DN>(domains.size() + 1);
+ final Set<DN> disabledBaseDNs = new HashSet<>(domains.size() + 1);
disabledBaseDNs.add(DN.valueOf(DN_EXTERNAL_CHANGELOG_ROOT));
for (LDAPReplicationDomain domain : domains.values())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PendingChanges.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PendingChanges.java
index f0587c9..1fe60f7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PendingChanges.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PendingChanges.java
@@ -51,8 +51,7 @@
class PendingChanges
{
/** A map used to store the pending changes. */
- private final TreeMap<CSN, PendingChange> pendingChanges =
- new TreeMap<CSN, PendingChange>();
+ private final TreeMap<CSN, PendingChange> pendingChanges = new TreeMap<>();
/**
* The {@link CSNGenerator} to use to create new unique CSNs
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/RemotePendingChanges.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/RemotePendingChanges.java
index 8252018..27da159 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/RemotePendingChanges.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/RemotePendingChanges.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2007-2009 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS.
+ * Portions Copyright 2013-2015 ForgeRock AS.
*/
package org.opends.server.replication.plugin;
@@ -50,23 +50,17 @@
*/
final class RemotePendingChanges
{
- /**
- * A map used to store the pending changes.
- */
- private final SortedMap<CSN, PendingChange> pendingChanges =
- new TreeMap<CSN, PendingChange>();
+ /** A map used to store the pending changes. */
+ private final SortedMap<CSN, PendingChange> pendingChanges = new TreeMap<>();
/**
* A sorted set containing the list of PendingChanges that have
* not been replayed correctly because they are dependent on
* another change to be completed.
*/
- private final SortedSet<PendingChange> dependentChanges =
- new TreeSet<PendingChange>();
+ private final SortedSet<PendingChange> dependentChanges = new TreeSet<>();
- /**
- * The ServerState that will be updated when LDAPUpdateMsg are fully replayed.
- */
+ /** The ServerState that will be updated when LDAPUpdateMsg are fully replayed. */
private final ServerState state;
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AckMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AckMsg.java
index b18b3b1..67e3e53 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AckMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/AckMsg.java
@@ -82,7 +82,7 @@
* (corresponding to CSN). Each server id of the list had one of the 3
* possible errors (timeout/degraded or admin/replay error).
*/
- private List<Integer> failedServers = new ArrayList<Integer>();
+ private List<Integer> failedServers = new ArrayList<>();
/**
* Creates a new AckMsg from a CSN (no errors).
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/LDAPUpdateMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/LDAPUpdateMsg.java
index 6e5289a..52b5063 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/LDAPUpdateMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/LDAPUpdateMsg.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.protocol;
@@ -436,7 +436,7 @@
ArrayList<RawAttribute> decodeRawAttributes(byte[] in)
throws LDAPException, DecodeException
{
- ArrayList<RawAttribute> rattr = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> rattr = new ArrayList<>();
try
{
ByteSequenceReader reader =
@@ -465,7 +465,7 @@
ArrayList<Attribute> decodeAttributes(byte[] in)
throws LDAPException, DecodeException
{
- ArrayList<Attribute> lattr = new ArrayList<Attribute>();
+ ArrayList<Attribute> lattr = new ArrayList<>();
try
{
ByteSequenceReader reader =
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java
index 4504a58..e02cf04 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java
@@ -170,7 +170,7 @@
protected List<Modification> decodeMods(byte[] in) throws IOException,
LDAPException
{
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
ASN1Reader reader = ASN1.getReader(in);
while (reader.hasNextElement())
{
@@ -189,7 +189,7 @@
protected List<RawModification> decodeRawMods(byte[] in)
throws LDAPException, IOException
{
- List<RawModification> ldapmods = new ArrayList<RawModification>();
+ List<RawModification> ldapmods = new ArrayList<>();
ASN1Reader asn1Reader = ASN1.getReader(in);
while(asn1Reader.hasNextElement())
{
@@ -197,5 +197,4 @@
}
return ldapmods;
}
-
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java
index 9c73aa0..d296e35 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS.
+ * Portions Copyright 2013-2015 ForgeRock AS.
*/
package org.opends.server.replication.protocol;
@@ -79,11 +79,9 @@
/** This replication server DbState. */
private ServerState replServerDbState;
/** The data related to the LDAP servers connected to this RS. */
- private final Map<Integer, ServerData> ldapStates =
- new HashMap<Integer, ServerData>();
+ private final Map<Integer, ServerData> ldapStates = new HashMap<>();
/** The data related to the RS servers connected to this RS. */
- private final Map<Integer, ServerData> rsStates =
- new HashMap<Integer, ServerData>();
+ private final Map<Integer, ServerData> rsStates = new HashMap<>();
}
private final SubTopoMonitorData data = new SubTopoMonitorData();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/Session.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/Session.java
index bbbc7ed..6988e75 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/Session.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/Session.java
@@ -105,8 +105,7 @@
*/
private BufferedOutputStream output;
- private final LinkedBlockingQueue<byte[]> sendQueue =
- new LinkedBlockingQueue<byte[]>(4000);
+ private final LinkedBlockingQueue<byte[]> sendQueue = new LinkedBlockingQueue<>(4000);
private AtomicBoolean isRunning = new AtomicBoolean(false);
private final CountDownLatch latch = new CountDownLatch(1);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/StartSessionMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/StartSessionMsg.java
index 69b7497..45b6e37 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/StartSessionMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/StartSessionMsg.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -56,7 +56,7 @@
public class StartSessionMsg extends ReplicationMsg
{
/** The list of referrals URLs to the sending DS. */
- private final List<String> referralsURLs = new ArrayList<String>();
+ private final List<String> referralsURLs = new ArrayList<>();
/** The initial status the DS starts with. */
private ServerStatus status = ServerStatus.INVALID_STATUS;
/** Assured replication enabled on DS or not. */
@@ -66,8 +66,8 @@
/** DS safe data level (relevant if assured mode is safe data). */
private byte safeDataLevel = 1;
- private Set<String> eclIncludes = new HashSet<String>();
- private Set<String> eclIncludesForDeletes = new HashSet<String>();
+ private Set<String> eclIncludes = new HashSet<>();
+ private Set<String> eclIncludesForDeletes = new HashSet<>();
/**
* Creates a new StartSessionMsg message from its encoded form.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/TopologyMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/TopologyMsg.java
index 20ea943..8cfe004 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/TopologyMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/TopologyMsg.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2007-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -79,8 +79,7 @@
// Read the DS info entries, first read number of them
int nDsInfo = scanner.nextByte();
- final Map<Integer, DSInfo> replicaInfos =
- new HashMap<Integer, DSInfo>(Math.max(0, nDsInfo));
+ final Map<Integer, DSInfo> replicaInfos = new HashMap<>(Math.max(0, nDsInfo));
while (nDsInfo > 0 && !scanner.isEmpty())
{
final DSInfo dsInfo = nextDSInfo(scanner, version);
@@ -90,7 +89,7 @@
// Read the RS info entries
int nRsInfo = scanner.nextByte();
- final List<RSInfo> rsInfos = new ArrayList<RSInfo>(Math.max(0, nRsInfo));
+ final List<RSInfo> rsInfos = new ArrayList<>(Math.max(0, nRsInfo));
while (nRsInfo > 0 && !scanner.isEmpty())
{
rsInfos.add(nextRSInfo(scanner, version));
@@ -115,11 +114,11 @@
final byte safeDataLevel = scanner.nextByte();
final byte groupId = scanner.nextByte();
- final List<String> refUrls = new ArrayList<String>();
+ final List<String> refUrls = new ArrayList<>();
scanner.nextStrings(refUrls);
- final Set<String> attrs = new HashSet<String>();
- final Set<String> delattrs = new HashSet<String>();
+ final Set<String> attrs = new HashSet<>();
+ final Set<String> delattrs = new HashSet<>();
short protocolVersion = -1;
if (version >= REPLICATION_PROTOCOL_V4)
{
@@ -175,7 +174,7 @@
}
else
{
- Map<Integer, DSInfo> replicas = new HashMap<Integer, DSInfo>();
+ Map<Integer, DSInfo> replicas = new HashMap<>();
for (DSInfo dsInfo : dsInfos)
{
replicas.put(dsInfo.getDsId(), dsInfo);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ChangelogState.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ChangelogState.java
index 503851e..e7ec990 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ChangelogState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ChangelogState.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013-2014 ForgeRock AS
+ * Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.replication.server;
@@ -49,10 +49,8 @@
*/
public class ChangelogState
{
-
- private final ConcurrentSkipListMap<DN, Long> domainToGenerationId = new ConcurrentSkipListMap<DN, Long>();
- private final ConcurrentSkipListMap<DN, Set<Integer>> domainToServerIds =
- new ConcurrentSkipListMap<DN, Set<Integer>>();
+ private final ConcurrentSkipListMap<DN, Long> domainToGenerationId = new ConcurrentSkipListMap<>();
+ private final ConcurrentSkipListMap<DN, Set<Integer>> domainToServerIds = new ConcurrentSkipListMap<>();
private final MultiDomainServerState offlineReplicas = new MultiDomainServerState();
/**
@@ -81,7 +79,7 @@
Set<Integer> serverIds = domainToServerIds.get(baseDN);
if (serverIds == null)
{
- serverIds = new HashSet<Integer>();
+ serverIds = new HashSet<>();
final Set<Integer> existingServerIds =
domainToServerIds.putIfAbsent(baseDN, serverIds);
if (existingServerIds != null)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/DataServerHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/DataServerHandler.java
index dde5d99..f696b2a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/DataServerHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/DataServerHandler.java
@@ -60,15 +60,15 @@
private ServerStatus status = ServerStatus.INVALID_STATUS;
/** Referrals URLs this DS is exporting. */
- private List<String> refUrls = new ArrayList<String>();
+ private List<String> refUrls = new ArrayList<>();
/** Assured replication enabled on DS or not. */
private boolean assuredFlag;
/** DS assured mode (relevant if assured replication enabled). */
private AssuredMode assuredMode = AssuredMode.SAFE_DATA_MODE;
/** DS safe data level (relevant if assured mode is safe data). */
private byte safeDataLevel = -1;
- private Set<String> eclIncludes = new HashSet<String>();
- private Set<String> eclIncludesForDeletes = new HashSet<String>();
+ private Set<String> eclIncludes = new HashSet<>();
+ private Set<String> eclIncludesForDeletes = new HashSet<>();
/**
* Creates a new data server handler.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ExpectedAcksInfo.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ExpectedAcksInfo.java
index 8506ddd..6e7cb6c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ExpectedAcksInfo.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ExpectedAcksInfo.java
@@ -76,8 +76,7 @@
* value: a boolean true if we received the ack from the server,
* false otherwise.
*/
- protected Map<Integer,Boolean> expectedServersAckStatus =
- new HashMap<Integer,Boolean>();
+ protected Map<Integer,Boolean> expectedServersAckStatus = new HashMap<>();
/**
* Facility for monitoring:
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/LightweightServerHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/LightweightServerHandler.java
index 7ca0567..22687f6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/LightweightServerHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/LightweightServerHandler.java
@@ -164,7 +164,7 @@
@Override
public List<Attribute> getMonitorData()
{
- List<Attribute> attributes = new ArrayList<Attribute>();
+ List<Attribute> attributes = new ArrayList<>();
final int serverId = dsInfo.getDsId();
final ReplicationServerDomain domain = replServerHandler.getDomain();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/MsgQueue.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/MsgQueue.java
index d8dced4..42127db 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/MsgQueue.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/MsgQueue.java
@@ -44,7 +44,7 @@
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
- private TreeMap<CSN, UpdateMsg> map = new TreeMap<CSN, UpdateMsg>();
+ private TreeMap<CSN, UpdateMsg> map = new TreeMap<>();
/**
* FIXME JNR to be investigated:
* I strongly suspect that we could replace this field
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java
index 7d915cb..a6773ff 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java
@@ -72,7 +72,7 @@
* <p>
* Guarded by pendingMonitorLock.
*/
- private final Set<Integer> monitorDataLateServers = new HashSet<Integer>();
+ private final Set<Integer> monitorDataLateServers = new HashSet<>();
/** This lock serializes updates to the pending monitor data. */
private final Object pendingMonitorDataLock = new Object();
@@ -91,8 +91,7 @@
* <p>
* Guarded by pendingMonitorDataLock.
*/
- private final Set<Integer> pendingMonitorDataServerIDs =
- new HashSet<Integer>();
+ private final Set<Integer> pendingMonitorDataServerIDs = new HashSet<>();
/**
* This latch is non-null and is used in order to count incoming responses as
@@ -108,9 +107,7 @@
*/
private final long monitorDataLifeTime = 500;
- /**
- * The replication domain monitored by this class.
- */
+ /** The replication domain monitored by this class. */
private final ReplicationServerDomain domain;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java
index b986c5e..2b2617b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java
@@ -98,8 +98,7 @@
* This table is used to store the list of dn for which we are currently
* handling servers.
*/
- private final Map<DN, ReplicationServerDomain> baseDNs =
- new HashMap<DN, ReplicationServerDomain>();
+ private final Map<DN, ReplicationServerDomain> baseDNs = new HashMap<>();
/** The database storing the changes. */
private final ChangelogDB changelogDB;
@@ -120,8 +119,7 @@
* This is required for unit testing, so that we can keep track of all the
* replication servers which are running in the VM.
*/
- private static final Set<Integer> localPorts =
- new CopyOnWriteArraySet<Integer>();
+ private static final Set<Integer> localPorts = new CopyOnWriteArraySet<>();
/** Monitors for synchronizing domain creation with the connect thread. */
private final Object domainTicketLock = new Object();
@@ -132,8 +130,7 @@
* Holds the list of all replication servers instantiated in this VM.
* This allows to perform clean up of the RS databases in unit tests.
*/
- private static final List<ReplicationServer> allInstances =
- new ArrayList<ReplicationServer>();
+ private static final List<ReplicationServer> allInstances = new ArrayList<>();
/**
* Creates a new Replication server using the provided configuration entry.
@@ -199,7 +196,7 @@
private Set<HostPort> getConfiguredRSAddresses()
{
- final Set<HostPort> results = new HashSet<HostPort>();
+ final Set<HostPort> results = new HashSet<>();
for (String serverAddress : this.config.getReplicationServer())
{
results.add(HostPort.valueOf(serverAddress));
@@ -369,7 +366,7 @@
private Set<HostPort> getConnectedRSAddresses(ReplicationServerDomain domain)
{
- Set<HostPort> results = new HashSet<HostPort>();
+ Set<HostPort> results = new HashSet<>();
for (ReplicationServerHandler rsHandler : domain.getConnectedRSs().values())
{
results.add(HostPort.valueOf(rsHandler.getServerAddressURL()));
@@ -516,7 +513,7 @@
private List<VirtualAttributeRule> getVirtualAttributesRules() throws DirectoryException
{
- final List<VirtualAttributeRule> rules = new ArrayList<VirtualAttributeRule>();
+ final List<VirtualAttributeRule> rules = new ArrayList<>();
rules.add(buildVirtualAttributeRule("lastexternalchangelogcookie", new LastCookieVirtualProvider(this)));
rules.add(buildVirtualAttributeRule("firstchangenumber", new FirstChangeNumberVirtualAttributeProvider(this)));
rules.add(buildVirtualAttributeRule("lastchangenumber", new LastChangeNumberVirtualAttributeProvider(this)));
@@ -599,7 +596,7 @@
Set<DN> domains = null;
synchronized (baseDNs)
{
- domains = new HashSet<DN>(baseDNs.keySet());
+ domains = new HashSet<>(baseDNs.keySet());
}
domains.removeAll(excludedBaseDNs);
return domains;
@@ -631,7 +628,7 @@
private Set<DN> getDNsOfCookie(MultiDomainServerState cookie)
{
- final Set<DN> cookieDomains = new HashSet<DN>();
+ final Set<DN> cookieDomains = new HashSet<>();
for (final DN dn : cookie)
{
cookieDomains.add(dn);
@@ -641,7 +638,7 @@
private Set<DN> getDNsOfActiveDomainsInServer(final Set<DN> ignoredBaseDNs) throws DirectoryException
{
- final Set<DN> activeDomains = new HashSet<DN>();
+ final Set<DN> activeDomains = new HashSet<>();
for (final DN dn : getDomainDNs(ignoredBaseDNs))
{
final ServerState lastServerState = getReplicationServerDomain(dn).getLatestServerState();
@@ -658,7 +655,7 @@
{
if (!activeDomains.containsAll(cookieDomains))
{
- final Set<DN> unknownCookieDomains = new HashSet<DN>(cookieDomains);
+ final Set<DN> unknownCookieDomains = new HashSet<>(cookieDomains);
unknownCookieDomains.removeAll(activeDomains);
final StringBuilder currentStartingCookie = new StringBuilder();
for (DN domainDN : activeDomains) {
@@ -1118,7 +1115,7 @@
*/
private void disconnectRemovedReplicationServers(Set<HostPort> oldRSAddresses)
{
- final Collection<HostPort> serversToDisconnect = new ArrayList<HostPort>();
+ final Collection<HostPort> serversToDisconnect = new ArrayList<>();
final Set<HostPort> newRSAddresses = getConfiguredRSAddresses();
for (HostPort oldRSAddress : oldRSAddresses)
@@ -1321,7 +1318,7 @@
{
synchronized (baseDNs)
{
- return new ArrayList<ReplicationServerDomain>(baseDNs.values());
+ return new ArrayList<>(baseDNs.values());
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerDomain.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerDomain.java
index a3e392e..5474067 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerDomain.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerDomain.java
@@ -113,21 +113,16 @@
* topology. Using an AtomicReference to avoid leaking references to costly
* threads.
*/
- private final AtomicReference<MonitoringPublisher> monitoringPublisher =
- new AtomicReference<MonitoringPublisher>();
- /**
- * Maintains monitor data for the current domain.
- */
- private final ReplicationDomainMonitor domainMonitor =
- new ReplicationDomainMonitor(this);
+ private final AtomicReference<MonitoringPublisher> monitoringPublisher = new AtomicReference<>();
+ /** Maintains monitor data for the current domain. */
+ private final ReplicationDomainMonitor domainMonitor = new ReplicationDomainMonitor(this);
/**
* The following map contains one balanced tree for each replica ID to which
* we are currently publishing the first update in the balanced tree is the
* next change that we must push to this particular server.
*/
- private final Map<Integer, DataServerHandler> connectedDSs =
- new ConcurrentHashMap<Integer, DataServerHandler>();
+ private final Map<Integer, DataServerHandler> connectedDSs = new ConcurrentHashMap<>();
/**
* This map contains one ServerHandler for each replication servers with which
@@ -135,8 +130,7 @@
* in the balanced tree is the next change that we must push to this
* particular server.
*/
- private final Map<Integer, ReplicationServerHandler> connectedRSs =
- new ConcurrentHashMap<Integer, ReplicationServerHandler>();
+ private final Map<Integer, ReplicationServerHandler> connectedRSs = new ConcurrentHashMap<>();
private final ReplicationDomainDB domainDB;
/** The ReplicationServer that created the current instance. */
@@ -175,8 +169,7 @@
* @see ExpectedAcksInfo For more details, see ExpectedAcksInfo and its sub
* classes javadoc.
*/
- private final Map<CSN, ExpectedAcksInfo> waitingAcks =
- new ConcurrentHashMap<CSN, ExpectedAcksInfo>();
+ private final Map<CSN, ExpectedAcksInfo> waitingAcks = new ConcurrentHashMap<>();
/**
* The timer used to run the timeout code (timer tasks) for the assured update
@@ -200,12 +193,9 @@
*/
private static class PendingStatusMessages
{
- private final Map<Integer, ChangeTimeHeartbeatMsg> pendingHeartbeats =
- new HashMap<Integer, ChangeTimeHeartbeatMsg>(1);
- private final Map<Integer, MonitorMsg> pendingDSMonitorMsgs =
- new HashMap<Integer, MonitorMsg>(1);
- private final Map<Integer, MonitorMsg> pendingRSMonitorMsgs =
- new HashMap<Integer, MonitorMsg>(1);
+ private final Map<Integer, ChangeTimeHeartbeatMsg> pendingHeartbeats = new HashMap<>(1);
+ private final Map<Integer, MonitorMsg> pendingDSMonitorMsgs = new HashMap<>(1);
+ private final Map<Integer, MonitorMsg> pendingRSMonitorMsgs = new HashMap<>(1);
private boolean sendRSTopologyMsg;
private boolean sendDSTopologyMsg;
private int excludedDSForTopologyMsg = -1;
@@ -615,8 +605,8 @@
CSN csn = update.getCSN();
byte groupId = localReplicationServer.getGroupId();
byte sourceGroupId = sourceHandler.getGroupId();
- List<Integer> expectedServers = new ArrayList<Integer>();
- List<Integer> wrongStatusServers = new ArrayList<Integer>();
+ List<Integer> expectedServers = new ArrayList<>();
+ List<Integer> wrongStatusServers = new ArrayList<>();
if (sourceGroupId == groupId)
// Assured feature does not cross different group ids
@@ -744,7 +734,7 @@
}
}
- List<Integer> expectedServers = new ArrayList<Integer>();
+ List<Integer> expectedServers = new ArrayList<>();
if (interestedInAcks && sourceHandler.isDataServer())
{
collectRSsEligibleForAssuredReplication(groupId, expectedServers);
@@ -1309,7 +1299,7 @@
private List<ServerHandler> getDestinationServers(RoutableMsg msg,
ServerHandler senderHandler)
{
- List<ServerHandler> servers = new ArrayList<ServerHandler>();
+ List<ServerHandler> servers = new ArrayList<>();
if (msg.getDestination() == RoutableMsg.THE_CLOSEST_SERVER)
{
@@ -1650,14 +1640,14 @@
*/
public TopologyMsg createTopologyMsgForRS()
{
- List<DSInfo> dsInfos = new ArrayList<DSInfo>();
+ List<DSInfo> dsInfos = new ArrayList<>();
for (DataServerHandler dsHandler : connectedDSs.values())
{
dsInfos.add(dsHandler.toDSInfo());
}
// Create info for the local RS
- List<RSInfo> rsInfos = new ArrayList<RSInfo>();
+ List<RSInfo> rsInfos = new ArrayList<>();
rsInfos.add(toRSInfo(localReplicationServer, generationId));
return new TopologyMsg(dsInfos, rsInfos);
@@ -1676,7 +1666,7 @@
public TopologyMsg createTopologyMsgForDS(int destDsId)
{
// Go through every DSs (except recipient of msg)
- List<DSInfo> dsInfos = new ArrayList<DSInfo>();
+ List<DSInfo> dsInfos = new ArrayList<>();
for (DataServerHandler dsHandler : connectedDSs.values())
{
if (dsHandler.getServerId() == destDsId)
@@ -1687,7 +1677,7 @@
}
- List<RSInfo> rsInfos = new ArrayList<RSInfo>();
+ List<RSInfo> rsInfos = new ArrayList<>();
// Add our own info (local RS)
rsInfos.add(toRSInfo(localReplicationServer, generationId));
@@ -2296,7 +2286,7 @@
public List<Attribute> getMonitorData()
{
// publish the server id and the port number.
- List<Attribute> attributes = new ArrayList<Attribute>();
+ List<Attribute> attributes = new ArrayList<>();
attributes.add(Attributes.create("replication-server-id",
String.valueOf(localReplicationServer.getServerId())));
attributes.add(Attributes.create("replication-server-port",
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerHandler.java
index dfea203..5a60554 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerHandler.java
@@ -60,8 +60,7 @@
* This collection will contain as many elements as there are
* LDAP servers connected to the remote replication server.
*/
- private final Map<Integer, LightweightServerHandler> remoteDirectoryServers =
- new ConcurrentHashMap<Integer, LightweightServerHandler>();
+ private final Map<Integer, LightweightServerHandler> remoteDirectoryServers = new ConcurrentHashMap<>();
/**
* Starts this handler based on a start message received from remote server.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeDataExpectedAcksInfo.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeDataExpectedAcksInfo.java
index f50fc16..c0a672f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeDataExpectedAcksInfo.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeDataExpectedAcksInfo.java
@@ -120,9 +120,9 @@
// Fill collected errors info
ack.setHasTimeout(true);
// Tell which servers did not send an ack in time
- List<Integer> failedServers = new ArrayList<Integer>();
+ List<Integer> failedServers = new ArrayList<>();
Set<Integer> serverIds = expectedServersAckStatus.keySet();
- serversInTimeout = new ArrayList<Integer>(); // Use next loop to fill it
+ serversInTimeout = new ArrayList<>(); // Use next loop to fill it
for (Integer serverId : serverIds)
{
boolean ackReceived = expectedServersAckStatus.get(serverId);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java
index ece82f9..c6b11da 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java
@@ -59,7 +59,7 @@
* server id of the list had one of the 3 possible errors (timeout, wrong
* status or replay error).
*/
- private List<Integer> failedServers = new ArrayList<Integer>();
+ private List<Integer> failedServers = new ArrayList<>();
/**
* Number of servers we want an ack from and from which we received the ack.
@@ -215,7 +215,7 @@
// Add servers that did not respond in time
Set<Integer> serverIds = expectedServersAckStatus.keySet();
- serversInTimeout = new ArrayList<Integer>(); // Use next loop to fill it
+ serversInTimeout = new ArrayList<>(); // Use next loop to fill it
for (int serverId : serverIds)
{
boolean ackReceived = expectedServersAckStatus.get(serverId);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogReader.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogReader.java
index 243a342..1fb9849 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogReader.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogReader.java
@@ -100,7 +100,7 @@
static <K extends Comparable<K>, V> BlockLogReader<K, V> newReader(
final File file, final RandomAccessFile reader, final RecordParser<K, V> parser)
{
- return new BlockLogReader<K, V>(file, reader, parser, BLOCK_SIZE);
+ return new BlockLogReader<>(file, reader, parser, BLOCK_SIZE);
}
/**
@@ -126,7 +126,7 @@
static <K extends Comparable<K>, V> BlockLogReader<K, V> newReaderForTests(
final File file, final RandomAccessFile reader, final RecordParser<K, V> parser, int blockSize)
{
- return new BlockLogReader<K, V>(file, reader, parser, blockSize);
+ return new BlockLogReader<>(file, reader, parser, blockSize);
}
private BlockLogReader(
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java
index d0cd37c..ad766f0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogWriter.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2014 ForgeRock AS.
+ * Copyright 2014-2015 ForgeRock AS.
*/
package org.opends.server.replication.server.changelog.file;
@@ -73,7 +73,7 @@
static <K extends Comparable<K>, V> BlockLogWriter<K,V> newWriter(
final LogWriter writer, final RecordParser<K, V> parser)
{
- return new BlockLogWriter<K, V>(writer, parser, BLOCK_SIZE);
+ return new BlockLogWriter<>(writer, parser, BLOCK_SIZE);
}
/**
@@ -97,7 +97,7 @@
static <K extends Comparable<K>, V> BlockLogWriter<K,V> newWriterForTests(
final LogWriter writer, final RecordParser<K, V> parser, final int blockSize)
{
- return new BlockLogWriter<K, V>(writer, parser, blockSize);
+ return new BlockLogWriter<>(writer, parser, blockSize);
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/CompositeDBCursor.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/CompositeDBCursor.java
index 17aab83..a5b6321 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/CompositeDBCursor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/CompositeDBCursor.java
@@ -127,8 +127,7 @@
if (!exhaustedCursors.isEmpty())
{
// try to recycle exhausted cursors in case the underlying replica DBs received new changes.
- final Map<DBCursor<UpdateMsg>, T> copy =
- new HashMap<DBCursor<UpdateMsg>, T>(exhaustedCursors);
+ final Map<DBCursor<UpdateMsg>, T> copy = new HashMap<>(exhaustedCursors);
exhaustedCursors.clear();
for (Entry<DBCursor<UpdateMsg>, T> entry : copy.entrySet())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangeNumberIndexDB.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangeNumberIndexDB.java
index bd5aaf9..425e5f2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangeNumberIndexDB.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangeNumberIndexDB.java
@@ -282,7 +282,7 @@
long lastCN = readChangeNumber(ChangeNumberType.LAST);
long numberOfChanges = lastCN == NO_KEY ? 0 : lastCN - firstCN + 1;
- final List<Attribute> attributes = new ArrayList<Attribute>();
+ final List<Attribute> attributes = new ArrayList<>();
attributes.add(toAttribute(ChangeNumberType.FIRST, firstCN));
attributes.add(toAttribute(ChangeNumberType.LAST, lastCN));
attributes.add(Attributes.create("count", Long.toString(numberOfChanges)));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangelogDB.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangelogDB.java
index b3f70d9..d881e3e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangelogDB.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangelogDB.java
@@ -91,13 +91,12 @@
* concurrent shutdown.
*/
private final ConcurrentMap<DN, ConcurrentMap<Integer, FileReplicaDB>> domainToReplicaDBs =
- new ConcurrentHashMap<DN, ConcurrentMap<Integer, FileReplicaDB>>();
+ new ConcurrentHashMap<>();
private final ConcurrentSkipListMap<DN, CopyOnWriteArrayList<DomainDBCursor>> registeredDomainCursors =
- new ConcurrentSkipListMap<DN, CopyOnWriteArrayList<DomainDBCursor>>();
- private final CopyOnWriteArrayList<MultiDomainDBCursor> registeredMultiDomainCursors =
- new CopyOnWriteArrayList<MultiDomainDBCursor>();
+ new ConcurrentSkipListMap<>();
+ private final CopyOnWriteArrayList<MultiDomainDBCursor> registeredMultiDomainCursors = new CopyOnWriteArrayList<>();
private final ConcurrentSkipListMap<ReplicaId, CopyOnWriteArrayList<ReplicaCursor>> replicaCursors =
- new ConcurrentSkipListMap<ReplicaId, CopyOnWriteArrayList<ReplicaCursor>>();
+ new ConcurrentSkipListMap<>();
private ReplicationEnvironment replicationEnv;
private final ReplicationServerCfg config;
private final File dbDirectory;
@@ -109,7 +108,7 @@
* @GuardedBy("cnIndexDBLock")
*/
private FileChangeNumberIndexDB cnIndexDB;
- private final AtomicReference<ChangeNumberIndexer> cnIndexer = new AtomicReference<ChangeNumberIndexer>();
+ private final AtomicReference<ChangeNumberIndexer> cnIndexer = new AtomicReference<>();
/** Used for protecting {@link ChangeNumberIndexDB} related state. */
private final Object cnIndexDBLock = new Object();
@@ -119,7 +118,7 @@
* older than this delay might be removed.
*/
private volatile long purgeDelayInMillis;
- private final AtomicReference<ChangelogDBPurger> cnPurger = new AtomicReference<ChangelogDBPurger>();
+ private final AtomicReference<ChangelogDBPurger> cnPurger = new AtomicReference<>();
/** The local replication server. */
private final ReplicationServer replicationServer;
@@ -234,7 +233,7 @@
// unlucky, the domainMap does not exist: take the hit and create the
// newValue, even though the same could be done concurrently by another thread
- final ConcurrentMap<Integer, FileReplicaDB> newValue = new ConcurrentHashMap<Integer, FileReplicaDB>();
+ final ConcurrentMap<Integer, FileReplicaDB> newValue = new ConcurrentHashMap<>();
final ConcurrentMap<Integer, FileReplicaDB> previousValue = domainToReplicaDBs.putIfAbsent(baseDN, newValue);
if (previousValue != null)
{
@@ -748,7 +747,7 @@
CopyOnWriteArrayList<V> cursors = map.get(key);
if (cursors == null)
{
- cursors = new CopyOnWriteArrayList<V>();
+ cursors = new CopyOnWriteArrayList<>();
CopyOnWriteArrayList<V> previousValue = map.putIfAbsent(key, cursors);
if (previousValue != null)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileReplicaDB.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileReplicaDB.java
index 3698bb0..f646713 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileReplicaDB.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileReplicaDB.java
@@ -266,7 +266,7 @@
@Override
public List<Attribute> getMonitorData()
{
- final List<Attribute> attributes = new ArrayList<Attribute>();
+ final List<Attribute> attributes = new ArrayList<>();
create(attributes, "replicationServer-database",String.valueOf(serverId));
create(attributes, "domain-name", baseDN.toString());
final CSNLimits limits = csnLimits;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java
index 90b7d8c..52e2785 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java
@@ -124,7 +124,7 @@
};
/** Map that holds the unique log instance for each log path. */
- private static final Map<File, Log<?, ?>> logsCache = new HashMap<File, Log<?, ?>>();
+ private static final Map<File, Log<?, ?>> logsCache = new HashMap<>();
/**
* The number of references on this log instance. It is incremented each time
@@ -153,7 +153,7 @@
* <p>
* The read-only log files are associated with the highest key they contain.
*/
- private final TreeMap<K, LogFile<K, V>> logFiles = new TreeMap<K, LogFile<K, V>>();
+ private final TreeMap<K, LogFile<K, V>> logFiles = new TreeMap<>();
/**
* The last key appended to the log. In order to keep the ordering of the keys
@@ -166,7 +166,7 @@
* The list of non-empty cursors opened on this log. Opened cursors may have
* to be updated when rotating the head log file.
*/
- private final List<AbortableLogCursor<K, V>> openCursors = new CopyOnWriteArrayList<AbortableLogCursor<K, V>>();
+ private final List<AbortableLogCursor<K, V>> openCursors = new CopyOnWriteArrayList<>();
/**
* A log file can be rotated once it has exceeded this size limit. The log file can have
@@ -234,7 +234,7 @@
Log<K, V> log = (Log<K, V>) logsCache.get(logPath);
if (log == null)
{
- log = new Log<K, V>(replicationEnv, logPath, parser, rotationParameters);
+ log = new Log<>(replicationEnv, logPath, parser, rotationParameters);
logsCache.put(logPath, log);
}
else
@@ -254,7 +254,7 @@
* @return an empty cursor
*/
static <K extends Comparable<K>, V> RepositionableCursor<K, V> getEmptyCursor() {
- return new Log.EmptyCursor<K, V>();
+ return new Log.EmptyCursor<>();
}
/** Holds the parameters for log files rotation. */
@@ -537,9 +537,9 @@
{
if (isClosed)
{
- return new EmptyCursor<K, V>();
+ return new EmptyCursor<>();
}
- cursor = new AbortableLogCursor<K, V>(this, new InternalLogCursor<K, V>(this));
+ cursor = new AbortableLogCursor<>(this, new InternalLogCursor<K, V>(this));
cursor.positionTo(null, null, null);
registerCursor(cursor);
return cursor;
@@ -600,9 +600,9 @@
{
if (isClosed)
{
- return new EmptyCursor<K, V>();
+ return new EmptyCursor<>();
}
- cursor = new AbortableLogCursor<K, V>(this, new InternalLogCursor<K, V>(this));
+ cursor = new AbortableLogCursor<>(this, new InternalLogCursor<K, V>(this));
final boolean isSuccessfullyPositioned = cursor.positionTo(key, matchingStrategy, positionStrategy);
// Allow for cursor re-initialization after exhaustion in case of
// LESS_THAN_OR_EQUAL_TO_KEY ands GREATER_THAN_OR_EQUAL_TO_KEY strategies
@@ -614,7 +614,7 @@
else
{
StaticUtils.close(cursor);
- return new EmptyCursor<K, V>();
+ return new EmptyCursor<>();
}
}
catch (ChangelogException e)
@@ -719,7 +719,7 @@
{
return null;
}
- final List<String> undeletableFiles = new ArrayList<String>();
+ final List<String> undeletableFiles = new ArrayList<>();
final Iterator<LogFile<K, V>> entriesToPurge = logFilesToPurge.values().iterator();
while (entriesToPurge.hasNext())
{
@@ -793,7 +793,7 @@
}
// delete all log files
- final List<String> undeletableFiles = new ArrayList<String>();
+ final List<String> undeletableFiles = new ArrayList<>();
for (LogFile<K, V> logFile : logFiles.values())
{
try
@@ -1256,7 +1256,7 @@
@Override
CursorState<K, V> getState() throws ChangelogException
{
- return new CursorState<K, V>(currentLogFile, currentCursor.getFilePosition(), currentCursor.getRecord());
+ return new CursorState<>(currentLogFile, currentCursor.getFilePosition(), currentCursor.getRecord());
}
@Override
@@ -1462,7 +1462,7 @@
if (mustAbort)
{
delegate.close();
- delegate = new AbortedLogCursor<K, V>(log.getPath());
+ delegate = new AbortedLogCursor<>(log.getPath());
mustAbort = false;
}
return delegate.next();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/LogFile.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/LogFile.java
index cedee46..996eacd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/LogFile.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/LogFile.java
@@ -110,7 +110,7 @@
{
writer = null;
}
- readerPool = new LogReaderPool<K, V>(logfile, parser);
+ readerPool = new LogReaderPool<>(logfile, parser);
}
/**
@@ -131,7 +131,7 @@
static <K extends Comparable<K>, V> LogFile<K, V> newReadOnlyLogFile(final File logFilePath,
final RecordParser<K, V> parser) throws ChangelogException
{
- return new LogFile<K, V>(logFilePath, parser, false);
+ return new LogFile<>(logFilePath, parser, false);
}
/**
@@ -153,7 +153,7 @@
static <K extends Comparable<K>, V> LogFile<K, V> newAppendableLogFile(final File logFilePath,
final RecordParser<K, V> parser) throws ChangelogException
{
- return new LogFile<K, V>(logFilePath, parser, true);
+ return new LogFile<>(logFilePath, parser, true);
}
/**
@@ -316,11 +316,11 @@
*/
LogFileCursor<K, V> getCursor() throws ChangelogException
{
- return new LogFileCursor<K, V>(this);
+ return new LogFileCursor<>(this);
}
/**
- * Returns a cursor initialised to the provided record and position in file.
+ * Returns a cursor initialized to the provided record and position in file.
*
* @param record
* The initial record this cursor points on
@@ -332,7 +332,7 @@
*/
LogFileCursor<K, V> getCursorInitialisedTo(Record<K,V> record, long position) throws ChangelogException
{
- return new LogFileCursor<K, V>(this, record, position);
+ return new LogFileCursor<>(this, record, position);
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Record.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Record.java
index 2b68fec..21a3eac 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Record.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Record.java
@@ -78,7 +78,7 @@
* @return a record
*/
static <K, V> Record<K, V> from(final K key, final V value) {
- return new Record<K, V>(key, value);
+ return new Record<>(key, value);
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicaCursor.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicaCursor.java
index 8d2678a..59a0596 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicaCursor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicaCursor.java
@@ -45,8 +45,7 @@
{
/** @NonNull */
private final DBCursor<UpdateMsg> cursor;
- private final AtomicReference<ReplicaOfflineMsg> replicaOfflineMsg =
- new AtomicReference<ReplicaOfflineMsg>();
+ private final AtomicReference<ReplicaOfflineMsg> replicaOfflineMsg = new AtomicReference<>();
private UpdateMsg currentRecord;
private final ReplicaId replicaId;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironment.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironment.java
index bc947e7..5deba88 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironment.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironment.java
@@ -226,7 +226,7 @@
*
* @GuardedBy("domainsLock")
*/
- private final Map<DN, String> domains = new HashMap<DN, String>();
+ private final Map<DN, String> domains = new HashMap<>();
/**
* Exclusive lock to synchronize:
@@ -633,7 +633,7 @@
final File[] dnDirectories = changelogPath.listFiles(DOMAIN_FILE_FILTER);
if (dnDirectories != null)
{
- final Set<String> domainIdsFromFileSystem = new HashSet<String>();
+ final Set<String> domainIdsFromFileSystem = new HashSet<>();
for (final File dnDir : dnDirectories)
{
final String fileName = dnDir.getName();
@@ -641,7 +641,7 @@
domainIdsFromFileSystem.add(domainId);
}
- final Set<String> expectedDomainIds = new HashSet<String>(domains.values());
+ final Set<String> expectedDomainIds = new HashSet<>(domains.values());
if (!domainIdsFromFileSystem.equals(expectedDomainIds))
{
throw new ChangelogException(ERR_CHANGELOG_INCOHERENT_DOMAIN_STATE.get(domains.values().toString(),
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java
index d41c702..e405337 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java
@@ -310,7 +310,7 @@
@Override
public List<Attribute> getMonitorData()
{
- List<Attribute> attributes = new ArrayList<Attribute>();
+ List<Attribute> attributes = new ArrayList<>();
attributes.add(createChangeNumberAttribute(true));
attributes.add(createChangeNumberAttribute(false));
attributes.add(Attributes.create("count", Long.toString(count())));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangelogDB.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangelogDB.java
index ec7f3c1..b744bcc 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangelogDB.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangelogDB.java
@@ -92,13 +92,12 @@
* concurrent shutdown.
*/
private final ConcurrentMap<DN, ConcurrentMap<Integer, JEReplicaDB>> domainToReplicaDBs =
- new ConcurrentHashMap<DN, ConcurrentMap<Integer, JEReplicaDB>>();
+ new ConcurrentHashMap<>();
private final ConcurrentSkipListMap<DN, CopyOnWriteArrayList<DomainDBCursor>> registeredDomainCursors =
- new ConcurrentSkipListMap<DN, CopyOnWriteArrayList<DomainDBCursor>>();
- private final CopyOnWriteArrayList<MultiDomainDBCursor> registeredMultiDomainCursors =
- new CopyOnWriteArrayList<MultiDomainDBCursor>();
+ new ConcurrentSkipListMap<>();
+ private final CopyOnWriteArrayList<MultiDomainDBCursor> registeredMultiDomainCursors = new CopyOnWriteArrayList<>();
private final ConcurrentSkipListMap<ReplicaId, CopyOnWriteArrayList<ReplicaCursor>> replicaCursors =
- new ConcurrentSkipListMap<ReplicaId, CopyOnWriteArrayList<ReplicaCursor>>();
+ new ConcurrentSkipListMap<>();
private ReplicationDbEnv replicationEnv;
private final ReplicationServerCfg config;
private final File dbDirectory;
@@ -110,7 +109,7 @@
* @GuardedBy("cnIndexDBLock")
*/
private JEChangeNumberIndexDB cnIndexDB;
- private final AtomicReference<ChangeNumberIndexer> cnIndexer = new AtomicReference<ChangeNumberIndexer>();
+ private final AtomicReference<ChangeNumberIndexer> cnIndexer = new AtomicReference<>();
/** Used for protecting {@link ChangeNumberIndexDB} related state. */
private final Object cnIndexDBLock = new Object();
@@ -120,7 +119,7 @@
* older than this delay might be removed.
*/
private volatile long purgeDelayInMillis;
- private final AtomicReference<ChangelogDBPurger> cnPurger = new AtomicReference<ChangelogDBPurger>();
+ private final AtomicReference<ChangelogDBPurger> cnPurger = new AtomicReference<>();
/** The local replication server. */
private final ReplicationServer replicationServer;
@@ -260,7 +259,7 @@
// unlucky, the domainMap does not exist: take the hit and create the
// newValue, even though the same could be done concurrently by another thread
- final ConcurrentMap<Integer, JEReplicaDB> newValue = new ConcurrentHashMap<Integer, JEReplicaDB>();
+ final ConcurrentMap<Integer, JEReplicaDB> newValue = new ConcurrentHashMap<>();
final ConcurrentMap<Integer, JEReplicaDB> previousValue = domainToReplicaDBs.putIfAbsent(baseDN, newValue);
if (previousValue != null)
{
@@ -790,7 +789,7 @@
CopyOnWriteArrayList<V> cursors = map.get(key);
if (cursors == null)
{
- cursors = new CopyOnWriteArrayList<V>();
+ cursors = new CopyOnWriteArrayList<>();
CopyOnWriteArrayList<V> previousValue = map.putIfAbsent(key, cursors);
if (previousValue != null)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEReplicaDB.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEReplicaDB.java
index 401531f..a83bb0d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEReplicaDB.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEReplicaDB.java
@@ -290,7 +290,7 @@
@Override
public List<Attribute> getMonitorData()
{
- final List<Attribute> attributes = new ArrayList<Attribute>();
+ final List<Attribute> attributes = new ArrayList<>();
create(attributes, "replicationServer-database",String.valueOf(serverId));
create(attributes, "domain-name", baseDN.toString());
final CSNLimits limits = csnLimits;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java
index 1c585f6..048918d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java
@@ -71,7 +71,7 @@
private final ChangelogState changelogState;
/** Exclusive lock to synchronize updates to in-memory and on-disk changelogState. */
private final Object stateLock = new Object();
- private final List<Database> allDbs = new CopyOnWriteArrayList<Database>();
+ private final List<Database> allDbs = new CopyOnWriteArrayList<>();
private ReplicationServer replicationServer;
private final AtomicBoolean isShuttingDown = new AtomicBoolean(false);
private static final String GENERATION_ID_TAG = "GENID";
@@ -332,7 +332,7 @@
try
{
- final Map<byte[], byte[]> results = new LinkedHashMap<byte[], byte[]>();
+ final Map<byte[], byte[]> results = new LinkedHashMap<>();
OperationStatus status = cursor.getFirst(key, data, LockMode.DEFAULT);
while (status == OperationStatus.SUCCESS)
@@ -480,7 +480,7 @@
{
final String key = serverId + FIELD_SEPARATOR + baseDN.toNormalizedUrlSafeString();
final String value = serverId + FIELD_SEPARATOR + baseDN;
- return new SimpleImmutableEntry<String, String>(key, value);
+ return toEntry(key, value);
}
/**
@@ -496,9 +496,8 @@
static Entry<byte[], byte[]> toGenIdEntry(DN baseDN, long generationId)
{
final String key = GENERATION_ID_TAG + FIELD_SEPARATOR + baseDN.toNormalizedUrlSafeString();
- final String data = GENERATION_ID_TAG + FIELD_SEPARATOR + generationId
- + FIELD_SEPARATOR + baseDN;
- return new SimpleImmutableEntry<byte[], byte[]>(toBytes(key), toBytes(data));
+ final String data = GENERATION_ID_TAG + FIELD_SEPARATOR + generationId + FIELD_SEPARATOR + baseDN;
+ return toEntry(toBytes(key), toBytes(data));
}
/**
@@ -510,7 +509,7 @@
*/
static Entry<byte[], byte[]> toByteArray(Entry<String, String> entry)
{
- return new SimpleImmutableEntry<byte[], byte[]>(toBytes(entry.getKey()), toBytes(entry.getValue()));
+ return toEntry(toBytes(entry.getKey()), toBytes(entry.getValue()));
}
/**
@@ -527,9 +526,8 @@
{
final int serverId = offlineCSN.getServerId();
final byte[] key = toReplicaOfflineKey(baseDN, serverId);
- final byte[] data = toBytes(offlineCSN.getTime() + FIELD_SEPARATOR + serverId
- + FIELD_SEPARATOR + baseDN);
- return new SimpleImmutableEntry<byte[], byte[]>(key, data);
+ final byte[] data = toBytes(offlineCSN.getTime() + FIELD_SEPARATOR + serverId + FIELD_SEPARATOR + baseDN);
+ return toEntry(key, data);
}
/**
@@ -549,7 +547,12 @@
/** Returns an entry with the provided key and a null value. */
private SimpleImmutableEntry<byte[], byte[]> toEntryWithNullValue(byte[] key)
{
- return new SimpleImmutableEntry<byte[], byte[]>(key, null);
+ return toEntry(key, null);
+ }
+
+ private static <K, V> SimpleImmutableEntry<K, V> toEntry(final K key, final V value)
+ {
+ return new SimpleImmutableEntry<>(key, value);
}
private void putInChangelogStateDBIfNotExist(Entry<byte[], byte[]> entry)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/DSRSShutdownSync.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/DSRSShutdownSync.java
index 5ef595e..fd0cb1c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/DSRSShutdownSync.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/DSRSShutdownSync.java
@@ -20,7 +20,7 @@
*
* CDDL HEADER END
*
- * Copyright 2014 ForgeRock AS
+ * Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.replication.service;
@@ -41,9 +41,7 @@
*/
public class DSRSShutdownSync
{
-
- private static final ConcurrentSkipListSet<DN> replicaOfflineMsgs =
- new ConcurrentSkipListSet<DN>();
+ private static final ConcurrentSkipListSet<DN> replicaOfflineMsgs = new ConcurrentSkipListSet<>();
private static AtomicLong stopInstanceTimestamp = new AtomicLong();
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java
index d75f2ba..48456a0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java
@@ -167,8 +167,7 @@
* connected RS.
*/
// @NotNull // for the reference
- private final AtomicReference<ConnectedRS> connectedRS =
- new AtomicReference<ConnectedRS>(ConnectedRS.noConnectedRS());
+ private final AtomicReference<ConnectedRS> connectedRS = new AtomicReference<>(ConnectedRS.noConnectedRS());
/** Our replication domain. */
private final ReplicationDomain domain;
/**
@@ -181,15 +180,10 @@
* as seen by the ReplicationServer the last time it was polled or the last
* time it published monitoring information.
*/
- private Map<Integer, ServerState> replicaStates =
- new HashMap<Integer, ServerState>();
- /**
- * A thread to monitor heartbeats on the session.
- */
+ private Map<Integer, ServerState> replicaStates = new HashMap<>();
+ /** A thread to monitor heartbeats on the session. */
private HeartbeatMonitor heartbeatMonitor;
- /**
- * The number of times the connection was lost.
- */
+ /** The number of times the connection was lost. */
private int numLostConnections;
/**
* When the broker cannot connect to any replication server
@@ -210,8 +204,7 @@
* Properties for the last topology info received from the network.
*/
/** Contains the last known state of the replication topology. */
- private final AtomicReference<Topology> topology =
- new AtomicReference<Topology>(new Topology());
+ private final AtomicReference<Topology> topology = new AtomicReference<>(new Topology());
/** <pre>@GuardedBy("this")</pre>. */
private volatile int updateDoneCount;
private volatile boolean connectRequiresRecovery;
@@ -698,8 +691,7 @@
*/
private Map<Integer, ReplicationServerInfo> collectReplicationServersInfo()
{
- final Map<Integer, ReplicationServerInfo> rsInfos =
- new ConcurrentSkipListMap<Integer, ReplicationServerInfo>();
+ final Map<Integer, ReplicationServerInfo> rsInfos = new ConcurrentSkipListMap<>();
for (String serverUrl : getReplicationServerUrls())
{
@@ -1233,11 +1225,9 @@
*/
static class RSEvaluations
{
-
private final int localServerId;
private Map<Integer, ReplicationServerInfo> bestRSs;
- private final Map<Integer, LocalizableMessage> rsEvals =
- new HashMap<Integer, LocalizableMessage>();
+ private final Map<Integer, LocalizableMessage> rsEvals = new HashMap<>();
/**
* Ctor.
@@ -1377,10 +1367,8 @@
*/
private static class LocalEvaluation
{
- private final Map<Integer, ReplicationServerInfo> accepted =
- new HashMap<Integer, ReplicationServerInfo>();
- private final Map<ReplicationServerInfo, LocalizableMessage> rsEvals =
- new HashMap<ReplicationServerInfo, LocalizableMessage>();
+ private final Map<Integer, ReplicationServerInfo> accepted = new HashMap<>();
+ private final Map<ReplicationServerInfo, LocalizableMessage> rsEvals = new HashMap<>();
private void accept(Integer rsId, ReplicationServerInfo rsInfo)
{
@@ -1408,7 +1396,7 @@
public Map<Integer, LocalizableMessage> getRejected()
{
- final Map<Integer, LocalizableMessage> result = new HashMap<Integer, LocalizableMessage>();
+ final Map<Integer, LocalizableMessage> result = new HashMap<>();
for (Entry<ReplicationServerInfo, LocalizableMessage> entry : rsEvals.entrySet())
{
result.put(entry.getKey().getServerId(), entry.getValue());
@@ -1845,7 +1833,7 @@
// Distance (difference) of the current loads to the load goals of each RS:
// key:server id, value: distance
- Map<Integer, BigDecimal> loadDistances = new HashMap<Integer, BigDecimal>();
+ Map<Integer, BigDecimal> loadDistances = new HashMap<>();
// Precision for the operations (number of digits after the dot)
final MathContext mathContext = new MathContext(32, RoundingMode.HALF_UP);
for (Entry<Integer, ReplicationServerInfo> entry : bestServers.entrySet())
@@ -2100,8 +2088,7 @@
private static boolean isServerOverloadingRS(int localServerId,
ReplicationServerInfo currentRsInfo, int overloadingDSsNumber)
{
- List<Integer> serversConnectedToCurrentRS =
- new ArrayList<Integer>(currentRsInfo.getConnectedDSs());
+ List<Integer> serversConnectedToCurrentRS = new ArrayList<>(currentRsInfo.getConnectedDSs());
Collections.sort(serversConnectedToCurrentRS);
final int idx = serversConnectedToCurrentRS.indexOf(localServerId);
@@ -2497,8 +2484,7 @@
MonitorMsg monitorMsg = (MonitorMsg) msg;
// Extract and store replicas ServerStates
- final Map<Integer, ServerState> newReplicaStates =
- new HashMap<Integer, ServerState>();
+ final Map<Integer, ServerState> newReplicaStates = new HashMap<>();
for (int srvId : toIterable(monitorMsg.ldapIterator()))
{
newReplicaStates.put(srvId, monitorMsg.getLDAPServerState(srvId));
@@ -2871,7 +2857,7 @@
private List<RSInfo> toRSInfos(Map<Integer, ReplicationServerInfo> rsInfos)
{
- final List<RSInfo> result = new ArrayList<RSInfo>();
+ final List<RSInfo> result = new ArrayList<>();
for (ReplicationServerInfo rsInfo : rsInfos.values())
{
result.add(rsInfo.toRSInfo());
@@ -3007,7 +2993,7 @@
private Map<Integer, DSInfo> removeThisDs(Map<Integer, DSInfo> dsInfos,
int dsServerId)
{
- final Map<Integer, DSInfo> copy = new HashMap<Integer, DSInfo>(dsInfos);
+ final Map<Integer, DSInfo> copy = new HashMap<>(dsInfos);
copy.remove(dsServerId);
return Collections.unmodifiableMap(copy);
}
@@ -3017,11 +3003,10 @@
Map<Integer, ReplicationServerInfo> previousRsInfos,
Set<String> configuredReplicationServerUrls)
{
- final Map<Integer, ReplicationServerInfo> results =
- new HashMap<Integer, ReplicationServerInfo>(previousRsInfos);
+ final Map<Integer, ReplicationServerInfo> results = new HashMap<>(previousRsInfos);
// Update replication server info list with the received topology info
- final Set<Integer> rssToKeep = new HashSet<Integer>();
+ final Set<Integer> rssToKeep = new HashSet<>();
for (RSInfo newRSInfo : newRsInfos)
{
final int rsId = newRSInfo.getId();
@@ -3053,7 +3038,7 @@
/** Computes the list of DSs connected to a particular RS. */
private Set<Integer> computeDSsConnectedTo(int rsId, int dsServerId)
{
- final Set<Integer> connectedDSs = new HashSet<Integer>();
+ final Set<Integer> connectedDSs = new HashSet<>();
if (rsServerId == rsId)
{
/*
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java
index 3e23eba..e7ba797 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java
@@ -157,30 +157,26 @@
{
boolean configurationChanged = false;
- Set<String> s1 = new HashSet<String>(includeAttributes);
+ Set<String> s1 = new HashSet<>(includeAttributes);
// Combine all+delete attributes.
- Set<String> s2 = new HashSet<String>(s1);
+ Set<String> s2 = new HashSet<>(s1);
s2.addAll(includeAttributesForDeletes);
Map<Integer,Set<String>> eclIncludesByServer = this.includedAttrsByServer;
if (!s1.equals(this.includedAttrsByServer.get(serverId)))
{
configurationChanged = true;
- eclIncludesByServer = new HashMap<Integer, Set<String>>(
- this.includedAttrsByServer);
+ eclIncludesByServer = new HashMap<>(this.includedAttrsByServer);
eclIncludesByServer.put(serverId, Collections.unmodifiableSet(s1));
}
- Map<Integer, Set<String>> eclIncludesForDeletesByServer =
- this.includedAttrsForDeletesByServer;
+ Map<Integer, Set<String>> eclIncludesForDeletesByServer = this.includedAttrsForDeletesByServer;
if (!s2.equals(this.includedAttrsForDeletesByServer.get(serverId)))
{
configurationChanged = true;
- eclIncludesForDeletesByServer = new HashMap<Integer, Set<String>>(
- this.includedAttrsForDeletesByServer);
- eclIncludesForDeletesByServer.put(
- serverId, Collections.unmodifiableSet(s2));
+ eclIncludesForDeletesByServer = new HashMap<>(this.includedAttrsForDeletesByServer);
+ eclIncludesForDeletesByServer.put(serverId, Collections.unmodifiableSet(s2));
}
if (!configurationChanged)
@@ -189,13 +185,13 @@
}
// and rebuild the global list to be ready for usage
- Set<String> eclIncludesAllServer = new HashSet<String>();
+ Set<String> eclIncludesAllServer = new HashSet<>();
for (Set<String> attributes : eclIncludesByServer.values())
{
eclIncludesAllServer.addAll(attributes);
}
- Set<String> eclIncludesForDeletesAllServer = new HashSet<String>();
+ Set<String> eclIncludesForDeletesAllServer = new HashSet<>();
for (Set<String> attributes : eclIncludesForDeletesByServer.values())
{
eclIncludesForDeletesAllServer.addAll(attributes);
@@ -234,16 +230,12 @@
* to be able to correlate all the coming back acks to the original
* operation.
*/
- private final Map<CSN, UpdateMsg> waitingAckMsgs =
- new ConcurrentHashMap<CSN, UpdateMsg>();
-
-
+ private final Map<CSN, UpdateMsg> waitingAckMsgs = new ConcurrentHashMap<>();
/**
* The context related to an import or export being processed
* Null when none is being processed.
*/
- private final AtomicReference<ImportExportContext> importExportContext =
- new AtomicReference<ImportExportContext>();
+ private final AtomicReference<ImportExportContext> importExportContext = new AtomicReference<>();
/**
* The Thread waiting for incoming update messages for this domain and pushing
@@ -252,9 +244,7 @@
*/
private volatile DirectoryThread listenerThread;
- /**
- * A set of counters used for Monitoring.
- */
+ /** A set of counters used for Monitoring. */
private AtomicInteger numProcessedUpdates = new AtomicInteger(0);
private AtomicInteger numRcvdUpdates = new AtomicInteger(0);
private AtomicInteger numSentUpdates = new AtomicInteger(0);
@@ -273,8 +263,7 @@
* successfully acknowledged (either because of timeout, wrong status or error
* at replay).
*/
- private AtomicInteger assuredSrNotAcknowledgedUpdates =
- new AtomicInteger(0);
+ private AtomicInteger assuredSrNotAcknowledgedUpdates = new AtomicInteger(0);
/**
* Number of updates sent in Assured Mode, Safe Read, that have not been
* successfully acknowledged because of timeout.
@@ -297,8 +286,7 @@
* <p>
* String format: <server id>:<number of failed updates>
*/
- private final Map<Integer, Integer> assuredSrServerNotAcknowledgedUpdates =
- new HashMap<Integer,Integer>();
+ private final Map<Integer, Integer> assuredSrServerNotAcknowledgedUpdates = new HashMap<>();
/** Number of updates received in Assured Mode, Safe Read request. */
private AtomicInteger assuredSrReceivedUpdates = new AtomicInteger(0);
/**
@@ -330,8 +318,7 @@
* <p>
* String format: <server id>:<number of failed updates>
*/
- private final Map<Integer, Integer> assuredSdServerTimeoutUpdates =
- new HashMap<Integer,Integer>();
+ private final Map<Integer, Integer> assuredSdServerTimeoutUpdates = new HashMap<>();
/* Status related monitoring fields */
@@ -354,8 +341,7 @@
*/
private final CSNGenerator generator;
- private final AtomicReference<ECLIncludes> eclIncludes =
- new AtomicReference<ECLIncludes>(new ECLIncludes());
+ private final AtomicReference<ECLIncludes> eclIncludes = new AtomicReference<>(new ECLIncludes());
/**
* An object used to protect the initialization of the underlying broker
@@ -1127,28 +1113,21 @@
*/
private final long startTime;
- /**
- * List for replicas (DS) connected to the topology when initialization
- * started.
- */
- private final Set<Integer> startList = new HashSet<Integer>(0);
+ /** List for replicas (DS) connected to the topology when initialization started. */
+ private final Set<Integer> startList = new HashSet<>(0);
/**
* List for replicas (DS) with a failure (disconnected from the topology)
* since the initialization started.
*/
- private final Set<Integer> failureList = new HashSet<Integer>(0);
+ private final Set<Integer> failureList = new HashSet<>(0);
/**
* Flow control during initialization: for each remote server, counter of
* messages received.
*/
- private final Map<Integer, Integer> ackVals =
- new HashMap<Integer, Integer>();
- /**
- * ServerId of the slowest server (the one with the smallest non null
- * counter).
- */
+ private final Map<Integer, Integer> ackVals = new HashMap<>();
+ /** ServerId of the slowest server (the one with the smallest non null counter). */
private int slowestServerId = -1;
private short exporterProtocolVersion = -1;
@@ -1644,8 +1623,7 @@
*/
private void waitForRemoteStartOfInit(ImportExportContext ieCtx)
{
- final Set<Integer> replicasWeAreWaitingFor =
- new HashSet<Integer>(ieCtx.startList);
+ final Set<Integer> replicasWeAreWaitingFor = new HashSet<>(ieCtx.startList);
if (logger.isTraceEnabled())
logger.trace(
@@ -1702,8 +1680,7 @@
*/
private void waitForRemoteEndOfInit(ImportExportContext ieCtx)
{
- final Set<Integer> replicasWeAreWaitingFor =
- new HashSet<Integer>(ieCtx.startList);
+ final Set<Integer> replicasWeAreWaitingFor = new HashSet<>(ieCtx.startList);
if (logger.isTraceEnabled())
logger.trace(
@@ -2774,8 +2751,7 @@
{
synchronized(assuredSrServerNotAcknowledgedUpdates)
{
- return new HashMap<Integer, Integer>(
- assuredSrServerNotAcknowledgedUpdates);
+ return new HashMap<>(assuredSrServerNotAcknowledgedUpdates);
}
}
@@ -2852,7 +2828,7 @@
{
synchronized(assuredSdServerTimeoutUpdates)
{
- return new HashMap<Integer, Integer>(assuredSdServerTimeoutUpdates);
+ return new HashMap<>(assuredSdServerTimeoutUpdates);
}
}
@@ -3189,7 +3165,7 @@
// -> replay error occurred
ackMsg.setHasReplayError(true);
// -> replay error occurred in our server
- List<Integer> idList = new ArrayList<Integer>();
+ List<Integer> idList = new ArrayList<>();
idList.add(getServerId());
ackMsg.setFailedServers(idList);
}
@@ -3427,7 +3403,7 @@
*/
public Collection<Attribute> getAdditionalMonitoring()
{
- return new ArrayList<Attribute>();
+ return new ArrayList<>();
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationMonitor.java
index a38f85b..9a59d05 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationMonitor.java
@@ -89,7 +89,7 @@
@Override
public List<Attribute> getMonitorData()
{
- List<Attribute> attributes = new ArrayList<Attribute>();
+ List<Attribute> attributes = new ArrayList<>();
attributes.add(Attributes.create("domain-name", String.valueOf(domain.getBaseDN())));
attributes.add(Attributes.create("connected-to", domain.getReplicationServer()));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java
index 39a99cf..503b6e6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java
@@ -352,7 +352,7 @@
// we get to the end of the value. But before we start, set default values
// for everything else we might need to know.
String primaryName = oid;
- List<String> typeNames = new LinkedList<String>();
+ List<String> typeNames = new LinkedList<>();
String description = null;
AttributeType superiorType = null;
Syntax syntax = DirectoryServer.getDefaultAttributeSyntax();
@@ -365,8 +365,7 @@
boolean isNoUserModification = false;
boolean isObsolete = false;
boolean isSingleValue = false;
- HashMap<String,List<String>> extraProperties =
- new LinkedHashMap<String,List<String>>();
+ HashMap<String,List<String>> extraProperties = new LinkedHashMap<>();
while (true)
@@ -812,7 +811,7 @@
// either a single value in single quotes or an open parenthesis
// followed by one or more values in single quotes separated by spaces
// followed by a close parenthesis.
- List<String> valueList = new ArrayList<String>();
+ List<String> valueList = new ArrayList<>();
pos = readExtraParameterValues(valueStr, valueList, pos);
extraProperties.put(tokenName, valueList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/CollationMatchingRuleFactory.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/CollationMatchingRuleFactory.java
index 2b09922..2173ec2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/CollationMatchingRuleFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/CollationMatchingRuleFactory.java
@@ -61,24 +61,18 @@
MatchingRuleFactory<CollationMatchingRuleCfg> implements
ConfigurationChangeListener<CollationMatchingRuleCfg>
{
-
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
/** Stores the list of available locales on this JVM. */
- private static final Set<Locale> supportedLocales = new HashSet<Locale>(
- Arrays.asList(Locale.getAvailableLocales()));
+ private static final Set<Locale> supportedLocales = new HashSet<>(Arrays.asList(Locale.getAvailableLocales()));
/** Current Configuration. */
private CollationMatchingRuleCfg currentConfig;
-
/** Map of OID and the Matching Rule. */
- private final Map<String, MatchingRule> matchingRules =
- new HashMap<String, MatchingRule>();
+ private final Map<String, MatchingRule> matchingRules = new HashMap<>();
- /**
- * Creates a new instance of CollationMatchingRuleFactory.
- */
+ /** Creates a new instance of CollationMatchingRuleFactory. */
public CollationMatchingRuleFactory()
{
super();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/DITContentRuleSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/DITContentRuleSyntax.java
index 1cfc5a2..f342d9c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/DITContentRuleSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/DITContentRuleSyntax.java
@@ -296,19 +296,14 @@
// out what it is and how to treat what comes after it, then repeat until
// we get to the end of the value. But before we start, set default values
// for everything else we might need to know.
- LinkedHashMap<String,String> names = new LinkedHashMap<String,String>();
+ LinkedHashMap<String,String> names = new LinkedHashMap<>();
String description = null;
boolean isObsolete = false;
- LinkedHashSet<ObjectClass> auxiliaryClasses =
- new LinkedHashSet<ObjectClass>();
- LinkedHashSet<AttributeType> requiredAttributes =
- new LinkedHashSet<AttributeType>();
- LinkedHashSet<AttributeType> optionalAttributes =
- new LinkedHashSet<AttributeType>();
- LinkedHashSet<AttributeType> prohibitedAttributes =
- new LinkedHashSet<AttributeType>();
- LinkedHashMap<String,List<String>> extraProperties =
- new LinkedHashMap<String,List<String>>();
+ LinkedHashSet<ObjectClass> auxiliaryClasses = new LinkedHashSet<>();
+ LinkedHashSet<AttributeType> requiredAttributes = new LinkedHashSet<>();
+ LinkedHashSet<AttributeType> optionalAttributes = new LinkedHashSet<>();
+ LinkedHashSet<AttributeType> prohibitedAttributes = new LinkedHashSet<>();
+ LinkedHashMap<String,List<String>> extraProperties = new LinkedHashMap<>();
while (true)
@@ -400,7 +395,7 @@
}
else if (lowerTokenName.equals("aux"))
{
- LinkedList<ObjectClass> ocs = new LinkedList<ObjectClass>();
+ LinkedList<ObjectClass> ocs = new LinkedList<>();
// This specifies the set of required auxiliary objectclasses for this
// DIT content rule. It may be a single name or OID (not in quotes), or
@@ -496,7 +491,7 @@
}
else if (lowerTokenName.equals("must"))
{
- LinkedList<AttributeType> attrs = new LinkedList<AttributeType>();
+ LinkedList<AttributeType> attrs = new LinkedList<>();
// This specifies the set of required attributes for the DIT content
// rule. It may be a single name or OID (not in quotes), or it may be
@@ -574,7 +569,7 @@
}
else if (lowerTokenName.equals("may"))
{
- LinkedList<AttributeType> attrs = new LinkedList<AttributeType>();
+ LinkedList<AttributeType> attrs = new LinkedList<>();
// This specifies the set of optional attributes for the DIT content
// rule. It may be a single name or OID (not in quotes), or it may be
@@ -653,7 +648,7 @@
}
else if (lowerTokenName.equals("not"))
{
- LinkedList<AttributeType> attrs = new LinkedList<AttributeType>();
+ LinkedList<AttributeType> attrs = new LinkedList<>();
// This specifies the set of prohibited attributes for the DIT content
// rule. It may be a single name or OID (not in quotes), or it may be
@@ -737,7 +732,7 @@
// either a single value in single quotes or an open parenthesis
// followed by one or more values in single quotes separated by spaces
// followed by a close parenthesis.
- LinkedList<String> valueList = new LinkedList<String>();
+ LinkedList<String> valueList = new LinkedList<>();
pos = readExtraParameterValues(valueStr, valueList, pos);
extraProperties.put(tokenName, valueList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/DITStructureRuleSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/DITStructureRuleSyntax.java
index 2970414..bc4c5c2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/DITStructureRuleSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/DITStructureRuleSyntax.java
@@ -225,14 +225,13 @@
// out what it is and how to treat what comes after it, then repeat until
// we get to the end of the value. But before we start, set default values
// for everything else we might need to know.
- LinkedHashMap<String,String> names = new LinkedHashMap<String,String>();
+ LinkedHashMap<String,String> names = new LinkedHashMap<>();
String description = null;
boolean isObsolete = false;
NameForm nameForm = null;
boolean nameFormGiven = false;
LinkedHashSet<DITStructureRule> superiorRules = null;
- LinkedHashMap<String,List<String>> extraProperties =
- new LinkedHashMap<String,List<String>>();
+ LinkedHashMap<String,List<String>> extraProperties = new LinkedHashMap<>();
while (true)
@@ -340,8 +339,7 @@
}
else if (lowerTokenName.equals("sup"))
{
- LinkedList<DITStructureRule> superiorList =
- new LinkedList<DITStructureRule>();
+ LinkedList<DITStructureRule> superiorList = new LinkedList<>();
// This specifies the set of superior rule IDs (which are integers) for
// this DIT structure rule. It may be a single rule ID or a set of
@@ -520,7 +518,7 @@
}
}
- superiorRules = new LinkedHashSet<DITStructureRule>(superiorList);
+ superiorRules = new LinkedHashSet<>(superiorList);
}
else
{
@@ -528,8 +526,7 @@
// either a single value in single quotes or an open parenthesis
// followed by one or more values in single quotes separated by spaces
// followed by a close parenthesis.
- LinkedList<String> valueList =
- new LinkedList<String>();
+ LinkedList<String> valueList = new LinkedList<>();
pos = readExtraParameterValues(valueStr, valueList, pos);
extraProperties.put(tokenName, valueList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
index 419f9d8..358e957 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
@@ -363,7 +363,7 @@
// for everything else we might need to know.
String description = null;
Syntax syntax = null;
- HashMap<String,List<String>> extraProperties = new LinkedHashMap<String,List<String>>();
+ HashMap<String,List<String>> extraProperties = new LinkedHashMap<>();
boolean hasXSyntaxToken = false;
while (true)
@@ -472,7 +472,7 @@
message);
}
hasXSyntaxToken = true;
- LinkedList<String> values = new LinkedList<String>();
+ LinkedList<String> values = new LinkedList<>();
pos = readExtraParameterValues(valueStr, values, pos);
if (values.isEmpty())
@@ -506,7 +506,7 @@
// either a single value in single quotes or an open parenthesis
// followed by one or more values in single quotes separated by spaces
// followed by a close parenthesis.
- List<String> valueList = new ArrayList<String>();
+ List<String> valueList = new ArrayList<>();
pos = readExtraParameterValues(valueStr, valueList, pos);
extraProperties.put(tokenName, valueList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/MatchingRuleUseSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/MatchingRuleUseSyntax.java
index 26ca87f..a3c5f53 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/MatchingRuleUseSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/MatchingRuleUseSyntax.java
@@ -286,12 +286,11 @@
// out what it is and how to treat what comes after it, then repeat until
// we get to the end of the value. But before we start, set default values
// for everything else we might need to know.
- LinkedHashMap<String,String> names = new LinkedHashMap<String,String>();
+ LinkedHashMap<String,String> names = new LinkedHashMap<>();
String description = null;
boolean isObsolete = false;
LinkedHashSet<AttributeType> attributes = null;
- LinkedHashMap<String,List<String>> extraProperties =
- new LinkedHashMap<String,List<String>>();
+ LinkedHashMap<String,List<String>> extraProperties = new LinkedHashMap<>();
while (true)
{
@@ -382,7 +381,7 @@
}
else if (lowerTokenName.equals("applies"))
{
- LinkedList<AttributeType> attrs = new LinkedList<AttributeType>();
+ LinkedList<AttributeType> attrs = new LinkedList<>();
// This specifies the set of attribute types that may be used with the
// associated matching rule. It may be a single name or OID (not in
@@ -458,7 +457,7 @@
attrs.add(attr);
}
- attributes = new LinkedHashSet<AttributeType>(attrs);
+ attributes = new LinkedHashSet<>(attrs);
}
else
{
@@ -466,7 +465,7 @@
// either a single value in single quotes or an open parenthesis
// followed by one or more values in single quotes separated by spaces
// followed by a close parenthesis.
- LinkedList<String> valueList = new LinkedList<String>();
+ LinkedList<String> valueList = new LinkedList<>();
pos = readExtraParameterValues(valueStr, valueList, pos);
extraProperties.put(tokenName, valueList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/NameFormSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/NameFormSyntax.java
index f5cb0f1..cd949e1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/NameFormSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/NameFormSyntax.java
@@ -281,16 +281,13 @@
// out what it is and how to treat what comes after it, then repeat until
// we get to the end of the value. But before we start, set default values
// for everything else we might need to know.
- LinkedHashMap<String,String> names = new LinkedHashMap<String,String>();
+ LinkedHashMap<String,String> names = new LinkedHashMap<>();
String description = null;
boolean isObsolete = false;
ObjectClass structuralClass = null;
- LinkedHashSet<AttributeType> requiredAttributes =
- new LinkedHashSet<AttributeType>();
- LinkedHashSet<AttributeType> optionalAttributes =
- new LinkedHashSet<AttributeType>();
- LinkedHashMap<String,List<String>> extraProperties =
- new LinkedHashMap<String,List<String>>();
+ LinkedHashSet<AttributeType> requiredAttributes = new LinkedHashSet<>();
+ LinkedHashSet<AttributeType> optionalAttributes = new LinkedHashSet<>();
+ LinkedHashMap<String,List<String>> extraProperties = new LinkedHashMap<>();
while (true)
@@ -422,7 +419,7 @@
}
else if (lowerTokenName.equals("must"))
{
- LinkedList<AttributeType> attrs = new LinkedList<AttributeType>();
+ LinkedList<AttributeType> attrs = new LinkedList<>();
// This specifies the set of required attributes for the name from.
// It may be a single name or OID (not in quotes), or it may be an
@@ -502,7 +499,7 @@
}
else if (lowerTokenName.equals("may"))
{
- LinkedList<AttributeType> attrs = new LinkedList<AttributeType>();
+ LinkedList<AttributeType> attrs = new LinkedList<>();
// This specifies the set of optional attributes for the name form. It
// may be a single name or OID (not in quotes), or it may be an open
@@ -586,7 +583,7 @@
// either a single value in single quotes or an open parenthesis
// followed by one or more values in single quotes separated by spaces
// followed by a close parenthesis.
- LinkedList<String> valueList = new LinkedList<String>();
+ LinkedList<String> valueList = new LinkedList<>();
pos = readExtraParameterValues(valueStr, valueList, pos);
extraProperties.put(tokenName, valueList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/ObjectClassSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/ObjectClassSyntax.java
index 4d0e146..4372579 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/ObjectClassSyntax.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/ObjectClassSyntax.java
@@ -287,16 +287,15 @@
// we get to the end of the value. But before we start, set default values
// for everything else we might need to know.
String primaryName = oid;
- List<String> names = new LinkedList<String>();
+ List<String> names = new LinkedList<>();
String description = null;
boolean isObsolete = false;
- Set<AttributeType> requiredAttributes = new LinkedHashSet<AttributeType>();
- Set<AttributeType> optionalAttributes = new LinkedHashSet<AttributeType>();
- Set<ObjectClass> superiorClasses = new LinkedHashSet<ObjectClass>();
+ Set<AttributeType> requiredAttributes = new LinkedHashSet<>();
+ Set<AttributeType> optionalAttributes = new LinkedHashSet<>();
+ Set<ObjectClass> superiorClasses = new LinkedHashSet<>();
//Default OC Type is STRUCTURAL ( RFC 4512 4.1.1)
ObjectClassType objectClassType = ObjectClassType.STRUCTURAL;
- Map<String, List<String>> extraProperties =
- new LinkedHashMap<String, List<String>>();
+ Map<String, List<String>> extraProperties = new LinkedHashMap<>();
while (true)
@@ -459,7 +458,7 @@
// by one or more names separated by spaces and the dollar sign
// character, followed by a closing parenthesis.
c = valueStr.charAt(pos++);
- LinkedList<ObjectClass> listSupOCs = new LinkedList<ObjectClass>();
+ LinkedList<ObjectClass> listSupOCs = new LinkedList<>();
if(c == '(')
{
while(true)
@@ -549,7 +548,7 @@
}
else if (lowerTokenName.equals("must"))
{
- LinkedList<AttributeType> attrs = new LinkedList<AttributeType>();
+ LinkedList<AttributeType> attrs = new LinkedList<>();
// This specifies the set of required attributes for the objectclass.
// It may be a single name or OID (not in quotes), or it may be an
@@ -634,7 +633,7 @@
}
else if (lowerTokenName.equals("may"))
{
- LinkedList<AttributeType> attrs = new LinkedList<AttributeType>();
+ LinkedList<AttributeType> attrs = new LinkedList<>();
// This specifies the set of optional attributes for the objectclass.
// It may be a single name or OID (not in quotes), or it may be an
@@ -723,7 +722,7 @@
// either a single value in single quotes or an open parenthesis
// followed by one or more values in single quotes separated by spaces
// followed by a close parenthesis.
- List<String> valueList = new LinkedList<String>();
+ List<String> valueList = new LinkedList<>();
pos = readExtraParameterValues(valueStr, valueList, pos);
extraProperties.put(tokenName, valueList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/TimeBasedMatchingRuleFactory.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/TimeBasedMatchingRuleFactory.java
index c712214..97cec09 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/TimeBasedMatchingRuleFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/schema/TimeBasedMatchingRuleFactory.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.opends.server.schema;
@@ -53,7 +53,7 @@
public void initializeMatchingRule(MatchingRuleCfg configuration)
throws ConfigException, InitializationException
{
- matchingRules = new HashSet<MatchingRule>();
+ matchingRules = new HashSet<>();
// relative time greater than
matchingRules.add(CoreSchema.getInstance().getMatchingRule("1.3.6.1.4.1.26027.1.4.5"));
// relative time less than
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
index 1da94bb..b5a4880 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
@@ -108,7 +108,7 @@
// the schema directory.
String schemaInstanceDirectory =
SchemaConfigManager.getSchemaDirectoryPath();
- filesToAdd = new TreeSet<String>();
+ filesToAdd = new TreeSet<>();
for (Attribute a : attrList)
{
for (ByteString v : a)
@@ -180,7 +180,7 @@
try
{
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
Schema schema = DirectoryServer.getSchema().duplicate();
for (String schemaFile : filesToAdd)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java
index 9e4628a..7ff7bfd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java
@@ -78,51 +78,19 @@
- /**
- * Stores mapping between configuration attribute name and its label.
- */
- private static Map<String,LocalizableMessage> argDisplayMap =
- new HashMap<String,LocalizableMessage>();
+ /** Stores mapping between configuration attribute name and its label. */
+ private static Map<String,LocalizableMessage> argDisplayMap = new HashMap<>();
static {
- argDisplayMap.put(
- ATTR_TASK_BACKUP_ALL,
- INFO_BACKUP_ARG_BACKUPALL.get());
-
- argDisplayMap.put(
- ATTR_TASK_BACKUP_COMPRESS,
- INFO_BACKUP_ARG_COMPRESS.get());
-
- argDisplayMap.put(
- ATTR_TASK_BACKUP_ENCRYPT,
- INFO_BACKUP_ARG_ENCRYPT.get());
-
- argDisplayMap.put(
- ATTR_TASK_BACKUP_HASH,
- INFO_BACKUP_ARG_HASH.get());
-
- argDisplayMap.put(
- ATTR_TASK_BACKUP_INCREMENTAL,
- INFO_BACKUP_ARG_INCREMENTAL.get());
-
- argDisplayMap.put(
- ATTR_TASK_BACKUP_SIGN_HASH,
- INFO_BACKUP_ARG_SIGN_HASH.get());
-
- argDisplayMap.put(
- ATTR_TASK_BACKUP_BACKEND_ID,
- INFO_BACKUP_ARG_BACKEND_IDS.get());
-
- argDisplayMap.put(
- ATTR_BACKUP_ID,
- INFO_BACKUP_ARG_BACKUP_ID.get());
-
- argDisplayMap.put(
- ATTR_BACKUP_DIRECTORY_PATH,
- INFO_BACKUP_ARG_BACKUP_DIR.get());
-
- argDisplayMap.put(
- ATTR_TASK_BACKUP_INCREMENTAL_BASE_ID,
- INFO_BACKUP_ARG_INC_BASE_ID.get());
+ argDisplayMap.put(ATTR_TASK_BACKUP_ALL, INFO_BACKUP_ARG_BACKUPALL.get());
+ argDisplayMap.put(ATTR_TASK_BACKUP_COMPRESS, INFO_BACKUP_ARG_COMPRESS.get());
+ argDisplayMap.put(ATTR_TASK_BACKUP_ENCRYPT, INFO_BACKUP_ARG_ENCRYPT.get());
+ argDisplayMap.put(ATTR_TASK_BACKUP_HASH, INFO_BACKUP_ARG_HASH.get());
+ argDisplayMap.put(ATTR_TASK_BACKUP_INCREMENTAL, INFO_BACKUP_ARG_INCREMENTAL.get());
+ argDisplayMap.put(ATTR_TASK_BACKUP_SIGN_HASH, INFO_BACKUP_ARG_SIGN_HASH.get());
+ argDisplayMap.put(ATTR_TASK_BACKUP_BACKEND_ID, INFO_BACKUP_ARG_BACKEND_IDS.get());
+ argDisplayMap.put(ATTR_BACKUP_ID, INFO_BACKUP_ARG_BACKUP_ID.get());
+ argDisplayMap.put(ATTR_BACKUP_DIRECTORY_PATH, INFO_BACKUP_ARG_BACKUP_DIR.get());
+ argDisplayMap.put(ATTR_TASK_BACKUP_INCREMENTAL_BASE_ID, INFO_BACKUP_ARG_INC_BASE_ID.get());
}
@@ -336,7 +304,7 @@
int numBackends = configEntries.size();
- backendsToArchive = new ArrayList<Backend<?>>(numBackends);
+ backendsToArchive = new ArrayList<>(numBackends);
if (backUpAll)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java
index 38eeedb..b787270 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java
@@ -72,63 +72,22 @@
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
- /**
- * Stores mapping between configuration attribute name and its label.
- */
- private static Map<String,LocalizableMessage> argDisplayMap =
- new HashMap<String,LocalizableMessage>();
+ /** Stores mapping between configuration attribute name and its label. */
+ private static Map<String,LocalizableMessage> argDisplayMap = new HashMap<>();
static {
- argDisplayMap.put(
- ATTR_TASK_EXPORT_LDIF_FILE,
- INFO_EXPORT_ARG_LDIF_FILE.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_BACKEND_ID,
- INFO_EXPORT_ARG_BACKEND_ID.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_APPEND_TO_LDIF,
- INFO_EXPORT_ARG_APPEND_TO_LDIF.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_COMPRESS_LDIF,
- INFO_EXPORT_ARG_COMPRESS_LDIF.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_ENCRYPT_LDIF,
- INFO_EXPORT_ARG_ENCRYPT_LDIF.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_SIGN_HASH,
- INFO_EXPORT_ARG_SIGN_HASH.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_INCLUDE_ATTRIBUTE,
- INFO_EXPORT_ARG_INCL_ATTR.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_EXCLUDE_ATTRIBUTE,
- INFO_EXPORT_ARG_EXCL_ATTR.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_INCLUDE_FILTER,
- INFO_EXPORT_ARG_INCL_FILTER.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_EXCLUDE_FILTER,
- INFO_EXPORT_ARG_EXCL_FILTER.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_INCLUDE_BRANCH,
- INFO_EXPORT_ARG_INCL_BRANCH.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_EXCLUDE_BRANCH,
- INFO_EXPORT_ARG_EXCL_BRANCH.get());
-
- argDisplayMap.put(
- ATTR_TASK_EXPORT_WRAP_COLUMN,
- INFO_EXPORT_ARG_WRAP_COLUMN.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_LDIF_FILE, INFO_EXPORT_ARG_LDIF_FILE.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_BACKEND_ID, INFO_EXPORT_ARG_BACKEND_ID.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_APPEND_TO_LDIF, INFO_EXPORT_ARG_APPEND_TO_LDIF.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_COMPRESS_LDIF, INFO_EXPORT_ARG_COMPRESS_LDIF.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_ENCRYPT_LDIF, INFO_EXPORT_ARG_ENCRYPT_LDIF.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_SIGN_HASH, INFO_EXPORT_ARG_SIGN_HASH.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_INCLUDE_ATTRIBUTE, INFO_EXPORT_ARG_INCL_ATTR.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_EXCLUDE_ATTRIBUTE, INFO_EXPORT_ARG_EXCL_ATTR.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_INCLUDE_FILTER, INFO_EXPORT_ARG_INCL_FILTER.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_EXCLUDE_FILTER, INFO_EXPORT_ARG_EXCL_FILTER.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_INCLUDE_BRANCH, INFO_EXPORT_ARG_INCL_BRANCH.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_EXCLUDE_BRANCH, INFO_EXPORT_ARG_EXCL_BRANCH.get());
+ argDisplayMap.put(ATTR_TASK_EXPORT_WRAP_COLUMN, INFO_EXPORT_ARG_WRAP_COLUMN.get());
}
private String ldifFile;
@@ -272,7 +231,7 @@
}
else
{
- excludeFilters = new ArrayList<SearchFilter>();
+ excludeFilters = new ArrayList<>();
for (String filterString : excludeFilterStrings)
{
try
@@ -299,7 +258,7 @@
}
else
{
- includeFilters = new ArrayList<SearchFilter>();
+ includeFilters = new ArrayList<>();
for (String filterString : includeFilterStrings)
{
try
@@ -334,13 +293,13 @@
return TaskState.STOPPED_BY_ERROR;
}
- ArrayList<DN> defaultIncludeBranches = new ArrayList<DN>(backend.getBaseDNs().length);
+ ArrayList<DN> defaultIncludeBranches = new ArrayList<>(backend.getBaseDNs().length);
for (DN dn : backend.getBaseDNs())
{
defaultIncludeBranches.add(dn);
}
- ArrayList<DN> excludeBranches = new ArrayList<DN>();
+ ArrayList<DN> excludeBranches = new ArrayList<>();
if (excludeBranchStrings != null)
{
for (String s : excludeBranchStrings)
@@ -372,7 +331,7 @@
ArrayList<DN> includeBranches;
if (!includeBranchStrings.isEmpty())
{
- includeBranches = new ArrayList<DN>();
+ includeBranches = new ArrayList<>();
for (String s : includeBranchStrings)
{
DN includeBranch;
@@ -533,7 +492,7 @@
{
return null;
}
- HashSet<AttributeType> attributes = new HashSet<AttributeType>();
+ HashSet<AttributeType> attributes = new HashSet<>();
for (String attrName : attributeStrings)
{
String lowerName = attrName.toLowerCase();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java
index 22f3140..d27e887 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java
@@ -73,8 +73,7 @@
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
/** Stores mapping between configuration attribute name and its label. */
- private static final Map<String, LocalizableMessage> argDisplayMap = new HashMap<String, LocalizableMessage>();
-
+ private static final Map<String, LocalizableMessage> argDisplayMap = new HashMap<>();
static
{
argDisplayMap.put(ATTR_IMPORT_LDIF_FILE, INFO_IMPORT_ARG_LDIF_FILE.get());
@@ -178,7 +177,7 @@
AttributeType typeDNCheckPhase2 = getAttributeType(ATTR_IMPORT_SKIP_DN_VALIDATION, true);
ArrayList<String> ldifFilestmp = asListOfStrings(taskEntry, typeLdifFile);
- ldifFiles = new ArrayList<String>(ldifFilestmp.size());
+ ldifFiles = new ArrayList<>(ldifFilestmp.size());
for (String s : ldifFilestmp)
{
File f = new File (s);
@@ -240,8 +239,8 @@
Backend<?> backend = null;
ArrayList<DN> defaultIncludeBranches;
- HashSet<DN> excludeBranches = new HashSet<DN>(excludeBranchStrings.size());
- HashSet<DN> includeBranches = new HashSet<DN>(includeBranchStrings.size());
+ HashSet<DN> excludeBranches = new HashSet<>(excludeBranchStrings.size());
+ HashSet<DN> includeBranches = new HashSet<>(includeBranchStrings.size());
for (String s : includeBranchStrings)
{
@@ -376,7 +375,7 @@
}
// Make sure the selected backend will handle all the include branches
- defaultIncludeBranches = new ArrayList<DN>(backend.getBaseDNs().length);
+ defaultIncludeBranches = new ArrayList<>(backend.getBaseDNs().length);
for (DN dn : backend.getBaseDNs())
{
defaultIncludeBranches.add(dn);
@@ -446,8 +445,7 @@
HashSet<AttributeType> excludeAttributes = toAttributeTypes(excludeAttributeStrings);
HashSet<AttributeType> includeAttributes = toAttributeTypes(includeAttributeStrings);
- ArrayList<SearchFilter> excludeFilters =
- new ArrayList<SearchFilter>(excludeFilterStrings.size());
+ ArrayList<SearchFilter> excludeFilters = new ArrayList<>(excludeFilterStrings.size());
for (String filterString : excludeFilterStrings)
{
try
@@ -461,8 +459,7 @@
}
}
- ArrayList<SearchFilter> includeFilters =
- new ArrayList<SearchFilter>(includeFilterStrings.size());
+ ArrayList<SearchFilter> includeFilters = new ArrayList<>(includeFilterStrings.size());
for (String filterString : includeFilterStrings)
{
try
@@ -480,8 +477,8 @@
// Get the backend into which the LDIF should be imported.
Backend<?> backend = null;
HashSet<DN> defaultIncludeBranches;
- HashSet<DN> excludeBranches = new HashSet<DN>(excludeBranchStrings.size());
- HashSet<DN> includeBranches = new HashSet<DN>(includeBranchStrings.size());
+ HashSet<DN> excludeBranches = new HashSet<>(excludeBranchStrings.size());
+ HashSet<DN> includeBranches = new HashSet<>(includeBranchStrings.size());
for (String s : includeBranchStrings)
{
@@ -558,10 +555,8 @@
}
}
- // Find backends with subordinate base DNs that should be excluded from the
- // import.
-
- defaultIncludeBranches = new HashSet<DN>(backend.getBaseDNs().length);
+ // Find backends with subordinate base DNs that should be excluded from the import.
+ defaultIncludeBranches = new HashSet<>(backend.getBaseDNs().length);
for (DN dn : backend.getBaseDNs())
{
defaultIncludeBranches.add(dn);
@@ -641,7 +636,7 @@
PATH_MAKELDIF_RESOURCE_DIR;
TemplateFile tf = new TemplateFile(resourcePath, random);
- ArrayList<LocalizableMessage> warnings = new ArrayList<LocalizableMessage>();
+ ArrayList<LocalizableMessage> warnings = new ArrayList<>();
try
{
tf.parse(templateFile, warnings);
@@ -656,7 +651,7 @@
}
else
{
- ArrayList<String> fileList = new ArrayList<String>(ldifFiles);
+ ArrayList<String> fileList = new ArrayList<>(ldifFiles);
importConfig = new LDIFImportConfig(fileList);
}
if(tmpDirectory == null)
@@ -841,7 +836,7 @@
private HashSet<AttributeType> toAttributeTypes(ArrayList<String> attrNames)
{
- final HashSet<AttributeType> attrTypes = new HashSet<AttributeType>(attrNames.size());
+ final HashSet<AttributeType> attrTypes = new HashSet<>(attrNames.size());
for (String attrName : attrNames)
{
String lowerName = attrName.toLowerCase();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java
index cb34979..78e9d16 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java
@@ -71,23 +71,12 @@
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
- /**
- * Stores mapping between configuration attribute name and its label.
- */
- private static Map<String,LocalizableMessage> argDisplayMap =
- new HashMap<String,LocalizableMessage>();
+ /** Stores mapping between configuration attribute name and its label. */
+ private static Map<String,LocalizableMessage> argDisplayMap = new HashMap<>();
static {
- argDisplayMap.put(
- ATTR_BACKUP_DIRECTORY_PATH,
- INFO_RESTORE_ARG_BACKUP_DIR.get());
-
- argDisplayMap.put(
- ATTR_BACKUP_ID,
- INFO_RESTORE_ARG_BACKUP_ID.get());
-
- argDisplayMap.put(
- ATTR_TASK_RESTORE_VERIFY_ONLY,
- INFO_RESTORE_ARG_VERIFY_ONLY.get());
+ argDisplayMap.put(ATTR_BACKUP_DIRECTORY_PATH, INFO_RESTORE_ARG_BACKUP_DIR.get());
+ argDisplayMap.put(ATTR_BACKUP_ID, INFO_RESTORE_ARG_BACKUP_ID.get());
+ argDisplayMap.put(ATTR_TASK_RESTORE_VERIFY_ONLY, INFO_RESTORE_ARG_VERIFY_ONLY.get());
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java
index 8d07890..8926338 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java
@@ -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.tasks;
@@ -108,7 +108,7 @@
*/
public static Map<String,ConfigEntry> getBackendConfigEntries()
{
- Map<String,ConfigEntry> configEntries = new HashMap<String,ConfigEntry>();
+ Map<String,ConfigEntry> configEntries = new HashMap<>();
// FIXME The error messages should not be the LDIF import messages
@@ -234,13 +234,13 @@
e.getMessageObject(), e);
}
- ArrayList<ByteString> valueList = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> valueList = new ArrayList<>(1);
valueList.add(ServerConstants.TRUE_VALUE);
LDAPAttribute a = new LDAPAttribute(ATTR_BACKEND_ENABLED, valueList);
LDAPModification m = new LDAPModification(ModificationType.REPLACE, a);
- ArrayList<RawModification> modList = new ArrayList<RawModification>(1);
+ ArrayList<RawModification> modList = new ArrayList<>(1);
modList.add(m);
InternalClientConnection conn =
@@ -284,13 +284,13 @@
e.getMessageObject(), e);
}
- ArrayList<ByteString> valueList = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> valueList = new ArrayList<>(1);
valueList.add(ServerConstants.FALSE_VALUE);
LDAPAttribute a = new LDAPAttribute(ATTR_BACKEND_ENABLED, valueList);
LDAPModification m = new LDAPModification(ModificationType.REPLACE, a);
- ArrayList<RawModification> modList = new ArrayList<RawModification>(1);
+ ArrayList<RawModification> modList = new ArrayList<>(1);
modList.add(m);
InternalClientConnection conn =
@@ -363,7 +363,7 @@
*/
public static ArrayList<String> getMultiValueString(List<Attribute> attrList)
{
- ArrayList<String> valueStrings = new ArrayList<String>();
+ ArrayList<String> valueStrings = new ArrayList<>();
if (attrList != null && !attrList.isEmpty())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java
index b5dcbc5..c7505c2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java
@@ -74,6 +74,7 @@
import org.opends.server.types.RawAttribute;
import org.opends.server.util.args.LDAPConnectionArgumentParser;
+import com.forgerock.opendj.cli.Argument;
import com.forgerock.opendj.cli.ArgumentException;
import com.forgerock.opendj.cli.BooleanArgument;
import com.forgerock.opendj.cli.ClientException;
@@ -342,8 +343,8 @@
else
{
// Check that the backendID has not been expressed twice.
- HashSet<String> backendIDLowerCase = new HashSet<String>();
- HashSet<String> repeatedBackendIds = new HashSet<String>();
+ HashSet<String> backendIDLowerCase = new HashSet<>();
+ HashSet<String> repeatedBackendIds = new HashSet<>();
StringBuilder repeatedBackends = new StringBuilder();
for (String id : backendID.getValues())
{
@@ -433,64 +434,16 @@
@Override
public void addTaskAttributes(List<RawAttribute> attributes)
{
- ArrayList<ByteString> values;
- if (backUpAll.getValue() != null &&
- !backUpAll.getValue().equals(
- backUpAll.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(backUpAll.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_TASK_BACKUP_ALL, values));
- }
-
- if (compress.getValue() != null &&
- !compress.getValue().equals(
- compress.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(compress.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_TASK_BACKUP_COMPRESS, values));
- }
-
- if (encrypt.getValue() != null &&
- !encrypt.getValue().equals(
- encrypt.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(encrypt.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_TASK_BACKUP_ENCRYPT, values));
- }
-
- if (hash.getValue() != null &&
- !hash.getValue().equals(
- hash.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(hash.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_TASK_BACKUP_HASH, values));
- }
-
- if (incremental.getValue() != null &&
- !incremental.getValue().equals(
- incremental.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(incremental.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_TASK_BACKUP_INCREMENTAL, values));
- }
-
- if (signHash.getValue() != null &&
- !signHash.getValue().equals(
- signHash.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(signHash.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_TASK_BACKUP_SIGN_HASH, values));
- }
+ addIfHasValue(attributes, ATTR_TASK_BACKUP_ALL, backUpAll);
+ addIfHasValue(attributes, ATTR_TASK_BACKUP_COMPRESS, compress);
+ addIfHasValue(attributes, ATTR_TASK_BACKUP_ENCRYPT, encrypt);
+ addIfHasValue(attributes, ATTR_TASK_BACKUP_HASH, hash);
+ addIfHasValue(attributes, ATTR_TASK_BACKUP_INCREMENTAL, incremental);
+ addIfHasValue(attributes, ATTR_TASK_BACKUP_SIGN_HASH, signHash);
List<String> backendIDs = backendID.getValues();
if (backendIDs != null && backendIDs.size() > 0) {
- values = new ArrayList<ByteString>(backendIDs.size());
+ ArrayList<ByteString> values = new ArrayList<>(backendIDs.size());
for (String s : backendIDs) {
values.add(ByteString.valueOf(s));
}
@@ -498,33 +451,29 @@
new LDAPAttribute(ATTR_TASK_BACKUP_BACKEND_ID, values));
}
- if (backupIDString.getValue() != null &&
- !backupIDString.getValue().equals(
- backupIDString.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(backupIDString.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_BACKUP_ID, values));
- }
+ addIfHasValue(attributes, ATTR_BACKUP_ID, backupIDString);
+ addIfHasValue(attributes, ATTR_BACKUP_DIRECTORY_PATH, backupDirectory);
+ addIfHasValue(attributes, ATTR_TASK_BACKUP_INCREMENTAL_BASE_ID, incrementalBaseID);
+ }
- if (backupDirectory.getValue() != null &&
- !backupDirectory.getValue().equals(
- backupDirectory.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(backupDirectory.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_BACKUP_DIRECTORY_PATH, values));
+ private void addIfHasValue(List<RawAttribute> attributes, String attrName, Argument arg)
+ {
+ if (hasValueDifferentThanDefaultValue(arg)) {
+ attributes.add(new LDAPAttribute(attrName, asList(arg.getValue())));
}
+ }
- if (incrementalBaseID.getValue() != null &&
- !incrementalBaseID.getValue().equals(
- incrementalBaseID.getDefaultValue())) {
- values = new ArrayList<ByteString>(1);
- values.add(ByteString.valueOf(incrementalBaseID.getValue()));
- attributes.add(
- new LDAPAttribute(ATTR_TASK_BACKUP_INCREMENTAL_BASE_ID, values));
- }
+ private boolean hasValueDifferentThanDefaultValue(Argument arg)
+ {
+ return arg.getValue() != null
+ && !arg.getValue().equals(arg.getDefaultValue());
+ }
+ private ArrayList<ByteString> asList(String value)
+ {
+ ArrayList<ByteString> values = new ArrayList<>(1);
+ values.add(ByteString.valueOf(value));
+ return values;
}
/** {@inheritDoc} */
@@ -703,16 +652,15 @@
// Get information about the backends defined in the server, and determine
// whether we are backing up multiple backends or a single backend.
- ArrayList<Backend> backendList = new ArrayList<Backend>();
- ArrayList<BackendCfg> entryList = new ArrayList<BackendCfg>();
- ArrayList<List<DN>> dnList = new ArrayList<List<DN>>();
+ ArrayList<Backend> backendList = new ArrayList<>();
+ ArrayList<BackendCfg> entryList = new ArrayList<>();
+ ArrayList<List<DN>> dnList = new ArrayList<>();
BackendToolUtils.getBackends(backendList, entryList, dnList);
int numBackends = backendList.size();
boolean multiple;
- ArrayList<Backend<?>> backendsToArchive = new ArrayList<Backend<?>>(numBackends);
- HashMap<String,BackendCfg> configEntries =
- new HashMap<String,BackendCfg>(numBackends);
+ ArrayList<Backend<?>> backendsToArchive = new ArrayList<>(numBackends);
+ HashMap<String,BackendCfg> configEntries = new HashMap<>(numBackends);
if (backUpAll.isPresent())
{
for (int i=0; i < numBackends; i++)
@@ -731,9 +679,8 @@
}
else
{
- // Iterate through the set of backends and pick out those that were
- // requested.
- HashSet<String> requestedBackends = new HashSet<String>(backendID.getValues());
+ // Iterate through the set of backends and pick out those that were requested.
+ HashSet<String> requestedBackends = new HashSet<>(backendID.getValues());
for (int i=0; i < numBackends; i++)
{
Backend<?> b = backendList.get(i);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ConfigureDS.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ConfigureDS.java
index 7fcda78..968f70b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ConfigureDS.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ConfigureDS.java
@@ -521,7 +521,7 @@
try
{
final IntegerArgument[] portArgs = {ldapPort, adminConnectorPort, ldapsPort, jmxPort};
- final Set<Integer> portsAdded = new HashSet<Integer>();
+ final Set<Integer> portsAdded = new HashSet<>();
for (final IntegerArgument portArg : portArgs)
{
@@ -606,7 +606,7 @@
private LinkedList<org.forgerock.opendj.ldap.DN> parseProvidedBaseDNs() throws ConfigureDSException
{
- LinkedList<org.forgerock.opendj.ldap.DN> baseDNs = new LinkedList<org.forgerock.opendj.ldap.DN>();
+ LinkedList<org.forgerock.opendj.ldap.DN> baseDNs = new LinkedList<>();
if (baseDNString.isPresent())
{
for (final String dnString : baseDNString.getValues())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java
index 828b66e..e0b63f6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java
@@ -731,7 +731,7 @@
}
else
{
- ArrayList<String> nameList = new ArrayList<String>(storageSchemes.size());
+ ArrayList<String> nameList = new ArrayList<>(storageSchemes.size());
for (PasswordStorageScheme<?> s : storageSchemes.values())
{
if (authPasswordSchemeName)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java
index ce34cc5..a096cf4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java
@@ -412,14 +412,14 @@
private ArrayList<ByteString> toByteStrings(String value)
{
- final ArrayList<ByteString> values = new ArrayList<ByteString>(1);
+ final ArrayList<ByteString> values = new ArrayList<>(1);
values.add(ByteString.valueOf(value));
return values;
}
private ArrayList<ByteString> toByteStrings(List<String> includeAttributes)
{
- final ArrayList<ByteString> values = new ArrayList<ByteString>(includeAttributes.size());
+ final ArrayList<ByteString> values = new ArrayList<>(includeAttributes.size());
for (String includeAttribute : includeAttributes)
{
values.add(ByteString.valueOf(includeAttribute));
@@ -565,7 +565,7 @@
// Make sure that the Directory Server plugin initialization is performed.
try
{
- HashSet<PluginType> pluginTypes = new HashSet<PluginType>(1);
+ HashSet<PluginType> pluginTypes = new HashSet<>(1);
pluginTypes.add(PluginType.LDIF_EXPORT);
directoryServer.initializePlugins(pluginTypes);
}
@@ -595,7 +595,7 @@
}
else
{
- excludeAttributes = new HashSet<AttributeType>();
+ excludeAttributes = new HashSet<>();
for (String attrName : excludeAttributeStrings.getValues())
{
String lowerName = attrName.toLowerCase();
@@ -616,7 +616,7 @@
}
else
{
- includeAttributes =new HashSet<AttributeType>();
+ includeAttributes = new HashSet<>();
for (String attrName : includeAttributeStrings.getValues())
{
String lowerName = attrName.toLowerCase();
@@ -637,7 +637,7 @@
}
else
{
- excludeFilters = new ArrayList<SearchFilter>();
+ excludeFilters = new ArrayList<>();
for (String filterString : excludeFilterStrings.getValues())
{
try
@@ -664,7 +664,7 @@
}
else
{
- includeFilters = new ArrayList<SearchFilter>();
+ includeFilters = new ArrayList<>();
for (String filterString : includeFilterStrings.getValues())
{
try
@@ -694,9 +694,9 @@
List<DN> defaultIncludeBranches = null;
ArrayList<DN> excludeBranches = null;
- ArrayList<Backend> backendList = new ArrayList<Backend>();
- ArrayList<BackendCfg> entryList = new ArrayList<BackendCfg>();
- ArrayList<List<DN>> dnList = new ArrayList<List<DN>>();
+ ArrayList<Backend> backendList = new ArrayList<>();
+ ArrayList<BackendCfg> entryList = new ArrayList<>();
+ ArrayList<List<DN>> dnList = new ArrayList<>();
BackendToolUtils.getBackends(backendList, entryList, dnList);
int numBackends = backendList.size();
@@ -734,7 +734,7 @@
if (excludeBranchStrings.isPresent())
{
- excludeBranches = new ArrayList<DN>();
+ excludeBranches = new ArrayList<>();
for (String s : excludeBranchStrings.getValues())
{
DN excludeBranch;
@@ -764,7 +764,7 @@
List<DN> includeBranches;
if (includeBranchStrings.isPresent())
{
- includeBranches = new ArrayList<DN>();
+ includeBranches = new ArrayList<>();
for (String s : includeBranchStrings.getValues())
{
DN includeBranch;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
index 6622f51..bfaf117 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
@@ -570,14 +570,14 @@
private ArrayList<ByteString> toByteStrings(String value)
{
- final ArrayList<ByteString> values = new ArrayList<ByteString>(1);
+ final ArrayList<ByteString> values = new ArrayList<>(1);
values.add(ByteString.valueOf(value));
return values;
}
private ArrayList<ByteString> toByteStrings(List<String> attrValues)
{
- final ArrayList<ByteString> values = new ArrayList<ByteString>(attrValues.size());
+ final ArrayList<ByteString> values = new ArrayList<>(attrValues.size());
for (String includeBranche : attrValues)
{
values.add(ByteString.valueOf(includeBranche));
@@ -713,7 +713,7 @@
// Initialize the plugin manager.
try
{
- HashSet<PluginType> pluginTypes = new HashSet<PluginType>(1);
+ HashSet<PluginType> pluginTypes = new HashSet<>(1);
directoryServer.initializePlugins(pluginTypes);
}
catch (Exception e)
@@ -752,7 +752,7 @@
// Make sure that the plugin initialization is performed.
try
{
- HashSet<PluginType> pluginTypes = new HashSet<PluginType>(1);
+ HashSet<PluginType> pluginTypes = new HashSet<>(1);
pluginTypes.add(PluginType.LDIF_IMPORT);
PluginConfigManager pluginConfigManager =
DirectoryServer.getPluginConfigManager();
@@ -776,7 +776,7 @@
}
else
{
- excludeAttributes = new HashSet<AttributeType>();
+ excludeAttributes = new HashSet<>();
for (String attrName : excludeAttributeStrings.getValues())
{
String lowerName = attrName.toLowerCase();
@@ -810,7 +810,7 @@
}
else
{
- includeAttributes = new HashSet<AttributeType>();
+ includeAttributes = new HashSet<>();
for (String attrName : includeAttributeStrings.getValues())
{
String lowerName = attrName.toLowerCase();
@@ -842,7 +842,7 @@
}
else
{
- excludeFilters = new ArrayList<SearchFilter>();
+ excludeFilters = new ArrayList<>();
for (String filterString : excludeFilterStrings.getValues())
{
try
@@ -869,7 +869,7 @@
}
else
{
- includeFilters = new ArrayList<SearchFilter>();
+ includeFilters = new ArrayList<>();
for (String filterString : includeFilterStrings.getValues())
{
try
@@ -896,8 +896,8 @@
// excluded from the import.
Backend<?> backend = null;
Set<DN> defaultIncludeBranches = null;
- Set<DN> excludeBranches = new HashSet<DN>();
- Set<DN> includeBranches = new HashSet<DN>();
+ Set<DN> excludeBranches = new HashSet<>();
+ Set<DN> includeBranches = new HashSet<>();
if (includeBranchStrings.isPresent())
{
@@ -923,9 +923,9 @@
}
}
- ArrayList<Backend> backendList = new ArrayList<Backend>();
- ArrayList<BackendCfg> entryList = new ArrayList<BackendCfg>();
- ArrayList<List<DN>> dnList = new ArrayList<List<DN>>();
+ ArrayList<Backend> backendList = new ArrayList<>();
+ ArrayList<BackendCfg> entryList = new ArrayList<>();
+ ArrayList<List<DN>> dnList = new ArrayList<>();
int code = BackendToolUtils.getBackends(backendList, entryList, dnList);
if (code != 0)
{
@@ -955,7 +955,7 @@
if (backend == null)
{
backend = b;
- defaultIncludeBranches = new HashSet<DN>(dnList.get(i));
+ defaultIncludeBranches = new HashSet<>(dnList.get(i));
}
else
{
@@ -1051,7 +1051,7 @@
LDIFImportConfig importConfig;
if (ldifFiles.isPresent())
{
- ArrayList<String> fileList = new ArrayList<String>(ldifFiles.getValues());
+ ArrayList<String> fileList = new ArrayList<>(ldifFiles.getValues());
int badFileCount = 0;
for (String pathname : fileList)
{
@@ -1073,7 +1073,7 @@
PATH_MAKELDIF_RESOURCE_DIR;
TemplateFile tf = new TemplateFile(resourcePath, random);
- ArrayList<LocalizableMessage> warnings = new ArrayList<LocalizableMessage>();
+ ArrayList<LocalizableMessage> warnings = new ArrayList<>();
try
{
tf.parse(templateFile.getValue(), warnings);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/InstallDSArgumentParser.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/InstallDSArgumentParser.java
index 4fc4a1e..3d7e41e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/InstallDSArgumentParser.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/InstallDSArgumentParser.java
@@ -420,7 +420,7 @@
@Override
public void parseArguments(String[] args) throws ArgumentException
{
- LinkedHashSet<LocalizableMessage> errorMessages = new LinkedHashSet<LocalizableMessage>();
+ LinkedHashSet<LocalizableMessage> errorMessages = new LinkedHashSet<>();
try
{
super.parseArguments(args);
@@ -519,7 +519,7 @@
{
try
{
- Set<Integer> ports = new HashSet<Integer>();
+ Set<Integer> ports = new HashSet<>();
ports.add(ldapPortArg.getIntValue());
checkPortAlreadyUsed(ports, adminConnectorPortArg.getIntValue(), errorMessages,
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java
index 3e8ee7c..c2efae4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java
@@ -111,7 +111,7 @@
@Override
public void parseArguments(String[] args) throws ArgumentException
{
- LinkedHashSet<LocalizableMessage> errorMessages = new LinkedHashSet<LocalizableMessage>();
+ LinkedHashSet<LocalizableMessage> errorMessages = new LinkedHashSet<>();
try
{
super.parseArguments(args);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java
index fe5bb2e..a649f2f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java
@@ -735,8 +735,7 @@
*/
public static LinkedHashMap<String, LocalizableMessage> getSASLAnonymousProperties()
{
- LinkedHashMap<String,LocalizableMessage> properties =
- new LinkedHashMap<String,LocalizableMessage>(1);
+ LinkedHashMap<String,LocalizableMessage> properties = new LinkedHashMap<>(1);
properties.put(SASL_PROPERTY_TRACE,
INFO_LDAPAUTH_PROPERTY_DESCRIPTION_TRACE.get());
@@ -1210,8 +1209,7 @@
*/
public static LinkedHashMap<String,LocalizableMessage> getSASLCRAMMD5Properties()
{
- LinkedHashMap<String,LocalizableMessage> properties =
- new LinkedHashMap<String,LocalizableMessage>(1);
+ LinkedHashMap<String,LocalizableMessage> properties = new LinkedHashMap<>(1);
properties.put(SASL_PROPERTY_AUTHID,
INFO_LDAPAUTH_PROPERTY_DESCRIPTION_AUTHID.get());
@@ -1611,7 +1609,7 @@
// list. Decode that list and make sure the QoP we have chosen is in
// that list.
StringTokenizer tokenizer = new StringTokenizer(tokenValue, ",");
- LinkedList<String> qopModes = new LinkedList<String>();
+ LinkedList<String> qopModes = new LinkedList<>();
while (tokenizer.hasMoreTokens())
{
qopModes.add(toLowerCase(tokenizer.nextToken().trim()));
@@ -2309,8 +2307,7 @@
*/
public static LinkedHashMap<String,LocalizableMessage> getSASLDigestMD5Properties()
{
- LinkedHashMap<String,LocalizableMessage> properties =
- new LinkedHashMap<String,LocalizableMessage>(5);
+ LinkedHashMap<String,LocalizableMessage> properties = new LinkedHashMap<>(5);
properties.put(SASL_PROPERTY_AUTHID,
INFO_LDAPAUTH_PROPERTY_DESCRIPTION_AUTHID.get());
@@ -2507,7 +2504,7 @@
public static LinkedHashMap<String,LocalizableMessage> getSASLExternalProperties()
{
// There are no properties for the SASL EXTERNAL mechanism.
- return new LinkedHashMap<String,LocalizableMessage>(0);
+ return new LinkedHashMap<>(0);
}
@@ -2816,8 +2813,7 @@
*/
public static LinkedHashMap<String,LocalizableMessage> getSASLGSSAPIProperties()
{
- LinkedHashMap<String,LocalizableMessage> properties =
- new LinkedHashMap<String,LocalizableMessage>(4);
+ LinkedHashMap<String,LocalizableMessage> properties = new LinkedHashMap<>(4);
properties.put(SASL_PROPERTY_AUTHID,
INFO_LDAPAUTH_PROPERTY_DESCRIPTION_AUTHID.get());
@@ -3091,8 +3087,7 @@
*/
public static LinkedHashMap<String,LocalizableMessage> getSASLPlainProperties()
{
- LinkedHashMap<String,LocalizableMessage> properties =
- new LinkedHashMap<String,LocalizableMessage>(2);
+ LinkedHashMap<String,LocalizableMessage> properties = new LinkedHashMap<>(2);
properties.put(SASL_PROPERTY_AUTHID,
INFO_LDAPAUTH_PROPERTY_DESCRIPTION_AUTHID.get());
@@ -3130,7 +3125,7 @@
else if (saslMechanism.equals(SASL_MECHANISM_GSSAPI))
{
// Create the property map that will be used by the internal SASL handler.
- HashMap<String,String> saslProperties = new HashMap<String,String>();
+ HashMap<String,String> saslProperties = new HashMap<>();
saslProperties.put(Sasl.QOP, gssapiQoP);
saslProperties.put(Sasl.SERVER_AUTH, "true");
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java
index b1effba..e6a5583 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPCompare.java
@@ -392,7 +392,7 @@
StringArgument propertiesFileArgument = null;
BooleanArgument noPropertiesFileArgument = null;
- ArrayList<String> dnStrings = new ArrayList<String> ();
+ ArrayList<String> dnStrings = new ArrayList<> ();
String attributeType = null;
byte[] attributeVal = null;
Reader rdr = null;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java
index 14e80c8..d50b821 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnection.java
@@ -179,8 +179,8 @@
Socket socket;
Socket startTLSSocket = null;
int resultCode;
- ArrayList<Control> requestControls = new ArrayList<Control> ();
- ArrayList<Control> responseControls = new ArrayList<Control> ();
+ ArrayList<Control> requestControls = new ArrayList<> ();
+ ArrayList<Control> responseControls = new ArrayList<> ();
if (connectionOptions.isVerbose())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnectionOptions.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnectionOptions.java
index 20f8ed5..5e9f821 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnectionOptions.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPConnectionOptions.java
@@ -50,14 +50,10 @@
private SSLConnectionFactory sslConnectionFactory;
private String saslMechanism;
private int versionNumber = 3;
- private Map<String, List<String>> saslProperties =
- new HashMap<String, List<String>> ();
+ private Map<String, List<String>> saslProperties = new HashMap<> ();
private boolean verbose;
- /**
- * Creates a the connection options instance.
- *
- */
+ /** Creates a the connection options instance. */
public LDAPConnectionOptions()
{
}
@@ -66,9 +62,7 @@
* Set whether to use SSL for the connection or not.
*
* @param useSSL True if SSL should be used, false otherwise.
- *
*/
-
public void setUseSSL(boolean useSSL)
{
this.useSSL = useSSL;
@@ -77,8 +71,7 @@
/**
* Return the useSSL flag value.
*
- * @return <CODE>true</CODE> if SSL should be used, or <CODE>false</CODE> if
- * not.
+ * @return {@code true} if SSL should be used, or {@code false} if not.
*/
public boolean useSSL()
{
@@ -222,7 +215,7 @@
List<String> valList = saslProperties.get(key);
if(valList == null)
{
- valList = new ArrayList<String> ();
+ valList = new ArrayList<>();
}
valList.add(value);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java
index 7b82202..409ad41 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPDelete.java
@@ -318,7 +318,7 @@
BooleanArgument noPropertiesFileArgument = null;
Reader rdr = null;
- ArrayList<String> dnStrings = new ArrayList<String> ();
+ ArrayList<String> dnStrings = new ArrayList<>();
// Create the command-line argument parser for use with this program.
LocalizableMessage toolDescription = INFO_LDAPDELETE_TOOL_DESCRIPTION.get();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java
index 66908d0..2338dde 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPModify.java
@@ -256,8 +256,7 @@
operationType = "ADD";
AddChangeRecordEntry addEntry = (AddChangeRecordEntry) entry;
List<Attribute> attrs = addEntry.getAttributes();
- ArrayList<RawAttribute> attributes =
- new ArrayList<RawAttribute>(attrs.size());
+ ArrayList<RawAttribute> attributes = new ArrayList<>(attrs.size());
for(Attribute a : attrs)
{
attributes.add(new LDAPAttribute(a));
@@ -273,8 +272,7 @@
case MODIFY:
operationType = "MODIFY";
ModifyChangeRecordEntry modEntry = (ModifyChangeRecordEntry) entry;
- ArrayList<RawModification> mods =
- new ArrayList<RawModification>(modEntry.getModifications());
+ ArrayList<RawModification> mods = new ArrayList<>(modEntry.getModifications());
protocolOp = new ModifyRequestProtocolOp(asn1OctetStr, mods);
out.println(INFO_PROCESSING_OPERATION.get(operationType, asn1OctetStr));
break;
@@ -1036,7 +1034,7 @@
if (preReadAttributes.isPresent())
{
String valueStr = preReadAttributes.getValue();
- Set<String> attrElements = new LinkedHashSet<String>();
+ Set<String> attrElements = new LinkedHashSet<>();
StringTokenizer tokenizer = new StringTokenizer(valueStr, ", ");
while (tokenizer.hasMoreTokens())
@@ -1051,7 +1049,7 @@
if (postReadAttributes.isPresent())
{
String valueStr = postReadAttributes.getValue();
- Set<String> attrElements = new LinkedHashSet<String>();
+ Set<String> attrElements = new LinkedHashSet<>();
StringTokenizer tokenizer = new StringTokenizer(valueStr, ", ");
while (tokenizer.hasMoreTokens())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPPasswordModify.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPPasswordModify.java
index ce92599..3f093e1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPPasswordModify.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPPasswordModify.java
@@ -561,7 +561,7 @@
// If a control string was provided, then decode the requested controls.
- ArrayList<Control> controls = new ArrayList<Control>();
+ ArrayList<Control> controls = new ArrayList<>();
if(controlStr.isPresent())
{
for (String ctrlString : controlStr.getValues())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java
index 006e253..79349ac 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPSearch.java
@@ -104,7 +104,7 @@
this.nextMessageID = nextMessageID;
this.out = out;
this.err = err;
- responseControls = new ArrayList<Control>();
+ responseControls = new ArrayList<>();
}
@@ -630,8 +630,8 @@
LDAPConnectionOptions connectionOptions = new LDAPConnectionOptions();
LDAPSearchOptions searchOptions = new LDAPSearchOptions();
LDAPConnection connection = null;
- ArrayList<LDAPFilter> filters = new ArrayList<LDAPFilter>();
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ ArrayList<LDAPFilter> filters = new ArrayList<>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
BooleanArgument continueOnError = null;
BooleanArgument countEntries = null;
@@ -766,7 +766,7 @@
baseDN.setPropertyName(OPTION_LONG_BASEDN);
argParser.addArgument(baseDN);
- HashSet<String> allowedScopes = new HashSet<String>();
+ HashSet<String> allowedScopes = new HashSet<>();
allowedScopes.add("base");
allowedScopes.add("one");
allowedScopes.add("sub");
@@ -1299,8 +1299,7 @@
if (pSearchInfo.isPresent())
{
String infoString = toLowerCase(pSearchInfo.getValue().trim());
- HashSet<PersistentSearchChangeType> changeTypes =
- new HashSet<PersistentSearchChangeType>();
+ HashSet<PersistentSearchChangeType> changeTypes = new HashSet<>();
boolean changesOnly = true;
boolean returnECs = true;
@@ -1441,8 +1440,7 @@
if (matchedValuesFilter.isPresent())
{
LinkedList<String> mvFilterStrings = matchedValuesFilter.getValues();
- ArrayList<MatchedValuesFilter> mvFilters =
- new ArrayList<MatchedValuesFilter>();
+ ArrayList<MatchedValuesFilter> mvFilters = new ArrayList<>();
for (String s : mvFilterStrings)
{
try
@@ -1696,8 +1694,7 @@
while (true)
{
- ArrayList<Control> newControls =
- new ArrayList<Control>(origControls.size()+1);
+ ArrayList<Control> newControls = new ArrayList<>(origControls.size() + 1);
newControls.addAll(origControls);
newControls.add(new PagedResultsControl(true, pageSize, cookieValue));
searchOptions.setControls(newControls);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolOptions.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolOptions.java
index 0ebf4a4..ffc1a3a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolOptions.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPToolOptions.java
@@ -41,7 +41,7 @@
private boolean verbose;
private boolean continueOnError;
private String encoding = System.getProperty("file.encoding");
- private ArrayList<Control> controls = new ArrayList<Control>();
+ private ArrayList<Control> controls = new ArrayList<>();
/**
* Creates a the tool options instance.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFDiff.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFDiff.java
index 1d0f3e9..1ae2ee8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFDiff.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFDiff.java
@@ -337,8 +337,8 @@
// Read in ignored entries and attributes if any
BufferedReader ignReader = null;
- Collection<DN> ignoreEntries = new HashSet<DN>();
- Collection<String> ignoreAttrs = new HashSet<String>();
+ Collection<DN> ignoreEntries = new HashSet<>();
+ Collection<String> ignoreAttrs = new HashSet<>();
if (ignoreAttrsFile.getValue() != null)
{
@@ -411,7 +411,7 @@
return OPERATIONS_ERROR;
}
- TreeMap<DN,Entry> sourceMap = new TreeMap<DN,Entry>();
+ TreeMap<DN,Entry> sourceMap = new TreeMap<>();
try
{
while (true)
@@ -451,7 +451,7 @@
return OPERATIONS_ERROR;
}
- TreeMap<DN,Entry> targetMap = new TreeMap<DN,Entry>();
+ TreeMap<DN,Entry> targetMap = new TreeMap<>();
try
{
while (true)
@@ -764,16 +764,12 @@
throws IOException
{
// Create a list to hold the modifications that are found.
- LinkedList<Modification> modifications = new LinkedList<Modification>();
+ LinkedList<Modification> modifications = new LinkedList<>();
// Look at the set of objectclasses for the entries.
- LinkedHashSet<ObjectClass> sourceClasses =
- new LinkedHashSet<ObjectClass>(
- sourceEntry.getObjectClasses().keySet());
- LinkedHashSet<ObjectClass> targetClasses =
- new LinkedHashSet<ObjectClass>(
- targetEntry.getObjectClasses().keySet());
+ LinkedHashSet<ObjectClass> sourceClasses = new LinkedHashSet<>(sourceEntry.getObjectClasses().keySet());
+ LinkedHashSet<ObjectClass> targetClasses = new LinkedHashSet<>(targetEntry.getObjectClasses().keySet());
Iterator<ObjectClass> sourceClassIterator = sourceClasses.iterator();
while (sourceClassIterator.hasNext())
{
@@ -814,9 +810,7 @@
// Look at the user attributes for the entries.
- LinkedHashSet<AttributeType> sourceTypes =
- new LinkedHashSet<AttributeType>(
- sourceEntry.getUserAttributes().keySet());
+ LinkedHashSet<AttributeType> sourceTypes = new LinkedHashSet<>(sourceEntry.getUserAttributes().keySet());
Iterator<AttributeType> sourceTypeIterator = sourceTypes.iterator();
while (sourceTypeIterator.hasNext())
{
@@ -935,13 +929,13 @@
Attribute a = m.getAttribute();
if (a.isEmpty())
{
- LinkedList<Modification> attrMods = new LinkedList<Modification>();
+ LinkedList<Modification> attrMods = new LinkedList<>();
attrMods.add(m);
writer.writeModifyChangeRecord(sourceEntry.getName(), attrMods);
}
else
{
- LinkedList<Modification> attrMods = new LinkedList<Modification>();
+ LinkedList<Modification> attrMods = new LinkedList<>();
for (ByteString v : a)
{
AttributeBuilder builder = new AttributeBuilder(a, true);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFModify.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFModify.java
index ec5e22c..d8ccf4f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFModify.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFModify.java
@@ -133,14 +133,10 @@
throws IOException, LDIFException
{
// Read the changes into memory.
- TreeMap<DN,AddChangeRecordEntry> adds =
- new TreeMap<DN,AddChangeRecordEntry>();
- TreeMap<DN,Entry> ldifEntries =
- new TreeMap<DN,Entry>();
- HashMap<DN,DeleteChangeRecordEntry> deletes =
- new HashMap<DN,DeleteChangeRecordEntry>();
- HashMap<DN,LinkedList<Modification>> modifications =
- new HashMap<DN,LinkedList<Modification>>();
+ TreeMap<DN,AddChangeRecordEntry> adds = new TreeMap<>();
+ TreeMap<DN,Entry> ldifEntries = new TreeMap<>();
+ HashMap<DN,DeleteChangeRecordEntry> deletes = new HashMap<>();
+ HashMap<DN,LinkedList<Modification>> modifications = new HashMap<>();
while (true)
{
@@ -212,7 +208,7 @@
modifications.get(changeDN);
if (mods == null)
{
- mods = new LinkedList<Modification>();
+ mods = new LinkedList<>();
modifications.put(changeDN, mods);
}
@@ -314,12 +310,9 @@
// Perform any adds that may be necessary.
for (AddChangeRecordEntry add : adds.values())
{
- Map<ObjectClass,String> objectClasses =
- new LinkedHashMap<ObjectClass,String>();
- Map<AttributeType,List<Attribute>> userAttributes =
- new LinkedHashMap<AttributeType,List<Attribute>>();
- Map<AttributeType,List<Attribute>> operationalAttributes =
- new LinkedHashMap<AttributeType,List<Attribute>>();
+ Map<ObjectClass,String> objectClasses = new LinkedHashMap<>();
+ Map<AttributeType,List<Attribute>> userAttributes = new LinkedHashMap<>();
+ Map<AttributeType,List<Attribute>> operationalAttributes = new LinkedHashMap<>();
for (Attribute a : add.getAttributes())
{
@@ -339,7 +332,7 @@
List<Attribute> attrList = operationalAttributes.get(t);
if (attrList == null)
{
- attrList = new LinkedList<Attribute>();
+ attrList = new LinkedList<>();
operationalAttributes.put(t, attrList);
}
attrList.add(a);
@@ -349,7 +342,7 @@
List<Attribute> attrList = userAttributes.get(t);
if (attrList == null)
{
- attrList = new LinkedList<Attribute>();
+ attrList = new LinkedList<>();
userAttributes.put(t, attrList);
}
attrList.add(a);
@@ -637,8 +630,8 @@
}
- // Actually invoke the LDIF procesing.
- LinkedList<LocalizableMessage> errorList = new LinkedList<LocalizableMessage>();
+ // Actually invoke the LDIF processing.
+ LinkedList<LocalizableMessage> errorList = new LinkedList<>();
boolean successful;
try
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java
index da278e1..3c6a62e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java
@@ -118,7 +118,7 @@
PrintStream err = NullOutputStream.wrapOrNullStream(errStream);
JDKLogging.disableLogging();
- LinkedHashSet<String> scopeStrings = new LinkedHashSet<String>(4);
+ LinkedHashSet<String> scopeStrings = new LinkedHashSet<>(4);
scopeStrings.add(SCOPE_STRING_BASE);
scopeStrings.add(SCOPE_STRING_ONE);
scopeStrings.add(SCOPE_STRING_SUB);
@@ -273,9 +273,9 @@
//Return objectclass attribute unless analysis of the arguments determines
//otherwise.
boolean includeObjectclassAttrs = true;
- final LinkedList<String> attributeNames = new LinkedList<String>();
- LinkedList<String> objectClassNames = new LinkedList<String>();
- LinkedList<String> filterStrings = new LinkedList<String>();
+ final LinkedList<String> attributeNames = new LinkedList<>();
+ LinkedList<String> objectClassNames = new LinkedList<>();
+ LinkedList<String> filterStrings = new LinkedList<>();
if (filterFile.isPresent())
{
BufferedReader in = null;
@@ -342,7 +342,7 @@
{
Iterator<String> iterator = trailingArguments.iterator();
- filterStrings = new LinkedList<String>();
+ filterStrings = new LinkedList<>();
filterStrings.add(iterator.next());
while (iterator.hasNext())
@@ -466,7 +466,7 @@
// Create the list of filters that will be used to process the searches.
- LinkedList<SearchFilter> searchFilters = new LinkedList<SearchFilter>();
+ LinkedList<SearchFilter> searchFilters = new LinkedList<>();
for (String filterString : filterStrings)
{
try
@@ -484,10 +484,8 @@
// Transform the attributes to return from strings to attribute types.
- LinkedHashSet<AttributeType> userAttributeTypes =
- new LinkedHashSet<AttributeType>();
- LinkedHashSet<AttributeType> operationalAttributeTypes =
- new LinkedHashSet<AttributeType>();
+ LinkedHashSet<AttributeType> userAttributeTypes = new LinkedHashSet<>();
+ LinkedHashSet<AttributeType> operationalAttributeTypes = new LinkedHashSet<>();
for (String attributeName : attributeNames)
{
AttributeType t = DirectoryServer.getAttributeType(attributeName, true);
@@ -531,7 +529,7 @@
// Set the base DNs for the import config.
- LinkedList<DN> baseDNs = new LinkedList<DN>();
+ LinkedList<DN> baseDNs = new LinkedList<>();
if (baseDNString.isPresent())
{
for (String dnString : baseDNString.getValues())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ListBackends.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ListBackends.java
index d3e4fe2..32808e4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ListBackends.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ListBackends.java
@@ -328,7 +328,7 @@
{
// Create a map from the base DNs of the backends to the corresponding
// backend ID.
- TreeMap<DN,String> baseToIDMap = new TreeMap<DN,String>();
+ TreeMap<DN,String> baseToIDMap = new TreeMap<>();
for (String id : backends.keySet())
{
for (DN dn : backends.get(id))
@@ -406,7 +406,7 @@
}
else
{
- backendIDs = new LinkedList<String>(backends.keySet());
+ backendIDs = new LinkedList<>(backends.keySet());
}
// Figure out the length of the longest backend ID and base DN defined in
@@ -541,9 +541,8 @@
}
- // Iterate through the immediate children, attempting to parse them as
- // backends.
- TreeMap<String,TreeSet<DN>> backendMap = new TreeMap<String,TreeSet<DN>>();
+ // Iterate through the immediate children, attempting to parse them as backends.
+ TreeMap<String,TreeSet<DN>> backendMap = new TreeMap<>();
for (ConfigEntry configEntry : baseEntry.getChildren().values())
{
// Get the backend ID attribute from the entry. If there isn't one, then
@@ -580,7 +579,7 @@
// Get the base DN attribute from the entry. If there isn't one, then
// just skip this entry.
- TreeSet<DN> baseDNs = new TreeSet<DN>();
+ TreeSet<DN> baseDNs = new TreeSet<>();
try
{
LocalizableMessage msg = INFO_CONFIG_BACKEND_ATTR_DESCRIPTION_BASE_DNS.get();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageAccount.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageAccount.java
index 342807b..19c91d7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageAccount.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageAccount.java
@@ -646,7 +646,7 @@
{
reader.readStartSequence();
opType = (int)reader.readInteger();
- opValues = new ArrayList<String>();
+ opValues = new ArrayList<>();
if (reader.hasNextElement())
{
reader.readStartSequence();
@@ -971,7 +971,7 @@
argParser.setUsageArgument(showUsage, out);
- HashSet<String> booleanValues = new HashSet<String>(2);
+ HashSet<String> booleanValues = new HashSet<>(2);
booleanValues.add(INFO_MULTICHOICE_TRUE_VALUE.get().toString());
booleanValues.add(INFO_MULTICHOICE_FALSE_VALUE.get().toString());
@@ -1305,7 +1305,7 @@
if (saslOption.isPresent())
{
String mechanism = null;
- LinkedList<String> options = new LinkedList<String>();
+ LinkedList<String> options = new LinkedList<>();
for (String s : saslOption.getValues())
{
@@ -1554,7 +1554,7 @@
Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
if ((a != null) && a.isPresent())
{
- ArrayList<String> valueList = new ArrayList<String>(a.getValues());
+ ArrayList<String> valueList = new ArrayList<>(a.getValues());
String[] values = new String[valueList.size()];
valueList.toArray(values);
@@ -1667,7 +1667,7 @@
Argument a = subCommand.getArgumentForName(ARG_OP_VALUE);
if ((a != null) && a.isPresent())
{
- ArrayList<String> valueList = new ArrayList<String>(a.getValues());
+ ArrayList<String> valueList = new ArrayList<>(a.getValues());
String[] values = new String[valueList.size()];
valueList.toArray(values);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java
index 4c130d4..14e4f20 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java
@@ -400,8 +400,7 @@
List<TaskEntry> entries = taskClient.getTaskEntries();
if (entries.size() > 0) {
TableBuilder table = new TableBuilder();
- Map<String, TaskEntry> mapIdToEntry =
- new TreeMap<String, TaskEntry>();
+ Map<String, TaskEntry> mapIdToEntry = new TreeMap<>();
for (TaskEntry entry : entries) {
String taskId = entry.getId();
if (taskId != null) {
@@ -443,13 +442,12 @@
*/
private Menu<Void> getSummaryMenu()
throws LDAPException, IOException, DecodeException {
- List<String> taskIds = new ArrayList<String>();
- List<Integer> cancelableIndices = new ArrayList<Integer>();
+ List<String> taskIds = new ArrayList<>();
+ List<Integer> cancelableIndices = new ArrayList<>();
List<TaskEntry> entries = taskClient.getTaskEntries();
- MenuBuilder<Void> menuBuilder = new MenuBuilder<Void>(this);
+ MenuBuilder<Void> menuBuilder = new MenuBuilder<>(this);
if (entries.size() > 0) {
- Map<String, TaskEntry> mapIdToEntry =
- new TreeMap<String, TaskEntry>();
+ Map<String, TaskEntry> mapIdToEntry = new TreeMap<>();
for (TaskEntry entry : entries) {
String taskId = entry.getId();
if (taskId != null) {
@@ -612,8 +610,7 @@
taskEntry = app.getTaskClient().getTaskEntry(taskId);
// Show the menu
- MenuBuilder<TaskEntry> menuBuilder =
- new MenuBuilder<TaskEntry>(app);
+ MenuBuilder<TaskEntry> menuBuilder = new MenuBuilder<>(app);
menuBuilder.addBackOption(true);
menuBuilder.addCharOption(
INFO_TASKINFO_CMD_REFRESH_CHAR.get(),
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/RebuildIndex.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/RebuildIndex.java
index c8a42ce..4d58b72 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/RebuildIndex.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/RebuildIndex.java
@@ -635,9 +635,9 @@
{
Backend<?> backend = null;
- final ArrayList<Backend> backendList = new ArrayList<Backend>();
- final ArrayList<BackendCfg> entryList = new ArrayList<BackendCfg>();
- final ArrayList<List<DN>> dnList = new ArrayList<List<DN>>();
+ final ArrayList<Backend> backendList = new ArrayList<>();
+ final ArrayList<BackendCfg> entryList = new ArrayList<>();
+ final ArrayList<List<DN>> dnList = new ArrayList<>();
BackendToolUtils.getBackends(backendList, entryList, dnList);
final int numBackends = backendList.size();
@@ -767,7 +767,7 @@
addLdapAttribute(attributes, ATTR_REBUILD_BASE_DN, baseDNString.getValue());
final List<String> indexes = indexList.getValues();
- final ArrayList<ByteString> values = new ArrayList<ByteString>(indexes.size());
+ final ArrayList<ByteString> values = new ArrayList<>(indexes.size());
for (final String s : indexes)
{
values.add(ByteString.valueOf(s));
@@ -814,7 +814,7 @@
private ArrayList<ByteString> toByteStrings(String value)
{
- final ArrayList<ByteString> values = new ArrayList<ByteString>(1);
+ final ArrayList<ByteString> values = new ArrayList<>(1);
values.add(ByteString.valueOf(value));
return values;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/RestoreDB.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/RestoreDB.java
index 5c67047..f7987ef 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/RestoreDB.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/RestoreDB.java
@@ -308,7 +308,7 @@
private ArrayList<ByteString> toByteStrings(String value)
{
- final ArrayList<ByteString> values = new ArrayList<ByteString>(1);
+ final ArrayList<ByteString> values = new ArrayList<>(1);
values.add(ByteString.valueOf(value));
return values;
}
@@ -555,9 +555,9 @@
// Get information about the backends defined in the server and determine
// which to use for the restore.
- ArrayList<Backend> backendList = new ArrayList<Backend>();
- ArrayList<BackendCfg> entryList = new ArrayList<BackendCfg>();
- ArrayList<List<DN>> dnList = new ArrayList<List<DN>>();
+ ArrayList<Backend> backendList = new ArrayList<>();
+ ArrayList<BackendCfg> entryList = new ArrayList<>();
+ ArrayList<List<DN>> dnList = new ArrayList<>();
BackendToolUtils.getBackends(backendList, entryList, dnList);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
index 15a2976..d6f0732 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
@@ -529,7 +529,7 @@
if (saslOption.isPresent())
{
String mechanism = null;
- LinkedList<String> options = new LinkedList<String>();
+ LinkedList<String> options = new LinkedList<>();
for (String s : saslOption.getValues())
{
@@ -617,43 +617,39 @@
ByteString.valueOf(ATTR_TASK_ID + "=" + taskID + "," +
SCHEDULED_TASK_BASE_RDN + "," + DN_TASK_ROOT);
- ArrayList<RawAttribute> attributes = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> attributes = new ArrayList<>();
- ArrayList<ByteString> ocValues = new ArrayList<ByteString>(3);
+ ArrayList<ByteString> ocValues = new ArrayList<>(3);
ocValues.add(ByteString.valueOf("top"));
ocValues.add(ByteString.valueOf("ds-task"));
ocValues.add(ByteString.valueOf("ds-task-shutdown"));
attributes.add(new LDAPAttribute(ATTR_OBJECTCLASS, ocValues));
- ArrayList<ByteString> taskIDValues = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> taskIDValues = new ArrayList<>(1);
taskIDValues.add(ByteString.valueOf(taskID));
attributes.add(new LDAPAttribute(ATTR_TASK_ID, taskIDValues));
- ArrayList<ByteString> classValues = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> classValues = new ArrayList<>(1);
classValues.add(ByteString.valueOf(ShutdownTask.class.getName()));
attributes.add(new LDAPAttribute(ATTR_TASK_CLASS, classValues));
if (restart.isPresent())
{
- ArrayList<ByteString> restartValues =
- new ArrayList<ByteString>(1);
+ ArrayList<ByteString> restartValues = new ArrayList<>(1);
restartValues.add(ByteString.valueOf("true"));
attributes.add(new LDAPAttribute(ATTR_RESTART_SERVER, restartValues));
}
if (stopReason.isPresent())
{
- ArrayList<ByteString> stopReasonValues =
- new ArrayList<ByteString>(1);
+ ArrayList<ByteString> stopReasonValues = new ArrayList<>(1);
stopReasonValues.add(ByteString.valueOf(stopReason.getValue()));
- attributes.add(new LDAPAttribute(ATTR_SHUTDOWN_MESSAGE,
- stopReasonValues));
+ attributes.add(new LDAPAttribute(ATTR_SHUTDOWN_MESSAGE, stopReasonValues));
}
if (stopTime != null)
{
- ArrayList<ByteString> stopTimeValues =
- new ArrayList<ByteString>(1);
+ ArrayList<ByteString> stopTimeValues = new ArrayList<>(1);
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_GMT_TIME);
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
@@ -662,7 +658,7 @@
stopTimeValues));
}
- ArrayList<Control> controls = new ArrayList<Control>();
+ ArrayList<Control> controls = new ArrayList<>();
if (proxyAuthzID.isPresent())
{
Control c = new ProxiedAuthV2Control(
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/VerifyIndex.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/VerifyIndex.java
index c006607..d2a647a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/VerifyIndex.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/VerifyIndex.java
@@ -363,9 +363,9 @@
// through them, finding the one backend to be verified.
Backend<?> backend = null;
- ArrayList<Backend> backendList = new ArrayList<Backend>();
- ArrayList<BackendCfg> entryList = new ArrayList<BackendCfg>();
- ArrayList<List<DN>> dnList = new ArrayList<List<DN>>();
+ ArrayList<Backend> backendList = new ArrayList<>();
+ ArrayList<BackendCfg> entryList = new ArrayList<>();
+ ArrayList<List<DN>> dnList = new ArrayList<>();
BackendToolUtils.getBackends(backendList, entryList, dnList);
int numBackends = backendList.size();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalScheduleInformation.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalScheduleInformation.java
index 0ad458a..4f5953f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalScheduleInformation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalScheduleInformation.java
@@ -68,7 +68,7 @@
/** {@inheritDoc} */
public void addTaskAttributes(List<RawAttribute> attributes)
{
- ArrayList<ByteString> baseDNs = new ArrayList<ByteString>();
+ ArrayList<ByteString> baseDNs = new ArrayList<>();
for (String baseDN : uData.getBaseDNs())
{
baseDNs.add(ByteString.valueOf(baseDN));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java
index 216ef79..0d10b27 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java
@@ -286,7 +286,7 @@
{
int returnValue;
super.validateGlobalOptions(buf);
- ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>();
+ ArrayList<LocalizableMessage> errors = new ArrayList<>();
if (secureArgsList.bindPasswordArg.isPresent() &&
secureArgsList.bindPasswordFileArg.isPresent()) {
LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(
@@ -302,9 +302,7 @@
String file = equivalentCommandFileArgument.getValue();
if (!canWrite(file))
{
- errors.add(
- ERR_REPLICATION_CANNOT_WRITE_EQUIVALENT_COMMAND_LINE_FILE.get(
- file));
+ errors.add(ERR_REPLICATION_CANNOT_WRITE_EQUIVALENT_COMMAND_LINE_FILE.get(file));
}
else
{
@@ -390,8 +388,7 @@
private void initializeGlobalArguments(OutputStream outStream)
throws ArgumentException
{
- ArrayList<Argument> defaultArgs =
- new ArrayList<Argument>(createGlobalArguments(outStream, alwaysSSL));
+ ArrayList<Argument> defaultArgs = new ArrayList<>(createGlobalArguments(outStream, alwaysSSL));
Argument[] argsToRemove = {
secureArgsList.hostNameArg,
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationUserData.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationUserData.java
index 1dc067b..7630839 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationUserData.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationUserData.java
@@ -22,9 +22,8 @@
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
- * Portions Copyright 2013 ForgeRock AS.
+ * Portions Copyright 2013-2015 ForgeRock AS.
*/
-
package org.opends.server.tools.dsreplication;
import java.util.LinkedList;
@@ -34,11 +33,10 @@
* This class is used to store the information provided by the user in the
* replication command line. It is required because when we are in interactive
* mode the ReplicationCliArgumentParser is not enough.
- *
*/
public abstract class ReplicationUserData
{
- private final LinkedList<String> baseDNs = new LinkedList<String>();
+ private final LinkedList<String> baseDNs = new LinkedList<>();
private String adminUid;
private String adminPwd;
@@ -84,7 +82,7 @@
*/
public List<String> getBaseDNs()
{
- return new LinkedList<String>(baseDNs);
+ return new LinkedList<>(baseDNs);
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Branch.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Branch.java
index 678fd88..6f6f3cd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Branch.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Branch.java
@@ -115,8 +115,8 @@
// Get the RDN template lines based just on the entry DN.
Entry entry = createEntry(branchDN);
- ArrayList<LocalizableMessage> warnings = new ArrayList<LocalizableMessage>();
- ArrayList<TemplateLine> lineList = new ArrayList<TemplateLine>();
+ ArrayList<LocalizableMessage> warnings = new ArrayList<>();
+ ArrayList<TemplateLine> lineList = new ArrayList<>();
for (String ocName : entry.getObjectClasses().values())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIF.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIF.java
index cfee7b9..b106bdc 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIF.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIF.java
@@ -321,24 +321,21 @@
// Load and parse the template file.
- LinkedList<LocalizableMessage> warnings = new LinkedList<LocalizableMessage>();
- TemplateFile templateFile = new TemplateFile(resourcePath.getValue(),
- random);
+ LinkedList<LocalizableMessage> warnings = new LinkedList<>();
+ TemplateFile templateFile = new TemplateFile(resourcePath.getValue(), random);
try
{
templateFile.parse(templatePath.getValue(), warnings);
}
catch (IOException ioe)
{
- LocalizableMessage message = ERR_MAKELDIF_IOEXCEPTION_DURING_PARSE.get(
- ioe.getMessage());
+ LocalizableMessage message = ERR_MAKELDIF_IOEXCEPTION_DURING_PARSE.get(ioe.getMessage());
err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
- LocalizableMessage message = ERR_MAKELDIF_EXCEPTION_DURING_PARSE.get(
- e.getMessage());
+ LocalizableMessage message = ERR_MAKELDIF_EXCEPTION_DURING_PARSE.get(e.getMessage());
err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java
index 9ca5fb0..d750cef 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java
@@ -98,7 +98,7 @@
allGenerated = false;
closed = false;
- entryQueue = new LinkedBlockingQueue<TemplateEntry>(10);
+ entryQueue = new LinkedBlockingQueue<>(10);
ioException = null;
entryBytes = null;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Template.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Template.java
index 5845db7..2721660 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Template.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Template.java
@@ -29,6 +29,7 @@
import org.forgerock.i18n.LocalizableMessage;
import java.io.IOException;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
@@ -173,12 +174,8 @@
// Make sure that all of the RDN attributes are defined.
- HashSet<AttributeType> rdnAttrs =
- new HashSet<AttributeType>(rdnAttributes.length);
- for (AttributeType t : rdnAttributes)
- {
- rdnAttrs.add(t);
- }
+ HashSet<AttributeType> rdnAttrs = new HashSet<>(rdnAttributes.length);
+ Collections.addAll(rdnAttrs, rdnAttributes);
for (TemplateLine l : templateLines)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
index 7a69ae3..c117fc0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
@@ -48,10 +48,8 @@
{
/** The branch used to generate this entry (if it is associated with a branch). */
private Branch branch;
-
/** The DN for this template entry, if it is known. */
private DN dn;
-
/** The DN of the parent entry for this template entry, if it is available. */
private DN parentDN;
@@ -59,16 +57,12 @@
* The set of attributes associated with this template entry, mapped from the
* lowercase name of the attribute to the list of generated values.
*/
- private LinkedHashMap<AttributeType,ArrayList<TemplateValue>> attributes;
+ private final LinkedHashMap<AttributeType, ArrayList<TemplateValue>> attributes = new LinkedHashMap<>();
- /**
- * The template used to generate this entry (if it is associated with a
- * template).
- */
+ /** The template used to generate this entry (if it is associated with a template). */
private Template template;
-
/**
* Creates a new template entry that will be associated with the provided
* branch.
@@ -80,9 +74,6 @@
this.branch = branch;
dn = branch.getBranchDN();
- template = null;
- parentDN = null;
- attributes = new LinkedHashMap<AttributeType,ArrayList<TemplateValue>>();
}
@@ -98,10 +89,6 @@
{
this.template = template;
this.parentDN = parentDN;
-
- dn = null;
- branch = null;
- attributes = new LinkedHashMap<AttributeType,ArrayList<TemplateValue>>();
}
@@ -257,11 +244,10 @@
*/
public void addValue(TemplateValue value)
{
- ArrayList<TemplateValue> valueList =
- attributes.get(value.getAttributeType());
+ ArrayList<TemplateValue> valueList = attributes.get(value.getAttributeType());
if (valueList == null)
{
- valueList = new ArrayList<TemplateValue>();
+ valueList = new ArrayList<>();
attributes.put(value.getAttributeType(), valueList);
}
valueList.add(value);
@@ -287,17 +273,12 @@
public boolean toLDIF(LDIFExportConfig exportConfig)
throws IOException, LDIFException
{
-// Process all of the attributes for this entry.
- LinkedHashMap<ObjectClass,String> objectClasses =
- new LinkedHashMap<ObjectClass,String>();
- LinkedHashMap<AttributeType,List<Attribute>> userAttributes =
- new LinkedHashMap<AttributeType,List<Attribute>>();
- LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes =
- new LinkedHashMap<AttributeType,List<Attribute>>();
- LinkedHashMap<AttributeType, List<Attribute>> urlAttributes =
- new LinkedHashMap<AttributeType, List<Attribute>>();
- LinkedHashMap<AttributeType, List<Attribute>> base64Attributes =
- new LinkedHashMap<AttributeType, List<Attribute>>();
+ // Process all of the attributes for this entry.
+ LinkedHashMap<ObjectClass,String> objectClasses = new LinkedHashMap<>();
+ LinkedHashMap<AttributeType,List<Attribute>> userAttributes = new LinkedHashMap<>();
+ LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes = new LinkedHashMap<>();
+ LinkedHashMap<AttributeType, List<Attribute>> urlAttributes = new LinkedHashMap<>();
+ LinkedHashMap<AttributeType, List<Attribute>> base64Attributes = new LinkedHashMap<>();
for (AttributeType t : attributes.keySet())
{
@@ -490,7 +471,7 @@
private ArrayList<Attribute> asList(AttributeBuilder builder)
{
- ArrayList<Attribute> attrList = new ArrayList<Attribute>(1);
+ ArrayList<Attribute> attrList = new ArrayList<>(1);
attrList.add(builder.toAttribute());
return attrList;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java
index f316f7c..6fc7a50 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java
@@ -25,10 +25,9 @@
* Portions Copyright 2013-2015 ForgeRock AS.
*/
package org.opends.server.tools.makeldif;
+
import org.forgerock.i18n.LocalizableMessage;
-
-
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
@@ -49,40 +48,28 @@
import org.opends.server.types.InitializationException;
import static org.opends.messages.ToolMessages.*;
-
import static org.opends.server.util.StaticUtils.*;
-
-
/**
* This class defines a template file, which is a collection of constant
* definitions, branches, and templates.
*/
public class TemplateFile
{
- /**
- * The name of the file holding the list of first names.
- */
+ /** The name of the file holding the list of first names. */
public static final String FIRST_NAME_FILE = "first.names";
-
-
-
- /**
- * The name of the file holding the list of last names.
- */
+ /** The name of the file holding the list of last names. */
public static final String LAST_NAME_FILE = "last.names";
-
/**
* A map of the contents of various text files used during the parsing
* process, mapped from absolute path to the array of lines in the file.
*/
- private HashMap<String,String[]> fileLines;
+ private final HashMap<String, String[]> fileLines = new HashMap<>();
/** The index of the next first name value that should be used. */
private int firstNameIndex;
-
/** The index of the next last name value that should be used. */
private int lastNameIndex;
@@ -91,7 +78,6 @@
* first/last name list has been completed.
*/
private int nameLoopCounter;
-
/**
* A counter that will be used in case we have exhausted all possible first
* and last name combinations.
@@ -99,23 +85,19 @@
private int nameUniquenessCounter;
/** The set of branch definitions for this template file. */
- private LinkedHashMap<DN,Branch> branches;
-
+ private final LinkedHashMap<DN, Branch> branches = new LinkedHashMap<>();
/** The set of constant definitions for this template file. */
- private LinkedHashMap<String,String> constants;
-
+ private final LinkedHashMap<String, String> constants = new LinkedHashMap<>();
/** The set of registered tags for this template file. */
- private LinkedHashMap<String,Tag> registeredTags;
-
+ private final LinkedHashMap<String, Tag> registeredTags = new LinkedHashMap<>();
/** The set of template definitions for this template file. */
- private LinkedHashMap<String,Template> templates;
+ private final LinkedHashMap<String, Template> templates = new LinkedHashMap<>();
/** The random number generator for this template file. */
private Random random;
/** The next first name that should be used. */
private String firstName;
-
/** The next last name that should be used. */
private String lastName;
@@ -124,13 +106,11 @@
* anywhere else.
*/
private String resourcePath;
-
/** The path to the directory containing the template file, if available. */
private String templatePath;
/** The set of first names to use when generating the LDIF. */
private String[] firstNames;
-
/** The set of last names to use when generating the LDIF. */
private String[] lastNames;
@@ -164,19 +144,8 @@
this.resourcePath = resourcePath;
this.random = random;
- fileLines = new HashMap<String,String[]>();
- branches = new LinkedHashMap<DN,Branch>();
- constants = new LinkedHashMap<String,String>();
- registeredTags = new LinkedHashMap<String,Tag>();
- templates = new LinkedHashMap<String,Template>();
- templatePath = null;
firstNames = new String[0];
lastNames = new String[0];
- firstName = null;
- lastName = null;
- firstNameIndex = 0;
- lastNameIndex = 0;
- nameLoopCounter = 0;
nameUniquenessCounter = 1;
registerDefaultTags();
@@ -462,44 +431,34 @@
throws IOException
{
File f = getFile(FIRST_NAME_FILE);
- ArrayList<String> nameList = new ArrayList<String>();
- BufferedReader reader = new BufferedReader(new FileReader(f));
- while (true)
- {
- String line = reader.readLine();
- if (line == null)
- {
- break;
- }
- else
- {
- nameList.add(line);
- }
- }
- reader.close();
+ List<String> nameList = readLines(f);
firstNames = new String[nameList.size()];
nameList.toArray(firstNames);
f = getFile(LAST_NAME_FILE);
- nameList = new ArrayList<String>();
- reader = new BufferedReader(new FileReader(f));
- while (true)
- {
- String line = reader.readLine();
- if (line == null)
- {
- break;
- }
- else
- {
- nameList.add(line);
- }
- }
- reader.close();
+ nameList = readLines(f);
lastNames = new String[nameList.size()];
nameList.toArray(lastNames);
}
+ private List<String> readLines(File f) throws IOException
+ {
+ try (BufferedReader reader = new BufferedReader(new FileReader(f)))
+ {
+ ArrayList<String> lines = new ArrayList<>();
+ while (true)
+ {
+ String line = reader.readLine();
+ if (line == null)
+ {
+ break;
+ }
+ lines.add(line);
+ }
+ return lines;
+ }
+ }
+
/**
@@ -602,8 +561,6 @@
public void parse(String filename, List<LocalizableMessage> warnings)
throws IOException, InitializationException, MakeLDIFException
{
- ArrayList<String> fileLines = new ArrayList<String>();
-
templatePath = null;
File f = getFile(filename);
if ((f == null) || (! f.exists()))
@@ -611,27 +568,9 @@
LocalizableMessage message = ERR_MAKELDIF_COULD_NOT_FIND_TEMPLATE_FILE.get(filename);
throw new IOException(message.toString());
}
- else
- {
- templatePath = f.getParentFile().getAbsolutePath();
- }
+ templatePath = f.getParentFile().getAbsolutePath();
- BufferedReader reader = new BufferedReader(new FileReader(f));
- while (true)
- {
- String line = reader.readLine();
- if (line == null)
- {
- break;
- }
- else
- {
- fileLines.add(line);
- }
- }
-
- reader.close();
-
+ List<String> fileLines = readLines(f);
String[] lines = new String[fileLines.size()];
fileLines.toArray(lines);
parse(lines, warnings);
@@ -660,25 +599,21 @@
public void parse(InputStream inputStream, List<LocalizableMessage> warnings)
throws IOException, InitializationException, MakeLDIFException
{
- ArrayList<String> fileLines = new ArrayList<String>();
+ ArrayList<String> fileLines = new ArrayList<>();
- BufferedReader reader =
- new BufferedReader(new InputStreamReader(inputStream));
- while (true)
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)))
{
- String line = reader.readLine();
- if (line == null)
+ while (true)
{
- break;
- }
- else
- {
+ String line = reader.readLine();
+ if (line == null)
+ {
+ break;
+ }
fileLines.add(line);
}
}
- reader.close();
-
String[] lines = new String[fileLines.size()];
fileLines.toArray(lines);
parse(lines, warnings);
@@ -702,14 +637,10 @@
throws InitializationException, MakeLDIFException
{
// Create temporary variables that will be used to hold the data read.
- LinkedHashMap<String,Tag> templateFileIncludeTags =
- new LinkedHashMap<String,Tag>();
- LinkedHashMap<String,String> templateFileConstants =
- new LinkedHashMap<String,String>();
- LinkedHashMap<DN,Branch> templateFileBranches =
- new LinkedHashMap<DN,Branch>();
- LinkedHashMap<String,Template> templateFileTemplates =
- new LinkedHashMap<String,Template>();
+ LinkedHashMap<String,Tag> templateFileIncludeTags = new LinkedHashMap<>();
+ LinkedHashMap<String,String> templateFileConstants = new LinkedHashMap<>();
+ LinkedHashMap<DN,Branch> templateFileBranches = new LinkedHashMap<>();
+ LinkedHashMap<String,Template> templateFileTemplates = new LinkedHashMap<>();
for (int lineNumber=0; lineNumber < lines.length; lineNumber++)
{
@@ -803,7 +734,7 @@
else if (lowerLine.startsWith("branch: "))
{
int startLineNumber = lineNumber;
- ArrayList<String> lineList = new ArrayList<String>();
+ ArrayList<String> lineList = new ArrayList<>();
lineList.add(line);
while (true)
{
@@ -818,12 +749,8 @@
{
break;
}
- else
- {
- line = replaceConstants(line, lineNumber,
- templateFileConstants, warnings);
- lineList.add(line);
- }
+ line = replaceConstants(line, lineNumber, templateFileConstants, warnings);
+ lineList.add(line);
}
String[] branchLines = new String[lineList.size()];
@@ -846,7 +773,7 @@
else if (lowerLine.startsWith("template: "))
{
int startLineNumber = lineNumber;
- ArrayList<String> lineList = new ArrayList<String>();
+ ArrayList<String> lineList = new ArrayList<>();
lineList.add(line);
while (true)
{
@@ -861,12 +788,8 @@
{
break;
}
- else
- {
- line = replaceConstants(line, lineNumber,
- templateFileConstants, warnings);
- lineList.add(line);
- }
+ line = replaceConstants(line, lineNumber, templateFileConstants, warnings);
+ lineList.add(line);
}
String[] templateLines = new String[lineList.size()];
@@ -881,10 +804,7 @@
LocalizableMessage message = ERR_MAKELDIF_CONFLICTING_TEMPLATE_NAME.get(t.getName(), startLineNumber);
throw new MakeLDIFException(message);
}
- else
- {
- templateFileTemplates.put(lowerName, t);
- }
+ templateFileTemplates.put(lowerName, t);
}
else
{
@@ -1129,8 +1049,8 @@
int arrayLineNumber = 1;
Template parentTemplate = null;
AttributeType[] rdnAttributes = null;
- ArrayList<String> subTemplateNames = new ArrayList<String>();
- ArrayList<Integer> entriesPerTemplate = new ArrayList<Integer>();
+ ArrayList<String> subTemplateNames = new ArrayList<>();
+ ArrayList<Integer> entriesPerTemplate = new ArrayList<>();
for ( ; arrayLineNumber < templateLines.length; arrayLineNumber++)
{
int lineNumber = startLineNumber + arrayLineNumber;
@@ -1157,7 +1077,7 @@
{
// This is the set of RDN attributes. If there are multiple, they may
// be separated by plus signs.
- ArrayList<AttributeType> attrList = new ArrayList<AttributeType>();
+ ArrayList<AttributeType> attrList = new ArrayList<>();
String rdnAttrNames = lowerLine.substring(9).trim();
StringTokenizer tokenizer = new StringTokenizer(rdnAttrNames, "+");
while (tokenizer.hasMoreTokens())
@@ -1390,7 +1310,7 @@
int phase = PARSING_STATIC_TEXT;
int previousPhase = PARSING_STATIC_TEXT;
- ArrayList<Tag> tagList = new ArrayList<Tag>();
+ ArrayList<Tag> tagList = new ArrayList<>();
StringBuilder buffer = new StringBuilder();
for ( ; pos < length; pos++)
@@ -1554,7 +1474,7 @@
}
}
- ArrayList<String> argList = new ArrayList<String>();
+ ArrayList<String> argList = new ArrayList<>();
while (tokenizer.hasMoreTokens())
{
argList.add(tokenizer.nextToken().trim());
@@ -1627,7 +1547,7 @@
// number of characters to use from the attribute value. The arguments will
// be delimited by colons.
StringTokenizer tokenizer = new StringTokenizer(tagString, ":");
- ArrayList<String> argList = new ArrayList<String>();
+ ArrayList<String> argList = new ArrayList<>();
while (tokenizer.hasMoreTokens())
{
argList.add(tokenizer.nextToken());
@@ -1720,30 +1640,13 @@
*
* @throws IOException If a problem occurs while reading the file.
*/
- public String[] getFileLines(File file)
- throws IOException
+ public String[] getFileLines(File file) throws IOException
{
String absolutePath = file.getAbsolutePath();
String[] lines = fileLines.get(absolutePath);
if (lines == null)
{
- ArrayList<String> lineList = new ArrayList<String>();
-
- BufferedReader reader = new BufferedReader(new FileReader(file));
- while (true)
- {
- String line = reader.readLine();
- if (line == null)
- {
- break;
- }
- else
- {
- lineList.add(line);
- }
- }
-
- reader.close();
+ List<String> lineList = readLines(file);
lines = new String[lineList.size()];
lineList.toArray(lines);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java
index fe3aef8..7257a1d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java
@@ -575,7 +575,7 @@
Set<DN> administrators = desc.getAdministrativeUsers();
if (administrators.size() > 0)
{
- TreeSet<DN> ordered = new TreeSet<DN>(administrators);
+ TreeSet<DN> ordered = new TreeSet<>(administrators);
for (DN dn : ordered)
{
writeLabelValue(INFO_ADMINISTRATIVE_USERS_LABEL.get(), dn.toString(), maxLabelWidth);
@@ -743,7 +743,7 @@
println(centerTitle(title));
}
- Set<BaseDNDescriptor> replicas = new HashSet<BaseDNDescriptor>();
+ Set<BaseDNDescriptor> replicas = new HashSet<>();
Set<BackendDescriptor> bs = desc.getBackends();
for (BackendDescriptor backend: bs)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCliArgumentParser.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCliArgumentParser.java
index 632058e..aed8a1a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCliArgumentParser.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCliArgumentParser.java
@@ -26,6 +26,8 @@
*/
package org.opends.server.tools.status;
+import static com.forgerock.opendj.cli.CommonArguments.*;
+
import static org.opends.messages.AdminToolMessages.*;
import static org.opends.messages.ToolMessages.*;
@@ -39,7 +41,6 @@
import com.forgerock.opendj.cli.Argument;
import com.forgerock.opendj.cli.ArgumentException;
import com.forgerock.opendj.cli.BooleanArgument;
-import com.forgerock.opendj.cli.CommonArguments;
import com.forgerock.opendj.cli.IntegerArgument;
import com.forgerock.opendj.cli.StringArgument;
@@ -85,27 +86,24 @@
public void initializeGlobalArguments(OutputStream outStream)
throws ArgumentException
{
- ArrayList<Argument> defaultArgs =
- new ArrayList<Argument>(createGlobalArguments(outStream, alwaysSSL));
+ ArrayList<Argument> defaultArgs = new ArrayList<>(createGlobalArguments(outStream, alwaysSSL));
defaultArgs.remove(secureArgsList.portArg);
defaultArgs.remove(secureArgsList.hostNameArg);
defaultArgs.remove(verboseArg);
defaultArgs.remove(noPropertiesFileArg);
defaultArgs.remove(propertiesFileArg);
- noPromptArg = CommonArguments.getNoPrompt();
+ noPromptArg = getNoPrompt();
defaultArgs.add(0, noPromptArg);
- scriptFriendlyArg = CommonArguments.getScriptFriendly();
+ scriptFriendlyArg = getScriptFriendly();
defaultArgs.add(1, scriptFriendlyArg);
- StringArgument propertiesFileArgument
- = CommonArguments.getPropertiesFile();
+ StringArgument propertiesFileArgument = getPropertiesFile();
defaultArgs.add(propertiesFileArgument);
setFilePropertiesArgument(propertiesFileArgument);
- BooleanArgument noPropertiesFileArgument =
- CommonArguments.getNoPropertiesFile();
+ BooleanArgument noPropertiesFileArgument = getNoPropertiesFile();
defaultArgs.add(noPropertiesFileArgument);
setNoPropertiesFileArgument(noPropertiesFileArgument);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java
index 5153724..fc8e991 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java
@@ -185,9 +185,9 @@
taskID = df.format(new Date());
}
- ArrayList<RawAttribute> attributes = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> attributes = new ArrayList<>();
- ArrayList<ByteString> ocValues = new ArrayList<ByteString>(3);
+ ArrayList<ByteString> ocValues = new ArrayList<>(3);
ocValues.add(ByteString.valueOf("top"));
ocValues.add(ByteString.valueOf(ConfigConstants.OC_TASK));
@@ -198,7 +198,7 @@
ocValues.add(ByteString.valueOf(information.getTaskObjectclass()));
attributes.add(new LDAPAttribute(ATTR_OBJECTCLASS, ocValues));
- ArrayList<ByteString> taskIDValues = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> taskIDValues = new ArrayList<>(1);
taskIDValues.add(ByteString.valueOf(taskID));
if (scheduleRecurring) {
@@ -206,7 +206,7 @@
}
attributes.add(new LDAPAttribute(ATTR_TASK_ID, taskIDValues));
- ArrayList<ByteString> classValues = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> classValues = new ArrayList<>(1);
classValues.add(ByteString.valueOf(information.getTaskClass().getName()));
attributes.add(new LDAPAttribute(ATTR_TASK_CLASS, classValues));
@@ -214,69 +214,57 @@
Date startDate = information.getStartDateTime();
if (startDate != null) {
String startTimeString = StaticUtils.formatDateTimeString(startDate);
- ArrayList<ByteString> startDateValues =
- new ArrayList<ByteString>(1);
+ ArrayList<ByteString> startDateValues = new ArrayList<>(1);
startDateValues.add(ByteString.valueOf(startTimeString));
- attributes.add(new LDAPAttribute(ATTR_TASK_SCHEDULED_START_TIME,
- startDateValues));
+ attributes.add(new LDAPAttribute(ATTR_TASK_SCHEDULED_START_TIME, startDateValues));
}
if (scheduleRecurring) {
- ArrayList<ByteString> recurringPatternValues =
- new ArrayList<ByteString>(1);
+ ArrayList<ByteString> recurringPatternValues = new ArrayList<>(1);
recurringPatternValues.add(ByteString.valueOf(
information.getRecurringDateTime()));
- attributes.add(new LDAPAttribute(ATTR_RECURRING_TASK_SCHEDULE,
- recurringPatternValues));
+ attributes.add(new LDAPAttribute(ATTR_RECURRING_TASK_SCHEDULE, recurringPatternValues));
}
// add dependency IDs
List<String> dependencyIds = information.getDependencyIds();
if (dependencyIds != null && dependencyIds.size() > 0) {
- ArrayList<ByteString> dependencyIdValues =
- new ArrayList<ByteString>(dependencyIds.size());
+ ArrayList<ByteString> dependencyIdValues = new ArrayList<>(dependencyIds.size());
for (String dependencyId : dependencyIds) {
dependencyIdValues.add(ByteString.valueOf(dependencyId));
}
- attributes.add(new LDAPAttribute(ATTR_TASK_DEPENDENCY_IDS,
- dependencyIdValues));
+ attributes.add(new LDAPAttribute(ATTR_TASK_DEPENDENCY_IDS, dependencyIdValues));
// add the dependency action
FailedDependencyAction fda = information.getFailedDependencyAction();
if (fda == null) {
fda = FailedDependencyAction.defaultValue();
}
- ArrayList<ByteString> fdaValues =
- new ArrayList<ByteString>(1);
+ ArrayList<ByteString> fdaValues = new ArrayList<>(1);
fdaValues.add(ByteString.valueOf(fda.name()));
- attributes.add(new LDAPAttribute(ATTR_TASK_FAILED_DEPENDENCY_ACTION,
- fdaValues));
+ attributes.add(new LDAPAttribute(ATTR_TASK_FAILED_DEPENDENCY_ACTION, fdaValues));
}
// add completion notification email addresses
List<String> compNotifEmailAddresss =
information.getNotifyUponCompletionEmailAddresses();
if (compNotifEmailAddresss != null && compNotifEmailAddresss.size() > 0) {
- ArrayList<ByteString> compNotifEmailAddrValues =
- new ArrayList<ByteString>(compNotifEmailAddresss.size());
+ ArrayList<ByteString> compNotifEmailAddrValues = new ArrayList<>(compNotifEmailAddresss.size());
for (String emailAddr : compNotifEmailAddresss) {
compNotifEmailAddrValues.add(ByteString.valueOf(emailAddr));
}
- attributes.add(new LDAPAttribute(ATTR_TASK_NOTIFY_ON_COMPLETION,
- compNotifEmailAddrValues));
+ attributes.add(new LDAPAttribute(ATTR_TASK_NOTIFY_ON_COMPLETION, compNotifEmailAddrValues));
}
// add error notification email addresses
List<String> errNotifEmailAddresss =
information.getNotifyUponErrorEmailAddresses();
if (errNotifEmailAddresss != null && errNotifEmailAddresss.size() > 0) {
- ArrayList<ByteString> errNotifEmailAddrValues =
- new ArrayList<ByteString>(errNotifEmailAddresss.size());
+ ArrayList<ByteString> errNotifEmailAddrValues = new ArrayList<>(errNotifEmailAddresss.size());
for (String emailAddr : errNotifEmailAddresss) {
errNotifEmailAddrValues.add(ByteString.valueOf(emailAddr));
}
- attributes.add(new LDAPAttribute(ATTR_TASK_NOTIFY_ON_ERROR,
- errNotifEmailAddrValues));
+ attributes.add(new LDAPAttribute(ATTR_TASK_NOTIFY_ON_ERROR, errNotifEmailAddrValues));
}
information.addTaskAttributes(attributes);
@@ -301,12 +289,11 @@
LDAPReader reader = connection.getLDAPReader();
LDAPWriter writer = connection.getLDAPWriter();
- ArrayList<Control> controls = new ArrayList<Control>();
+ ArrayList<Control> controls = new ArrayList<>();
ArrayList<RawAttribute> attributes = getTaskAttributes(information);
ByteString entryDN = ByteString.valueOf(getTaskDN(attributes));
- AddRequestProtocolOp addRequest = new AddRequestProtocolOp(entryDN,
- attributes);
+ AddRequestProtocolOp addRequest = new AddRequestProtocolOp(entryDN, attributes);
LDAPMessage requestMessage =
new LDAPMessage(nextMessageID.getAndIncrement(), addRequest, controls);
@@ -352,7 +339,7 @@
*/
public synchronized List<TaskEntry> getTaskEntries()
throws LDAPException, IOException, DecodeException {
- List<Entry> entries = new ArrayList<Entry>();
+ List<Entry> entries = new ArrayList<>();
writeSearch(new SearchRequestProtocolOp(
ByteString.valueOf(ConfigConstants.DN_TASK_ROOT),
@@ -383,7 +370,7 @@
}
}
while (opType != LDAPConstants.OP_TYPE_SEARCH_RESULT_DONE);
- List<TaskEntry> taskEntries = new ArrayList<TaskEntry>(entries.size());
+ List<TaskEntry> taskEntries = new ArrayList<>(entries.size());
for (Entry entry : entries) {
taskEntries.add(new TaskEntry(entry));
}
@@ -463,9 +450,9 @@
ByteString dn = ByteString.valueOf(entry.getDN().toString());
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
String newState;
if (TaskState.isPending(state)) {
newState = TaskState.CANCELED_BEFORE_STARTING.name();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskEntry.java
index a908297..c479c19 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskEntry.java
@@ -59,11 +59,8 @@
*/
public class TaskEntry {
- private static Map<String, LocalizableMessage> mapClassToTypeName =
- new HashMap<String, LocalizableMessage>();
-
- private static Map<String, LocalizableMessage> mapAttrToDisplayName =
- new HashMap<String, LocalizableMessage>();
+ private static Map<String, LocalizableMessage> mapClassToTypeName = new HashMap<>();
+ private static Map<String, LocalizableMessage> mapAttrToDisplayName = new HashMap<>();
private int hashCode;
@@ -71,7 +68,7 @@
* These attributes associated with the ds-task object
* class are all handled explicitly below in the constructor.
*/
- private static Set<String> supAttrNames = new HashSet<String>();
+ private static Set<String> supAttrNames = new HashSet<>();
static {
supAttrNames.add("ds-task-id");
supAttrNames.add("ds-task-class-name");
@@ -108,8 +105,7 @@
*/
private Task task;
- private Map<LocalizableMessage, List<String>> taskSpecificAttrValues =
- new HashMap<LocalizableMessage, List<String>>();
+ private Map<LocalizableMessage, List<String>> taskSpecificAttrValues = new HashMap<>();
/**
* Creates a parameterized instance.
@@ -148,7 +144,7 @@
for (ByteString av : attr) {
List<String> valueList = taskSpecificAttrValues.get(attrTypeName);
if (valueList == null) {
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
taskSpecificAttrValues.put(attrTypeName, valueList);
}
valueList.add(av.toString());
@@ -329,7 +325,7 @@
* @return array of log messages
*/
public List<LocalizableMessage> getLogMessages() {
- List<LocalizableMessage> formattedLogs = new ArrayList<LocalizableMessage>();
+ List<LocalizableMessage> formattedLogs = new ArrayList<>();
for (String aLog : logs) {
formattedLogs.add(LocalizableMessage.raw(aLog));
}
@@ -448,7 +444,7 @@
}
private List<String> getMultiStringValue(Entry entry, String attrName) {
- List<String> valuesList = new ArrayList<String>();
+ List<String> valuesList = new ArrayList<>();
List<Attribute> attrList = entry.getAttribute(attrName);
if (attrList != null) {
for (Attribute attr : attrList) {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleInteraction.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleInteraction.java
index 513e0eb..adc84ba 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleInteraction.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleInteraction.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS
+ * Portions Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.tools.tasks;
@@ -198,8 +198,7 @@
{
checkHeaderDisplay();
- MenuBuilder<FailedDependencyAction> builder =
- new MenuBuilder<FailedDependencyAction>(app);
+ MenuBuilder<FailedDependencyAction> builder = new MenuBuilder<>(app);
builder.setPrompt(INFO_TASK_FAILED_DEPENDENCY_ACTION_PROMPT.get());
builder.addCancelOption(false);
for (FailedDependencyAction choice : FailedDependencyAction.values())
@@ -222,7 +221,6 @@
{
throw new ClientException(ReturnCode.ERROR_UNEXPECTED, LocalizableMessage.EMPTY);
}
-
}
private void runDependency() throws ClientException
@@ -246,7 +244,7 @@
if (hasDependencies)
{
printAvailableDependencyTaskMessage();
- HashSet<String> dependencies = new HashSet<String>();
+ HashSet<String> dependencies = new HashSet<>();
while (true)
{
String dependencyID =
@@ -338,29 +336,25 @@
{
checkHeaderDisplay();
- List<String> addresses = new ArrayList<String>();
+ List<String> addresses = new ArrayList<>();
boolean hasNotification =
app.confirmAction(hasNotificationPrompt, false);
if (hasNotification)
{
- HashSet<String> set = new HashSet<String>();
+ HashSet<String> set = new HashSet<>();
while (true)
{
- String address =
- app.readLineOfInput(emailAddressPrompt);
- if (address != null && !address.isEmpty())
+ String address = app.readLineOfInput(emailAddressPrompt);
+ if (address == null || address.isEmpty())
{
- if (!StaticUtils.isEmailAddress(address)) {
- app.println(ERR_INVALID_EMAIL_ADDRESS.get(address));
- }
- else
- {
- set.add(address);
- }
+ break;
+ }
+ if (!StaticUtils.isEmailAddress(address)) {
+ app.println(ERR_INVALID_EMAIL_ADDRESS.get(address));
}
else
{
- break;
+ set.add(address);
}
}
addresses.addAll(set);
@@ -412,7 +406,7 @@
{
checkHeaderDisplay();
- MenuBuilder<ScheduleOption> builder = new MenuBuilder<ScheduleOption>(app);
+ MenuBuilder<ScheduleOption> builder = new MenuBuilder<>(app);
builder.setPrompt(INFO_TASK_SCHEDULE_PROMPT.get(taskName));
builder.addCancelOption(false);
for (ScheduleOption choice : ScheduleOption.values())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleUserData.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleUserData.java
index 62b5f6e..59b2467 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleUserData.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskScheduleUserData.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS
+ * Portions Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.tools.tasks;
@@ -51,13 +51,10 @@
private boolean startNow;
private Date startDate;
private String recurringDateTime;
- private final List<String> dependencyIds =
- new ArrayList<String>();
+ private final List<String> dependencyIds = new ArrayList<>();
private FailedDependencyAction failedDependencyAction;
- private final List<String> notifyUponCompletionEmailAddresses =
- new ArrayList<String>();
- private final List<String> notifyUponErrorEmailAddresses =
- new ArrayList<String>();
+ private final List<String> notifyUponCompletionEmailAddresses = new ArrayList<>();
+ private final List<String> notifyUponErrorEmailAddresses = new ArrayList<>();
/**
* Whether the arguments provided by the user, indicate that the task should
@@ -300,4 +297,4 @@
}
return arg;
}
-}
\ No newline at end of file
+}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskTool.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskTool.java
index 949678e..feb8e99 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskTool.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskTool.java
@@ -304,7 +304,7 @@
// Poll the task printing log messages until finished
String taskId = taskEntry.getId();
- Set<LocalizableMessage> printedLogMessages = new HashSet<LocalizableMessage>();
+ Set<LocalizableMessage> printedLogMessages = new HashSet<>();
do {
taskEntry = tc.getTaskEntry(taskId);
List<LocalizableMessage> logs = taskEntry.getLogMessages();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java
index 78b1221..1159ee2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java
@@ -81,10 +81,8 @@
static boolean hasPostUpgradeTask;
/** Developers should register upgrade tasks below. */
- private static final NavigableMap<BuildVersion, List<UpgradeTask>> TASKS =
- new TreeMap<BuildVersion, List<UpgradeTask>>();
- private static final List<UpgradeTask> MANDATORY_TASKS =
- new LinkedList<UpgradeTask>();
+ private static final NavigableMap<BuildVersion, List<UpgradeTask>> TASKS = new TreeMap<>();
+ private static final List<UpgradeTask> MANDATORY_TASKS = new LinkedList<>();
static
{
@@ -431,7 +429,7 @@
private static List<UpgradeTask> getUpgradeTasks(
final BuildVersion fromVersion, final BuildVersion toVersion)
{
- final List<UpgradeTask> tasks = new LinkedList<UpgradeTask>();
+ final List<UpgradeTask> tasks = new LinkedList<>();
for (final List<UpgradeTask> subList : TASKS.subMap(fromVersion, false,
toVersion, true).values())
{
@@ -591,7 +589,7 @@
List<UpgradeTask> taskList = TASKS.get(version);
if (taskList == null)
{
- taskList = new LinkedList<UpgradeTask>();
+ taskList = new LinkedList<>();
TASKS.put(version, taskList);
}
taskList.addAll(Arrays.asList(tasks));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeCli.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeCli.java
index 4d8f781..663164d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeCli.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeCli.java
@@ -418,7 +418,7 @@
else if (c instanceof ConfirmationCallback)
{
final ConfirmationCallback cc = (ConfirmationCallback) c;
- List<String> choices = new ArrayList<String>();
+ List<String> choices = new ArrayList<>();
final String defaultOption = getDefaultOption(cc.getDefaultOption());
StringBuilder prompt =
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java
index 6d2ab34..82fd890 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java
@@ -63,7 +63,7 @@
static int countErrors;
/** Contains all the indexes to rebuild. */
- static Set<String> indexesToRebuild = new HashSet<String>();
+ static Set<String> indexesToRebuild = new HashSet<>();
/** A flag to avoid rebuild single indexes if 'rebuild all' is selected. */
static boolean isRebuildAllIndexesIsPresent;
@@ -568,7 +568,7 @@
public void postUpgrade(final UpgradeContext context) throws ClientException
{
LocalizableMessage message = null;
- final List<String> args = new LinkedList<String>();
+ final List<String> args = new LinkedList<>();
if (isRebuildAllIndexesIsPresent && isRebuildAllIndexesTaskAccepted)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java
index 2fc3e61..152d7ff 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java
@@ -376,7 +376,7 @@
{
final Schema schema = getUpgradeSchema();
- final List<String> listBackends = new LinkedList<String>();
+ final List<String> listBackends = new LinkedList<>();
LDIFEntryReader entryReader = null;
try
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/AbstractOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/types/AbstractOperation.java
index c4ae513..99c0d6d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/AbstractOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/AbstractOperation.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.types;
@@ -69,8 +69,7 @@
* The set of response controls that will always be returned for
* an abandon operation.
*/
- protected static final List<Control> NO_RESPONSE_CONTROLS =
- new ArrayList<Control>(0);
+ protected static final List<Control> NO_RESPONSE_CONTROLS = new ArrayList<>(0);
/** The client connection with which this operation is associated. */
protected final ClientConnection clientConnection;
@@ -192,7 +191,7 @@
if (requestControls == null)
{
- this.requestControls = new ArrayList<Control>(0);
+ this.requestControls = new ArrayList<>(0);
}
else
{
@@ -202,7 +201,7 @@
resultCode = ResultCode.UNDEFINED;
additionalLogItems = null;
errorMessage = new LocalizableMessageBuilder();
- attachments = new HashMap<String,Object>();
+ attachments = new HashMap<>();
matchedDN = null;
referralURLs = null;
cancelResult = null;
@@ -401,7 +400,7 @@
Reject.ifNull(item);
if (additionalLogItems == null)
{
- additionalLogItems = new LinkedList<AdditionalLogItem>();
+ additionalLogItems = new LinkedList<>();
}
additionalLogItems.add(item);
}
@@ -729,7 +728,7 @@
{
if (postResponseCallbacks == null)
{
- postResponseCallbacks = new LinkedList<Runnable>();
+ postResponseCallbacks = new LinkedList<>();
}
postResponseCallbacks.add(callback);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/AccountStatusNotification.java b/opendj-server-legacy/src/main/java/org/opends/server/types/AccountStatusNotification.java
index ff2ca68..2404447 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/AccountStatusNotification.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/AccountStatusNotification.java
@@ -99,9 +99,7 @@
if (notificationProperties == null)
{
- this.notificationProperties =
- new HashMap<AccountStatusNotificationProperty,
- List<String>>(0);
+ this.notificationProperties = new HashMap<>(0);
}
else
{
@@ -233,13 +231,11 @@
List<ByteString> oldPasswords,
List<ByteString> newPasswords)
{
- HashMap<AccountStatusNotificationProperty,List<String>> props =
- new HashMap<AccountStatusNotificationProperty,
- List<String>>(4);
+ HashMap<AccountStatusNotificationProperty,List<String>> props = new HashMap<>(4);
PasswordPolicy policy = pwPolicyState.getAuthenticationPolicy();
- ArrayList<String> propList = new ArrayList<String>(1);
+ ArrayList<String> propList = new ArrayList<>(1);
propList.add(policy.getDN().toString());
props.put(PASSWORD_POLICY_DN, propList);
@@ -248,18 +244,17 @@
long secondsUntilUnlock = policy.getLockoutDuration();
if (secondsUntilUnlock > 0L)
{
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add(String.valueOf(secondsUntilUnlock));
props.put(SECONDS_UNTIL_UNLOCK, propList);
- propList = new ArrayList<String>(1);
- propList.add(
- secondsToTimeString(secondsUntilUnlock).toString());
+ propList = new ArrayList<>(1);
+ propList.add(secondsToTimeString(secondsUntilUnlock).toString());
props.put(TIME_UNTIL_UNLOCK, propList);
long unlockTime = System.currentTimeMillis() +
(1000*secondsUntilUnlock);
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add(new Date(unlockTime).toString());
props.put(ACCOUNT_UNLOCK_TIME, propList);
}
@@ -267,18 +262,16 @@
if (timeToExpiration >= 0)
{
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add(String.valueOf(timeToExpiration));
props.put(SECONDS_UNTIL_EXPIRATION, propList);
- propList = new ArrayList<String>(1);
- propList.add(
- secondsToTimeString(timeToExpiration).toString());
+ propList = new ArrayList<>(1);
+ propList.add(secondsToTimeString(timeToExpiration).toString());
props.put(TIME_UNTIL_EXPIRATION, propList);
- long expTime = System.currentTimeMillis() +
- (1000*timeToExpiration);
- propList = new ArrayList<String>(1);
+ long expTime = System.currentTimeMillis() + (1000*timeToExpiration);
+ propList = new ArrayList<>(1);
propList.add(new Date(expTime).toString());
props.put(PASSWORD_EXPIRATION_TIME, propList);
}
@@ -298,7 +291,7 @@
private static ArrayList<String> toStrings(List<ByteString> byteStrings)
{
- ArrayList<String> results = new ArrayList<String>(byteStrings.size());
+ ArrayList<String> results = new ArrayList<>(byteStrings.size());
for (ByteString v : byteStrings)
{
results.add(v.toString());
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java b/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
index 7efe7d9..327420d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
@@ -673,7 +673,7 @@
if (initialCapacity > 1)
{
- elements = new LinkedHashSet<T>(initialCapacity);
+ elements = new LinkedHashSet<>(initialCapacity);
}
}
@@ -696,7 +696,7 @@
return false;
}
- elements = new LinkedHashSet<T>(2);
+ elements = new LinkedHashSet<>(2);
// Move the first value into the set.
elements.add(firstElement);
@@ -716,7 +716,7 @@
if (firstElement != null)
{
- elements = new LinkedHashSet<T>(1 + c.size());
+ elements = new LinkedHashSet<>(1 + c.size());
elements.add(firstElement);
firstElement = null;
return elements.addAll(c);
@@ -732,7 +732,7 @@
firstElement = c.iterator().next();
return true;
default:
- elements = new LinkedHashSet<T>(c);
+ elements = new LinkedHashSet<>(c);
return true;
}
}
@@ -844,7 +844,7 @@
if (initialCapacity > 1)
{
- elements = new LinkedHashSet<T>(initialCapacity);
+ elements = new LinkedHashSet<>(initialCapacity);
}
}
@@ -1046,7 +1046,7 @@
private SortedSet<String> normalizedOptions;
/** The set of options. */
- private final SmallSet<String> options = new SmallSet<String>();
+ private final SmallSet<String> options = new SmallSet<>();
/** The set of attribute values, which are lazily normalized. */
private Set<AttributeValue> values = new SmallSet<>();
@@ -1598,7 +1598,7 @@
return options.add(option);
case 1:
// Normalize and add the first option to normalized set.
- normalizedOptions = new TreeSet<String>();
+ normalizedOptions = new TreeSet<>();
normalizedOptions.add(toLowerCase(options.firstElement));
if (normalizedOptions.add(toLowerCase(option)))
@@ -1790,7 +1790,7 @@
name = null;
normalizedOptions = null;
options.clear();
- values = new SmallSet<AttributeValue>();
+ values = new SmallSet<>();
return attribute;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java b/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java
index 4d68fc7..6fe0365 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2012-2014 ForgeRock AS.
+ * Copyright 2012-2015 ForgeRock AS.
*/
package org.opends.server.types;
@@ -260,15 +260,15 @@
public <T> Set<T> asSetOf(final Function<ByteString, ? extends T, NeverThrowsException> f,
final Collection<? extends T> defaultValues) {
if (!isEmpty(attribute)) {
- final LinkedHashSet<T> result = new LinkedHashSet<T>(attribute.size());
+ final LinkedHashSet<T> result = new LinkedHashSet<>(attribute.size());
for (final ByteString v : attribute) {
result.add(f.apply(v));
}
return result;
} else if (defaultValues != null) {
- return new LinkedHashSet<T>(defaultValues);
+ return new LinkedHashSet<>(defaultValues);
} else {
- return new LinkedHashSet<T>(0);
+ return new LinkedHashSet<>(0);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/BackupInfo.java b/opendj-server-legacy/src/main/java/org/opends/server/types/BackupInfo.java
index 17e7797..b0d9526 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/BackupInfo.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/BackupInfo.java
@@ -225,7 +225,7 @@
if (dependencies == null)
{
- this.dependencies = new HashSet<String>();
+ this.dependencies = new HashSet<>();
}
else
{
@@ -234,7 +234,7 @@
if (backupProperties == null)
{
- this.backupProperties = new HashMap<String,String>();
+ this.backupProperties = new HashMap<>();
}
else
{
@@ -431,32 +431,26 @@
*/
public LinkedList<String> encode()
{
- LinkedList<String> list = new LinkedList<String>();
+ LinkedList<String> list = new LinkedList<>();
SimpleDateFormat dateFormat =
new SimpleDateFormat(DATE_FORMAT_GMT_TIME);
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
list.add(PROPERTY_BACKUP_ID + "=" + backupID);
- list.add(PROPERTY_BACKUP_DATE + "=" +
- dateFormat.format(backupDate));
- list.add(PROPERTY_IS_INCREMENTAL + "=" +
- String.valueOf(isIncremental));
- list.add(PROPERTY_IS_COMPRESSED + "=" +
- String.valueOf(isCompressed));
- list.add(PROPERTY_IS_ENCRYPTED + "=" +
- String.valueOf(isEncrypted));
+ list.add(PROPERTY_BACKUP_DATE + "=" + dateFormat.format(backupDate));
+ list.add(PROPERTY_IS_INCREMENTAL + "=" + String.valueOf(isIncremental));
+ list.add(PROPERTY_IS_COMPRESSED + "=" + String.valueOf(isCompressed));
+ list.add(PROPERTY_IS_ENCRYPTED + "=" + String.valueOf(isEncrypted));
if (unsignedHash != null)
{
- list.add(PROPERTY_UNSIGNED_HASH + "=" +
- Base64.encode(unsignedHash));
+ list.add(PROPERTY_UNSIGNED_HASH + "=" + Base64.encode(unsignedHash));
}
if (signedHash != null)
{
- list.add(PROPERTY_SIGNED_HASH + "=" +
- Base64.encode(signedHash));
+ list.add(PROPERTY_SIGNED_HASH + "=" + Base64.encode(signedHash));
}
if (! dependencies.isEmpty())
@@ -513,9 +507,8 @@
boolean isEncrypted = false;
byte[] unsignedHash = null;
byte[] signedHash = null;
- HashSet<String> dependencies = new HashSet<String>();
- HashMap<String,String> backupProperties =
- new HashMap<String,String>();
+ HashSet<String> dependencies = new HashSet<>();
+ HashMap<String,String> backupProperties = new HashMap<>();
String backupPath = backupDirectory.getPath();
try
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java b/opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java
index 9c662d4..28b344c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java
@@ -166,7 +166,7 @@
// Construct the normalized attribute name mapping.
if (names != null) {
- this.names = new LinkedHashMap<String, String>(names.size());
+ this.names = new LinkedHashMap<>(names.size());
// Make sure the primary name is first (never null).
this.names.put(lowerName, this.primaryName);
@@ -176,16 +176,14 @@
this.names.put(toLowerCase(name), name);
}
} else if (this.primaryName != null) {
- this.names = Collections.singletonMap(lowerName,
- this.primaryName);
+ this.names = Collections.singletonMap(lowerName, this.primaryName);
} else {
this.names = Collections.emptyMap();
}
// FIXME: should really be a deep-copy.
if (extraProperties != null) {
- this.extraProperties = new LinkedHashMap<String, List<String>>(
- extraProperties);
+ this.extraProperties = new LinkedHashMap<>(extraProperties);
} else {
this.extraProperties = Collections.emptyMap();
}
@@ -468,7 +466,7 @@
}
else
{
- LinkedList<String> values = new LinkedList<String>();
+ LinkedList<String> values = new LinkedList<>();
values.add(value);
elem.getExtraProperties().put(name, values);
@@ -501,7 +499,7 @@
}
else
{
- LinkedList<String> valuesCopy = new LinkedList<String>(values);
+ LinkedList<String> valuesCopy = new LinkedList<>(values);
extraProperties.put(name, valuesCopy);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/DITContentRule.java b/opendj-server-legacy/src/main/java/org/opends/server/types/DITContentRule.java
index 8a2da64..b8197fd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/DITContentRule.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/DITContentRule.java
@@ -168,63 +168,57 @@
if ((names == null) || names.isEmpty())
{
- this.names = new LinkedHashMap<String,String>(0);
+ this.names = new LinkedHashMap<>(0);
}
else
{
- this.names = new LinkedHashMap<String,String>(names);
+ this.names = new LinkedHashMap<>(names);
}
if ((auxiliaryClasses == null) || auxiliaryClasses.isEmpty())
{
- this.auxiliaryClasses = new LinkedHashSet<ObjectClass>(0);
+ this.auxiliaryClasses = new LinkedHashSet<>(0);
}
else
{
- this.auxiliaryClasses =
- new LinkedHashSet<ObjectClass>(auxiliaryClasses);
+ this.auxiliaryClasses = new LinkedHashSet<>(auxiliaryClasses);
}
if ((requiredAttributes == null) || requiredAttributes.isEmpty())
{
- this.requiredAttributes = new LinkedHashSet<AttributeType>(0);
+ this.requiredAttributes = new LinkedHashSet<>(0);
}
else
{
- this.requiredAttributes =
- new LinkedHashSet<AttributeType>(requiredAttributes);
+ this.requiredAttributes = new LinkedHashSet<>(requiredAttributes);
}
if ((optionalAttributes == null) || optionalAttributes.isEmpty())
{
- this.optionalAttributes = new LinkedHashSet<AttributeType>(0);
+ this.optionalAttributes = new LinkedHashSet<>(0);
}
else
{
- this.optionalAttributes =
- new LinkedHashSet<AttributeType>(optionalAttributes);
+ this.optionalAttributes = new LinkedHashSet<>(optionalAttributes);
}
if ((prohibitedAttributes == null) ||
prohibitedAttributes.isEmpty())
{
- this.prohibitedAttributes = new LinkedHashSet<AttributeType>(0);
+ this.prohibitedAttributes = new LinkedHashSet<>(0);
}
else
{
- this.prohibitedAttributes =
- new LinkedHashSet<AttributeType>(prohibitedAttributes);
+ this.prohibitedAttributes = new LinkedHashSet<>(prohibitedAttributes);
}
if ((extraProperties == null) || extraProperties.isEmpty())
{
- this.extraProperties =
- new LinkedHashMap<String,List<String>>(0);
+ this.extraProperties = new LinkedHashMap<>(0);
}
else
{
- this.extraProperties =
- new LinkedHashMap<String,List<String>>(extraProperties);
+ this.extraProperties = new LinkedHashMap<>(extraProperties);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java b/opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java
index 37ab96c..3de9eb9 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java
@@ -146,32 +146,29 @@
if ((names == null) || names.isEmpty())
{
- this.names = new LinkedHashMap<String,String>(0);
+ this.names = new LinkedHashMap<>(0);
}
else
{
- this.names = new LinkedHashMap<String,String>(names);
+ this.names = new LinkedHashMap<>(names);
}
if ((superiorRules == null) || superiorRules.isEmpty())
{
- this.superiorRules = new LinkedHashSet<DITStructureRule>(0);
+ this.superiorRules = new LinkedHashSet<>(0);
}
else
{
- this.superiorRules =
- new LinkedHashSet<DITStructureRule>(superiorRules);
+ this.superiorRules = new LinkedHashSet<>(superiorRules);
}
if ((extraProperties == null) || extraProperties.isEmpty())
{
- this.extraProperties =
- new LinkedHashMap<String,List<String>>(0);
+ this.extraProperties = new LinkedHashMap<>(0);
}
else
{
- this.extraProperties =
- new LinkedHashMap<String,List<String>>(extraProperties);
+ this.extraProperties = new LinkedHashMap<>(extraProperties);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/DN.java b/opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
index 0b5b789..f8459bf 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
@@ -594,7 +594,7 @@
// components.
boolean allowExceptions =
DirectoryServer.allowAttributeNameExceptions();
- LinkedList<RDN> rdnComponents = new LinkedList<RDN>();
+ LinkedList<RDN> rdnComponents = new LinkedList<>();
while (true)
{
ByteString attributeName =
@@ -937,7 +937,7 @@
// components.
boolean allowExceptions =
DirectoryServer.allowAttributeNameExceptions();
- LinkedList<RDN> rdnComponents = new LinkedList<RDN>();
+ LinkedList<RDN> rdnComponents = new LinkedList<>();
while (true)
{
StringBuilder attributeName = new StringBuilder();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryEnvironmentConfig.java b/opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryEnvironmentConfig.java
index 676a5a7..fdd584c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryEnvironmentConfig.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryEnvironmentConfig.java
@@ -101,7 +101,7 @@
public DirectoryEnvironmentConfig(Properties properties, boolean checkIfServerIsRunning)
{
this.checkIfServerIsRunning = checkIfServerIsRunning;
- configProperties = new HashMap<String,String>();
+ configProperties = new HashMap<>();
if (properties != null)
{
Enumeration<?> propertyNames = properties.propertyNames();
@@ -131,11 +131,11 @@
this.checkIfServerIsRunning = checkIfServerIsRunning;
if (properties == null)
{
- configProperties = new HashMap<String,String>();
+ configProperties = new HashMap<>();
}
else
{
- configProperties = new HashMap<String,String>(properties);
+ configProperties = new HashMap<>(properties);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
index 7d3406c..05d57f1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
@@ -98,8 +98,7 @@
* The set of suppressed real attributes for this entry. It contains real
* attributes that have been overridden by virtual attributes.
*/
- private final Map<AttributeType, List<Attribute>> suppressedAttributes =
- new LinkedHashMap<AttributeType, List<Attribute>>();
+ private final Map<AttributeType, List<Attribute>> suppressedAttributes = new LinkedHashMap<>();
/** The set of objectclasses for this entry. */
private Map<ObjectClass,String> objectClasses;
@@ -168,7 +167,7 @@
{
return map;
}
- return new HashMap<K, V>();
+ return new HashMap<>();
}
@@ -309,7 +308,7 @@
// Estimate the size.
int size = userAttributes.size() + operationalAttributes.size();
- final List<Attribute> attributes = new ArrayList<Attribute>(size);
+ final List<Attribute> attributes = new ArrayList<>(size);
for (List<Attribute> attrs : userAttributes.values())
{
attributes.addAll(attrs);
@@ -611,7 +610,7 @@
{
if (includeSubordinates && attributeType.mayHaveSubordinateTypes())
{
- List<Attribute> attributes = new LinkedList<Attribute>();
+ List<Attribute> attributes = new LinkedList<>();
addAllIfNotNull(attributes, userAttributes.get(attributeType));
addAllIfNotNull(attributes, operationalAttributes.get(attributeType));
@@ -705,7 +704,7 @@
if (lowerName.equals(OBJECTCLASS_ATTRIBUTE_TYPE_NAME) &&
(! objectClasses.isEmpty()))
{
- List<Attribute> attrList = new LinkedList<Attribute>();
+ List<Attribute> attrList = new LinkedList<>();
attrList.add(getObjectClassAttribute());
return attrList;
}
@@ -756,7 +755,7 @@
boolean includeSubordinates,
Set<String> options)
{
- List<Attribute> attributes = new LinkedList<Attribute>();
+ List<Attribute> attributes = new LinkedList<>();
if (includeSubordinates && attributeType.mayHaveSubordinateTypes())
{
addAllIfNotNull(attributes, userAttributes.get(attributeType));
@@ -844,7 +843,7 @@
if (lowerName.equals(OBJECTCLASS_ATTRIBUTE_TYPE_NAME) &&
((options == null) || options.isEmpty()))
{
- List<Attribute> attributes = new LinkedList<Attribute>();
+ List<Attribute> attributes = new LinkedList<>();
attributes.add(getObjectClassAttribute());
return attributes;
}
@@ -940,7 +939,7 @@
{
if (attributeType.mayHaveSubordinateTypes())
{
- List<Attribute> attributes = new LinkedList<Attribute>();
+ List<Attribute> attributes = new LinkedList<>();
addAllIfNotNull(attributes, attrs.get(attributeType));
for (AttributeType at : schema.getSubTypes(attributeType))
{
@@ -993,7 +992,7 @@
private List<Attribute> getAttribute(AttributeType attributeType,
Set<String> options, Map<AttributeType, List<Attribute>> attrs)
{
- List<Attribute> attributes = new LinkedList<Attribute>();
+ List<Attribute> attributes = new LinkedList<>();
addAllIfNotNull(attributes, attrs.get(attributeType));
if (attributeType.mayHaveSubordinateTypes())
@@ -1509,7 +1508,7 @@
// special way.
if (t.isObjectClass())
{
- Map<ObjectClass, String> ocs = new LinkedHashMap<ObjectClass, String>();
+ Map<ObjectClass, String> ocs = new LinkedHashMap<>();
for (ByteString v : a)
{
String ocName = v.toString();
@@ -1572,7 +1571,7 @@
switch (mod.getModificationType().asEnum())
{
case ADD:
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
addAttribute(a, duplicateValues);
if (!duplicateValues.isEmpty() && !relaxConstraints)
{
@@ -1582,7 +1581,7 @@
break;
case DELETE:
- List<ByteString> missingValues = new LinkedList<ByteString>();
+ List<ByteString> missingValues = new LinkedList<>();
removeAttribute(a, missingValues);
if (!missingValues.isEmpty() && !relaxConstraints)
{
@@ -2483,18 +2482,14 @@
*/
public Entry duplicate(boolean processVirtual)
{
- Map<ObjectClass, String> objectClassesCopy =
- new HashMap<ObjectClass,String>(objectClasses);
+ Map<ObjectClass, String> objectClassesCopy = new HashMap<>(objectClasses);
- Map<AttributeType, List<Attribute>> userAttrsCopy =
- new HashMap<AttributeType,List<Attribute>>(
- userAttributes.size());
+ Map<AttributeType, List<Attribute>> userAttrsCopy = new HashMap<>(userAttributes.size());
deepCopy(userAttributes, userAttrsCopy, false, false, false,
true, false);
Map<AttributeType, List<Attribute>> operationalAttrsCopy =
- new HashMap<AttributeType,List<Attribute>>(
- operationalAttributes.size());
+ new HashMap<>(operationalAttributes.size());
deepCopy(operationalAttributes, operationalAttrsCopy, false,
false, false, true, false);
@@ -2561,7 +2556,7 @@
{
AttributeType t = mapEntry.getKey();
List<Attribute> sourceList = mapEntry.getValue();
- List<Attribute> targetList = new ArrayList<Attribute>(sourceList.size());
+ List<Attribute> targetList = new ArrayList<>(sourceList.size());
for (Attribute a : sourceList)
{
@@ -2737,7 +2732,7 @@
}
}
- Set<String> referralURLs = new LinkedHashSet<String>();
+ Set<String> referralURLs = new LinkedHashSet<>();
for (Attribute a : refAttrs)
{
for (ByteString v : a)
@@ -3015,7 +3010,7 @@
ATTR_COLLECTIVE_EXCLUSIONS_LC);
List<Attribute> exclusionsAttrList =
operationalAttributes.get(exclusionsType);
- Set<String> exclusionsNameSet = new HashSet<String>();
+ Set<String> exclusionsNameSet = new HashSet<>();
if (exclusionsAttrList != null && !exclusionsAttrList.isEmpty())
{
for (Attribute attr : exclusionsAttrList)
@@ -3145,7 +3140,7 @@
{
// There aren't any conflicts, so we can just add the
// attribute to the entry.
- attrList = new LinkedList<Attribute>();
+ attrList = new LinkedList<>();
attrList.add(collectiveAttr);
putAttributes(attributeType, attrList);
}
@@ -3225,7 +3220,7 @@
// suppressed list and replace it with the
// virtual attribute.
suppressedAttributes.put(attributeType, attrList);
- attrList = new LinkedList<Attribute>();
+ attrList = new LinkedList<>();
attrList.add(collectiveAttr);
attributes.put(attributeType, attrList);
break;
@@ -3260,7 +3255,7 @@
{
// There aren't any conflicts, so we can just add the
// attribute to the entry.
- attrList = new LinkedList<Attribute>();
+ attrList = new LinkedList<>();
attrList.add(new VirtualAttribute(attributeType, this, rule));
putAttributes(attributeType, attrList);
}
@@ -3319,7 +3314,7 @@
// We need to move the real attribute to the suppressed
// list and replace it with the virtual attribute.
suppressedAttributes.put(attributeType, attrList);
- attrList = new LinkedList<Attribute>();
+ attrList = new LinkedList<>();
attrList.add(new VirtualAttribute(attributeType, this, rule));
attributes.put(attributeType, attrList);
break;
@@ -3650,7 +3645,7 @@
// The set of object classes will be encoded as a single
// string with the object class names separated by zeros.
- objectClasses = new LinkedHashMap<ObjectClass,String>();
+ objectClasses = new LinkedHashMap<>();
int startPos = entryBuffer.position();
for (int i=0; i < ocLength; i++)
{
@@ -3670,7 +3665,7 @@
{
// Next is the number of zero terminated object classes.
int numOC = entryBuffer.getBERLength();
- objectClasses = new LinkedHashMap<ObjectClass,String>(numOC);
+ objectClasses = new LinkedHashMap<>(numOC);
for(int i = 0; i < numOC; i++)
{
int startPos = entryBuffer.position();
@@ -3731,8 +3726,7 @@
// Now, we should iterate through the attributes and decode each one.
- Map<AttributeType, List<Attribute>> attributes =
- new LinkedHashMap<AttributeType,List<Attribute>>(attrs);
+ Map<AttributeType, List<Attribute>> attributes = new LinkedHashMap<>(attrs);
if (config.compressAttributeDescriptions())
{
for (int i=0; i < attrs; i++)
@@ -3747,7 +3741,7 @@
List<Attribute> attrList = attributes.get(a.getAttributeType());
if (attrList == null)
{
- attrList = new ArrayList<Attribute>(1);
+ attrList = new ArrayList<>(1);
attributes.put(a.getAttributeType(), attrList);
}
attrList.add(a);
@@ -3823,7 +3817,7 @@
List<Attribute> attrList = attributes.get(attributeType);
if (attrList == null)
{
- attrList = new ArrayList<Attribute>(1);
+ attrList = new ArrayList<>(1);
attributes.put(attributeType, attrList);
}
attrList.add(a);
@@ -3843,7 +3837,7 @@
*/
public List<StringBuilder> toLDIF()
{
- List<StringBuilder> ldifLines = new LinkedList<StringBuilder>();
+ List<StringBuilder> ldifLines = new LinkedList<>();
// First, append the DN.
StringBuilder dnLine = new StringBuilder("dn");
@@ -4617,26 +4611,23 @@
if (attrNameList == null || attrNameList.isEmpty())
{
// Common case: return filtered user attributes.
- userAttrsCopy = new LinkedHashMap<AttributeType, List<Attribute>>(
- userAttributes.size());
- operationalAttrsCopy =
- new LinkedHashMap<AttributeType, List<Attribute>>(0);
+ userAttrsCopy = new LinkedHashMap<>(userAttributes.size());
+ operationalAttrsCopy = new LinkedHashMap<>(0);
if (omitReal)
{
- objectClassesCopy = new LinkedHashMap<ObjectClass, String>(0);
+ objectClassesCopy = new LinkedHashMap<>(0);
}
else if (omitValues)
{
- objectClassesCopy = new LinkedHashMap<ObjectClass, String>(0);
+ objectClassesCopy = new LinkedHashMap<>(0);
// Add empty object class attribute.
userAttrsCopy.put(ocType, newList(Attributes.empty(ocType)));
}
else
{
- objectClassesCopy =
- new LinkedHashMap<ObjectClass, String>(objectClasses);
+ objectClassesCopy = new LinkedHashMap<>(objectClasses);
// First, add the objectclass attribute.
Attribute ocAttr = getObjectClassAttribute();
@@ -4655,19 +4646,15 @@
// Incrementally build table of attributes.
if (omitReal || omitValues)
{
- objectClassesCopy = new LinkedHashMap<ObjectClass, String>(0);
+ objectClassesCopy = new LinkedHashMap<>(0);
}
else
{
- objectClassesCopy =
- new LinkedHashMap<ObjectClass, String>(objectClasses.size());
+ objectClassesCopy = new LinkedHashMap<>(objectClasses.size());
}
- userAttrsCopy = new LinkedHashMap<AttributeType, List<Attribute>>(
- userAttributes.size());
- operationalAttrsCopy =
- new LinkedHashMap<AttributeType, List<Attribute>>(
- operationalAttributes.size());
+ userAttrsCopy = new LinkedHashMap<>(userAttributes.size());
+ operationalAttrsCopy = new LinkedHashMap<>(operationalAttributes.size());
for (String attrName : attrNameList)
{
@@ -4716,7 +4703,7 @@
String tmpName = attrName.substring(0, semicolonPos);
lowerName = toLowerCase(tmpName);
int nextPos = attrName.indexOf(';', semicolonPos+1);
- options = new HashSet<String>();
+ options = new HashSet<>();
while (nextPos > 0)
{
options.add(attrName.substring(semicolonPos+1, nextPos));
@@ -4826,7 +4813,7 @@
*/
private List<Attribute> newList(Attribute elem)
{
- List<Attribute> l = new ArrayList<Attribute>(1);
+ List<Attribute> l = new ArrayList<>(1);
l.add(elem);
return l;
}
@@ -4935,9 +4922,8 @@
if (attrList == null)
{
// Assume that they'll all go in the one list. This isn't
- // always the case, for example if the list contains
- // sub-types.
- attrList = new ArrayList<Attribute>(sourceList.size());
+ // always the case, for example if the list contains sub-types.
+ attrList = new ArrayList<>(sourceList.size());
attrList.add(attribute);
destMap.put(subAttrType, attrList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/HostPort.java b/opendj-server-legacy/src/main/java/org/opends/server/types/HostPort.java
index 5303a35..dd418c4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/HostPort.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/HostPort.java
@@ -95,7 +95,7 @@
/** Time-stamp acts as memory barrier for networkInterfaces. */
private static final long CACHED_LOCAL_ADDRESSES_TIMEOUT_MS = 30 * 1000;
private static volatile long localAddressesTimeStamp;
- private static Set<InetAddress> localAddresses = new HashSet<InetAddress>();
+ private static Set<InetAddress> localAddresses = new HashSet<>();
/**
* Returns {@code true} if the provided {@code InetAddress} represents the
@@ -133,7 +133,7 @@
final Enumeration<NetworkInterface> i =
NetworkInterface.getNetworkInterfaces();
if (i != null) {
- final Set<InetAddress> newLocalAddresses = new HashSet<InetAddress>();
+ final Set<InetAddress> newLocalAddresses = new HashSet<>();
while (i.hasMoreElements())
{
NetworkInterface n = i.nextElement();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/IntermediateResponse.java b/opendj-server-legacy/src/main/java/org/opends/server/types/IntermediateResponse.java
index 0be546a..5c30984 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/IntermediateResponse.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/IntermediateResponse.java
@@ -81,7 +81,7 @@
if (controls == null)
{
- this.controls = new ArrayList<Control>(0);
+ this.controls = new ArrayList<>(0);
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java b/opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java
index b967855..5bee9f8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java
@@ -115,11 +115,11 @@
if ((extraProperties == null) || extraProperties.isEmpty())
{
- this.extraProperties = new LinkedHashMap<String,List<String>>(0);
+ this.extraProperties = new LinkedHashMap<>(0);
}
else
{
- this.extraProperties = new LinkedHashMap<String,List<String>>(extraProperties);
+ this.extraProperties = new LinkedHashMap<>(extraProperties);
}
}
@@ -214,7 +214,7 @@
}
else
{
- LinkedList<String> valuesCopy = new LinkedList<String>(values);
+ LinkedList<String> valuesCopy = new LinkedList<>(values);
extraProperties.put(name, valuesCopy);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/LDAPURL.java b/opendj-server-legacy/src/main/java/org/opends/server/types/LDAPURL.java
index 6b64d2d..80a0495 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/LDAPURL.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/LDAPURL.java
@@ -182,7 +182,7 @@
if (attributes == null)
{
- this.attributes = new LinkedHashSet<String>();
+ this.attributes = new LinkedHashSet<>();
}
else
{
@@ -209,7 +209,7 @@
if (extensions == null)
{
- this.extensions = new LinkedList<String>();
+ this.extensions = new LinkedList<>();
}
else
{
@@ -271,7 +271,7 @@
if (attributes == null)
{
- this.attributes = new LinkedHashSet<String>();
+ this.attributes = new LinkedHashSet<>();
}
else
{
@@ -300,7 +300,7 @@
if (extensions == null)
{
- this.extensions = new LinkedList<String>();
+ this.extensions = new LinkedList<>();
}
else
{
@@ -489,7 +489,7 @@
startPos = pos+1;
}
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
StringTokenizer tokenizer = new StringTokenizer(attrsString, ",");
while (tokenizer.hasMoreTokens())
{
@@ -622,7 +622,7 @@
// The rest of the string must be the set of extensions.
String extensionsString = url.substring(startPos);
- LinkedList<String> extensions = new LinkedList<String>();
+ LinkedList<String> extensions = new LinkedList<>();
tokenizer = new StringTokenizer(extensionsString, ",");
while (tokenizer.hasMoreTokens())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/LDIFExportConfig.java b/opendj-server-legacy/src/main/java/org/opends/server/types/LDIFExportConfig.java
index 5bf4878..b913da3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/LDIFExportConfig.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/LDIFExportConfig.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.types;
@@ -152,10 +152,10 @@
this.existingFileBehavior = existingFileBehavior;
ldifOutputStream = null;
- excludeBranches = new ArrayList<DN>();
- includeBranches = new ArrayList<DN>();
- excludeFilters = new ArrayList<SearchFilter>();
- includeFilters = new ArrayList<SearchFilter>();
+ excludeBranches = new ArrayList<>();
+ includeBranches = new ArrayList<>();
+ excludeFilters = new ArrayList<>();
+ includeFilters = new ArrayList<>();
compressData = false;
encryptData = false;
hashData = false;
@@ -166,8 +166,8 @@
signHash = false;
typesOnly = false;
writer = null;
- excludeAttributes = new HashSet<AttributeType>();
- includeAttributes = new HashSet<AttributeType>();
+ excludeAttributes = new HashSet<>();
+ includeAttributes = new HashSet<>();
wrapColumn = -1;
}
@@ -186,10 +186,10 @@
ldifFile = null;
existingFileBehavior = ExistingFileBehavior.FAIL;
- excludeBranches = new ArrayList<DN>();
- includeBranches = new ArrayList<DN>();
- excludeFilters = new ArrayList<SearchFilter>();
- includeFilters = new ArrayList<SearchFilter>();
+ excludeBranches = new ArrayList<>();
+ includeBranches = new ArrayList<>();
+ excludeFilters = new ArrayList<>();
+ includeFilters = new ArrayList<>();
compressData = false;
encryptData = false;
hashData = false;
@@ -200,8 +200,8 @@
signHash = false;
typesOnly = false;
writer = null;
- excludeAttributes = new HashSet<AttributeType>();
- includeAttributes = new HashSet<AttributeType>();
+ excludeAttributes = new HashSet<>();
+ includeAttributes = new HashSet<>();
wrapColumn = -1;
}
@@ -548,7 +548,7 @@
{
if (excludeBranches == null)
{
- this.excludeBranches = new ArrayList<DN>(0);
+ this.excludeBranches = new ArrayList<>(0);
}
else
{
@@ -584,7 +584,7 @@
{
if (includeBranches == null)
{
- this.includeBranches = new ArrayList<DN>(0);
+ this.includeBranches = new ArrayList<>(0);
}
else
{
@@ -712,7 +712,7 @@
{
if (excludeAttributes == null)
{
- this.excludeAttributes = new HashSet<AttributeType>(0);
+ this.excludeAttributes = new HashSet<>(0);
}
else
{
@@ -749,7 +749,7 @@
{
if (includeAttributes == null)
{
- this.includeAttributes = new HashSet<AttributeType>(0);
+ this.includeAttributes = new HashSet<>(0);
}
else
{
@@ -807,7 +807,7 @@
{
if (excludeFilters == null)
{
- this.excludeFilters = new ArrayList<SearchFilter>(0);
+ this.excludeFilters = new ArrayList<>(0);
}
else
{
@@ -844,7 +844,7 @@
{
if (includeFilters == null)
{
- this.includeFilters = new ArrayList<SearchFilter>(0);
+ this.includeFilters = new ArrayList<>(0);
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/LDIFImportConfig.java b/opendj-server-legacy/src/main/java/org/opends/server/types/LDIFImportConfig.java
index 515c4b0..a19684f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/LDIFImportConfig.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/LDIFImportConfig.java
@@ -94,22 +94,22 @@
private Iterator<String> ldifFileIterator;
/** The set of base DNs to exclude from the import. */
- private Set<DN> excludeBranches = new HashSet<DN>(0);
+ private Set<DN> excludeBranches = new HashSet<>(0);
/** The set of base DNs to include from the import. */
- private Set<DN> includeBranches = new HashSet<DN>(0);
+ private Set<DN> includeBranches = new HashSet<>(0);
/** The set of search filters for entries to exclude from the import. */
- private List<SearchFilter> excludeFilters = new ArrayList<SearchFilter>(0);
+ private List<SearchFilter> excludeFilters = new ArrayList<>(0);
/** The set of search filters for entries to include in the import. */
- private List<SearchFilter> includeFilters = new ArrayList<SearchFilter>(0);
+ private List<SearchFilter> includeFilters = new ArrayList<>(0);
/** The set of LDIF files to be imported. */
private List<String> ldifFiles;
/** The set of attribute types that should be excluded from the import. */
- private Set<AttributeType> excludeAttributes = new HashSet<AttributeType>(0);
+ private Set<AttributeType> excludeAttributes = new HashSet<>(0);
/** The set of attribute types that should be included in the import. */
- private Set<AttributeType> includeAttributes = new HashSet<AttributeType>(0);
+ private Set<AttributeType> includeAttributes = new HashSet<>(0);
/** Indicates whether all the user attributes should be included. */
private boolean includeAllUserAttrs;
@@ -134,7 +134,7 @@
*/
public LDIFImportConfig(String ldifFile)
{
- ldifFiles = new ArrayList<String>(1);
+ ldifFiles = new ArrayList<>(1);
ldifFiles.add(ldifFile);
ldifFileIterator = ldifFiles.iterator();
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/LockManager.java b/opendj-server-legacy/src/main/java/org/opends/server/types/LockManager.java
index 651eb42..8d758f0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/LockManager.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/LockManager.java
@@ -284,7 +284,7 @@
private final TimeUnit lockTimeoutUnits;
// Avoid sub-classing in order to workaround class leaks in app servers.
- private final ThreadLocal<LinkedList<DNLockHolder>> threadLocalCache = new ThreadLocal<LinkedList<DNLockHolder>>();
+ private final ThreadLocal<LinkedList<DNLockHolder>> threadLocalCache = new ThreadLocal<>();
/**
* Creates a new lock manager with a lock timeout of 9 seconds and an automatically chosen number
@@ -332,7 +332,7 @@
this.lockTable = new LinkedList[this.numberOfBuckets];
for (int i = 0; i < this.numberOfBuckets; i++)
{
- this.lockTable[i] = new LinkedList<DNLockHolder>();
+ this.lockTable[i] = new LinkedList<>();
}
}
@@ -437,7 +437,7 @@
LinkedList<DNLockHolder> cache = threadLocalCache.get();
if (cache == null)
{
- cache = new LinkedList<DNLockHolder>();
+ cache = new LinkedList<>();
threadLocalCache.set(cache);
}
return acquireLockFromCache0(dn, cache);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java b/opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java
index 7efdf96..cfa9657 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java
@@ -149,31 +149,29 @@
if ((names == null) || names.isEmpty())
{
- this.names = new LinkedHashMap<String,String>(0);
+ this.names = new LinkedHashMap<>(0);
}
else
{
- this.names = new LinkedHashMap<String,String>(names);
+ this.names = new LinkedHashMap<>(names);
}
if ((attributes == null) || attributes.isEmpty())
{
- this.attributes = new LinkedHashSet<AttributeType>(0);
+ this.attributes = new LinkedHashSet<>(0);
}
else
{
- this.attributes = new LinkedHashSet<AttributeType>(attributes);
+ this.attributes = new LinkedHashSet<>(attributes);
}
if ((extraProperties == null) || extraProperties.isEmpty())
{
- this.extraProperties =
- new LinkedHashMap<String,List<String>>(0);
+ this.extraProperties = new LinkedHashMap<>(0);
}
else
{
- this.extraProperties =
- new LinkedHashMap<String,List<String>>(extraProperties);
+ this.extraProperties = new LinkedHashMap<>(extraProperties);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java b/opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java
index e3b599f..b4f75fc 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java
@@ -154,42 +154,38 @@
if ((names == null) || names.isEmpty())
{
- this.names = new LinkedHashMap<String,String>(0);
+ this.names = new LinkedHashMap<>(0);
}
else
{
- this.names = new LinkedHashMap<String,String>(names);
+ this.names = new LinkedHashMap<>(names);
}
if ((requiredAttributes == null) || requiredAttributes.isEmpty())
{
- this.requiredAttributes = new LinkedHashSet<AttributeType>(0);
+ this.requiredAttributes = new LinkedHashSet<>(0);
}
else
{
- this.requiredAttributes =
- new LinkedHashSet<AttributeType>(requiredAttributes);
+ this.requiredAttributes = new LinkedHashSet<>(requiredAttributes);
}
if ((optionalAttributes == null) || optionalAttributes.isEmpty())
{
- this.optionalAttributes = new LinkedHashSet<AttributeType>(0);
+ this.optionalAttributes = new LinkedHashSet<>(0);
}
else
{
- this.optionalAttributes =
- new LinkedHashSet<AttributeType>(optionalAttributes);
+ this.optionalAttributes = new LinkedHashSet<>(optionalAttributes);
}
if ((extraProperties == null) || extraProperties.isEmpty())
{
- this.extraProperties =
- new LinkedHashMap<String,List<String>>(0);
+ this.extraProperties = new LinkedHashMap<>(0);
}
else
{
- this.extraProperties =
- new LinkedHashMap<String,List<String>>(extraProperties);
+ this.extraProperties = new LinkedHashMap<>(extraProperties);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java b/opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java
index f3f1d86..e599fcf 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java
@@ -219,8 +219,7 @@
if (this.superiorClasses.isEmpty()) {
this.requiredAttributesChain = this.requiredAttributes;
} else {
- Set<AttributeType> tmp = new HashSet<AttributeType>(
- this.requiredAttributes);
+ Set<AttributeType> tmp = new HashSet<>(this.requiredAttributes);
for(ObjectClass oc: this.superiorClasses)
{
tmp.addAll(oc.getRequiredAttributeChain());
@@ -240,8 +239,7 @@
if (this.superiorClasses.isEmpty()) {
this.optionalAttributesChain = this.optionalAttributes;
} else {
- Set<AttributeType> tmp = new HashSet<AttributeType>(
- this.optionalAttributes);
+ Set<AttributeType> tmp = new HashSet<>(this.optionalAttributes);
for(ObjectClass oc : this.superiorClasses)
{
tmp.addAll(oc.getOptionalAttributeChain());
@@ -249,11 +247,9 @@
this.optionalAttributesChain = Collections.unmodifiableSet(tmp);
}
- // Construct unmodifiable views of the required and optional
- // attribute chains.
- HashSet<AttributeType> reqAndOptSet =
- new HashSet<AttributeType>(requiredAttributesChain.size() +
- optionalAttributesChain.size());
+ // Construct unmodifiable views of the required and optional attribute chains.
+ int size = requiredAttributesChain.size() + optionalAttributesChain.size();
+ HashSet<AttributeType> reqAndOptSet = new HashSet<>(size);
reqAndOptSet.addAll(requiredAttributesChain);
reqAndOptSet.addAll(optionalAttributesChain);
requiredAndOptionalChain =
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Privilege.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Privilege.java
index 477bd71..4ff99df 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Privilege.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Privilege.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS
+ * Portions Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.types;
@@ -240,23 +240,14 @@
CHANGELOG_READ("changelog-read");
-
- /**
- * A map that will be used to hold a mapping between privilege names
- * and enum values.
- */
- private static final Map<String, Privilege> PRIV_MAP =
- new HashMap<String,Privilege>();
-
-
+ /** A map that will be used to hold a mapping between privilege names and enum values. */
+ private static final Map<String, Privilege> PRIV_MAP = new HashMap<>();
/**
* The set of privileges that will be automatically assigned to root
- * users if the root privilege set is not specified in the
- * configuration.
+ * users if the root privilege set is not specified in the configuration.
*/
- private static final Set<Privilege> DEFAULT_ROOT_PRIV_SET =
- new HashSet<Privilege>();
+ private static final Set<Privilege> DEFAULT_ROOT_PRIV_SET = new HashSet<>();
/** The human-readable name for this privilege. */
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java b/opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java
index 2b5447d..2487edb 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java
@@ -992,7 +992,7 @@
else
{
// Normalization sorts RDNs alphabetically
- SortedSet<String> avaStrings = new TreeSet<String>();
+ SortedSet<String> avaStrings = new TreeSet<>();
for (int i=0; i < attributeNames.length; i++)
{
StringBuilder builder = new StringBuilder();
@@ -1051,7 +1051,7 @@
else
{
// Normalization sorts RDNs
- SortedSet<ByteString> avaStrings = new TreeSet<ByteString>();
+ SortedSet<ByteString> avaStrings = new TreeSet<>();
for (int i = 0; i < attributeNames.length; i++)
{
ByteStringBuilder b = new ByteStringBuilder();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/RawAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/types/RawAttribute.java
index f783c7a..9ba64d8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/RawAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/RawAttribute.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.types;
@@ -264,7 +264,7 @@
try
{
reader.readStartSequence();
- values = new ArrayList<ByteString>();
+ values = new ArrayList<>();
while(reader.hasNextElement())
{
values.add(reader.readOctetString());
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/RawFilter.java b/opendj-server-legacy/src/main/java/org/opends/server/types/RawFilter.java
index 291a9dd..9805373 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/RawFilter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/RawFilter.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.types;
@@ -629,8 +629,7 @@
filterType = null;
}
- ArrayList<RawFilter> filterComponents =
- new ArrayList<RawFilter>();
+ ArrayList<RawFilter> filterComponents = new ArrayList<>();
try
{
reader.readStartSequence();
@@ -889,7 +888,7 @@
{
if(subAnyElements == null)
{
- subAnyElements = new ArrayList<ByteString>();
+ subAnyElements = new ArrayList<>();
}
subAnyElements.add(reader.readOctetString());
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
index d224a8e..8cb53e9 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
@@ -184,36 +184,24 @@
* <p>
* ex : Replication uses this to store its state and GenerationID.
*/
- private Map<String, Attribute> extraAttributes =
- new HashMap<String, Attribute>();
+ private Map<String, Attribute> extraAttributes = new HashMap<>();
-
- /**
- * Creates a new schema structure with all elements initialized but
- * empty.
- */
+ /** Creates a new schema structure with all elements initialized but empty. */
public Schema()
{
- attributeTypes = new ConcurrentHashMap<String,AttributeType>();
- objectClasses = new ConcurrentHashMap<String,ObjectClass>();
- syntaxes = new ConcurrentHashMap<String,Syntax>();
- matchingRules = new ConcurrentHashMap<String,MatchingRule>();
- matchingRuleUses =
- new ConcurrentHashMap<MatchingRule,MatchingRuleUse>();
- ditContentRules =
- new ConcurrentHashMap<ObjectClass,DITContentRule>();
- ditStructureRulesByID =
- new ConcurrentHashMap<Integer,DITStructureRule>();
- ditStructureRulesByNameForm =
- new ConcurrentHashMap<NameForm,DITStructureRule>();
- nameFormsByOC =
- new ConcurrentHashMap<ObjectClass,List<NameForm>>();
- nameFormsByName = new ConcurrentHashMap<String,NameForm>();
- ldapSyntaxDescriptions =
- new ConcurrentHashMap<String,LDAPSyntaxDescription>();
- subordinateTypes =
- new ConcurrentHashMap<AttributeType,List<AttributeType>>();
+ attributeTypes = new ConcurrentHashMap<>();
+ objectClasses = new ConcurrentHashMap<>();
+ syntaxes = new ConcurrentHashMap<>();
+ matchingRules = new ConcurrentHashMap<>();
+ matchingRuleUses = new ConcurrentHashMap<>();
+ ditContentRules = new ConcurrentHashMap<>();
+ ditStructureRulesByID = new ConcurrentHashMap<>();
+ ditStructureRulesByNameForm = new ConcurrentHashMap<>();
+ nameFormsByOC = new ConcurrentHashMap<>();
+ nameFormsByName = new ConcurrentHashMap<>();
+ ldapSyntaxDescriptions = new ConcurrentHashMap<>();
+ subordinateTypes = new ConcurrentHashMap<>();
oldestModificationTime = System.currentTimeMillis();
youngestModificationTime = oldestModificationTime;
@@ -396,7 +384,7 @@
if (subTypes == null)
{
superiorType.setMayHaveSubordinateTypes();
- subTypes = new LinkedList<AttributeType>();
+ subTypes = new LinkedList<>();
subTypes.add(attributeType);
subordinateTypes.put(superiorType, subTypes);
}
@@ -1622,7 +1610,7 @@
if(mappedForms == null)
{
- mappedForms = new ArrayList<NameForm>();
+ mappedForms = new ArrayList<>();
}
mappedForms.add(nameForm);
@@ -2057,8 +2045,7 @@
dupSchema.youngestModificationTime = youngestModificationTime;
if (extraAttributes != null)
{
- dupSchema.extraAttributes =
- new HashMap<String, Attribute>(extraAttributes);
+ dupSchema.extraAttributes = new HashMap<>(extraAttributes);
}
return dupSchema;
@@ -2100,13 +2087,13 @@
String concatFilePath = null;
try
{
- Set<String> attributeTypes = new LinkedHashSet<String>();
- Set<String> objectClasses = new LinkedHashSet<String>();
- Set<String> nameForms = new LinkedHashSet<String>();
- Set<String> ditContentRules = new LinkedHashSet<String>();
- Set<String> ditStructureRules = new LinkedHashSet<String>();
- Set<String> matchingRuleUses = new LinkedHashSet<String>();
- Set<String> ldapSyntaxes = new LinkedHashSet<String>();
+ Set<String> attributeTypes = new LinkedHashSet<>();
+ Set<String> objectClasses = new LinkedHashSet<>();
+ Set<String> nameForms = new LinkedHashSet<>();
+ Set<String> ditContentRules = new LinkedHashSet<>();
+ Set<String> ditStructureRules = new LinkedHashSet<>();
+ Set<String> matchingRuleUses = new LinkedHashSet<>();
+ Set<String> ldapSyntaxes = new LinkedHashSet<>();
genConcatenatedSchema(attributeTypes, objectClasses, nameForms,
ditContentRules, ditStructureRules,
matchingRuleUses,ldapSyntaxes);
@@ -2250,7 +2237,7 @@
throws IOException
{
// Get a sorted list of the files in the schema directory.
- TreeSet<File> schemaFiles = new TreeSet<File>();
+ TreeSet<File> schemaFiles = new TreeSet<>();
String schemaDirectory =
SchemaConfigManager.getSchemaDirectoryPath();
@@ -2270,10 +2257,8 @@
{
// Read the contents of the file into a list with one schema
// element per list element.
- LinkedList<StringBuilder> lines =
- new LinkedList<StringBuilder>();
- BufferedReader reader =
- new BufferedReader(new FileReader(f));
+ LinkedList<StringBuilder> lines = new LinkedList<>();
+ BufferedReader reader = new BufferedReader(new FileReader(f));
while (true)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
index f5e1942..6e2fbb8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
@@ -138,7 +138,7 @@
// This used to happen in getSubAnyElements, but we do it here
// so that we can make this.subAnyElements final.
if (subAnyElements == null) {
- subAnyElements = new ArrayList<ByteString>(0);
+ subAnyElements = new ArrayList<>(0);
}
// This used to happen in getFilterComponents, but we do it here
@@ -148,8 +148,7 @@
}
this.filterType = filterType;
- this.filterComponents =
- new LinkedHashSet<SearchFilter>(filterComponents);
+ this.filterComponents = new LinkedHashSet<>(filterComponents);
this.notComponent = notComponent;
this.attributeType = attributeType;
this.attributeOptions = attributeOptions;
@@ -765,7 +764,7 @@
// the attribute type (with or without options). Decode it.
String attrType = filterString.substring(startPos, attrEndPos);
StringBuilder lowerType = new StringBuilder(attrType.length());
- Set<String> attributeOptions = new HashSet<String>();
+ Set<String> attributeOptions = new HashSet<>();
int semicolonPos = attrType.indexOf(';');
if (semicolonPos < 0)
@@ -1034,20 +1033,17 @@
throws DirectoryException
{
// Create a list to hold the returned components.
- List<SearchFilter> filterComponents =
- new ArrayList<SearchFilter>();
+ List<SearchFilter> filterComponents = new ArrayList<>();
- // If the end pos is equal to the start pos, then there are no
- // components.
+ // If the end pos is equal to the start pos, then there are no components.
if (startPos == endPos)
{
if (filterType == FilterType.NOT)
{
LocalizableMessage message = ERR_SEARCH_FILTER_NOT_EXACTLY_ONE.get(
filterString, startPos, endPos);
- throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
- message);
+ throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
}
else
{
@@ -1192,7 +1188,7 @@
// check to see if there are any escaped values, since they will
// need special treatment.
boolean hasEscape = false;
- LinkedList<Integer> asteriskPositions = new LinkedList<Integer>();
+ LinkedList<Integer> asteriskPositions = new LinkedList<>();
for (int i=0; i < valueBytes.length; i++)
{
if (valueBytes[i] == 0x2A) // The asterisk.
@@ -1394,9 +1390,8 @@
}
- // Next, process through the rest of the asterisks to get the
- // subAny values.
- List<ByteString> subAny = new ArrayList<ByteString>();
+ // Next, process through the rest of the asterisks to get the subAny values.
+ List<ByteString> subAny = new ArrayList<>();
for (int asteriskPos : asteriskPositions)
{
int length = asteriskPos - firstPos - 1;
@@ -1773,7 +1768,7 @@
throws DirectoryException
{
AttributeType attributeType = null;
- Set<String> attributeOptions = new HashSet<String>();
+ Set<String> attributeOptions = new HashSet<>();
boolean dnAttributes = false;
String matchingRuleID = null;
@@ -3765,8 +3760,7 @@
return false;
}
- HashSet<String> lowerOptions =
- new HashSet<String>(options1.size());
+ HashSet<String> lowerOptions = new HashSet<>(options1.size());
for (String option : options1)
{
lowerOptions.add(toLowerCase(option));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultEntry.java
index cdd25ad..73d9386 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultEntry.java
@@ -71,7 +71,7 @@
entry.getOperationalAttributes());
- this.controls = new ArrayList<Control>(0);
+ this.controls = new ArrayList<>(0);
}
@@ -96,7 +96,7 @@
if (controls == null)
{
- this.controls = new ArrayList<Control>(0);
+ this.controls = new ArrayList<>(0);
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultReference.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultReference.java
index f7e5cc2..0a55cb2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultReference.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchResultReference.java
@@ -61,10 +61,10 @@
*/
public SearchResultReference(String referralURL)
{
- referralURLs = new ArrayList<String>(1);
+ referralURLs = new ArrayList<>(1);
referralURLs.add(referralURL);
- this.controls = new ArrayList<Control>(0);
+ this.controls = new ArrayList<>(0);
}
@@ -80,14 +80,14 @@
{
if (referralURLs == null)
{
- this.referralURLs = new ArrayList<String>();
+ this.referralURLs = new ArrayList<>();
}
else
{
this.referralURLs = referralURLs;
}
- this.controls = new ArrayList<Control>(0);
+ this.controls = new ArrayList<>(0);
}
@@ -106,7 +106,7 @@
{
if (referralURLs == null)
{
- this.referralURLs = new ArrayList<String>();
+ this.referralURLs = new ArrayList<>();
}
else
{
@@ -115,7 +115,7 @@
if (controls == null)
{
- this.controls = new ArrayList<Control>(0);
+ this.controls = new ArrayList<>(0);
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SmallMap.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SmallMap.java
index 88769c8..7df79a8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SmallMap.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SmallMap.java
@@ -20,7 +20,7 @@
*
* CDDL HEADER END
*
- * Copyright 2014 ForgeRock AS
+ * Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.types;
@@ -29,7 +29,7 @@
/**
* A small map of values. This map implementation is optimized to use as little
* memory as possible in the case where there zero or one elements. In addition,
- * any normalization of entriess is delayed until the second entry is added
+ * any normalization of entries is delayed until the second entry is added
* (normalization may be triggered by invoking {@link Object#hashCode()} or
* {@link Object#equals(Object)}.
* <p>
@@ -106,7 +106,7 @@
return oldValue;
}
// overflow to the underlying map
- entries = new LinkedHashMap<K, V>(2);
+ entries = new LinkedHashMap<>(2);
entries.put(firstKey, firstValue);
firstKey = null;
firstValue = null;
@@ -234,7 +234,7 @@
throw new NoSuchElementException();
}
isFirst = false;
- return new SimpleEntry<K, V>(firstKey, firstValue);
+ return new SimpleEntry<>(firstKey, firstValue);
}
@Override
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java
index 7d97297..df082a8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java
@@ -258,7 +258,7 @@
}
// Process collective attributes.
- this.collectiveAttributes = new ArrayList<Attribute>();
+ this.collectiveAttributes = new ArrayList<>();
if (this.isCollective)
{
List<Attribute> subAttrList = entry.getAttributes();
@@ -273,16 +273,13 @@
}
else if (subAttr.hasOption(ATTR_OPTION_COLLECTIVE))
{
- AttributeBuilder builder = new AttributeBuilder(
- subAttr.getAttributeType());
+ AttributeBuilder builder = new AttributeBuilder(subAttr.getAttributeType());
builder.addAll(subAttr);
- Set<String> options = new LinkedHashSet<String>(
- subAttr.getOptions());
+ Set<String> options = new LinkedHashSet<>(subAttr.getOptions());
options.remove(ATTR_OPTION_COLLECTIVE);
builder.setOptions(options);
Attribute attr = builder.toAttribute();
- CollectiveVirtualAttribute collectiveAttr =
- new CollectiveVirtualAttribute(attr);
+ CollectiveVirtualAttribute collectiveAttr = new CollectiveVirtualAttribute(attr);
this.collectiveAttributes.add(collectiveAttr);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java
index 89c3e55..42012ff 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java
@@ -933,8 +933,8 @@
int minimum = -1;
int maximum = -1;
- final HashSet<DN> chopBefore = new HashSet<DN>();
- final HashSet<DN> chopAfter = new HashSet<DN>();
+ final HashSet<DN> chopBefore = new HashSet<>();
+ final HashSet<DN> chopAfter = new HashSet<>();
Refinement refinement = null;
@@ -953,8 +953,7 @@
{
if (parser.hasNextRightBrace())
{
- // Make sure that there is a closing brace and no trailing
- // text.
+ // Make sure that there is a closing brace and no trailing text.
parser.skipRightBrace();
if (parser.hasNext())
@@ -1138,8 +1137,7 @@
final Parser parser) throws InputMismatchException,
NoSuchElementException
{
- final ArrayList<Refinement> refinements =
- new ArrayList<Refinement>();
+ final ArrayList<Refinement> refinements = new ArrayList<>();
// Skip leading open-brace.
parser.skipLeftBrace();
@@ -1238,7 +1236,7 @@
if (chopBefore != null && chopBefore.iterator().hasNext())
{
// Calculate the absolute DNs.
- final TreeMap<DN, DN> map = new TreeMap<DN, DN>();
+ final TreeMap<DN, DN> map = new TreeMap<>();
for (final DN localName : chopBefore)
{
map.put(baseDN.child(localName), localName);
@@ -1254,7 +1252,7 @@
if (chopAfter != null && chopAfter.iterator().hasNext())
{
// Calculate the absolute DNs.
- final TreeMap<DN, DN> map = new TreeMap<DN, DN>();
+ final TreeMap<DN, DN> map = new TreeMap<>();
for (final DN localName : chopAfter)
{
map.put(baseDN.child(localName), localName);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/AddChangeRecordEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/util/AddChangeRecordEntry.java
index 4a704d6..dcc170f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/AddChangeRecordEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/AddChangeRecordEntry.java
@@ -79,7 +79,7 @@
ifNull(attributes);
- this.attributes = new ArrayList<Attribute>(attributes.size());
+ this.attributes = new ArrayList<>(attributes.size());
for (List<Attribute> list : attributes.values())
{
this.attributes.addAll(list);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/BackupManager.java b/opendj-server-legacy/src/main/java/org/opends/server/util/BackupManager.java
index 4bddca8..25d551e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/BackupManager.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/BackupManager.java
@@ -488,7 +488,7 @@
{
backupID = backupConfig.getBackupID();
backupDir = backupConfig.getBackupDirectory();
- backupProperties = new HashMap<String,String>();
+ backupProperties = new HashMap<>();
shouldCompress = backupConfig.compressData();
incrementalBaseID = retrieveIncrementalBaseID(backupConfig);
@@ -552,7 +552,7 @@
this.backendID = backendID;
this.newBackupParams = backupParams;
this.cryptoEngine = crypt;
- dependencies = new HashSet<String>();
+ dependencies = new HashSet<>();
if (backupParams.isIncremental)
{
HashMap<String,String> properties = backupParams.baseBackupInfo.getBackupProperties();
@@ -672,7 +672,7 @@
*/
List<BackupInfo> getBackupDependencies() throws DirectoryException
{
- List<BackupInfo> dependencies = new ArrayList<BackupInfo>();
+ List<BackupInfo> dependencies = new ArrayList<>();
BackupInfo currentBackupInfo = backupInfo;
while (currentBackupInfo != null && !currentBackupInfo.getDependencies().isEmpty())
{
@@ -844,7 +844,7 @@
void writeUnchangedFiles(Path rootDirectory, ListIterator<Path> files, BackupConfig backupConfig)
throws DirectoryException
{
- List<String> unchangedFilenames = new ArrayList<String>();
+ List<String> unchangedFilenames = new ArrayList<>();
while (files.hasNext() && !backupConfig.isCancelled())
{
Path file = files.next();
@@ -1012,7 +1012,7 @@
*/
Set<String> readUnchangedDependentFiles() throws DirectoryException
{
- Set<String> hashSet = new HashSet<String>();
+ Set<String> hashSet = new HashSet<>();
ZipInputStream zipStream = null;
try
{
@@ -1246,7 +1246,7 @@
private List<String> readAllLines(ZipInputStream zipStream) throws IOException
{
- final ArrayList<String> results = new ArrayList<String>();
+ final ArrayList<String> results = new ArrayList<>();
String line;
BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream));
while ((line = reader.readLine()) != null)
@@ -1255,7 +1255,6 @@
}
return results;
}
-
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/Base64.java b/opendj-server-legacy/src/main/java/org/opends/server/util/Base64.java
index 6b1514e..75c3c8a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/Base64.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/Base64.java
@@ -530,7 +530,7 @@
encodeSubCommand.addArgument(toEncodedFile);
- ArrayList<SubCommand> subCommandList = new ArrayList<SubCommand>(2);
+ ArrayList<SubCommand> subCommandList = new ArrayList<>(2);
subCommandList.add(decodeSubCommand);
subCommandList.add(encodeSubCommand);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java b/opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java
index ef84089..9ca045f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java
@@ -208,7 +208,7 @@
aliasEnumeration = keyStore.aliases();
if (aliasEnumeration == null)
return new String[0];
- ArrayList<String> aliasList = new ArrayList<String>();
+ ArrayList<String> aliasList = new ArrayList<>();
while (aliasEnumeration.hasMoreElements())
aliasList.add(aliasEnumeration.nextElement());
String[] aliases = new String[aliasList.size()];
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java
index 175be36..8812848 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/CollectionUtils.java
@@ -20,7 +20,7 @@
*
* CDDL HEADER END
*
- * Copyright 2014 ForgeRock AS
+ * Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.util;
@@ -48,7 +48,7 @@
*/
public static <E> ArrayList<E> newArrayList(E... elements)
{
- return new ArrayList<E>(Arrays.asList(elements));
+ return new ArrayList<>(Arrays.asList(elements));
}
/**
@@ -62,7 +62,7 @@
*/
public static <E> LinkedList<E> newLinkedList(E... elements)
{
- return new LinkedList<E>(Arrays.asList(elements));
+ return new LinkedList<>(Arrays.asList(elements));
}
/**
@@ -76,7 +76,7 @@
*/
public static <E> HashSet<E> newHashSet(E... elements)
{
- return new HashSet<E>(Arrays.asList(elements));
+ return new HashSet<>(Arrays.asList(elements));
}
/**
@@ -90,7 +90,7 @@
*/
public static <E> LinkedHashSet<E> newLinkedHashSet(E... elements)
{
- return new LinkedHashSet<E>(Arrays.asList(elements));
+ return new LinkedHashSet<>(Arrays.asList(elements));
}
/**
@@ -104,6 +104,6 @@
*/
public static <E> TreeSet<E> newTreeSet(E... elements)
{
- return new TreeSet<E>(Arrays.asList(elements));
+ return new TreeSet<>(Arrays.asList(elements));
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java b/opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java
index 2e6c62a..0b62484 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java
@@ -114,11 +114,11 @@
this.sender = sender;
this.subject = subject;
- recipients = new ArrayList<String>();
+ recipients = new ArrayList<>();
recipients.add(recipient);
body = new LocalizableMessageBuilder();
- attachments = new LinkedList<MimeBodyPart>();
+ attachments = new LinkedList<>();
bodyMIMEType = "text/plain";
}
@@ -139,7 +139,7 @@
this.subject = subject;
body = new LocalizableMessageBuilder();
- attachments = new LinkedList<MimeBodyPart>();
+ attachments = new LinkedList<>();
bodyMIMEType = "text/plain";
}
@@ -577,7 +577,7 @@
return;
}
- LinkedList<Properties> mailServerProperties = new LinkedList<Properties>();
+ LinkedList<Properties> mailServerProperties = new LinkedList<>();
for (String s : host.getValues())
{
Properties p = new Properties();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
index 62cb7e4..9d0603e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
@@ -144,8 +144,8 @@
this.importConfig = importConfig;
reader = importConfig.getReader();
- lastEntryBodyLines = new LinkedList<StringBuilder>();
- lastEntryHeaderLines = new LinkedList<StringBuilder>();
+ lastEntryBodyLines = new LinkedList<>();
+ lastEntryHeaderLines = new LinkedList<>();
pluginConfigManager = DirectoryServer.getPluginConfigManager();
// If we should invoke import plugins, then do so.
if (importConfig.invokeImportPlugins())
@@ -205,7 +205,7 @@
return null;
}
lastEntryBodyLines = lines;
- lastEntryHeaderLines = new LinkedList<StringBuilder>();
+ lastEntryHeaderLines = new LinkedList<>();
// Read the DN of the entry and see if it is one that should be included
@@ -247,10 +247,9 @@
private Entry createEntry(DN entryDN, List<StringBuilder> lines, boolean checkSchema) throws LDIFException
{
- Map<ObjectClass, String> objectClasses = new HashMap<ObjectClass, String>();
- Map<AttributeType, List<AttributeBuilder>> userAttrBuilders = new HashMap<AttributeType, List<AttributeBuilder>>();
- Map<AttributeType, List<AttributeBuilder>> operationalAttrBuilders =
- new HashMap<AttributeType, List<AttributeBuilder>>();
+ Map<ObjectClass, String> objectClasses = new HashMap<>();
+ Map<AttributeType, List<AttributeBuilder>> userAttrBuilders = new HashMap<>();
+ Map<AttributeType, List<AttributeBuilder>> operationalAttrBuilders = new HashMap<>();
for (StringBuilder line : lines)
{
readAttribute(lines, line, entryDN, objectClasses, userAttrBuilders, operationalAttrBuilders, checkSchema);
@@ -341,7 +340,7 @@
*/
protected Map<AttributeType, List<Attribute>> toAttributesMap(Map<AttributeType, List<AttributeBuilder>> attrBuilders)
{
- Map<AttributeType, List<Attribute>> attributes = new HashMap<AttributeType, List<Attribute>>(attrBuilders.size());
+ Map<AttributeType, List<Attribute>> attributes = new HashMap<>(attrBuilders.size());
for (Map.Entry<AttributeType, List<AttributeBuilder>> attrTypeEntry : attrBuilders.entrySet())
{
AttributeType attrType = attrTypeEntry.getKey();
@@ -359,7 +358,7 @@
*/
protected List<Attribute> toAttributesList(List<AttributeBuilder> builders)
{
- List<Attribute> results = new ArrayList<Attribute>(builders.size());
+ List<Attribute> results = new ArrayList<>(builders.size());
for (AttributeBuilder builder : builders)
{
results.add(builder.toAttribute());
@@ -465,7 +464,7 @@
protected LinkedList<StringBuilder> readEntryLines() throws IOException, LDIFException
{
// Read the entry lines into a buffer.
- LinkedList<StringBuilder> lines = new LinkedList<StringBuilder>();
+ LinkedList<StringBuilder> lines = new LinkedList<>();
int lastLine = -1;
if(reader == null)
@@ -904,7 +903,7 @@
{
AttributeBuilder builder = new AttributeBuilder(attribute, true);
builder.add(attributeValue);
- attrList = new ArrayList<AttributeBuilder>();
+ attrList = new ArrayList<>();
attrList.add(builder);
attrBuilders.put(attrType, attrList);
return;
@@ -1343,7 +1342,7 @@
private ChangeRecordEntry parseModifyChangeRecordEntry(DN entryDN,
LinkedList<StringBuilder> lines) throws LDIFException {
- List<RawModification> modifications = new ArrayList<RawModification>();
+ List<RawModification> modifications = new ArrayList<>();
while(!lines.isEmpty())
{
StringBuilder line = lines.remove();
@@ -1441,9 +1440,8 @@
private ChangeRecordEntry parseAddChangeRecordEntry(DN entryDN,
List<StringBuilder> lines) throws LDIFException
{
- Map<ObjectClass, String> objectClasses = new HashMap<ObjectClass, String>();
- Map<AttributeType, List<AttributeBuilder>> attrBuilders =
- new HashMap<AttributeType, List<AttributeBuilder>>();
+ Map<ObjectClass, String> objectClasses = new HashMap<>();
+ Map<AttributeType, List<AttributeBuilder>> attrBuilders = new HashMap<>();
for(StringBuilder line : lines)
{
readAttribute(lines, line, entryDN, objectClasses,
@@ -1460,7 +1458,7 @@
toAttributesMap(attrBuilders);
if (attributes.get(ocType) == null)
{
- List<Attribute> ocAttrList = new ArrayList<Attribute>(1);
+ List<Attribute> ocAttrList = new ArrayList<>(1);
ocAttrList.add(builder.toAttribute());
attributes.put(ocType, ocAttrList);
}
@@ -1721,7 +1719,7 @@
List<Attribute> attrList = attributes.get(t);
if (attrList == null)
{
- attrList = new ArrayList<Attribute>();
+ attrList = new ArrayList<>();
attrList.add(Attributes.create(t, n, v));
attributes.put(t, attrList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/ModifyChangeRecordEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/util/ModifyChangeRecordEntry.java
index d687299..ac004b4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/ModifyChangeRecordEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/ModifyChangeRecordEntry.java
@@ -68,7 +68,7 @@
ifNull(modifications);
- this.modifications = new ArrayList<RawModification>(modifications);
+ this.modifications = new ArrayList<>(modifications);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/SetupUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/util/SetupUtils.java
index 84f05ca..ae51ae2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/SetupUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/SetupUtils.java
@@ -158,7 +158,7 @@
public static File createTemplateFile(String baseDN, int numEntries)
throws IOException
{
- Set<String> baseDNs = new HashSet<String>(1);
+ Set<String> baseDNs = new HashSet<>(1);
baseDNs.add(baseDN);
return createTemplateFile(baseDNs, numEntries);
}
@@ -181,7 +181,7 @@
File templateFile = File.createTempFile("opendj-install", ".template");
templateFile.deleteOnExit();
- LinkedList<String> lines = new LinkedList<String>();
+ LinkedList<String> lines = new LinkedList<>();
int i = 0;
for (String baseDN : baseDNs)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java b/opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java
index 46b2e3d..a28c6ae 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java
@@ -2405,7 +2405,7 @@
}
- ArrayList<String> commandAndArgs = new ArrayList<String>();
+ ArrayList<String> commandAndArgs = new ArrayList<>();
commandAndArgs.add(command);
if ((args != null) && (args.length > 0))
{
@@ -3374,7 +3374,7 @@
return null;
}
- ArrayList<String> stringList = new ArrayList<String>(stringArray.length);
+ ArrayList<String> stringList = new ArrayList<>(stringArray.length);
for (String s : stringArray)
{
stringList.add(s);
@@ -3634,8 +3634,7 @@
ObjectClass structuralClass = DirectoryServer.getObjectClass(getObjectClassName(rdn, numAVAs));
// Get the top and untypedObject classes to include in the entry.
- LinkedHashMap<ObjectClass,String> objectClasses =
- new LinkedHashMap<ObjectClass,String>(3);
+ LinkedHashMap<ObjectClass,String> objectClasses = new LinkedHashMap<>(3);
objectClasses.put(DirectoryServer.getTopObjectClass(), OC_TOP);
objectClasses.put(structuralClass, structuralClass.getNameOrOID());
@@ -3643,10 +3642,8 @@
// Iterate through the RDN attributes and add them to the set of user or
// operational attributes.
- LinkedHashMap<AttributeType,List<Attribute>> userAttributes =
- new LinkedHashMap<AttributeType,List<Attribute>>();
- LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes =
- new LinkedHashMap<AttributeType,List<Attribute>>();
+ LinkedHashMap<AttributeType,List<Attribute>> userAttributes = new LinkedHashMap<>();
+ LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes = new LinkedHashMap<>();
boolean extensibleObjectAdded = false;
for (int i=0; i < numAVAs; i++)
@@ -3721,7 +3718,7 @@
{
AttributeBuilder builder = new AttributeBuilder(attrType, attrName);
builder.add(attrValue);
- attrList = new ArrayList<Attribute>(1);
+ attrList = new ArrayList<>(1);
attrList.add(builder.toAttribute());
attrs.put(attrType, attrList);
}
@@ -4028,7 +4025,7 @@
{
if (additionalClasses == null)
{
- additionalClasses = new HashSet<ObjectClass>();
+ additionalClasses = new HashSet<>();
}
additionalClasses.add(superiorClass);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/TimeThread.java b/opendj-server-legacy/src/main/java/org/opends/server/util/TimeThread.java
index 4db14fb..ed5d42d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/TimeThread.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/TimeThread.java
@@ -112,9 +112,8 @@
*/
public TimeInfo()
{
- userDefinedFormatters =
- new CopyOnWriteArrayList<SimpleDateFormat>();
- userDefinedTimeStrings = new ConcurrentHashMap<String, String>();
+ userDefinedFormatters = new CopyOnWriteArrayList<>();
+ userDefinedTimeStrings = new ConcurrentHashMap<>();
TimeZone utcTimeZone = TimeZone.getTimeZone("UTC");
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/VersionCompatibilityIssue.java b/opendj-server-legacy/src/main/java/org/opends/server/util/VersionCompatibilityIssue.java
index d63090b..b7844a7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/VersionCompatibilityIssue.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/VersionCompatibilityIssue.java
@@ -350,7 +350,7 @@
}
private int id;
- private Set<Effect> effects = new HashSet<Effect>();
+ private Set<Effect> effects = new HashSet<>();
private LocalizableMessage upgradeMsg;
private LocalizableMessage reversionMsg;
@@ -474,12 +474,8 @@
}
- /**
- * Container for registered issues.
- */
- private static final Set<VersionCompatibilityIssue>
- VERSION_COMPATIBILITY_ISSUES =
- new HashSet<VersionCompatibilityIssue>();
+ /** Container for registered issues. */
+ private static final Set<VersionCompatibilityIssue> VERSION_COMPATIBILITY_ISSUES = new HashSet<>();
//***************************************************
//
@@ -524,9 +520,7 @@
* they appear
*/
public static List<VersionCompatibilityIssue> getAllEvents() {
- List<VersionCompatibilityIssue> issueList =
- new ArrayList<VersionCompatibilityIssue>
- (VERSION_COMPATIBILITY_ISSUES);
+ List<VersionCompatibilityIssue> issueList = new ArrayList<>(VERSION_COMPATIBILITY_ISSUES);
Collections.sort(issueList, VERSION_COMPARATOR);
return Collections.unmodifiableList(issueList);
}
@@ -548,8 +542,7 @@
BuildInformation neu)
{
if (excludeIds == null) excludeIds = Collections.emptySet();
- List<VersionCompatibilityIssue> issueList =
- new ArrayList<VersionCompatibilityIssue>();
+ List<VersionCompatibilityIssue> issueList = new ArrayList<>();
for (VersionCompatibilityIssue evt : VERSION_COMPATIBILITY_ISSUES) {
if (!excludeIds.contains(evt.getCause().getId())) {
BuildVersion currentVersion = new BuildVersion(
@@ -582,8 +575,7 @@
* @return List or IncompatibleVersionEvent objects
*/
public static List<VersionCompatibilityIssue> getEvents(BuildVersion from) {
- List<VersionCompatibilityIssue> issueList =
- new ArrayList<VersionCompatibilityIssue>();
+ List<VersionCompatibilityIssue> issueList = new ArrayList<>();
for (VersionCompatibilityIssue evt : VERSION_COMPATIBILITY_ISSUES) {
BuildVersion evtVer = evt.getVersion();
if (evtVer.compareTo(from) >= 0) {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java b/opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java
index 449ad8c..3d1fffd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java
@@ -470,7 +470,7 @@
{
checkHeadingDisplayed();
- MenuBuilder<Integer> builder = new MenuBuilder<Integer>(app);
+ MenuBuilder<Integer> builder = new MenuBuilder<>(app);
builder.setPrompt(INFO_LDAP_CONN_PROMPT_SECURITY_USE_SECURE_CTX.get());
Protocols defaultProtocol;
@@ -886,7 +886,7 @@
checkHeadingDisplayed();
app.println();
- MenuBuilder<Integer> builder = new MenuBuilder<Integer>(app);
+ MenuBuilder<Integer> builder = new MenuBuilder<>(app);
builder.setPrompt(INFO_LDAP_CONN_PROMPT_SECURITY_TRUST_METHOD.get());
TrustMethod defaultTrustMethod = TrustMethod.DISPLAY_CERTIFICATE;
@@ -1240,7 +1240,7 @@
try
{
- MenuBuilder<String> builder = new MenuBuilder<String>(app);
+ MenuBuilder<String> builder = new MenuBuilder<>(app);
builder.setPrompt(INFO_LDAP_CONN_PROMPT_SECURITY_CERTIFICATE_ALIASES.get());
int certificateNumber = 0;
for (; aliasesEnum.hasMoreElements();)
@@ -1524,7 +1524,7 @@
app.println();
}
}
- MenuBuilder<Integer> builder = new MenuBuilder<Integer>(app);
+ MenuBuilder<Integer> builder = new MenuBuilder<>(app);
builder.setPrompt(INFO_LDAP_CONN_PROMPT_SECURITY_TRUST_OPTION.get());
TrustOption defaultTrustMethod = TrustOption.SESSION;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
index 10e86c5..7f17f0a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
@@ -649,7 +649,7 @@
if (isSynchronizationOperation() ||
DirectoryServer.addMissingRDNAttributes())
{
- attrList = new ArrayList<Attribute>();
+ attrList = new ArrayList<>();
attrList.add(Attributes.create(t, n, v));
attributes.put(t, attrList);
}
@@ -841,7 +841,7 @@
if (! passwordPolicy.isSkipValidationForAdministrators())
{
// There are never any current passwords for an add operation.
- HashSet<ByteString> currentPasswords = new HashSet<ByteString>(0);
+ HashSet<ByteString> currentPasswords = new HashSet<>(0);
LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
// Work on a copy of the entry without the password to avoid
// false positives from some validators.
@@ -885,7 +885,7 @@
// Set the password changed time attribute.
- ArrayList<Attribute> changedTimeList = new ArrayList<Attribute>(1);
+ ArrayList<Attribute> changedTimeList = new ArrayList<>(1);
Attribute changedTime = Attributes.create(
OP_ATTR_PWPOLICY_CHANGED_TIME, TimeThread.getGeneralizedTime());
changedTimeList.add(changedTime);
@@ -897,7 +897,7 @@
{
addPWPolicyControl(PasswordPolicyErrorType.CHANGE_AFTER_RESET);
- ArrayList<Attribute> resetList = new ArrayList<Attribute>(1);
+ ArrayList<Attribute> resetList = new ArrayList<>(1);
Attribute reset = Attributes.create(
OP_ATTR_PWPOLICY_RESET_REQUIRED, "TRUE");
resetList.add(reset);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
index 5fa241f..5f1fe7d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
@@ -676,7 +676,7 @@
ERR_MODDN_OLD_RDN_ATTR_IS_NO_USER_MOD.get(entryDN, a.getName()));
}
- List<ByteString> missingValues = new LinkedList<ByteString>();
+ List<ByteString> missingValues = new LinkedList<>();
newEntry.removeAttribute(a, missingValues);
if (missingValues.isEmpty())
@@ -696,7 +696,7 @@
newRDN.getAttributeName(i),
newRDN.getAttributeValue(i));
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
newEntry.addAttribute(a, duplicateValues);
if (duplicateValues.isEmpty())
@@ -771,12 +771,12 @@
switch (m.getModificationType().asEnum())
{
case ADD:
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
newEntry.addAttribute(a, duplicateValues);
break;
case DELETE:
- List<ByteString> missingValues = new LinkedList<ByteString>();
+ List<ByteString> missingValues = new LinkedList<>();
newEntry.removeAttribute(a, missingValues);
break;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
index 2df63de..eafc4e2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -1092,7 +1092,7 @@
if (newPasswords == null)
{
- newPasswords = new LinkedList<ByteString>();
+ newPasswords = new LinkedList<>();
}
newPasswords.add(v);
@@ -1228,7 +1228,7 @@
{
if (currentPasswords == null)
{
- currentPasswords = new LinkedList<ByteString>();
+ currentPasswords = new LinkedList<>();
}
currentPasswords.add(v);
numPasswords--;
@@ -1336,9 +1336,8 @@
}
// Add the provided attribute or merge an existing attribute with
- // the values of the new attribute. If there are any duplicates,
- // then fail.
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ // the values of the new attribute. If there are any duplicates, then fail.
+ List<ByteString> duplicateValues = new LinkedList<>();
modifiedEntry.addAttribute(attr, duplicateValues);
if (!duplicateValues.isEmpty() && !permissiveModify)
{
@@ -1419,7 +1418,7 @@
// Remove the specified attribute values or the entire attribute from the
// value. If there are any specified values that were not present, then
// fail. If the RDN attribute value would be removed, then fail.
- List<ByteString> missingValues = new LinkedList<ByteString>();
+ List<ByteString> missingValues = new LinkedList<>();
boolean attrExists = modifiedEntry.removeAttribute(attr, missingValues);
if (attrExists)
@@ -1688,7 +1687,7 @@
if (newPasswords != null
&& (selfChange || !authPolicy.isSkipValidationForAdministrators()))
{
- HashSet<ByteString> clearPasswords = new HashSet<ByteString>(pwPolicyState.getClearPasswords());
+ HashSet<ByteString> clearPasswords = new HashSet<>(pwPolicyState.getClearPasswords());
if (currentPasswords != null)
{
if (clearPasswords.isEmpty())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
index 2e40158..398605d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
@@ -207,8 +207,7 @@
private final Backend<?> backend;
/** The set of local backend workflow elements registered with the server. */
- private static TreeMap<DN, LocalBackendWorkflowElement> registeredLocalBackends =
- new TreeMap<DN, LocalBackendWorkflowElement>();
+ private static TreeMap<DN, LocalBackendWorkflowElement> registeredLocalBackends = new TreeMap<>();
/** A lock to guarantee safe concurrent access to the registeredLocalBackends variable. */
private static final Object registeredLocalBackendsLock = new Object();
@@ -706,8 +705,7 @@
LocalBackendWorkflowElement existingLocalBackend = registeredLocalBackends.get(baseDN);
if (existingLocalBackend == null)
{
- TreeMap<DN, LocalBackendWorkflowElement> newLocalBackends =
- new TreeMap<DN, LocalBackendWorkflowElement>(registeredLocalBackends);
+ TreeMap<DN, LocalBackendWorkflowElement> newLocalBackends = new TreeMap<>(registeredLocalBackends);
newLocalBackends.put(baseDN, localBackend);
registeredLocalBackends = newLocalBackends;
}
@@ -729,8 +727,7 @@
LocalBackendWorkflowElement existingLocalBackend = registeredLocalBackends.get(baseDN);
if (existingLocalBackend != null)
{
- TreeMap<DN, LocalBackendWorkflowElement> newLocalBackends =
- new TreeMap<DN, LocalBackendWorkflowElement>(registeredLocalBackends);
+ TreeMap<DN, LocalBackendWorkflowElement> newLocalBackends = new TreeMap<>(registeredLocalBackends);
newLocalBackends.remove(baseDN);
registeredLocalBackends = newLocalBackends;
}
@@ -804,7 +801,7 @@
static <O extends Operation, L> void attachLocalOperation(O globalOperation, L currentLocalOperation)
{
List<?> existingAttachment = (List<?>) globalOperation.getAttachment(Operation.LOCALBACKENDOPERATIONS);
- List<L> newAttachment = new ArrayList<L>();
+ List<L> newAttachment = new ArrayList<>();
if (existingAttachment != null)
{
@@ -1036,7 +1033,7 @@
{
final RootDSEBackend rootDSEBackend = DirectoryServer.getRootDSEBackend();
- final List<LocalBackendWorkflowElement> results = new ArrayList<LocalBackendWorkflowElement>();
+ final List<LocalBackendWorkflowElement> results = new ArrayList<>();
for (DN subordinateBaseDN : rootDSEBackend.getSubordinateBaseDNs().keySet())
{
results.add(registeredLocalBackends.get(subordinateBaseDN));
@@ -1134,7 +1131,7 @@
final DN baseDN = workflow.getBaseDN();
final Backend<?> backend = workflow.getBackend();
- final ArrayList<LocalBackendWorkflowElement> results = new ArrayList<LocalBackendWorkflowElement>();
+ final ArrayList<LocalBackendWorkflowElement> results = new ArrayList<>();
for (Backend<?> subordinate : backend.getSubordinateBackends())
{
for (DN subordinateDN : subordinate.getBaseDNs())
diff --git a/opendj-server-legacy/src/messages/src/org/opends/messages/Category.java b/opendj-server-legacy/src/messages/src/org/opends/messages/Category.java
index 0a5083c..3196641 100644
--- a/opendj-server-legacy/src/messages/src/org/opends/messages/Category.java
+++ b/opendj-server-legacy/src/messages/src/org/opends/messages/Category.java
@@ -177,7 +177,7 @@
private static Map<Integer,Category> MASK_VALUE_MAP;
static {
- MASK_VALUE_MAP = new HashMap<Integer,Category>();
+ MASK_VALUE_MAP = new HashMap<>();
for (Category c : EnumSet.allOf(Category.class)) {
MASK_VALUE_MAP.put(c.mask, c);
}
diff --git a/opendj-server-legacy/src/messages/src/org/opends/messages/Severity.java b/opendj-server-legacy/src/messages/src/org/opends/messages/Severity.java
index 71195e8..ab0158b 100644
--- a/opendj-server-legacy/src/messages/src/org/opends/messages/Severity.java
+++ b/opendj-server-legacy/src/messages/src/org/opends/messages/Severity.java
@@ -77,8 +77,8 @@
private static Map<String,Severity> PROPERTY_KEY_FORM_MAP;
static {
- PROPERTY_KEY_FORM_MAP = new HashMap<String,Severity>();
- PROPERTY_KEY_FORM_VALUES_SET = new HashSet<String>();
+ PROPERTY_KEY_FORM_MAP = new HashMap<>();
+ PROPERTY_KEY_FORM_VALUES_SET = new HashSet<>();
for (Severity s : EnumSet.allOf(Severity.class)) {
PROPERTY_KEY_FORM_MAP.put(s.propertyKeyFormName(), s);
PROPERTY_KEY_FORM_VALUES_SET.add(s.propertyKeyFormName());
diff --git a/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java b/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
index 7a9f171..52666ce 100644
--- a/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
@@ -239,8 +239,7 @@
.newControl("dn:uid=kvaughan,ou=People,dc=example,dc=com");
assertThat(control3.getOID()).isEqualTo("2.16.840.1.113730.3.4.18");
- List<org.forgerock.opendj.ldap.controls.Control> mySDKControlsList =
- new LinkedList<org.forgerock.opendj.ldap.controls.Control>();
+ List<org.forgerock.opendj.ldap.controls.Control> mySDKControlsList = new LinkedList<>();
mySDKControlsList.add(control);
mySDKControlsList.add(control2);
mySDKControlsList.add(control3);
diff --git a/opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java b/opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java
index f64235f..384dac5 100644
--- a/opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java
+++ b/opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java
@@ -126,7 +126,7 @@
isProfileRegistered = true;
}
- SingletonRelationDefinition.Builder<C, S> builder = new SingletonRelationDefinition.Builder<C, S>(
+ SingletonRelationDefinition.Builder<C, S> builder = new SingletonRelationDefinition.Builder<>(
RootCfgDefn.getInstance(), DUMMY_TEST_RELATION, d);
ManagedObjectPath<?, ?> root = ManagedObjectPath.emptyPath();
return root.child(builder.getInstance());
diff --git a/opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java b/opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java
index 6a08131..2088dc9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java
+++ b/opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java
@@ -79,7 +79,7 @@
ldapPort = ports[0];
jmxPort = ports[1];
- List<String> args = new ArrayList<String>();
+ List<String> args = new ArrayList<>();
File root = getQuickSetupTestServerRootDir();
String filename = OperatingSystem.isUnixBased() ? "setup" : "setup.bat";
args.add(new File(root, filename).getPath());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/DirectoryServerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/DirectoryServerTestCase.java
index 9ce0e8e..013569b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/DirectoryServerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/DirectoryServerTestCase.java
@@ -82,12 +82,12 @@
* keep this so that once all of the tests are finished, we can clear
* it out in an @AfterClass method. We can't just clear it out right
* away in the TestListener because some methods share a @DataProvider.*/
- private final IdentityHashMap<Object[],Object> successfulTestParams = new IdentityHashMap<Object[],Object>();
+ private final IdentityHashMap<Object[],Object> successfulTestParams = new IdentityHashMap<>();
/** These are test parameters from a test that has failed. We need to
* keep these around because the test report expects to find them when
* printing out failures. */
- private final IdentityHashMap<Object[],Object> failedTestParams = new IdentityHashMap<Object[],Object>();
+ private final IdentityHashMap<Object[],Object> failedTestParams = new IdentityHashMap<>();
/**
* Adds testParams to the list of all test parameters, so it can be
@@ -206,7 +206,7 @@
Thread threads[] = new Thread[topGroup.activeCount() * 2];
int numThreads = topGroup.enumerate(threads);
- List<String> activeThreads = new ArrayList<String>();
+ List<String> activeThreads = new ArrayList<>();
for (int i = 0; i < numThreads; i++)
{
Thread thread = threads[i];
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java b/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
index 602c4b2..ac129e3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
@@ -553,7 +553,7 @@
}
}
- private static List<Long> restartTimesMs = new ArrayList<Long>();
+ private static List<Long> restartTimesMs = new ArrayList<>();
public static List<Long> getRestartTimesMs() {
return Collections.unmodifiableList(restartTimesMs);
}
@@ -914,7 +914,7 @@
RootContainer rootContainer = backend.getRootContainer();
for (EntryContainer ec : rootContainer.getEntryContainers())
{
- List<DatabaseContainer> databases = new ArrayList<DatabaseContainer>();
+ List<DatabaseContainer> databases = new ArrayList<>();
ec.listDatabases(databases);
for (DatabaseContainer dbContainer: databases) {
if (dbContainer instanceof Index) {
@@ -1152,7 +1152,7 @@
ldifImportConfig.setValidateSchema(false);
LDIFReader reader = new LDIFReader(ldifImportConfig);
- List<Entry> entries = new ArrayList<Entry>();
+ List<Entry> entries = new ArrayList<>();
Entry entry;
while ((entry = reader.readEntry()) != null) {
entries.add(entry);
@@ -1522,7 +1522,7 @@
*/
public static Map<String, String> makeMap(String... keyValuePairs)
{
- Map<String, String> map = new LinkedHashMap<String, String>();
+ Map<String, String> map = new LinkedHashMap<>();
for (int i = 0; i < keyValuePairs.length; i += 2) {
map.put(keyValuePairs[i], keyValuePairs[i+1]);
}
@@ -1534,7 +1534,7 @@
// ---------------------------------------------------------------------------
/** The set of loggers for which the console logger has been disabled. */
- private static final Map<Logger, Handler> disabledLogHandlers = new HashMap<Logger,Handler>();
+ private static final Map<Logger, Handler> disabledLogHandlers = new HashMap<>();
/** The original System.err print stream. Use this if you absolutely
* must write something to System.err. */
@@ -1692,15 +1692,10 @@
* included). An ArrayList is explicitly returned, so that callers know that
* random access is not expensive.
*/
- public static ArrayList<String> readFileToLines(File file)
- throws IOException {
- BufferedReader reader =
- new BufferedReader(
- new InputStreamReader(
- new DataInputStream(
- new FileInputStream(file))));
+ public static ArrayList<String> readFileToLines(File file) throws IOException {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
- ArrayList<String> lines = new ArrayList<String>();
+ ArrayList<String> lines = new ArrayList<>();
String line;
while ((line = reader.readLine()) != null) {
lines.add(line);
@@ -1848,8 +1843,7 @@
// Re-arrange all of the elements by thread ID so that there is some logical order.
- Map<Long, Map.Entry<Thread, StackTraceElement[]>> orderedStacks =
- new TreeMap<Long,Map.Entry<Thread,StackTraceElement[]>>();
+ Map<Long, Map.Entry<Thread, StackTraceElement[]>> orderedStacks = new TreeMap<>();
for (Map.Entry<Thread,StackTraceElement[]> e : threadStacks.entrySet())
{
orderedStacks.put(e.getKey().getId(), e);
@@ -1930,7 +1924,7 @@
public static HashSet<PluginType> getPluginTypes(Entry e)
{
- HashSet<PluginType> pluginTypes = new HashSet<PluginType>();
+ HashSet<PluginType> pluginTypes = new HashSet<>();
List<Attribute> attrList = e.getAttribute("ds-cfg-plugin-type");
if (attrList != null)
{
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/TestListener.java b/opendj-server-legacy/src/test/java/org/opends/server/TestListener.java
index e94a04b..713a649 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/TestListener.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/TestListener.java
@@ -573,9 +573,9 @@
}
}
- private final LinkedHashSet<Class<?>> _classesWithTestsRunInterleaved = new LinkedHashSet<Class<?>>();
+ private final LinkedHashSet<Class<?>> _classesWithTestsRunInterleaved = new LinkedHashSet<>();
private Object _lastTestObject;
- private final IdentityHashMap<Object,Object> _previousTestObjects = new IdentityHashMap<Object,Object>();
+ private final IdentityHashMap<Object,Object> _previousTestObjects = new IdentityHashMap<>();
private void checkForInterleavedBetweenClasses(ITestResult tr) {
Object[] testInstances = tr.getMethod().getInstances();
// This will almost always have a single element. If it doesn't, just skip it.
@@ -607,7 +607,7 @@
}
- private Set<Method> _checkedForAnnotation = new HashSet<Method>();
+ private Set<Method> _checkedForAnnotation = new HashSet<>();
private void enforceMethodHasAnnotation(ITestResult tr) {
// Only warn once per method.
Method testMethod = tr.getMethod().getMethod();
@@ -841,7 +841,7 @@
return runtime.totalMemory() - runtime.freeMemory();
}
- private final LinkedHashMap<IClass, TestClassResults> _classResults = new LinkedHashMap<IClass, TestClassResults>();
+ private final LinkedHashMap<IClass, TestClassResults> _classResults = new LinkedHashMap<>();
private TestClassResults getResultsForClass(IClass cls) {
TestClassResults results = _classResults.get(cls);
@@ -892,7 +892,7 @@
}
private synchronized List<TestMethodResults> getAllMethodResults() {
- List<TestMethodResults> allResults = new ArrayList<TestMethodResults>();
+ List<TestMethodResults> allResults = new ArrayList<>();
for (TestClassResults results: _classResults.values()) {
allResults.addAll(results.getAllMethodResults());
}
@@ -943,7 +943,7 @@
}
private List<TestClassResults> getClassesDescendingSortedByDuration() {
- List<TestClassResults> allClasses = new ArrayList<TestClassResults>(_classResults.values());
+ List<TestClassResults> allClasses = new ArrayList<>(_classResults.values());
Collections.sort(allClasses, new Comparator<TestClassResults>() {
@Override
public int compare(TestClassResults o1, TestClassResults o2) {
@@ -965,7 +965,7 @@
private static class TestClassResults {
private final IClass _cls;
- private final LinkedHashMap<ITestNGMethod, TestMethodResults> _methods = new LinkedHashMap<ITestNGMethod, TestMethodResults>();
+ private final LinkedHashMap<ITestNGMethod, TestMethodResults> _methods = new LinkedHashMap<>();
private int _totalInvocations;
private long _totalDurationMs;
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/TestTextWriter.java b/opendj-server-legacy/src/test/java/org/opends/server/TestTextWriter.java
index 1bb31dd..8b20882 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/TestTextWriter.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/TestTextWriter.java
@@ -39,7 +39,7 @@
public TestTextWriter()
{
- messageList = new LinkedList<String>();
+ messageList = new LinkedList<>();
}
public synchronized void writeRecord(String record)
@@ -76,18 +76,12 @@
*/
public synchronized List<String> getMessages()
{
- return new ArrayList<String>(messageList);
+ return new ArrayList<>(messageList);
}
-
-
- /**
- * Clears any messages currently stored by this logger.
- */
+ /** Clears any messages currently stored by this logger. */
public synchronized void clear()
{
messageList.clear();
}
-
-
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/RelativeInheritedDefaultBehaviorProviderTest.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/RelativeInheritedDefaultBehaviorProviderTest.java
index d27e590..54bbc5d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/RelativeInheritedDefaultBehaviorProviderTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/RelativeInheritedDefaultBehaviorProviderTest.java
@@ -65,7 +65,7 @@
*/
@BeforeClass
public void setUp() {
- this.ridbp = new RelativeInheritedDefaultBehaviorProvider<Boolean>(d, d
+ this.ridbp = new RelativeInheritedDefaultBehaviorProvider<>(d, d
.getMandatoryBooleanPropertyPropertyDefinition().getName(), OFFSET);
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
index 18575a0..582ab21 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
@@ -57,7 +57,7 @@
/** Create a one-to-many relation for test-parent components. */
static {
- InstantiableRelationDefinition.Builder<TestParentCfgClient, TestParentCfg> builder = new InstantiableRelationDefinition.Builder<TestParentCfgClient, TestParentCfg>(
+ InstantiableRelationDefinition.Builder<TestParentCfgClient, TestParentCfg> builder = new InstantiableRelationDefinition.Builder<>(
RootCfgDefn.getInstance(), "test-one-to-many-parent",
"test-one-to-many-parents", TestParentCfgDefn.getInstance());
RD_TEST_ONE_TO_MANY_PARENT = builder.getInstance();
@@ -65,7 +65,7 @@
/** Create a one-to-many relation for test-parent components. */
static {
- OptionalRelationDefinition.Builder<TestParentCfgClient, TestParentCfg> builder = new OptionalRelationDefinition.Builder<TestParentCfgClient, TestParentCfg>(
+ OptionalRelationDefinition.Builder<TestParentCfgClient, TestParentCfg> builder = new OptionalRelationDefinition.Builder<>(
RootCfgDefn.getInstance(), "test-one-to-zero-or-one-parent",
TestParentCfgDefn.getInstance());
RD_TEST_ONE_TO_ZERO_OR_ONE_PARENT = builder.getInstance();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestChildCfgDefn.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestChildCfgDefn.java
index 1aabf26..6757d1c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestChildCfgDefn.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestChildCfgDefn.java
@@ -122,7 +122,7 @@
ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "mandatory-class-property");
builder.setOption(PropertyOption.MANDATORY);
builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "mandatory-class-property"));
- DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.extensions.UserDefinedVirtualAttributeProvider");
+ DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<>("org.opends.server.extensions.UserDefinedVirtualAttributeProvider");
builder.setDefaultBehaviorProvider(provider);
builder.addInstanceOf("org.opends.server.api.VirtualAttributeProvider");
PD_MANDATORY_CLASS_PROPERTY = builder.getInstance();
@@ -149,7 +149,7 @@
DNPropertyDefinition.Builder builder = DNPropertyDefinition.createBuilder(INSTANCE, "optional-multi-valued-dn-property1");
builder.setOption(PropertyOption.MULTI_VALUED);
builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "optional-multi-valued-dn-property1"));
- DefaultBehaviorProvider<DN> provider = new RelativeInheritedDefaultBehaviorProvider<DN>(TestParentCfgDefn.getInstance(), "optional-multi-valued-dn-property", 1);
+ DefaultBehaviorProvider<DN> provider = new RelativeInheritedDefaultBehaviorProvider<>(TestParentCfgDefn.getInstance(), "optional-multi-valued-dn-property", 1);
builder.setDefaultBehaviorProvider(provider);
PD_OPTIONAL_MULTI_VALUED_DN_PROPERTY1 = builder.getInstance();
INSTANCE.registerPropertyDefinition(PD_OPTIONAL_MULTI_VALUED_DN_PROPERTY1);
@@ -162,7 +162,7 @@
DNPropertyDefinition.Builder builder = DNPropertyDefinition.createBuilder(INSTANCE, "optional-multi-valued-dn-property2");
builder.setOption(PropertyOption.MULTI_VALUED);
builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "optional-multi-valued-dn-property2"));
- DefaultBehaviorProvider<DN> provider = new RelativeInheritedDefaultBehaviorProvider<DN>(TestChildCfgDefn.getInstance(), "optional-multi-valued-dn-property1", 0);
+ DefaultBehaviorProvider<DN> provider = new RelativeInheritedDefaultBehaviorProvider<>(TestChildCfgDefn.getInstance(), "optional-multi-valued-dn-property1", 0);
builder.setDefaultBehaviorProvider(provider);
PD_OPTIONAL_MULTI_VALUED_DN_PROPERTY2 = builder.getInstance();
INSTANCE.registerPropertyDefinition(PD_OPTIONAL_MULTI_VALUED_DN_PROPERTY2);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestParentCfgDefn.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestParentCfgDefn.java
index 89ebcac..49a4f3d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestParentCfgDefn.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestParentCfgDefn.java
@@ -108,7 +108,7 @@
ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "mandatory-class-property");
builder.setOption(PropertyOption.MANDATORY);
builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "mandatory-class-property"));
- DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.extensions.UserDefinedVirtualAttributeProvider");
+ DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<>("org.opends.server.extensions.UserDefinedVirtualAttributeProvider");
builder.setDefaultBehaviorProvider(provider);
builder.addInstanceOf("org.opends.server.api.VirtualAttributeProvider");
PD_MANDATORY_CLASS_PROPERTY = builder.getInstance();
@@ -135,7 +135,7 @@
DNPropertyDefinition.Builder builder = DNPropertyDefinition.createBuilder(INSTANCE, "optional-multi-valued-dn-property");
builder.setOption(PropertyOption.MULTI_VALUED);
builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "optional-multi-valued-dn-property"));
- DefaultBehaviorProvider<DN> provider = new DefinedDefaultBehaviorProvider<DN>("dc=domain1,dc=com", "dc=domain2,dc=com", "dc=domain3,dc=com");
+ DefaultBehaviorProvider<DN> provider = new DefinedDefaultBehaviorProvider<>("dc=domain1,dc=com", "dc=domain2,dc=com", "dc=domain3,dc=com");
builder.setDefaultBehaviorProvider(provider);
PD_OPTIONAL_MULTI_VALUED_DN_PROPERTY = builder.getInstance();
INSTANCE.registerPropertyDefinition(PD_OPTIONAL_MULTI_VALUED_DN_PROPERTY);
@@ -146,9 +146,8 @@
/** Build the "test-children" relation definition. */
static {
InstantiableRelationDefinition.Builder<TestChildCfgClient, TestChildCfg> builder =
- new InstantiableRelationDefinition.Builder<TestChildCfgClient, TestChildCfg>(
- INSTANCE, "multiple-children", "test-children", TestChildCfgDefn
- .getInstance());
+ new InstantiableRelationDefinition.Builder<>(
+ INSTANCE, "multiple-children", "test-children", TestChildCfgDefn.getInstance());
RD_TEST_CHILDREN = builder.getInstance();
INSTANCE.registerRelationDefinition(RD_TEST_CHILDREN);
}
@@ -158,7 +157,7 @@
/** Build the "optional-test-child" relation definition. */
static {
OptionalRelationDefinition.Builder<TestChildCfgClient, TestChildCfg> builder =
- new OptionalRelationDefinition.Builder<TestChildCfgClient, TestChildCfg>(
+ new OptionalRelationDefinition.Builder<>(
INSTANCE, "optional-test-child", TestChildCfgDefn.getInstance());
RD_OPTIONAL_TEST_CHILD = builder.getInstance();
INSTANCE.registerRelationDefinition(RD_OPTIONAL_TEST_CHILD);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/ValidateConfigDefinitionsTest.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/ValidateConfigDefinitionsTest.java
index 971a587..86f6010 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/ValidateConfigDefinitionsTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/ValidateConfigDefinitionsTest.java
@@ -58,8 +58,7 @@
@DataProvider
public Object[][] enumrateManageObjectDefns() throws Exception {
TopCfgDefn topCfgDefn = TopCfgDefn.getInstance();
- List<AbstractManagedObjectDefinition<?,?>> allCfgDefns =
- new ArrayList<AbstractManagedObjectDefinition<?,?>>(topCfgDefn.getAllChildren());
+ List<AbstractManagedObjectDefinition<?,?>> allCfgDefns = new ArrayList<>(topCfgDefn.getAllChildren());
Object[][] params = new Object[allCfgDefns.size()][];
for (int i = 0; i < params.length; i++) {
@@ -213,7 +212,7 @@
" is declared as mandatory in the schema.").append(EOL + EOL);
}
- Set<AttributeType> allowedAttributes = new HashSet<AttributeType>(mandatoryAttributes);
+ Set<AttributeType> allowedAttributes = new HashSet<>(mandatoryAttributes);
allowedAttributes.addAll(configObjectClass.getOptionalAttributeChain());
if (!allowedAttributes.contains(attrType)) {
errors.append(propName + " property on config object " + objName + " has" +
@@ -224,7 +223,4 @@
}
}
}
-
-
-
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/AggregationClientTest.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/AggregationClientTest.java
index 78c4d6d..2072e17 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/AggregationClientTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/AggregationClientTest.java
@@ -380,7 +380,7 @@
/** Asserts that the actual set of DNs contains the expected values. */
private void assertSetEquals(SortedSet<String> actual, String... expected) {
- SortedSet<String> values = new TreeSet<String>(TestChildCfgDefn
+ SortedSet<String> values = new TreeSet<>(TestChildCfgDefn
.getInstance().getAggregationPropertyPropertyDefinition());
if (expected != null) {
for (String value : expected) {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/CreateEntryMockLDAPConnection.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/CreateEntryMockLDAPConnection.java
index 85bad91..5ed05eb 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/CreateEntryMockLDAPConnection.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/CreateEntryMockLDAPConnection.java
@@ -52,7 +52,7 @@
private boolean alreadyAdded;
/** The expected set of attributes (attribute name -> list of values). */
- private final Map<String, List<String>> attributes = new HashMap<String, List<String>>();
+ private final Map<String, List<String>> attributes = new HashMap<>();
/** The expected DN. */
private final LdapName expectedDN;
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/MockLDAPConnection.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/MockLDAPConnection.java
index 37dfaa0..b713a56 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/MockLDAPConnection.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/MockLDAPConnection.java
@@ -87,7 +87,7 @@
public MockEntry(DN dn, Attributes attributes) {
this.dn = dn;
this.attributes = attributes;
- this.children = new LinkedList<MockEntry>();
+ this.children = new LinkedList<>();
}
@@ -150,7 +150,7 @@
*/
public MockLDAPConnection() {
this.rootEntry = new MockEntry(DN.rootDN(), new BasicAttributes());
- this.entries = new HashMap<DN, MockEntry>();
+ this.entries = new HashMap<>();
this.entries.put(DN.rootDN(), this.rootEntry);
}
@@ -207,7 +207,7 @@
throw new NameNotFoundException("could not find entry " + dn);
}
- LinkedList<LdapName> names = new LinkedList<LdapName>();
+ LinkedList<LdapName> names = new LinkedList<>();
for (MockEntry child : entry.children)
{
names.add(new LdapName(child.getDN().toString()));
@@ -262,7 +262,7 @@
*/
protected final void assertAttributeEquals(Attribute attr,
Collection<String> values) throws NamingException {
- LinkedList<String> actualValues = new LinkedList<String>();
+ LinkedList<String> actualValues = new LinkedList<>();
NamingEnumeration<?> ne = attr.getAll();
while (ne.hasMore()) {
actualValues.add(ne.next().toString());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/ModifyEntryMockLDAPConnection.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/ModifyEntryMockLDAPConnection.java
index d6c27f3..1ceb0f5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/ModifyEntryMockLDAPConnection.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/ldap/ModifyEntryMockLDAPConnection.java
@@ -55,7 +55,7 @@
private final LdapName expectedDN;
/** The expected set of modifications (attribute name -> list of values). */
- private final Map<String, List<String>> modifications = new HashMap<String, List<String>>();
+ private final Map<String, List<String>> modifications = new HashMap<>();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/spi/PropertySetTest.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/spi/PropertySetTest.java
index c8dc3ee..90ec8a6 100755
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/client/spi/PropertySetTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/client/spi/PropertySetTest.java
@@ -91,21 +91,21 @@
BooleanPropertyDefinition.Builder builder =
BooleanPropertyDefinition.createBuilder(TopCfgDefn.getInstance(), "test-bool-prop");
DefinedDefaultBehaviorProvider<Boolean> dbp =
- new DefinedDefaultBehaviorProvider<Boolean>(BOOL_DEFAULT.toString());
+ new DefinedDefaultBehaviorProvider<>(BOOL_DEFAULT.toString());
builder.setDefaultBehaviorProvider(dbp);
testBoolPropertyDefinition = builder.getInstance();
StringPropertyDefinition.Builder builder2 =
StringPropertyDefinition.createBuilder(TopCfgDefn.getInstance(), "test-sv-str-prop");
DefinedDefaultBehaviorProvider<String> dbp2 =
- new DefinedDefaultBehaviorProvider<String>(STR_DEFAULT);
+ new DefinedDefaultBehaviorProvider<>(STR_DEFAULT);
builder2.setDefaultBehaviorProvider(dbp2);
testSvStringPropertyDefinition = builder2.getInstance();
StringPropertyDefinition.Builder builder3 =
StringPropertyDefinition.createBuilder(TopCfgDefn.getInstance(), "test-mv-str-prop");
DefinedDefaultBehaviorProvider<String> dbp3 =
- new DefinedDefaultBehaviorProvider<String>(STR_DEFAULT);
+ new DefinedDefaultBehaviorProvider<>(STR_DEFAULT);
builder3.setDefaultBehaviorProvider(dbp3);
builder3.setOption(PropertyOption.MULTI_VALUED);
testMvStringPropertyDefinition = builder3.getInstance();
@@ -133,13 +133,13 @@
@DataProvider(name = "propertyDefinitionAndValuesData")
public Object[][] createPropertyDefinitionAndValuesData() {
- Set<Boolean> sb = new HashSet<Boolean>();
+ Set<Boolean> sb = new HashSet<>();
sb.add(Boolean.TRUE);
- Set<String> ss1 = new HashSet<String>();
+ Set<String> ss1 = new HashSet<>();
ss1.add("v");
- Set<String> ss2 = new HashSet<String>();
+ Set<String> ss2 = new HashSet<>();
ss2.add("v1");
ss2.add("v2");
@@ -196,7 +196,7 @@
*/
@Test(dataProvider = "propertyDefinitionAndValuesData")
public <T> void testGetActiveValues(final PropertyDefinition<T> pd, final Collection<T> values) {
- PropertyProvider pp = new TestPropertyProvider<T>(pd, values);
+ PropertyProvider pp = new TestPropertyProvider<>(pd, values);
PropertySet ps = createTestPropertySet(pp);
Property<T> p = ps.getProperty(pd);
SortedSet<T> ss = p.getActiveValues();
@@ -213,13 +213,13 @@
@DataProvider(name = "defaultData")
public Object[][] createDefaultData() {
- Set<Boolean> sb = new HashSet<Boolean>();
+ Set<Boolean> sb = new HashSet<>();
sb.add(BOOL_DEFAULT);
- Set<String> ss1 = new HashSet<String>();
+ Set<String> ss1 = new HashSet<>();
ss1.add(STR_DEFAULT);
- Set<String> ss2 = new HashSet<String>();
+ Set<String> ss2 = new HashSet<>();
ss2.add(STR_DEFAULT);
return new Object[][] {
@@ -252,23 +252,23 @@
@DataProvider(name = "effectiveData")
public Object[][] createEffectiveData() {
- Set<Boolean> nvb = new HashSet<Boolean>();
+ Set<Boolean> nvb = new HashSet<>();
nvb.add(Boolean.FALSE);
- Set<Boolean> edb = new HashSet<Boolean>();
+ Set<Boolean> edb = new HashSet<>();
edb.add(BOOL_DEFAULT);
- Set<String> nvss1 = new HashSet<String>();
+ Set<String> nvss1 = new HashSet<>();
nvss1.add("new value");
- Set<String> edss1 = new HashSet<String>();
+ Set<String> edss1 = new HashSet<>();
edss1.add(STR_DEFAULT);
- Set<String> nvss2 = new HashSet<String>();
+ Set<String> nvss2 = new HashSet<>();
nvss2.add("new value 1");
nvss2.add("new value 2");
- Set<String> edss2 = new HashSet<String>();
+ Set<String> edss2 = new HashSet<>();
edss2.add(STR_DEFAULT);
return new Object[][] {
@@ -400,7 +400,7 @@
}
private PropertySet createTestPropertySet(PropertyProvider pp) {
- ManagedObjectDefinition<?, ?> d = new TestManagedObjectDefinition<ConfigurationClient, Configuration>("test-mod", null);
+ ManagedObjectDefinition<?, ?> d = new TestManagedObjectDefinition<>("test-mod", null);
PropertySet ps = new PropertySet();
for (PropertyDefinition<?> pd : d.getPropertyDefinitions()) {
addProperty(ps, pd, pp);
@@ -409,7 +409,7 @@
}
private <T> void addProperty(PropertySet ps, PropertyDefinition<T> pd, PropertyProvider pp) {
- Collection<T> defaultValues = new LinkedList<T>();
+ Collection<T> defaultValues = new LinkedList<>();
DefaultBehaviorProvider<T> dbp = pd.getDefaultBehaviorProvider();
if (dbp instanceof DefinedDefaultBehaviorProvider) {
DefinedDefaultBehaviorProvider<T> ddbp = (DefinedDefaultBehaviorProvider<T>) dbp;
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java
index 0e0dafa..e9cf29a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java
@@ -132,7 +132,7 @@
}
SingletonRelationDefinition.Builder<C, S> builder =
- new SingletonRelationDefinition.Builder<C, S>(
+ new SingletonRelationDefinition.Builder<>(
RootCfgDefn.getInstance(), DUMMY_TEST_RELATION, d);
ManagedObjectPath<?, ?> root = ManagedObjectPath.emptyPath();
return root.child(builder.getInstance());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AggregationServerTest.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AggregationServerTest.java
index a3ada17..880cb99 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AggregationServerTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AggregationServerTest.java
@@ -909,7 +909,7 @@
/** Asserts that the actual set of DNs contains the expected values. */
private void assertSetEquals(SortedSet<String> actual, String... expected) {
- SortedSet<String> values = new TreeSet<String>(TestChildCfgDefn
+ SortedSet<String> values = new TreeSet<>(TestChildCfgDefn
.getInstance().getAggregationPropertyPropertyDefinition());
if (expected != null) {
for (String value : expected) {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/server/DNBuilderTest.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/server/DNBuilderTest.java
index 6144062..3f7b600 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/server/DNBuilderTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/server/DNBuilderTest.java
@@ -122,7 +122,7 @@
.emptyPath();
SingletonRelationDefinition.Builder<TestChildCfgClient, TestChildCfg> b =
- new SingletonRelationDefinition.Builder<TestChildCfgClient, TestChildCfg>(
+ new SingletonRelationDefinition.Builder<>(
TestParentCfgDefn.getInstance(), "singleton-test-child",
TestChildCfgDefn.getInstance());
final SingletonRelationDefinition<TestChildCfgClient, TestChildCfg> r2 = b.getInstance();
@@ -137,7 +137,6 @@
return null;
}
}
-
};
path = path.child(TestCfg.getTestOneToManyParentRelationDefinition(), "test-parent-1");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/api/AlertHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/api/AlertHandlerTestCase.java
index c87a094..6a97b23 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/api/AlertHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/api/AlertHandlerTestCase.java
@@ -311,7 +311,7 @@
@Test // TestNG treats this as a test, so we annotate it to eliminate warnings
public LinkedHashMap<String,String> getAlerts()
{
- LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>();
+ LinkedHashMap<String,String> alerts = new LinkedHashMap<>();
alerts.put(ALERT_TYPE, ALERT_DESCRIPTION);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/api/ConfigChangeListenerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/api/ConfigChangeListenerTestCase.java
index 694fdff..aeafbc8 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/api/ConfigChangeListenerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/api/ConfigChangeListenerTestCase.java
@@ -71,19 +71,15 @@
public Object[][] getConfigChangeListeners()
throws Exception
{
- ArrayList<DN> dns = new ArrayList<DN>();
- ArrayList<ConfigChangeListener> listeners =
- new ArrayList<ConfigChangeListener>();
- getChangeListeners(DirectoryServer.getConfigHandler().getConfigRootEntry(),
- dns, listeners);
-
+ ArrayList<DN> dns = new ArrayList<>();
+ ArrayList<ConfigChangeListener> listeners = new ArrayList<>();
+ getChangeListeners(DirectoryServer.getConfigHandler().getConfigRootEntry(), dns, listeners);
Object[][] componentArray = new Object[listeners.size()][1];
for (int i=0; i < componentArray.length; i++)
{
componentArray[i] = new Object[] { dns.get(i), listeners.get(i) };
}
-
return componentArray;
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/api/DITCacheMapTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/api/DITCacheMapTestCase.java
index a1d8413..383fc11 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/api/DITCacheMapTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/api/DITCacheMapTestCase.java
@@ -46,8 +46,7 @@
*/
public class DITCacheMapTestCase extends APITestCase
{
- private static final DITCacheMap<String> ditMap =
- new DITCacheMap<String>();
+ private static final DITCacheMap<String> ditMap = new DITCacheMap<>();
private static final String dn0String =
"cn=Object0,dc=example,dc=com";
@@ -83,8 +82,7 @@
private void putAllAndVerify()
{
- Map<DN,String> hashMap =
- new HashMap<DN,String>();
+ Map<DN,String> hashMap = new HashMap<>();
hashMap.put(dn0, dn0String);
hashMap.put(dn1, dn1String);
@@ -333,7 +331,7 @@
assertFalse(entrySet.isEmpty());
assertEquals(entrySet.size(), 10);
Iterator<Entry<DN,String>> iterator = entrySet.iterator();
- Map<DN,String> tempMap = new HashMap<DN,String>();
+ Map<DN,String> tempMap = new HashMap<>();
while (iterator.hasNext())
{
Entry<DN,String> entry = iterator.next();
@@ -381,10 +379,8 @@
putAllAndVerify();
- Set<String> removeSet = new HashSet<String>();
- assertTrue(ditMap.removeSubtree(DN.valueOf(
- "dc=example,dc=com"),
- removeSet));
+ Set<String> removeSet = new HashSet<>();
+ assertTrue(ditMap.removeSubtree(DN.valueOf("dc=example,dc=com"), removeSet));
assertFalse(removeSet.isEmpty());
assertEquals(removeSet.size(), 10);
assertTrue(removeSet.contains(dn0String));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
index 9fe1dce..a0e7e8d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
@@ -440,8 +440,8 @@
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), 0);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<RawModification> mods = new ArrayList<>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("newPassword"));
LDAPAttribute attr = new LDAPAttribute("userPassword", values);
mods.add(new LDAPModification(ModificationType.REPLACE, attr));
@@ -508,8 +508,8 @@
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), 0);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<RawModification> mods = new ArrayList<>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("newPassword"));
LDAPAttribute attr = new LDAPAttribute("userPassword", values);
mods.add(new LDAPModification(ModificationType.REPLACE, attr));
@@ -580,13 +580,13 @@
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), 0);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<RawModification> mods = new ArrayList<>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("password"));
LDAPAttribute attr = new LDAPAttribute("userPassword", values);
mods.add(new LDAPModification(ModificationType.DELETE, attr));
- values = new ArrayList<ByteString>();
+ values = new ArrayList<>();
values.add(ByteString.valueOf("newPassword"));
attr = new LDAPAttribute("userPassword", values);
mods.add(new LDAPModification(ModificationType.ADD, attr));
@@ -659,8 +659,8 @@
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), 0);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<RawModification> mods = new ArrayList<>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("newPassword"));
LDAPAttribute attr = new LDAPAttribute("userPassword", values);
mods.add(new LDAPModification(ModificationType.REPLACE, attr));
@@ -733,13 +733,13 @@
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), 0);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<RawModification> mods = new ArrayList<>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("password"));
LDAPAttribute attr = new LDAPAttribute("userPassword", values);
mods.add(new LDAPModification(ModificationType.DELETE, attr));
- values = new ArrayList<ByteString>();
+ values = new ArrayList<>();
values.add(ByteString.valueOf("newPassword"));
attr = new LDAPAttribute("userPassword", values);
mods.add(new LDAPModification(ModificationType.ADD, attr));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java
index be22796..ad00480 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java
@@ -77,10 +77,9 @@
public void testAbstractMethods()
throws Exception
{
- LinkedList<LinkedList<String>> expectedAbstractMethods =
- new LinkedList<LinkedList<String>>();
+ LinkedList<LinkedList<String>> expectedAbstractMethods = new LinkedList<>();
- LinkedList<String> sigList = new LinkedList<String>();
+ LinkedList<String> sigList = new LinkedList<>();
sigList.add("initializePlugin");
sigList.add("void");
sigList.add("java.util.Set");
@@ -90,14 +89,13 @@
expectedAbstractMethods.add(sigList);
- LinkedList<LinkedList<String>> newAbstractMethods =
- new LinkedList<LinkedList<String>>();
+ LinkedList<LinkedList<String>> newAbstractMethods = new LinkedList<>();
Class pluginClass = DirectoryServerPlugin.class;
for (Method m : pluginClass.getMethods())
{
if (Modifier.isAbstract(m.getModifiers()))
{
- LinkedList<String> foundList = new LinkedList<String>();
+ LinkedList<String> foundList = new LinkedList<>();
foundList.add(m.getName());
foundList.add(m.getReturnType().getName());
for (Class c : m.getParameterTypes())
@@ -184,32 +182,31 @@
public void testNonAbstractPublicAPIMethods()
throws Exception
{
- LinkedList<LinkedList<String>> expectedPublicMethods =
- new LinkedList<LinkedList<String>>();
+ LinkedList<LinkedList<String>> expectedPublicMethods = new LinkedList<>();
- LinkedList<String> sigList = new LinkedList<String>();
+ LinkedList<String> sigList = new LinkedList<>();
sigList.add("finalizePlugin");
sigList.add("void");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doStartup");
sigList.add("org.opends.server.api.plugin.PluginResult$Startup");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doShutdown");
sigList.add("void");
sigList.add("org.forgerock.i18n.LocalizableMessage");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostConnect");
sigList.add("org.opends.server.api.plugin.PluginResult$PostConnect");
sigList.add("org.opends.server.api.ClientConnection");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostDisconnect");
sigList.add("org.opends.server.api.plugin.PluginResult$PostDisconnect");
sigList.add("org.opends.server.api.ClientConnection");
@@ -217,100 +214,100 @@
sigList.add("org.forgerock.i18n.LocalizableMessage");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doLDIFImport");
sigList.add("org.opends.server.api.plugin.PluginResult$ImportLDIF");
sigList.add("org.opends.server.types.LDIFImportConfig");
sigList.add("org.opends.server.types.Entry");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doLDIFImportEnd");
sigList.add("void");
sigList.add("org.opends.server.types.LDIFImportConfig");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doLDIFImportBegin");
sigList.add("void");
sigList.add("org.opends.server.types.LDIFImportConfig");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doLDIFExport");
sigList.add("org.opends.server.api.plugin.PluginResult$ImportLDIF");
sigList.add("org.opends.server.types.LDIFExportConfig");
sigList.add("org.opends.server.types.Entry");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseAbandonOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseModifyOperation");
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseAddOperation");
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseBindOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseCompareOperation");
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseDeleteOperation");
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseExtendedOperation");
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseUnbindOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseModifyDNOperation");
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreParse");
sigList.add("org.opends.server.api.plugin.PluginResult$PreParse");
sigList.add("org.opends.server.types.operation.PreParseSearchOperation");
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PreOperation");
sigList.add("org.opends.server.types.operation." +
@@ -318,7 +315,7 @@
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PreOperation");
sigList.add("org.opends.server.types.operation." +
@@ -326,13 +323,13 @@
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PreOperation");
sigList.add("org.opends.server.types.operation.PreOperationBindOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PreOperation");
sigList.add("org.opends.server.types.operation." +
@@ -340,14 +337,14 @@
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PreOperation");
sigList.add("org.opends.server.types.operation.PreOperationAddOperation");
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PreOperation");
sigList.add("org.opends.server.types.operation."+
@@ -355,7 +352,7 @@
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PreOperation");
sigList.add("org.opends.server.types.operation." +
@@ -363,7 +360,7 @@
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPreOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PreOperation");
sigList.add("org.opends.server.types.operation." +
@@ -371,158 +368,158 @@
sigList.add("org.opends.server.types.CanceledOperationException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationCompareOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationModifyDNOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationExtendedOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationBindOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationAbandonOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationUnbindOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationModifyOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation.PostOperationAddOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationDeleteOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostOperation");
sigList.add("org.opends.server.api.plugin.PluginResult$PostOperation");
sigList.add("org.opends.server.types.operation." +
"PostOperationSearchOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostResponse");
sigList.add("org.opends.server.api.plugin.PluginResult$PostResponse");
sigList.add("org.opends.server.types.operation." +
"PostResponseCompareOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostResponse");
sigList.add("org.opends.server.api.plugin.PluginResult$PostResponse");
sigList.add("org.opends.server.types.operation." +
"PostResponseDeleteOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostResponse");
sigList.add("org.opends.server.api.plugin.PluginResult$PostResponse");
sigList.add("org.opends.server.types.operation." +
"PostResponseSearchOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostResponse");
sigList.add("org.opends.server.api.plugin.PluginResult$PostResponse");
sigList.add("org.opends.server.types.operation." +
"PostResponseExtendedOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostResponse");
sigList.add("org.opends.server.api.plugin.PluginResult$PostResponse");
sigList.add("org.opends.server.types.operation." +
"PostResponseModifyOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostResponse");
sigList.add("org.opends.server.api.plugin.PluginResult$PostResponse");
sigList.add("org.opends.server.types.operation." +
"PostResponseModifyDNOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostResponse");
sigList.add("org.opends.server.api.plugin.PluginResult$PostResponse");
sigList.add("org.opends.server.types.operation.PostResponseAddOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostResponse");
sigList.add("org.opends.server.api.plugin.PluginResult$PostResponse");
sigList.add("org.opends.server.types.operation.PostResponseBindOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostSynchronization");
sigList.add("void");
sigList.add("org.opends.server.types.operation." +
"PostSynchronizationAddOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostSynchronization");
sigList.add("void");
sigList.add("org.opends.server.types.operation." +
"PostSynchronizationDeleteOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostSynchronization");
sigList.add("void");
sigList.add("org.opends.server.types.operation." +
"PostSynchronizationModifyOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("doPostSynchronization");
sigList.add("void");
sigList.add("org.opends.server.types.operation." +
"PostSynchronizationModifyDNOperation");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("processSearchEntry");
sigList.add("org.opends.server.api.plugin." +
"PluginResult$IntermediateResponse");
@@ -530,7 +527,7 @@
sigList.add("org.opends.server.types.SearchResultEntry");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("processSearchReference");
sigList.add("org.opends.server.api.plugin." +
"PluginResult$IntermediateResponse");
@@ -539,7 +536,7 @@
sigList.add("org.opends.server.types.SearchResultReference");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("processSubordinateModifyDN");
sigList.add("org.opends.server.api.plugin." +
"PluginResult$SubordinateModifyDN");
@@ -550,7 +547,7 @@
sigList.add("java.util.List");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("processSubordinateDelete");
sigList.add("org.opends.server.api.plugin." +
"PluginResult$SubordinateDelete");
@@ -559,14 +556,14 @@
sigList.add("org.opends.server.types.Entry");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("processIntermediateResponse");
sigList.add("org.opends.server.api.plugin." +
"PluginResult$IntermediateResponse");
sigList.add("org.opends.server.types.IntermediateResponse");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("initializeInternal");
sigList.add("void");
sigList.add("org.opends.server.types.DN");
@@ -574,62 +571,62 @@
sigList.add("boolean");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("getPluginEntryDN");
sigList.add("org.opends.server.types.DN");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("getPluginTypes");
sigList.add("java.util.Set");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("invokeForInternalOperations");
sigList.add("boolean");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("setInvokeForInternalOperations");
sigList.add("void");
sigList.add("boolean");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("getClass");
sigList.add("java.lang.Class");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("equals");
sigList.add("boolean");
sigList.add("java.lang.Object");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("hashCode");
sigList.add("int");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("toString");
sigList.add("java.lang.String");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("wait");
sigList.add("void");
sigList.add("java.lang.InterruptedException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("wait");
sigList.add("void");
sigList.add("long");
sigList.add("java.lang.InterruptedException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("wait");
sigList.add("void");
sigList.add("long");
@@ -637,17 +634,17 @@
sigList.add("java.lang.InterruptedException");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("notify");
sigList.add("void");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("notifyAll");
sigList.add("void");
expectedPublicMethods.add(sigList);
- sigList = new LinkedList<String>();
+ sigList = new LinkedList<>();
sigList.add("isConfigurationAcceptable");
sigList.add("boolean");
sigList.add("org.opends.server.admin.std.server.PluginCfg");
@@ -655,8 +652,7 @@
expectedPublicMethods.add(sigList);
- LinkedList<LinkedList<String>> newPublicMethods =
- new LinkedList<LinkedList<String>>();
+ LinkedList<LinkedList<String>> newPublicMethods = new LinkedList<>();
Class pluginClass = DirectoryServerPlugin.class;
for (Method m : pluginClass.getMethods())
{
@@ -669,7 +665,7 @@
if (Modifier.isPublic(m.getModifiers()) &&
(! Modifier.isAbstract(m.getModifiers())))
{
- LinkedList<String> foundList = new LinkedList<String>();
+ LinkedList<String> foundList = new LinkedList<>();
foundList.add(m.getName());
foundList.add(m.getReturnType().getName());
for (Class c : m.getParameterTypes())
@@ -825,7 +821,7 @@
NullPlugin nullPlugin = new NullPlugin();
DN pluginEntryDN = DN.valueOf("cn=Null Plugin,cn=Plugins,cn=config");
- HashSet<PluginType> pluginTypes = new HashSet<PluginType>();
+ HashSet<PluginType> pluginTypes = new HashSet<>();
for (PluginType t : PluginType.values())
{
pluginTypes.add(t);
@@ -912,7 +908,7 @@
NullPlugin nullPlugin = new NullPlugin();
- HashSet<PluginType> pluginTypes = new HashSet<PluginType>();
+ HashSet<PluginType> pluginTypes = new HashSet<>();
for (PluginType t : PluginType.values())
{
pluginTypes.add(t);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java
index 972e12e..2d5167e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java
@@ -99,7 +99,7 @@
{
Reporter.log("Restoring global ACI attribute: " + globalACIAttribute);
- List<Modification> modifications = new ArrayList<Modification>(1);
+ List<Modification> modifications = new ArrayList<>(1);
modifications.add(new Modification(ModificationType.REPLACE,
globalACIAttribute));
InternalClientConnection conn =
@@ -166,15 +166,14 @@
"allow (read) userdn=\"ldap:///anyone\";)";
private static final ByteArrayOutputStream oStream = new ByteArrayOutputStream();
- private static final ThreadLocal<Map<String,File>> tempLdifFile =
- new ThreadLocal<Map<String,File>>();
+ private static final ThreadLocal<Map<String, File>> tempLdifFile = new ThreadLocal<>();
protected String pwdModify(String bindDn, String bindPassword,
String newPassword, String noOpControl,
String pwdPolicyControl, int expectedRc) {
- ArrayList<String> argList=new ArrayList<String>(20);
+ ArrayList<String> argList=new ArrayList<>(20);
argList.add("-h");
argList.add("127.0.0.1");
argList.add("-p");
@@ -206,7 +205,7 @@
protected String LDAPSearchCtrl(String bindDn, String bindPassword,
String proxyDN, String controlStr,
String base, String filter, String attr) {
- ArrayList<String> argList=new ArrayList<String>(20);
+ ArrayList<String> argList=new ArrayList<>(20);
argList.add("-h");
argList.add("127.0.0.1");
argList.add("-p");
@@ -264,7 +263,7 @@
String base, String filter ,String attr,
boolean pwdPolicy, boolean reportAuthzID,
int expectedRc) {
- List<String> argList = new ArrayList<String>(20);
+ List<String> argList = new ArrayList<>(20);
argList.add("-h");
argList.add("127.0.0.1");
argList.add("-p");
@@ -351,7 +350,7 @@
private void _LDIFDelete(String dn, String bindDn, String bindPassword,
String controlStr, int expectedRc)
{
- List<String> argList = new ArrayList<String>(20);
+ List<String> argList = new ArrayList<>(20);
argList.add("-h");
argList.add("127.0.0.1");
argList.add("-p");
@@ -383,7 +382,7 @@
{
File tempFile = getTemporaryLdifFile();
TestCaseUtils.writeFile(tempFile, ldif);
- ArrayList<String> argList=new ArrayList<String>(20);
+ ArrayList<String> argList=new ArrayList<>(20);
argList.add("-h");
argList.add("127.0.0.1");
argList.add("-p");
@@ -534,7 +533,7 @@
private File getTemporaryLdifFile() throws IOException {
Map<String,File> tempFilesForThisThread = tempLdifFile.get();
if (tempFilesForThisThread == null) {
- tempFilesForThisThread = new HashMap<String,File>();
+ tempFilesForThisThread = new HashMap<>();
tempLdifFile.set(tempFilesForThisThread);
}
File tempFile = tempFilesForThisThread.get("effectiverights-tests");
@@ -721,7 +720,7 @@
{
StringReader r=new StringReader(resultString);
BufferedReader br=new BufferedReader(r);
- Map<String, String> attrMap = new HashMap<String, String>();
+ Map<String, String> attrMap = new HashMap<>();
try {
while(true) {
String s = br.readLine();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTests.java b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTests.java
index 19a8bec..de3c11b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTests.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTests.java
@@ -131,7 +131,7 @@
private static final Map<String,String> DN_TO_PW;
static {
- Map<String,String> dnToPw = new HashMap<String,String>();
+ Map<String,String> dnToPw = new HashMap<>();
dnToPw.put(DIR_MGR_DN, DIR_MGR_PW);
dnToPw.put(ADMIN_DN, ADMIN_PW);
dnToPw.put(ANNONYMOUS_DN, ANNONYMOUS_PW);
@@ -812,7 +812,7 @@
public Object[][] validBasisOfValidityTests() throws Exception {
TestCaseUtils.startServer(); // This appears to be necessary since the DataProviders can be called before @BeforeClass.
- List<String> acis = new ArrayList<String>();
+ List<String> acis = new ArrayList<>();
for (String[] aciAndMask: INVALID_ACIS_IF_ANY_CHAR_REMOVED) {
acis.add("aci: " + aciAndMask[0]);
}
@@ -842,7 +842,7 @@
public Object[][] invalidAcis() throws Exception {
TestCaseUtils.startServer(); // This appears to be necessary since the DataProviders can be called before @BeforeClass.
- List<String> invalid = new ArrayList<String>(Arrays.asList(INVALID_ACIS));
+ List<String> invalid = new ArrayList<>(Arrays.asList(INVALID_ACIS));
for (String[] aciAndMask: INVALID_ACIS_IF_ANY_CHAR_REMOVED) {
invalid.addAll(getAciMissingCharCombos(aciAndMask[0], aciAndMask[1]));
}
@@ -855,7 +855,7 @@
* is only removed if the corresponding mask character is a - or \"
*/
protected List<String> getAciMissingCharCombos(String aci, String mask) {
- List <String> acisMissingOneChar = new ArrayList<String>();
+ List <String> acisMissingOneChar = new ArrayList<>();
for (int i = 0; i < aci.length(); i++) {
// Add this test only if the mask tells us we haven't seen it before.
// Also guard against ArrayIndexOutOfBoundsExceptions in case the
@@ -872,10 +872,10 @@
/** Common between validAcis and invalidAcis. */
private Object[][] buildAciValidationParams(List<String> acis, boolean testMultipleCombos) {
- List<String[]> paramsList = new ArrayList<String[]>();
+ List<String[]> paramsList = new ArrayList<>();
for (String aci: acis) {
- List<String> aciLdifs = new ArrayList<String>();
+ List<String> aciLdifs = new ArrayList<>();
// aci set in Add
aciLdifs.add(TestCaseUtils.makeLdif(
@@ -972,7 +972,7 @@
public Object[][] invalidAcisMultiCombos() throws Exception {
TestCaseUtils.startServer(); // This appears to be necessary since the DataProviders can be called before @BeforeClass.
- List<String> invalid = new ArrayList<String>();
+ List<String> invalid = new ArrayList<>();
invalid.add(INVALID_ACIS[0]);
invalid.add(INVALID_ACIS[1]);
@@ -1465,7 +1465,7 @@
// * Who sets the ACIs to start with
// * Whether the entries were created with the ACIs or they were added later. LDIFModify would work here.
- private static List<SearchTestParams> SEARCH_TEST_PARAMS = new ArrayList<SearchTestParams>();
+ private static List<SearchTestParams> SEARCH_TEST_PARAMS = new ArrayList<>();
private static SearchTestParams registerNewTestParams(String initialDitLdif, String... aciLdif) {
SearchTestParams testParams = new SearchTestParams(initialDitLdif, aciLdif);
SEARCH_TEST_PARAMS.add(testParams);
@@ -1652,7 +1652,7 @@
public String[] getLdapSearchArgs()
{
- final List<String> args = new ArrayList<String>();
+ final List<String> args = new ArrayList<>();
if (_bindDn.equals(ANNONYMOUS_DN))
{
@@ -1725,7 +1725,7 @@
/** ACIs that will produce the same search results for the above DIT. */
private final List<String> _equivalentAciLdifs;
- private final List<SingleSearchParams> _searchTests = new ArrayList<SingleSearchParams>();
+ private final List<SingleSearchParams> _searchTests = new ArrayList<>();
public SearchTestParams(String initialDitLdif, String... equivalentAciLdifs) {
_initialDitLdif = initialDitLdif;
@@ -1748,7 +1748,7 @@
ByteArrayOutputStream updatedEntriesStream = new ByteArrayOutputStream();
LDIFWriter ldifWriter = new LDIFWriter(new LDIFExportConfig(updatedEntriesStream));
- List<LocalizableMessage> errors = new ArrayList<LocalizableMessage>();
+ List<LocalizableMessage> errors = new ArrayList<>();
LDIFModify.modifyLDIF(baseReader, changesReader, ldifWriter, errors);
Assert.assertTrue(errors.isEmpty(), "Unexpected errors applying LDIF changes: " + errors);
ldifWriter.flush();
@@ -1762,7 +1762,7 @@
TestCaseUtils.startServer(); // This appears to be necessary since the DataProviders can be called before @BeforeClass.
try {
- List<Object[]> allTestParams = new ArrayList<Object[]>();
+ List<Object[]> allTestParams = new ArrayList<>();
for (SearchTestParams testParams: SEARCH_TEST_PARAMS) {
for (SingleSearchParams singleTest: testParams._searchTests) {
@@ -2330,7 +2330,7 @@
throws Exception {
File tempFile = getTemporaryLdifFile();
TestCaseUtils.writeFile(tempFile, ldif);
- ArrayList<String> argList=new ArrayList<String>(20);
+ ArrayList<String> argList=new ArrayList<>(20);
argList.add("-h");
argList.add("127.0.0.1");
argList.add("-p");
@@ -2461,7 +2461,7 @@
return COMMENTS_REGEX.matcher(ldif).replaceAll("");
}
- private static ThreadLocal<Map<String,File>> _tempLdifFilesByName = new ThreadLocal<Map<String,File>>();
+ private static ThreadLocal<Map<String,File>> _tempLdifFilesByName = new ThreadLocal<>();
/**
* To avoid a proliferation of temporary files, use the same ones over and over.
@@ -2471,7 +2471,7 @@
private File getTemporaryLdifFile(String name) throws IOException {
Map<String,File> tempFilesForThisThread = _tempLdifFilesByName.get();
if (tempFilesForThisThread == null) {
- tempFilesForThisThread = new HashMap<String,File>();
+ tempFilesForThisThread = new HashMap<>();
_tempLdifFilesByName.set(tempFilesForThisThread);
}
File tempFile = tempFilesForThisThread.get(name);
@@ -2584,7 +2584,7 @@
}
private static String getNotThisDayOfWeek() {
- Set<String> otherDays = new HashSet<String>(Arrays.asList(DAYS_OF_WEEK));
+ Set<String> otherDays = new HashSet<>(Arrays.asList(DAYS_OF_WEEK));
otherDays.remove(getThisDayOfWeek());
String dayList = "";
for (String otherDay: otherDays) {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/ProxyBindTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/ProxyBindTestCase.java
index 7e30a8d..d9d324f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/ProxyBindTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/ProxyBindTestCase.java
@@ -160,7 +160,7 @@
*/
@Test
public void testAci() throws Exception {
- Hashtable<String, String> env = new Hashtable<String, String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
int port = TestCaseUtils.getServerLdapPort();
String url = "ldap://localhost:" + Integer.valueOf(port);
@@ -206,7 +206,7 @@
*/
@Test
public void testBypass() throws Exception {
- Hashtable<String, String> env = new Hashtable<String, String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
int port = TestCaseUtils.getServerLdapPort();
String url = "ldap://localhost:" + Integer.valueOf(port);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/SSFTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/SSFTestCase.java
index a00e63c..dd3cebf 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/SSFTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/SSFTestCase.java
@@ -211,7 +211,7 @@
"--set", "quality-of-protection:" + "integrity");
//Configure JNDI props.
- Hashtable<String, String> env = new Hashtable<String, String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
int port = TestCaseUtils.getServerLdapPort();
String url = "ldap://localhost:" + Integer.valueOf(port);
@@ -249,7 +249,7 @@
"set-sasl-mechanism-handler-prop",
"--handler-name", "DIGEST-MD5",
"--set", "quality-of-protection:" + "confidentiality");
- Hashtable<String, String> env = new Hashtable<String, String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
int port = TestCaseUtils.getServerLdapPort();
String url = "ldap://localhost:" + Integer.valueOf(port);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/JebTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/JebTestCase.java
index 86c0000..f17599b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/JebTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/JebTestCase.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;
@@ -53,7 +53,7 @@
*/
@Test(groups = { "precommit", "jeb" }, sequential = true)
public abstract class JebTestCase extends DirectoryServerTestCase {
- private TreeMap<DN,Entry> entryTreeMap = new TreeMap<DN,Entry>();
+ private TreeMap<DN,Entry> entryTreeMap = new TreeMap<>();
private int numEntries;
/**
@@ -74,7 +74,7 @@
File.separator + "resource"+File.separator+"MakeLDIF";
TemplateFile templateFile =
new TemplateFile(makeLDIFPath, new Random());
- ArrayList<LocalizableMessage> warnings = new ArrayList<LocalizableMessage>();
+ ArrayList<LocalizableMessage> warnings = new ArrayList<>();
templateFile.parse(template, warnings);
MakeLDIFInputStream ldifEntryStream =
new MakeLDIFInputStream(templateFile);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java
index 2cb6b47..ec35988 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestImportJob.java
@@ -296,7 +296,7 @@
public void testImportAll() throws Exception
{
TestCaseUtils.clearJEBackend(backendID);
- ArrayList<String> fileList = new ArrayList<String>();
+ ArrayList<String> fileList = new ArrayList<>();
fileList.add(homeDirName + File.separator + "top.ldif");
fileList.add(homeDirName + File.separator + "entries1.ldif");
@@ -372,7 +372,7 @@
@Test(dependsOnMethods = "testImportAll")
public void testImportPartial() throws Exception
{
- ArrayList<String> fileList = new ArrayList<String>();
+ ArrayList<String> fileList = new ArrayList<>();
fileList.add(homeDirName + File.separator + "top.ldif");
fileList.add(homeDirName + File.separator + "entries1.ldif");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java
index 316c378..d18ef03 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVLVIndex.java
@@ -113,7 +113,7 @@
zorroDN = DN.valueOf("uid=zorro,dc=vlvtest,dc=com");
suffixDN = DN.valueOf("dc=vlvtest,dc=com");
- expectedSortedValues = new TreeSet<SortValues>();
+ expectedSortedValues = new TreeSet<>();
entries = TestCaseUtils.makeEntries(
"dn: dc=vlvtest,dc=com",
@@ -399,7 +399,7 @@
private ArrayList<DN> getDNs(InternalSearchOperation internalSearch)
{
- ArrayList<DN> results = new ArrayList<DN>();
+ ArrayList<DN> results = new ArrayList<>();
for (Entry e : internalSearch.getSearchEntries())
{
results.add(e.getName());
@@ -481,7 +481,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(albertZimmermanDN); // Albert, bigger
expectedDNOrder.add(albertSmithDN); // Albert, smaller sn
expectedDNOrder.add(lowercaseMcGeeDN); // lowercase
@@ -603,7 +603,7 @@
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(samZweckDN); // Sam
expectedDNOrder.add(zorroDN); // No first name
expectedDNOrder.add(suffixDN); // No sort attributes
@@ -645,7 +645,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(maryJonesDN); // Mary
expectedDNOrder.add(samZweckDN); // Sam
expectedDNOrder.add(zorroDN); // No first name
@@ -819,7 +819,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
expectedDNOrder.add(albertSmithDN); // Albert, higher entry ID
expectedDNOrder.add(lowercaseMcGeeDN); // lowercase
@@ -875,7 +875,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
expectedDNOrder.add(albertSmithDN); // Albert, higher entry ID
@@ -934,7 +934,7 @@
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
// Null values for given name are still bigger then zz
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(zorroDN); // No first name
expectedDNOrder.add(suffixDN); // No sort attributes
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVerifyJob.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVerifyJob.java
index d99525a..789242e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVerifyJob.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestVerifyJob.java
@@ -902,7 +902,7 @@
*/
private Entry buildEntry(String dn) throws DirectoryException {
DN entryDN = DN.valueOf(dn);
- HashMap<ObjectClass, String> ocs = new HashMap<ObjectClass, String>(2);
+ HashMap<ObjectClass, String> ocs = new HashMap<>(2);
ObjectClass topOC = DirectoryServer.getObjectClass(OC_TOP);
if (topOC == null) {
topOC = DirectoryServer.getDefaultObjectClass(OC_TOP);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
index 48df838..aa55247 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
@@ -181,7 +181,7 @@
@DataProvider(name = "substringsFilterData")
public Object[][] createSubstringsFilterData()
{
- ArrayList<String> l = new ArrayList<String>(3) ;
+ ArrayList<String> l = new ArrayList<>(3) ;
l.add("subAny") ;
l.add("o") ;
l.add("fakesubAny");
@@ -206,8 +206,7 @@
String rawAttTypeTest = type;
AttributeType attTypeTest = DirectoryServer.getAttributeType(type);
ByteString subInitialTest = ByteString.valueOf(subInitial);
- List<ByteString> subAnyTest =
- new ArrayList<ByteString>(subAny.size());
+ List<ByteString> subAnyTest = new ArrayList<>(subAny.size());
for (String s : subAny)
{
subAnyTest.add(ByteString.valueOf(s));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java
index 03e89fb..241ff0c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java
@@ -56,7 +56,7 @@
@DataProvider(name = "passwordPolicyErrorTypeData")
public Object[][] createPasswordPolicyErrorTypeData()
{
- HashMap<Integer, String> values = new HashMap<Integer, String>();
+ HashMap<Integer, String> values = new HashMap<>();
values.put(0, "passwordExpired");
values.put(1, "accountLocked");
values.put(2, "changeAfterReset");
@@ -126,7 +126,7 @@
@DataProvider(name = "passwordPolicyWarningTypeData")
public Object[][] createPasswordPolicyWarningTypeData()
{
- HashMap<Byte, String> values = new HashMap<Byte, String>();
+ HashMap<Byte, String> values = new HashMap<>();
values.put((byte)0x80, "timeBeforeExpiration");
values.put((byte)0x81, "graceAuthNsRemaining");
return new Object[][] { { values } };
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java
index af21264..8f6b8bf 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordPolicyControlTestCase.java
@@ -107,7 +107,7 @@
try
{
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
BindRequestProtocolOp bindRequest = new BindRequestProtocolOp(
@@ -127,14 +127,14 @@
assertTrue(passwordPolicyControlExists(controls, PasswordPolicyErrorType.CHANGE_AFTER_RESET));
- ArrayList<RawAttribute> rawAttrs = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> rawAttrs = new ArrayList<>();
rawAttrs.add(RawAttribute.create("objectClass", "organizationalUnit"));
rawAttrs.add(RawAttribute.create("ou", "People"));
AddRequestProtocolOp addRequest = new AddRequestProtocolOp(
ByteString.valueOf("ou=People,o=test"), rawAttrs);
- controls = new ArrayList<Control>();
+ controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, addRequest, controls);
@@ -189,7 +189,7 @@
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
- ArrayList<RawAttribute> rawAttrs = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> rawAttrs = new ArrayList<>();
rawAttrs.add(RawAttribute.create("objectClass", "inetOrgPerson"));
rawAttrs.add(RawAttribute.create("uid", "test.user"));
rawAttrs.add(RawAttribute.create("givenName", "Test"));
@@ -201,7 +201,7 @@
AddRequestProtocolOp addRequest = new AddRequestProtocolOp(
ByteString.valueOf("ou=uid=test.user,o=test"), rawAttrs);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, addRequest, controls);
@@ -279,7 +279,7 @@
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
- ArrayList<RawAttribute> rawAttrs = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> rawAttrs = new ArrayList<>();
rawAttrs.add(RawAttribute.create("objectClass", "inetOrgPerson"));
rawAttrs.add(RawAttribute.create("uid", "test.user"));
rawAttrs.add(RawAttribute.create("givenName", "Test"));
@@ -290,7 +290,7 @@
AddRequestProtocolOp addRequest = new AddRequestProtocolOp(
ByteString.valueOf("ou=uid=test.user,o=test"), rawAttrs);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, addRequest, controls);
@@ -368,7 +368,7 @@
ByteString.valueOf("uid=test.user,o=test"), 3,
ByteString.valueOf("password"));
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
LDAPMessage message = new LDAPMessage(4, bindRequest, controls);
@@ -441,7 +441,7 @@
new CompareRequestProtocolOp(ByteString.valueOf("o=test"), "o",
ByteString.valueOf("test"));
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, compareRequest, controls);
@@ -520,7 +520,7 @@
DeleteRequestProtocolOp deleteRequest =
new DeleteRequestProtocolOp(ByteString.valueOf("ou=People,o=test"));
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, deleteRequest, controls);
@@ -638,14 +638,14 @@
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(RawModification.create(ModificationType.REPLACE, "description",
"foo"));
ModifyRequestProtocolOp modifyRequest =
new ModifyRequestProtocolOp(ByteString.valueOf(entryDN), mods);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, modifyRequest, controls);
@@ -783,14 +783,14 @@
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(RawModification.create(ModificationType.REPLACE, "description",
"foo"));
ModifyRequestProtocolOp modifyRequest =
new ModifyRequestProtocolOp(ByteString.valueOf(entryDN), mods);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
controls.add(new LDAPControl(OID_PROXIED_AUTH_V2, true,
ByteString.valueOf("dn:" + authzDN)));
@@ -866,7 +866,7 @@
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(RawModification.create(ModificationType.REPLACE, "userPassword",
"newpassword"));
@@ -874,7 +874,7 @@
new ModifyRequestProtocolOp(
ByteString.valueOf("uid=test.user,o=test"), mods);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, modifyRequest, controls);
@@ -944,7 +944,7 @@
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(RawModification.create(ModificationType.REPLACE, "userPassword",
"password"));
@@ -952,7 +952,7 @@
new ModifyRequestProtocolOp(
ByteString.valueOf("uid=test.user,o=test"), mods);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, modifyRequest, controls);
@@ -1024,7 +1024,7 @@
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(RawModification.create(ModificationType.REPLACE, "userPassword",
"newpassword"));
@@ -1032,7 +1032,7 @@
new ModifyRequestProtocolOp(
ByteString.valueOf("uid=test.user,o=test"), mods);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, modifyRequest, controls);
@@ -1104,7 +1104,7 @@
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(RawModification.create(ModificationType.REPLACE, "userPassword",
"newpassword"));
@@ -1112,7 +1112,7 @@
new ModifyRequestProtocolOp(
ByteString.valueOf("uid=test.user,o=test"), mods);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, modifyRequest, controls);
@@ -1193,7 +1193,7 @@
ByteString.valueOf("ou=People,o=test"),
ByteString.valueOf("ou=Users"), true);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, modifyDNRequest, controls);
@@ -1269,7 +1269,7 @@
LDAPFilter.objectClassPresent(),
new LinkedHashSet<String>());
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(new LDAPControl(OID_PASSWORD_POLICY_CONTROL, true));
message = new LDAPMessage(2, searchRequest, controls);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java
index b5fda50..efb9feb 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java
@@ -75,7 +75,7 @@
@DataProvider(name = "persistentSearchChangeTypeData")
public Object[][] createPersistentSearchChangeTypeData()
{
- Map<Integer, String> values = new HashMap<Integer, String>();
+ Map<Integer, String> values = new HashMap<>();
values.put(1, "add");
values.put(2, "delete");
values.put(4, "modify");
@@ -153,8 +153,7 @@
{
Set<Integer> keys = exceptedValues.keySet() ;
- Set<PersistentSearchChangeType> expectedTypes =
- new HashSet<PersistentSearchChangeType>(4);
+ Set<PersistentSearchChangeType> expectedTypes = new HashSet<>(4);
for (int i = 1; i <= 15; i++)
{
@@ -517,11 +516,11 @@
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("1"));
LDAPAttribute attr = new LDAPAttribute("ds-cfg-max-psearches", values);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(new LDAPModification(ModificationType.REPLACE, attr));
ModifyOperation modifyOperation =
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/ServerSideSortControlTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/ServerSideSortControlTestCase.java
index 996f073..1689cb6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/ServerSideSortControlTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/ServerSideSortControlTestCase.java
@@ -298,7 +298,7 @@
InternalSearchOperation internalSearch = conn.processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaccfJohnsonDN); // Aaccf
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
@@ -331,7 +331,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaccfJohnsonDN); // Aaccf
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
@@ -363,7 +363,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaronZimmermanDN); // Zeke
expectedDNOrder.add(samZweckDN); // Sam
expectedDNOrder.add(maryJonesDN); // Mary
@@ -399,7 +399,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(lowercaseMcGeeDN); // lowercase
expectedDNOrder.add(aaronZimmermanDN); // Zeke
expectedDNOrder.add(samZweckDN); // Sam
@@ -433,7 +433,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaccfJohnsonDN); // Aaccf
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertSmithDN); // Albert, lower sn
@@ -466,7 +466,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaccfJohnsonDN); // Aaccf
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, higher sn
@@ -569,7 +569,7 @@
private ArrayList<DN> getDNs(LinkedList<SearchResultEntry> searchEntries)
{
- ArrayList<DN> results = new ArrayList<DN>();
+ ArrayList<DN> results = new ArrayList<>();
for (Entry e : searchEntries)
{
results.add(e.getName());
@@ -577,4 +577,3 @@
return results;
}
}
-
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java
index 9800bc0..ecde700 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/controls/VLVControlTestCase.java
@@ -495,7 +495,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaccfJohnsonDN); // Aaccf
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
@@ -555,7 +555,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaccfJohnsonDN); // Aaccf
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
@@ -615,7 +615,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
expectedDNOrder.add(albertSmithDN); // Albert, higher entry ID
expectedDNOrder.add(lowercaseMcGeeDN); // lowercase
@@ -732,7 +732,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(maryJonesDN); // Mary
expectedDNOrder.add(samZweckDN); // Sam
expectedDNOrder.add(zorroDN); // No first name
@@ -768,7 +768,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(maryJonesDN); // Mary
expectedDNOrder.add(samZweckDN); // Sam
expectedDNOrder.add(zorroDN); // No first name
@@ -827,7 +827,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaccfJohnsonDN); // Aaccf
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
@@ -887,7 +887,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaccfJohnsonDN); // Aaccf
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
@@ -949,7 +949,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
expectedDNOrder.add(albertSmithDN); // Albert, higher entry ID
expectedDNOrder.add(lowercaseMcGeeDN); // lowercase
@@ -1011,7 +1011,7 @@
InternalSearchOperation internalSearch = getRootConnection().processSearch(request);
assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS);
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(aaronZimmermanDN); // Aaron
expectedDNOrder.add(albertZimmermanDN); // Albert, lower entry ID
expectedDNOrder.add(albertSmithDN); // Albert, higher entry ID
@@ -1053,7 +1053,7 @@
private ArrayList<DN> getDNs(LinkedList<SearchResultEntry> entries)
{
- ArrayList<DN> results = new ArrayList<DN>();
+ ArrayList<DN> results = new ArrayList<>();
for (Entry e : entries)
{
results.add(e.getName());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java
index 8811d85..4776354 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/AbandonOperationTestCase.java
@@ -275,14 +275,14 @@
// Create an add request and send it to the server. Make sure to include
// the delay request control so it won't complete before we can send the
// abandon request.
- ArrayList<RawAttribute> attributes = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> attributes = new ArrayList<>();
- ArrayList<ByteString> values = new ArrayList<ByteString>(2);
+ ArrayList<ByteString> values = new ArrayList<>(2);
values.add(ByteString.valueOf("top"));
values.add(ByteString.valueOf("organizationalUnit"));
attributes.add(new LDAPAttribute("objectClass", values));
- values = new ArrayList<ByteString>(1);
+ values = new ArrayList<>(1);
values.add(ByteString.valueOf("People"));
attributes.add(new LDAPAttribute("ou", values));
@@ -555,10 +555,10 @@
// Create a modify request and send it to the server. Make sure to include
// the delay request control so it won't complete before we can send the
// abandon request.
- ArrayList<ByteString> values = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> values = new ArrayList<>(1);
values.add(ByteString.valueOf("foo"));
- ArrayList<RawModification> mods = new ArrayList<RawModification>(1);
+ ArrayList<RawModification> mods = new ArrayList<>(1);
mods.add(new LDAPModification(ModificationType.REPLACE,
new LDAPAttribute("description", values)));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
index 0624a6e..238d8d5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
@@ -99,7 +99,7 @@
@DataProvider(name = "addOperations")
public Object[][] getAddOperations() throws Exception
{
- ArrayList<Control> noControls = new ArrayList<Control>();
+ ArrayList<Control> noControls = new ArrayList<>();
ArrayList<RawAttribute> ldapAttrList = newRawAttributes(
new LDAPAttribute("objectclass", byteStrings("top", "organizationalUnit")),
@@ -201,12 +201,12 @@
private ArrayList<RawAttribute> newRawAttributes(RawAttribute... attributes)
{
- return new ArrayList<RawAttribute>(Arrays.asList(attributes));
+ return new ArrayList<>(Arrays.asList(attributes));
}
private ArrayList<ByteString> byteStrings(final String... v)
{
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
for (String s : v)
{
values.add(ByteString.valueOf(s));
@@ -281,7 +281,7 @@
assertNotNull(rawAttrs);
assertFalse(rawAttrs.isEmpty());
- ArrayList<RawAttribute> copiedAttrs = new ArrayList<RawAttribute>(rawAttrs);
+ ArrayList<RawAttribute> copiedAttrs = new ArrayList<>(rawAttrs);
copiedAttrs.add(new LDAPAttribute("description", byteStrings("foo")));
addOperation.setRawAttributes(copiedAttrs);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/BackendConfigManagerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/BackendConfigManagerTestCase.java
index 39ab76c..42398c9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/BackendConfigManagerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/BackendConfigManagerTestCase.java
@@ -194,7 +194,7 @@
InternalClientConnection conn = getRootConnection();
// Modify the backend to enable it.
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-enabled", "true")));
ModifyOperation modifyOperation =
@@ -207,7 +207,7 @@
// Modify the backend to disable it.
- mods = new ArrayList<Modification>();
+ mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-enabled", "false")));
modifyOperation = conn.processModify(backendEntry.getName(), mods);
@@ -434,7 +434,7 @@
// Disable the intermediate (child) backend. This should be allowed.
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE, Attributes.create("ds-cfg-enabled", "false")));
ModifyOperation modifyOperation =
conn.processModify(childBackendEntry.getName(), mods);
@@ -445,7 +445,7 @@
// Re-enable the intermediate backend.
- mods = new ArrayList<Modification>();
+ mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-enabled", "true")));
modifyOperation = conn.processModify(childBackendEntry.getName(), mods);
@@ -546,7 +546,7 @@
assertNotNull(baseDNs);
assertFalse(baseDNs.length == 0);
- ArrayList<String> lines = new ArrayList<String>();
+ ArrayList<String> lines = new ArrayList<>();
lines.add("dn: ds-cfg-backend-id=" + backendID + ",cn=Backends,cn=config");
lines.add("objectClass: top");
lines.add("objectClass: ds-cfg-backend");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java
index e47ff68..2ee6222 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/BindOperationTestCase.java
@@ -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.core;
@@ -72,7 +72,7 @@
{
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
- ArrayList<Control> noControls = new ArrayList<Control>(0);
+ ArrayList<Control> noControls = new ArrayList<>(0);
ByteString nullOS = null;
DN nullDN = null;
@@ -145,7 +145,7 @@
{
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
- ArrayList<Control> noControls = new ArrayList<Control>(0);
+ ArrayList<Control> noControls = new ArrayList<>(0);
ByteString nullOS = null;
DN nullDN = null;
@@ -1509,7 +1509,7 @@
InternalClientConnection conn =
new InternalClientConnection(new AuthenticationInfo());
- ArrayList<Control> requestControls = new ArrayList<Control>(1);
+ ArrayList<Control> requestControls = new ArrayList<>(1);
requestControls.add(new LDAPControl("1.2.3.4", true));
BindOperationBasis bindOperation =
@@ -1533,7 +1533,7 @@
InternalClientConnection conn =
new InternalClientConnection(new AuthenticationInfo());
- ArrayList<Control> requestControls = new ArrayList<Control>(1);
+ ArrayList<Control> requestControls = new ArrayList<>(1);
requestControls.add(new LDAPControl("1.2.3.4", true));
ByteString saslCreds =
@@ -1560,7 +1560,7 @@
InternalClientConnection conn =
new InternalClientConnection(new AuthenticationInfo());
- ArrayList<Control> requestControls = new ArrayList<Control>(1);
+ ArrayList<Control> requestControls = new ArrayList<>(1);
requestControls.add(new LDAPControl("1.2.3.4", false));
BindOperationBasis bindOperation =
@@ -1584,7 +1584,7 @@
InternalClientConnection conn =
new InternalClientConnection(new AuthenticationInfo());
- ArrayList<Control> requestControls = new ArrayList<Control>(1);
+ ArrayList<Control> requestControls = new ArrayList<>(1);
requestControls.add(new LDAPControl("1.2.3.4", false));
ByteString saslCreds =
@@ -1665,7 +1665,7 @@
InternalClientConnection.getRootConnection();
String attr = "ds-cfg-bind-with-dn-requires-password";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create(attr, "false")));
ModifyOperation modifyOperation =
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java
index 2126ba3..47bfff3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/CompareOperationTestCase.java
@@ -422,7 +422,7 @@
LDAPFilter ldapFilter = LDAPFilter.decode("(preferredlanguage=ja)");
LDAPAssertionRequestControl assertControl =
new LDAPAssertionRequestControl(true, ldapFilter);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(assertControl);
CompareOperationBasis compareOperation =
@@ -452,7 +452,7 @@
LDAPFilter ldapFilter = LDAPFilter.decode("(preferredlanguage=en)");
LDAPAssertionRequestControl assertControl =
new LDAPAssertionRequestControl(true, ldapFilter);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(assertControl);
CompareOperationBasis compareOperation =
@@ -478,7 +478,7 @@
ProxiedAuthV1Control authV1Control =
new ProxiedAuthV1Control(ByteString.valueOf(
"cn=Directory Manager,cn=Root DNs,cn=config"));
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(authV1Control);
CompareOperationBasis compareOperation =
@@ -507,7 +507,7 @@
ProxiedAuthV1Control authV1Control =
new ProxiedAuthV1Control(ByteString.valueOf("cn=nonexistent,o=test"));
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(authV1Control);
CompareOperationBasis compareOperation =
@@ -534,7 +534,7 @@
ProxiedAuthV2Control authV2Control =
new ProxiedAuthV2Control(ByteString.valueOf(
"dn:cn=Directory Manager,cn=Root DNs,cn=config"));
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(authV2Control);
CompareOperationBasis compareOperation =
@@ -561,7 +561,7 @@
ProxiedAuthV2Control authV2Control = new ProxiedAuthV2Control(
ByteString.valueOf("dn:cn=nonexistent,o=test"));
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(authV2Control);
CompareOperationBasis compareOperation =
@@ -589,7 +589,7 @@
new LDAPControl(ServerConstants.OID_PROXIED_AUTH_V2, false,
ByteString.empty());
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(authV2Control);
CompareOperationBasis compareOperation =
@@ -619,7 +619,7 @@
LDAPFilter.decode("(preferredlanguage=ja)");
LDAPControl assertControl =
new LDAPControl("1.1.1.1.1.1", true);
- List<Control> controls = new ArrayList<Control>();
+ List<Control> controls = new ArrayList<>();
controls.add(assertControl);
CompareOperationBasis compareOperation =
new CompareOperationBasis(
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java
index c29c007..619fee3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/DeleteOperationTestCase.java
@@ -72,7 +72,7 @@
@Override
protected Operation[] createTestOperations() throws Exception
{
- List<Control> noControls = new ArrayList<Control>();
+ List<Control> noControls = new ArrayList<>();
return new Operation[]
{
newDeleteOperation(noControls, ByteString.empty()),
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/GroupManagerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/GroupManagerTestCase.java
index 4b0d85b..f860300 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/GroupManagerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/GroupManagerTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.opends.server.core;
@@ -103,7 +103,7 @@
{
GroupManager groupManager = DirectoryServer.getGroupManager();
- LinkedHashSet<Class> groupClasses = new LinkedHashSet<Class>();
+ LinkedHashSet<Class> groupClasses = new LinkedHashSet<>();
groupClasses.add(StaticGroup.class);
groupClasses.add(DynamicGroup.class);
groupClasses.add(VirtualStaticGroup.class);
@@ -250,7 +250,7 @@
group1Instance.addMember(user4Entry);
//Switch things around, change groups and members to odd numbered nested
//groups and odd numbered members via ldap modify.
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
Attribute g1 = Attributes.create("member", "cn=group 1,ou=Groups,o=test");
Attribute g2 = Attributes.create("member", "cn=group 2,ou=Groups,o=test");
Attribute g3 = Attributes.create("member", "cn=group 3,ou=Groups,o=test");
@@ -459,7 +459,7 @@
"it didn't");
} catch (DirectoryException ex) {}
//Modify list via ldap modify.
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
Attribute a2 = Attributes.create("member", "cn=group 2,ou=Groups,o=test");
Attribute a3 = Attributes.create("member", "cn=group 1,ou=Groups,o=test");
mods.add(new Modification(ModificationType.DELETE, a2));
@@ -716,9 +716,8 @@
assertFalse(memberList.hasMoreMembers());
- // Modify the group and make sure the group manager gets updated
- // accordingly.
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ // Modify the group and make sure the group manager gets updated accordingly
+ LinkedList<Modification> mods = new LinkedList<>();
Attribute a2 = Attributes.create("member", "uid=user.2,ou=People,o=test");
Attribute a3 = Attributes.create("member", "uid=user.3,ou=People,o=test");
mods.add(new Modification(ModificationType.DELETE, a2));
@@ -737,8 +736,7 @@
assertTrue(groupInstance.isMember(user3DN));
- // Delete the group and make sure the group manager gets updated
- // accordingly.
+ // Delete the group and make sure the group manager gets updated accordingly
DeleteOperation deleteOperation = conn.processDelete(groupDN);
assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS);
assertNull(groupManager.getGroupInstance(groupDN));
@@ -789,8 +787,7 @@
assertFalse(groupInstance.getMembers().hasMoreMembers());
- // Delete the group and make sure the group manager gets updated
- // accordingly.
+ // Delete the group and make sure the group manager gets updated accordingly
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
DeleteOperation deleteOperation = conn.processDelete(groupDN);
@@ -910,9 +907,8 @@
assertFalse(memberList.hasMoreMembers());
- // Modify the group and make sure the group manager gets updated
- // accordingly.
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ // Modify the group and make sure the group manager gets updated accordingly
+ LinkedList<Modification> mods = new LinkedList<>();
Attribute a2 = Attributes.create("uniquemember", "uid=user.2,ou=People,o=test");
Attribute a3 = Attributes.create("uniquemember", "uid=user.3,ou=People,o=test");
mods.add(new Modification(ModificationType.DELETE, a2));
@@ -931,8 +927,7 @@
assertTrue(groupInstance.isMember(user3DN));
- // Delete the group and make sure the group manager gets updated
- // accordingly.
+ // Delete the group and make sure the group manager gets updated accordingly
DeleteOperation deleteOperation = conn.processDelete(groupDN);
assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS);
assertNull(groupManager.getGroupInstance(groupDN));
@@ -983,8 +978,7 @@
assertFalse(groupInstance.getMembers().hasMoreMembers());
- // Delete the group and make sure the group manager gets updated
- // accordingly.
+ // Delete the group and make sure the group manager gets updated accordingly
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
DeleteOperation deleteOperation = conn.processDelete(groupDN);
@@ -1104,9 +1098,8 @@
assertFalse(memberList.hasMoreMembers());
- // Modify the group and make sure the group manager gets updated
- // accordingly.
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ // Modify the group and make sure the group manager gets updated accordingly
+ LinkedList<Modification> mods = new LinkedList<>();
Attribute a2 = Attributes.create("member", "uid=user.2,ou=People,o=test");
Attribute a3 = Attributes.create("member", "uid=user.3,ou=People,o=test");
mods.add(new Modification(ModificationType.DELETE, a2));
@@ -1125,8 +1118,7 @@
assertTrue(groupInstance.isMember(user3DN));
- // Delete the group and make sure the group manager gets updated
- // accordingly.
+ // Delete the group and make sure the group manager gets updated accordingly
DeleteOperation deleteOperation = conn.processDelete(groupDN);
assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS);
assertNull(groupManager.getGroupInstance(groupDN));
@@ -1177,8 +1169,7 @@
assertFalse(groupInstance.getMembers().hasMoreMembers());
- // Delete the group and make sure the group manager gets updated
- // accordingly.
+ // Delete the group and make sure the group manager gets updated accordingly
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
DeleteOperation deleteOperation = conn.processDelete(groupDN);
@@ -1270,8 +1261,7 @@
assertTrue(groupInstance.isMember(user1DN));
- // Delete the group and make sure the group manager gets updated
- // accordingly.
+ // Delete the group and make sure the group manager gets updated accordingly
DeleteOperation deleteOperation = conn.processDelete(newDN);
assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS);
assertNull(groupManager.getGroupInstance(newDN));
@@ -1494,8 +1484,7 @@
assertTrue(groupSet.contains(group3));
- // Delete all of the groups and make sure the group manager gets updated
- // accordingly.
+ // Delete all of the groups and make sure the group manager gets updated accordingly
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
DeleteOperation deleteOperation = conn.processDelete(group1DN);
@@ -1650,8 +1639,7 @@
memberList.close();
- // Delete the group and make sure the group manager gets updated
- // accordingly.
+ // Delete the group and make sure the group manager gets updated accordingly
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
DeleteOperation deleteOperation = conn.processDelete(groupDN);
@@ -1919,7 +1907,7 @@
assertNotNull(groupInstance);
- LinkedHashSet<DN> memberSet = new LinkedHashSet<DN>();
+ LinkedHashSet<DN> memberSet = new LinkedHashSet<>();
memberSet.add(user1DN);
memberSet.add(user2DN);
@@ -2017,7 +2005,7 @@
assertNotNull(groupInstance);
- LinkedHashSet<DN> memberSet = new LinkedHashSet<DN>();
+ LinkedHashSet<DN> memberSet = new LinkedHashSet<>();
memberSet.add(user1DN);
MemberList memberList = groupInstance.getMembers(
@@ -2120,7 +2108,7 @@
groupInstance.toString();
- LinkedHashSet<DN> memberSet = new LinkedHashSet<DN>();
+ LinkedHashSet<DN> memberSet = new LinkedHashSet<>();
memberSet.add(user1DN);
memberSet.add(user2DN);
@@ -2224,7 +2212,7 @@
groupInstance.toString();
- LinkedHashSet<DN> memberSet = new LinkedHashSet<DN>();
+ LinkedHashSet<DN> memberSet = new LinkedHashSet<>();
memberSet.add(user1DN);
memberSet.add(user2DN);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
index 94159b5..dc025a0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
@@ -118,9 +118,9 @@
@DataProvider(name = "modifyOperations")
public Object[][] getModifyOperations() throws Exception
{
- List<ModifyOperation> opList = new ArrayList<ModifyOperation>();
+ List<ModifyOperation> opList = new ArrayList<>();
- List<Control> noControls = new ArrayList<Control>();
+ List<Control> noControls = new ArrayList<>();
LDAPAttribute ldapAttr = new LDAPAttribute("description", "foo");
List<RawModification> ldapMods = newRawModifications(add(ldapAttr));
@@ -308,7 +308,7 @@
private LDAPAttribute newLDAPAttribute(String attributeType, String... valueStrings)
{
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
for (String valueStr : valueStrings)
{
values.add(ByteString.valueOf(valueStr));
@@ -368,7 +368,7 @@
throws Exception
{
List<RawModification> rawMods = modifyOperation.getRawModifications();
- List<RawModification> clonedMods = new ArrayList<RawModification>(rawMods);
+ List<RawModification> clonedMods = new ArrayList<>(rawMods);
modifyOperation.setRawModifications(clonedMods);
LDAPAttribute attr = newLDAPAttribute("test", "test");
@@ -3229,7 +3229,7 @@
LDAPAttribute attr = newLDAPAttribute("givenName", "Test");
List<RawModification> mods = newRawModifications(add(attr));
- List<Control> requestControls = new ArrayList<Control>();
+ List<Control> requestControls = new ArrayList<>();
requestControls.add(
new LDAPControl(ServerConstants.OID_PERMISSIVE_MODIFY_CONTROL, false));
@@ -3266,7 +3266,7 @@
LDAPAttribute attr = newLDAPAttribute("givenName", "Foo");
List<RawModification> mods = newRawModifications(delete(attr));
- List<Control> requestControls = new ArrayList<Control>();
+ List<Control> requestControls = new ArrayList<>();
requestControls.add(
new LDAPControl(ServerConstants.OID_PERMISSIVE_MODIFY_CONTROL, false));
@@ -3303,7 +3303,7 @@
LDAPAttribute attr = new LDAPAttribute("description");
List<RawModification> mods = newRawModifications(delete(attr));
- List<Control> requestControls = new ArrayList<Control>();
+ List<Control> requestControls = new ArrayList<>();
requestControls.add(
new LDAPControl(ServerConstants.OID_PERMISSIVE_MODIFY_CONTROL, false));
@@ -3663,7 +3663,7 @@
"axuJ8LFNbZtsp1ldW3i84+F5+SYT+xI67ZcoAtwx/VFVI9s5I/Gkmu9f9nxjPpK7" +
"1AIUXiE3Qcck";
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.wrap(Base64.decode(certificateValue)));
LDAPAttribute attr = new LDAPAttribute("usercertificate", values);
ModifyOperation modifyOperation = processModify("uid=test.user," + baseDN, add(attr));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/PluginConfigManagerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/PluginConfigManagerTestCase.java
index 6df7fd0..78eaf0a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/PluginConfigManagerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/PluginConfigManagerTestCase.java
@@ -598,15 +598,14 @@
{
String pluginBase = ",cn=Plugins,cn=config";
- ArrayList<DN> dnList = new ArrayList<DN>();
+ ArrayList<DN> dnList = new ArrayList<>();
dnList.add(DN.valueOf("cn=" + PLUGIN_NAME_DELAY + pluginBase));
dnList.add(DN.valueOf("cn=" + PLUGIN_NAME_DISCONNECT + pluginBase));
dnList.add(DN.valueOf("cn=" + PLUGIN_NAME_INVOCATION_COUNTER + pluginBase));
dnList.add(DN.valueOf("cn=" + PLUGIN_NAME_SHORT_CIRCUIT + pluginBase));
dnList.add(DN.valueOf("cn=" + PLUGIN_NAME_UPDATE + pluginBase));
- ArrayList<DirectoryServerPlugin> pluginList =
- new ArrayList<DirectoryServerPlugin>(dnList.size());
+ ArrayList<DirectoryServerPlugin> pluginList = new ArrayList<>(dnList.size());
for (DN dn : dnList)
{
DirectoryServerPlugin p =
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java
index 6fa81d4..ed21be3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/SearchOperationTestCase.java
@@ -428,7 +428,7 @@
@Test
public void testSearchExternalAllUserAttributes() throws Exception
{
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
attributes.add("*");
SearchRequestProtocolOp searchRequest =
new SearchRequestProtocolOp(
@@ -472,7 +472,7 @@
@Test
public void testSearchExternalAllUserAttributesOmitValues() throws Exception
{
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
attributes.add("*");
SearchRequestProtocolOp searchRequest =
new SearchRequestProtocolOp(
@@ -497,7 +497,7 @@
@Test
public void testSearchExternalObjectClassAttribute() throws Exception
{
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
attributes.add("objectclass");
SearchRequestProtocolOp searchRequest =
new SearchRequestProtocolOp(
@@ -522,7 +522,7 @@
public void testSearchExternalObjectClassAttributeOmitValues()
throws Exception
{
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
attributes.add("objectclass");
SearchRequestProtocolOp searchRequest =
new SearchRequestProtocolOp(
@@ -546,7 +546,7 @@
@Test
public void testSearchExternalSelectedAttributes() throws Exception
{
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
attributes.add("uid");
attributes.add("createtimestamp");
SearchRequestProtocolOp searchRequest =
@@ -569,7 +569,7 @@
@Test
public void testSearchExternalAttributeWithSubtypes() throws Exception
{
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
attributes.add("title");
SearchRequestProtocolOp searchRequest =
new SearchRequestProtocolOp(
@@ -592,7 +592,7 @@
public void testSearchExternalAttributeWithSubtypesOmitValues()
throws Exception
{
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
attributes.add("title");
SearchRequestProtocolOp searchRequest =
new SearchRequestProtocolOp(
@@ -618,7 +618,7 @@
@Test
public void testSearchExternalAttributeWithOptions() throws Exception
{
- LinkedHashSet<String> attributes = new LinkedHashSet<String>();
+ LinkedHashSet<String> attributes = new LinkedHashSet<>();
attributes.add("title;lang-ja;phonetic");
SearchRequestProtocolOp searchRequest =
new SearchRequestProtocolOp(
@@ -644,11 +644,10 @@
LDAPFilter ldapFilter = LDAPFilter.decode("(title=*director*)");
MatchedValuesFilter matchedValuesFilter =
MatchedValuesFilter.createFromLDAPFilter(ldapFilter);
- ArrayList<MatchedValuesFilter> filters =
- new ArrayList<MatchedValuesFilter>();
+ ArrayList<MatchedValuesFilter> filters = new ArrayList<>();
filters.add(matchedValuesFilter);
MatchedValuesControl mvc = new MatchedValuesControl(true, filters);
- ArrayList<Control> controls = new ArrayList<Control>();
+ ArrayList<Control> controls = new ArrayList<>();
controls.add(mvc);
SearchRequestProtocolOp searchRequest =
@@ -947,7 +946,7 @@
assertEquals(entry.getName(), userDN);
// Check real attributes.
- List<String> messages = new LinkedList<String>();
+ List<String> messages = new LinkedList<>();
for (String attrType : realAttrTypes)
{
List<Attribute> attrList = entry.getAttribute(attrType);
@@ -1127,7 +1126,7 @@
// Check all expected attributes are present and have
// the user requested name.
List<Attribute> attrList = entry.getAttributes();
- Set<String> actualNames = new HashSet<String>();
+ Set<String> actualNames = new HashSet<>();
for (Attribute attribute : attrList)
{
actualNames.add(attribute.getNameWithOptions());
@@ -1171,8 +1170,7 @@
"cn;lang-fr: Test Usager",
"userPassword: password");
- LinkedHashSet<String> attributes =
- new LinkedHashSet<String>(requestedAttributes);
+ LinkedHashSet<String> attributes = new LinkedHashSet<>(requestedAttributes);
SearchRequestProtocolOp searchRequest =
new SearchRequestProtocolOp(
@@ -1193,7 +1191,7 @@
// Check all expected attributes are present and have
// the user requested name.
LinkedList<LDAPAttribute> attrList = entry.getAttributes();
- Set<String> actualNames = new HashSet<String>();
+ Set<String> actualNames = new HashSet<>();
for (LDAPAttribute attribute : attrList)
{
actualNames.add(attribute.getAttributeType());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
index 9903911..a599938 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
@@ -139,7 +139,7 @@
private List<Entry> getEntries(List<SubEntry> subentries)
{
- final List<Entry> results = new ArrayList<Entry>();
+ final List<Entry> results = new ArrayList<>();
for (SubEntry subEntry : subentries)
{
results.add(subEntry.getEntry());
@@ -149,7 +149,7 @@
private List<DN> getDns(List<SubEntry> subentries)
{
- final List<DN> results = new ArrayList<DN>();
+ final List<DN> results = new ArrayList<>();
for (SubEntry subEntry : subentries)
{
results.add(subEntry.getDN());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/SubtreeSpecificationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/SubtreeSpecificationTestCase.java
index 6cad65a..ec4c50c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/SubtreeSpecificationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/SubtreeSpecificationTestCase.java
@@ -55,7 +55,7 @@
*/
protected final Entry createEntry(DN entryDN,
Set<ObjectClass> objectClasses) {
- HashMap<ObjectClass, String> map = new HashMap<ObjectClass, String>();
+ HashMap<ObjectClass, String> map = new HashMap<>();
for (ObjectClass oc : objectClasses) {
if (oc != null) {
@@ -74,12 +74,11 @@
*/
@BeforeClass
public final void setUp() throws Exception {
- // This test suite depends on having the schema available, so we'll start
- // the server.
+ // This test suite depends on having the schema available, so we'll start the server.
TestCaseUtils.startServer();
// Retrieve required object classes.
- objectClasses = new HashSet<ObjectClass>();
+ objectClasses = new HashSet<>();
ObjectClass oc = DirectoryServer.getObjectClass("top");
if (oc == null) {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java b/opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java
index b7804ee..fbcd4e3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/TestModifyDNOperation.java
@@ -1330,7 +1330,7 @@
@Test(expectedExceptions=InvalidNameException.class)
public void testInvalidModRDN() throws Exception
{
- Hashtable<String,String> env = new Hashtable<String,String>();
+ Hashtable<String,String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
String url = "ldap://localhost:" + TestCaseUtils.getServerLdapPort()
+"/dc=example,dc=com";
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java
index c1e668a..a6516ef 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java
@@ -438,7 +438,7 @@
validator.initializePasswordValidator(configuration);
ByteString pwOS = ByteString.valueOf(password);
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", password)));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java
index 9242d6b..a1cbba5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CancelExtendedOperationTestCase.java
@@ -124,14 +124,14 @@
// Create an add request and send it to the server. Make sure to include
// the delay request control so it won't complete before we can send the
// cancel request.
- ArrayList<RawAttribute> attributes = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> attributes = new ArrayList<>();
- ArrayList<ByteString> values = new ArrayList<ByteString>(2);
+ ArrayList<ByteString> values = new ArrayList<>(2);
values.add(ByteString.valueOf("top"));
values.add(ByteString.valueOf("organizationalUnit"));
attributes.add(new LDAPAttribute("objectClass", values));
- values = new ArrayList<ByteString>(1);
+ values = new ArrayList<>(1);
values.add(ByteString.valueOf("People"));
attributes.add(new LDAPAttribute("ou", values));
@@ -457,10 +457,10 @@
// Create a modify request and send it to the server. Make sure to include
// the delay request control so it won't complete before we can send the
// cancel request.
- ArrayList<ByteString> values = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> values = new ArrayList<>(1);
values.add(ByteString.valueOf("foo"));
- ArrayList<RawModification> mods = new ArrayList<RawModification>(1);
+ ArrayList<RawModification> mods = new ArrayList<>(1);
mods.add(new LDAPModification(ModificationType.REPLACE,
new LDAPAttribute("description", values)));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java
index 6246eca..b7612a1 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java
@@ -994,7 +994,7 @@
validator.initializePasswordValidator(configuration);
ByteString pwOS = ByteString.valueOf(password);
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", password)));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ConfigFileHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ConfigFileHandlerTestCase.java
index 22147fc..3e99d91 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ConfigFileHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ConfigFileHandlerTestCase.java
@@ -112,7 +112,7 @@
public void testNoExtensibleObjects()
throws Exception
{
- ArrayList<DN> violatingDNs = new ArrayList<DN>();
+ ArrayList<DN> violatingDNs = new ArrayList<>();
recursivelyTestNoExtensibleObjects(
DirectoryServer.getConfigHandler().getConfigRootEntry(), violatingDNs);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/DefaultEntryCacheTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/DefaultEntryCacheTestCase.java
index 8d95fc4..92970a5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/DefaultEntryCacheTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/DefaultEntryCacheTestCase.java
@@ -68,9 +68,7 @@
Entry cacheFIFOConfigEntry;
/** The entry cache order map sorted by the cache level. */
- private SortedMap<Integer, EntryCache<? extends EntryCacheCfg>>
- cacheOrderMap = new TreeMap<Integer,
- EntryCache<? extends EntryCacheCfg>>();
+ private SortedMap<Integer, EntryCache<? extends EntryCacheCfg>> cacheOrderMap = new TreeMap<>();
// Dummy test entries for each participating implementation.
private ArrayList<Entry> testSoftRefEntriesList;
@@ -140,7 +138,7 @@
}
// Make some dummy test entries.
- super.testEntriesList = new ArrayList<Entry>(super.NUMTESTENTRIES);
+ super.testEntriesList = new ArrayList<>(super.NUMTESTENTRIES);
for(int i = 0; i < super.NUMTESTENTRIES; i++ ) {
super.testEntriesList.add(TestCaseUtils.makeEntry(
"dn: uid=test" + i + ".user" + i + ",ou=test" + i + ",o=test",
@@ -168,7 +166,7 @@
"uid: test" + i + ".user" + i)
);
}
- testSoftRefEntriesList = new ArrayList<Entry>(super.NUMTESTENTRIES);
+ testSoftRefEntriesList = new ArrayList<>(super.NUMTESTENTRIES);
for(int i = 0; i < super.NUMTESTENTRIES; i++ ) {
testSoftRefEntriesList.add(TestCaseUtils.makeEntry(
"dn: uid=softref" + i + ".user" + i + ",ou=test" + i + ",o=test",
@@ -179,7 +177,7 @@
"uid: softref" + i + ".user" + i)
);
}
- testFIFOEntriesList = new ArrayList<Entry>(super.NUMTESTENTRIES);
+ testFIFOEntriesList = new ArrayList<>(super.NUMTESTENTRIES);
for(int i = 0; i < super.NUMTESTENTRIES; i++ ) {
testFIFOEntriesList.add(TestCaseUtils.makeEntry(
"dn: uid=fifo" + i + ".user" + i + ",ou=test" + i + ",o=test",
@@ -208,9 +206,7 @@
throws Exception
{
// Unplug all cache implementations from default entry cache.
- SortedMap<Integer, EntryCache<? extends EntryCacheCfg>>
- emptyCacheOrderMap = new TreeMap<Integer,
- EntryCache<? extends EntryCacheCfg>>();
+ SortedMap<Integer, EntryCache<? extends EntryCacheCfg>> emptyCacheOrderMap = new TreeMap<>();
final Method[] defaultCacheMethods =
super.cache.getClass().getDeclaredMethods();
for (int i = 0; i < defaultCacheMethods.length; ++i) {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java
index 4739d5b..02e7e30 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java
@@ -675,7 +675,7 @@
validator.initializePasswordValidator(configuration);
ByteString pwOS = ByteString.valueOf(password);
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", password)));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java
index 3091674..75bd7ce 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntityTagVirtualAttributeProviderTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Portions Copyright 2012-2014 ForgeRock AS
+ * Portions Copyright 2012-2015 ForgeRock AS
*/
package org.opends.server.extensions;
@@ -95,7 +95,7 @@
private final EntityTagVirtualAttributeCfg config = new EntityTagVirtualAttributeCfg()
{
- private final TreeSet<AttributeType> excludedAttributes = new TreeSet<AttributeType>();
+ private final TreeSet<AttributeType> excludedAttributes = new TreeSet<>();
@Override
public void addChangeListener(
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java
index c4695fc..ade1322 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java
@@ -494,7 +494,7 @@
"o: test");
entry.processVirtualAttributes();
- LinkedList<ByteString> subAny = new LinkedList<ByteString>();
+ LinkedList<ByteString> subAny = new LinkedList<>();
subAny.add(ByteString.valueOf("="));
assertEquals(provider.matchesSubstring(entry, getRule(provider), null, subAny, null),
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandlerTestCase.java
index 9ae4eeb..ba21a23 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandlerTestCase.java
@@ -259,51 +259,49 @@
PasswordPolicy policy = (PasswordPolicy) AuthenticationPolicy.forUser(
userEntry, false);
- HashMap<AccountStatusNotificationProperty,List<String>>
- notificationProperties =
- new HashMap<AccountStatusNotificationProperty,List<String>>();
+ HashMap<AccountStatusNotificationProperty, List<String>> notificationProperties = new HashMap<>();
- ArrayList<String> propList = new ArrayList<String>(1);
+ ArrayList<String> propList = new ArrayList<>(1);
propList.add(policy.getDN().toString());
notificationProperties.put(PASSWORD_POLICY_DN, propList);
if (notificationType == ACCOUNT_TEMPORARILY_LOCKED)
{
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add("300");
notificationProperties.put(SECONDS_UNTIL_UNLOCK, propList);
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add("5 minutes");
notificationProperties.put(TIME_UNTIL_UNLOCK, propList);
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add(new Date(System.currentTimeMillis() + 300000L).toString());
notificationProperties.put(ACCOUNT_UNLOCK_TIME, propList);
}
else if (notificationType == PASSWORD_EXPIRING)
{
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add("86400");
notificationProperties.put(SECONDS_UNTIL_EXPIRATION, propList);
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add("1 day");
notificationProperties.put(TIME_UNTIL_EXPIRATION, propList);
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add(new Date(System.currentTimeMillis() + 86400000L).toString());
notificationProperties.put(PASSWORD_EXPIRATION_TIME, propList);
}
else if ((notificationType == PASSWORD_CHANGED) ||
(notificationType == PASSWORD_RESET))
{
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add("oldpassword");
notificationProperties.put(OLD_PASSWORD, propList);
- propList = new ArrayList<String>(1);
+ propList = new ArrayList<>(1);
propList.add("newpassword");
notificationProperties.put(NEW_PASSWORD, propList);
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java
index 72d3d89..0d2a5f5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java
@@ -804,10 +804,10 @@
InternalClientConnection conn = getRootConnection();
// Create a modification to change the map attribute from uid to cn.
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("cn"));
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(new LDAPModification(ModificationType.REPLACE,
new LDAPAttribute("ds-cfg-match-attribute",
values)));
@@ -883,10 +883,10 @@
InternalClientConnection conn = getRootConnection();
// Create a modification to set the map base DN to "dc=example,dc=com".
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("dc=example,dc=com"));
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(new LDAPModification(ModificationType.REPLACE,
new LDAPAttribute("ds-cfg-match-base-dn",
values)));
@@ -939,7 +939,7 @@
throws Exception
{
// Create a modification to remove the match attribute.
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(new LDAPModification(ModificationType.REPLACE,
new LDAPAttribute("ds-cfg-match-attribute")));
InternalClientConnection conn =
@@ -963,10 +963,10 @@
throws Exception
{
// Create a modification to remove the match attribute.
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("undefinedAttribute"));
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(new LDAPModification(ModificationType.REPLACE,
new LDAPAttribute("ds-cfg-match-attribute",
values)));
@@ -991,10 +991,10 @@
throws Exception
{
// Create a modification to remove the match attribute.
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("invalidDN"));
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(new LDAPModification(ModificationType.REPLACE,
new LDAPAttribute("ds-cfg-match-base-dn",
values)));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java
index a59bca6..1979765 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java
@@ -366,7 +366,7 @@
InternalClientConnection conn = getRootConnection();
String dnStr = "cn=EXTERNAL,cn=SASL Mechanisms,cn=config";
String attrName = "ds-cfg-certificate-validation-policy";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create(attrName, "always")));
ModifyOperation modifyOperation =
@@ -562,7 +562,7 @@
InternalClientConnection conn = getRootConnection();
String dnStr = "cn=EXTERNAL,cn=SASL Mechanisms,cn=config";
String attrName = "ds-cfg-certificate-validation-policy";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create(attrName, "always")));
ModifyOperation modifyOperation =
@@ -642,7 +642,7 @@
InternalClientConnection conn = getRootConnection();
String dnStr = "cn=EXTERNAL,cn=SASL Mechanisms,cn=config";
String attrName = "ds-cfg-certificate-validation-policy";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create(attrName, "always")));
ModifyOperation modifyOperation =
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/FIFOEntryCacheTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/FIFOEntryCacheTestCase.java
index 7af783f..80391d4 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/FIFOEntryCacheTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/FIFOEntryCacheTestCase.java
@@ -90,7 +90,7 @@
super.cache.initializeEntryCache(configuration);
// Make some dummy test entries.
- super.testEntriesList = new ArrayList<Entry>(super.NUMTESTENTRIES);
+ super.testEntriesList = new ArrayList<>(super.NUMTESTENTRIES);
for(int i = 0; i < super.NUMTESTENTRIES; i++ ) {
super.testEntriesList.add(TestCaseUtils.makeEntry(
"dn: uid=test" + i + ".user" + i + ",ou=test" + i + ",o=test",
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/FingerprintCertificateMapperTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/FingerprintCertificateMapperTestCase.java
index 9053e78..cb838b2 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/FingerprintCertificateMapperTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/FingerprintCertificateMapperTestCase.java
@@ -454,7 +454,7 @@
Attributes.empty(DirectoryServer.getAttributeType(
"ds-cfg-fingerprint-attribute"));
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.DELETE, a));
InternalClientConnection conn =
@@ -482,7 +482,7 @@
Attributes.empty(DirectoryServer.getAttributeType(
"ds-cfg-fingerprint-algorithm"));
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.DELETE, a));
InternalClientConnection conn =
@@ -550,7 +550,7 @@
String externalDN = "cn=EXTERNAL,cn=SASL Mechanisms,cn=config";
String mapperDN = "cn=Fingerprint Mapper,cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-certificate-mapper",
mapperDN)));
@@ -576,7 +576,7 @@
String externalDN = "cn=EXTERNAL,cn=SASL Mechanisms,cn=config";
String mapperDN = "cn=Subject Equals DN,cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-certificate-mapper",
mapperDN)));
@@ -604,7 +604,7 @@
{
String mapperDN = "cn=Fingerprint Mapper,cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-fingerprint-attribute",
attrName)));
@@ -631,7 +631,7 @@
{
String mapperDN = "cn=Fingerprint Mapper,cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-fingerprint-algorithm",
algorithm)));
@@ -672,7 +672,7 @@
}
}
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
builder.toAttribute()));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java
index e9bfdc2..ad179b0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.opends.server.extensions;
@@ -485,7 +485,7 @@
VirtualAttributeRule rule = buildRule(provider);
- LinkedList<ByteString> subAny = new LinkedList<ByteString>();
+ LinkedList<ByteString> subAny = new LinkedList<>();
subAny.add(ByteString.valueOf("="));
assertEquals(provider.matchesSubstring(entry, rule, null, subAny, null),
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/JMXAlertHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/JMXAlertHandlerTestCase.java
index 0f4f40e..141bf44 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/JMXAlertHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/JMXAlertHandlerTestCase.java
@@ -78,7 +78,7 @@
@DataProvider(name = "jmxAlertHandlers")
public Object[][] getJMXAlertHandlers()
{
- ArrayList<AlertHandler> handlers = new ArrayList<AlertHandler>();
+ ArrayList<AlertHandler> handlers = new ArrayList<>();
for (AlertHandler handler : DirectoryServer.getAlertHandlers())
{
if (handler instanceof JMXAlertHandler)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
index 7584f91..4aaf2c9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
@@ -371,11 +371,11 @@
final class MockPolicyCfg implements LDAPPassThroughAuthenticationPolicyCfg
{
- private final SortedSet<DN> baseDNs = new TreeSet<DN>();
- private final SortedSet<AttributeType> mappedAttributes = new TreeSet<AttributeType>();
+ private final SortedSet<DN> baseDNs = new TreeSet<>();
+ private final SortedSet<AttributeType> mappedAttributes = new TreeSet<>();
private MappingPolicy mappingPolicy = MappingPolicy.UNMAPPED;
- private final SortedSet<String> primaryServers = new TreeSet<String>();
- private final SortedSet<String> secondaryServers = new TreeSet<String>();
+ private final SortedSet<String> primaryServers = new TreeSet<>();
+ private final SortedSet<String> secondaryServers = new TreeSet<>();
/** Unlimited. */
private int timeoutMS;
private DN mappedSearchBindDN = searchBindDN;
@@ -502,7 +502,7 @@
@Override
public SortedSet<String> getSSLCipherSuite()
{
- return new TreeSet<String>();
+ return new TreeSet<>();
}
@@ -510,7 +510,7 @@
@Override
public SortedSet<String> getSSLProtocol()
{
- return new TreeSet<String>();
+ return new TreeSet<>();
}
@@ -831,8 +831,8 @@
- private final Queue<Event<?>> expectedEvents = new LinkedList<Event<?>>();
- private final List<MockScheduledFuture> monitorRunnables = new LinkedList<MockScheduledFuture>();
+ private final Queue<Event<?>> expectedEvents = new LinkedList<>();
+ private final List<MockScheduledFuture> monitorRunnables = new LinkedList<>();
private String currentTime = TimeThread.getGMTTime();
/** All methods unused excepted scheduleWithFixedDelay. */
@@ -1214,12 +1214,12 @@
private final ServerSocket serverSocket;
- private final List<Action> actions = new LinkedList<Action>();
+ private final List<Action> actions = new LinkedList<>();
private Socket socket;
private volatile Exception e;
private Thread serverThread;
private final CountDownLatch stopLatch = new CountDownLatch(1);
- private final Queue<BlockAction> blockers = new LinkedList<BlockAction>();
+ private final Queue<BlockAction> blockers = new LinkedList<>();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java
index cd46f47..c557898 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java
@@ -362,10 +362,9 @@
buffer.append('x');
ByteString password = ByteString.valueOf(buffer.toString());
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("userpassword",
- buffer.toString())));
+ Attributes.create("userpassword", buffer.toString())));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -435,10 +434,9 @@
buffer.append('x');
ByteString password = ByteString.valueOf(buffer.toString());
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("userpassword",
- buffer.toString())));
+ Attributes.create("userpassword", buffer.toString())));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -510,10 +508,9 @@
buffer.append('x');
ByteString password = ByteString.valueOf(buffer.toString());
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("userpassword",
- buffer.toString())));
+ Attributes.create("userpassword", buffer.toString())));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -585,10 +582,9 @@
buffer.append('x');
ByteString password = ByteString.valueOf(buffer.toString());
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("userpassword",
- buffer.toString())));
+ Attributes.create("userpassword", buffer.toString())));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java
index 9899ae8..f5c9860 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java
@@ -1861,7 +1861,7 @@
private void applyPwdPolicyMods(InternalClientConnection conn, String pwPolDN, String attr, String value)
throws DirectoryException
{
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
value == null ? Attributes.empty(attr) : Attributes.create(attr, value)));
ModifyOperation modifyOperation = conn.processModify(DN.valueOf(pwPolDN), mods);
@@ -1869,13 +1869,10 @@
}
private void setPasswordChangedTime(InternalClientConnection conn, Entry userEntry) {
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("pwdchangedtime",
- "20050101000000.000Z")));
+ Attributes.create("pwdchangedtime", "20050101000000.000Z")));
ModifyOperation modifyOperation = conn.processModify(userEntry.getName(), mods);
assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
}
-
}
-
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java
index 61711f4..aa8bed8 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/PasswordStorageSchemeTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2010-2014 ForgeRock AS.
+ * Portions Copyright 2010-2015 ForgeRock AS.
*/
package org.opends.server.extensions;
@@ -323,7 +323,7 @@
String attr = "ds-cfg-allow-pre-encoded-passwords";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create(attr, String.valueOf(allowPreencoded))));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java
index 7e8b0cb..6eb4f68 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java
@@ -303,7 +303,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("password");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "password")));
@@ -372,7 +372,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("passsword");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "passsword")));
@@ -440,7 +440,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("passSword");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "passSword")));
@@ -509,7 +509,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("passSword");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "passSword")));
@@ -576,7 +576,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("aaaaaaaa");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "aaaaaaaa")));
@@ -644,7 +644,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("aaaaaaaa");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "aaaaaaaa")));
@@ -679,7 +679,7 @@
RepeatedCharactersPasswordValidatorCfgDefn.getInstance(),
updatedValidatorEntry);
- ArrayList<LocalizableMessage> unacceptableReasons = new ArrayList<LocalizableMessage>();
+ ArrayList<LocalizableMessage> unacceptableReasons = new ArrayList<>();
assertTrue(validator.isConfigurationChangeAcceptable(updatedConfiguration,
unacceptableReasons),
String.valueOf(unacceptableReasons));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SASLOverTLSTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SASLOverTLSTestCase.java
index 83e207b..8160a1f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SASLOverTLSTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SASLOverTLSTestCase.java
@@ -22,9 +22,8 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2011-2012 ForgeRock AS.
+ * Portions copyright 2011-2015 ForgeRock AS.
*/
-
package org.opends.server.extensions;
import java.io.IOException;
@@ -252,7 +251,7 @@
sslTest(int size, String qop) throws NamingException, IOException {
LdapContext ctx = null;
try {
- Hashtable<String, String> env = new Hashtable<String, String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
String url = "ldaps://localhost:" + TestCaseUtils.getServerLdapsPort();
env.put(Context.PROVIDER_URL, url);
@@ -290,7 +289,7 @@
public void startTLS(int size) throws NamingException, IOException {
LdapContext ctx = null;
try {
- Hashtable<String, String> env = new Hashtable<String, String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
String url = "ldap://localhost:" + TestCaseUtils.getServerLdapPort();
env.put(Context.PROVIDER_URL, url);
@@ -342,7 +341,7 @@
entryAttrs.put(cn);
entryAttrs.put(sn);
entryAttrs.put(aPwdPolicy);
- Hashtable<String, String> env = new Hashtable<String, String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
String url = "ldaps://localhost:" + TestCaseUtils.getServerLdapsPort();
env.put(Context.PROVIDER_URL, url);
@@ -385,7 +384,7 @@
private void deleteTestEntry() throws NamingException {
DirContext ctx = null;
try {
- Hashtable<String, String> env = new Hashtable<String, String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
String url = "ldaps://localhost:" + TestCaseUtils.getServerLdapsPort();
env.put(Context.PROVIDER_URL, url);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java
index 91361f0..685b39c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java
@@ -283,10 +283,9 @@
buffer.append('x');
ByteString password = ByteString.valueOf(buffer.toString());
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("userpassword",
- buffer.toString())));
+ Attributes.create("userpassword", buffer.toString())));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -352,17 +351,16 @@
validator.initializePasswordValidator(configuration);
StringBuilder buffer = new StringBuilder();
- HashSet<ByteString> currentPassword = new HashSet<ByteString>(3);
+ HashSet<ByteString> currentPassword = new HashSet<>(3);
currentPassword.add(ByteString.valueOf("xxx"));
for (int i=0; i < 7; i++)
{
buffer.append('x');
ByteString password = ByteString.valueOf(buffer.toString());
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("userpassword",
- buffer.toString())));
+ Attributes.create("userpassword", buffer.toString())));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SoftReferenceEntryCacheTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SoftReferenceEntryCacheTestCase.java
index 5b06fec..a0db365 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SoftReferenceEntryCacheTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SoftReferenceEntryCacheTestCase.java
@@ -86,7 +86,7 @@
super.cache.initializeEntryCache(configuration);
// Make some dummy test entries.
- super.testEntriesList = new ArrayList<Entry>(super.NUMTESTENTRIES);
+ super.testEntriesList = new ArrayList<>(super.NUMTESTENTRIES);
for(int i = 0; i < super.NUMTESTENTRIES; i++ ) {
super.testEntriesList.add(TestCaseUtils.makeEntry(
"dn: uid=test" + i + ".user" + i + ",ou=test" + i + ",o=test",
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapperTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapperTestCase.java
index 296f800..4f1fb6d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapperTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapperTestCase.java
@@ -741,7 +741,7 @@
Attributes.empty(DirectoryServer.getAttributeType(
"ds-cfg-subject-attribute-mapping"));
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.DELETE, a));
InternalClientConnection conn =
@@ -870,10 +870,9 @@
String mapperDN = "cn=Subject Attribute to User Attribute," +
"cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("ds-cfg-certificate-mapper",
- mapperDN)));
+ Attributes.create("ds-cfg-certificate-mapper", mapperDN)));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -896,10 +895,9 @@
String externalDN = "cn=EXTERNAL,cn=SASL Mechanisms,cn=config";
String mapperDN = "cn=Subject Equals DN,cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("ds-cfg-certificate-mapper",
- mapperDN)));
+ Attributes.create("ds-cfg-certificate-mapper", mapperDN)));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -937,9 +935,8 @@
}
}
- ArrayList<Modification> mods = new ArrayList<Modification>();
- mods.add(new Modification(ModificationType.REPLACE,
- builder.toAttribute()));
+ ArrayList<Modification> mods = new ArrayList<>();
+ mods.add(new Modification(ModificationType.REPLACE, builder.toAttribute()));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -978,9 +975,8 @@
}
}
- ArrayList<Modification> mods = new ArrayList<Modification>();
- mods.add(new Modification(ModificationType.REPLACE,
- builder.toAttribute()));
+ ArrayList<Modification> mods = new ArrayList<>();
+ mods.add(new Modification(ModificationType.REPLACE, builder.toAttribute()));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapperTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapperTestCase.java
index 2f23d7c..f0eb42d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapperTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapperTestCase.java
@@ -552,7 +552,7 @@
Attributes.empty(DirectoryServer.getAttributeType(
"ds-cfg-subject-attribute"));
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.DELETE, a));
InternalClientConnection conn =
@@ -606,10 +606,9 @@
String mapperDN =
"cn=Subject DN to User Attribute,cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("ds-cfg-certificate-mapper",
- mapperDN)));
+ Attributes.create("ds-cfg-certificate-mapper", mapperDN)));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -632,10 +631,9 @@
String externalDN = "cn=EXTERNAL,cn=SASL Mechanisms,cn=config";
String mapperDN = "cn=Subject Equals DN,cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("ds-cfg-certificate-mapper",
- mapperDN)));
+ Attributes.create("ds-cfg-certificate-mapper", mapperDN)));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -661,10 +659,9 @@
String mapperDN =
"cn=Subject DN to User Attribute,cn=Certificate Mappers,cn=config";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
- Attributes.create("ds-cfg-subject-attribute",
- attrName)));
+ Attributes.create("ds-cfg-subject-attribute", attrName)));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
@@ -703,7 +700,7 @@
}
}
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
builder.toAttribute()));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/TLSByteChannelTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/TLSByteChannelTestCase.java
index 73072e1..63af066 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/TLSByteChannelTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/TLSByteChannelTestCase.java
@@ -427,7 +427,7 @@
{
NodeList nodes =
(NodeList) xpath.evaluate(xPathExpr, doc, XPathConstants.NODESET);
- List<String> cipherStrings = new ArrayList<String>(nodes.getLength());
+ List<String> cipherStrings = new ArrayList<>(nodes.getLength());
for (int i = 0; i < nodes.getLength(); i++)
{
String cipherString = nodes.item(i).getNodeValue();
@@ -484,7 +484,7 @@
private Set<String> toSet(String[][] data)
{
- Set<String> set = new HashSet<String>();
+ Set<String> set = new HashSet<>();
for (String[] array : data)
{
for (String s : array)
@@ -514,8 +514,7 @@
@Test
public void checkNoUnknownOverlappingCiphers()
{
- List<String> ciphers =
- new ArrayList<String>(TLSByteChannel.CIPHER_MAP.keySet());
+ List<String> ciphers = new ArrayList<>(TLSByteChannel.CIPHER_MAP.keySet());
for (int i = 0; i < ciphers.size(); i++)
{
for (int j = 0; j < i; j++)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/TestAlertGenerator.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/TestAlertGenerator.java
index 11a65b2..5c84fb5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/TestAlertGenerator.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/TestAlertGenerator.java
@@ -107,7 +107,7 @@
/** {@inheritDoc} */
public LinkedHashMap<String,String> getAlerts()
{
- LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>();
+ LinkedHashMap<String,String> alerts = new LinkedHashMap<>();
alerts.put(alertType, alertDescription);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/TraditionalWorkQueueTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/TraditionalWorkQueueTestCase.java
index fc67323..504c5e4 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/TraditionalWorkQueueTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/TraditionalWorkQueueTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS
+ * Portions Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.extensions;
@@ -97,7 +97,7 @@
{
DN dn = DN.valueOf("cn=Work Queue,cn=config");
String attr = "ds-cfg-num-worker-threads";
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create(attr, "30")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java
index ed22eeb..6f82e05 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java
@@ -303,7 +303,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("password");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "password")));
@@ -372,7 +372,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("passw");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "passw")));
@@ -440,7 +440,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("pasSw");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "pasSw")));
@@ -509,7 +509,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("pasSw");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "pasSw")));
@@ -576,7 +576,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("aaaaaaaa");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "aaaaaaaa")));
@@ -644,7 +644,7 @@
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("aaaaaaaa");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "aaaaaaaa")));
@@ -679,7 +679,7 @@
UniqueCharactersPasswordValidatorCfgDefn.getInstance(),
updatedValidatorEntry);
- ArrayList<LocalizableMessage> unacceptableReasons = new ArrayList<LocalizableMessage>();
+ ArrayList<LocalizableMessage> unacceptableReasons = new ArrayList<>();
assertTrue(validator.isConfigurationChangeAcceptable(updatedConfiguration,
unacceptableReasons),
String.valueOf(unacceptableReasons));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java
index f7efed9..8ac1a55 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/VirtualStaticGroupTestCase.java
@@ -783,7 +783,7 @@
ByteString v = ByteString.valueOf(u4.toString());
assertTrue(a.contains(v));
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.ADD,
Attributes.create("memberurl",
"ldap:///o=test??sub?(objectClass=person)")));
@@ -824,7 +824,7 @@
InternalClientConnection conn = getRootConnection();
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-allow-retrieving-membership", "false")));
DN definitionDN =
@@ -844,7 +844,7 @@
assertTrue(a.contains(v));
- mods = new LinkedList<Modification>();
+ mods = new LinkedList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-allow-retrieving-membership", "true")));
modifyOperation = conn.processModify(definitionDN, mods);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java
index dae8800..c49cebf 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java
@@ -305,14 +305,13 @@
new LDAPAuthenticationHandler(reader, writer, "localhost",
nextMessageID);
- HashMap<String,List<String>> saslProperties =
- new HashMap<String,List<String>>(2);
+ HashMap<String,List<String>> saslProperties = new HashMap<>(2);
- ArrayList<String> authIDList = new ArrayList<String>(1);
+ ArrayList<String> authIDList = new ArrayList<>(1);
authIDList.add("dn:uid=proxy.user,o=test");
saslProperties.put("authID", authIDList);
- ArrayList<String> authzIDList = new ArrayList<String>(1);
+ ArrayList<String> authzIDList = new ArrayList<>(1);
authzIDList.add("dn:uid=test.user,o=test");
saslProperties.put("authzID", authzIDList);
@@ -395,7 +394,7 @@
// Use the "Who Am I?" operation again, this time with the proxy control.
ExtendedRequestProtocolOp extendedRequest =
new ExtendedRequestProtocolOp(OID_WHO_AM_I_REQUEST);
- ArrayList<Control> requestControls = new ArrayList<Control>(1);
+ ArrayList<Control> requestControls = new ArrayList<>(1);
requestControls.add(new ProxiedAuthV2Control(
ByteString.valueOf("dn:uid=test.user,o=test")));
LDAPMessage message = new LDAPMessage(nextMessageID.getAndIncrement(),
@@ -482,7 +481,7 @@
// Use the "Who Am I?" operation again, this time with the proxy control.
ExtendedRequestProtocolOp extendedRequest =
new ExtendedRequestProtocolOp(OID_WHO_AM_I_REQUEST);
- ArrayList<Control> requestControls = new ArrayList<Control>(1);
+ ArrayList<Control> requestControls = new ArrayList<>(1);
requestControls.add(new ProxiedAuthV2Control(
ByteString.valueOf("dn:uid=test.user,o=test")));
LDAPMessage message = new LDAPMessage(nextMessageID.getAndIncrement(),
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/loggers/AbstractTextAccessLogPublisherTest.java b/opendj-server-legacy/src/test/java/org/opends/server/loggers/AbstractTextAccessLogPublisherTest.java
index 9b727dd..e1858ac 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/loggers/AbstractTextAccessLogPublisherTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/loggers/AbstractTextAccessLogPublisherTest.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013-2014 ForgeRock AS
+ * Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.loggers;
@@ -424,6 +424,6 @@
private <T> SortedSet<T> setOf(final T... values)
{
- return new TreeSet<T>(Arrays.asList(values));
+ return new TreeSet<>(Arrays.asList(values));
}
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java
index bc27aea..f996235 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/AttributeCleanupPluginTestCase.java
@@ -252,13 +252,13 @@
* cn: Name Surname
* sn: Surname
*/
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("top"));
values.add(ByteString.valueOf("person"));
values.add(ByteString.valueOf("organizationalperson"));
values.add(ByteString.valueOf("inetorgperson"));
- List<RawAttribute> rawAttributes = new ArrayList<RawAttribute>();
+ List<RawAttribute> rawAttributes = new ArrayList<>();
rawAttributes.add(RawAttribute.create("objectClass", values));
rawAttributes.add(RawAttribute.create("uid", "test"));
rawAttributes.add(RawAttribute.create("cn", "Name Surname"));
@@ -350,13 +350,13 @@
* createTimeStamp: 2011091212400000Z
*/
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("top"));
values.add(ByteString.valueOf("person"));
values.add(ByteString.valueOf("organizationalperson"));
values.add(ByteString.valueOf("inetorgperson"));
- List<RawAttribute> rawAttributes = new ArrayList<RawAttribute>();
+ List<RawAttribute> rawAttributes = new ArrayList<>();
rawAttributes.add(RawAttribute.create("objectClass", values));
rawAttributes.add(RawAttribute.create("uid", "test"));
@@ -447,7 +447,7 @@
* -
*/
- List<RawModification> rawMods= new ArrayList<RawModification>();
+ List<RawModification> rawMods= new ArrayList<>();
rawMods.add(RawModification.create(ModificationType.REPLACE,
"modifyTimeStamp",
@@ -527,7 +527,7 @@
* -
*/
- List<RawModification> rawMods= new ArrayList<RawModification>();
+ List<RawModification> rawMods= new ArrayList<>();
rawMods.add(RawModification.create(ModificationType.REPLACE,
"cn",
@@ -621,7 +621,7 @@
* replace: modifyTimeStamp
* modifyTimeStamp: 2011091212400000Z
*/
- List<RawModification> rawMods= new ArrayList<RawModification>();
+ List<RawModification> rawMods= new ArrayList<>();
rawMods.add(RawModification.create(ModificationType.REPLACE,
"cn",
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java
index 3168921..fdd2eb4 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java
@@ -365,7 +365,7 @@
*/
public static List<Control> createDelayControlList(long delay)
{
- ArrayList<Control> controlList = new ArrayList<Control>(1);
+ ArrayList<Control> controlList = new ArrayList<>(1);
controlList.add(new DelayRequestControl(false, delay));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java
index 75f6f1d..89ccb1e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java
@@ -725,7 +725,7 @@
*/
public static List<Control> createDisconnectControlList(String section)
{
- ArrayList<Control> controlList = new ArrayList<Control>(1);
+ ArrayList<Control> controlList = new ArrayList<>(1);
controlList.add(new DisconnectClientControl(false, section));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/EntryUUIDPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/EntryUUIDPluginTestCase.java
index fe41a21..228602e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/EntryUUIDPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/EntryUUIDPluginTestCase.java
@@ -188,7 +188,7 @@
public Object[][] getInvalidConfigs()
throws Exception
{
- ArrayList<Entry> entries = new ArrayList<Entry>();
+ ArrayList<Entry> entries = new ArrayList<>();
for (String s : PluginType.getPluginTypeNames())
{
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/LDAPADListPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/LDAPADListPluginTestCase.java
index 984f215..c9eb3e7 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/LDAPADListPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/LDAPADListPluginTestCase.java
@@ -134,7 +134,7 @@
@DataProvider(name = "invalidConfigs")
public Object[][] getInvalidConfigs() throws Exception
{
- ArrayList<Entry> entries = new ArrayList<Entry>();
+ ArrayList<Entry> entries = new ArrayList<>();
Entry e = TestCaseUtils.makeEntry(
"dn: cn=LDAP Attribute Description List,cn=Plugins,cn=config",
"objectClass: top",
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java
index 5722da4..09e2898 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java
@@ -212,7 +212,7 @@
public Object[][] getInvalidConfigs()
throws Exception
{
- ArrayList<Entry> entries = new ArrayList<Entry>();
+ ArrayList<Entry> entries = new ArrayList<>();
for (String s : PluginType.getPluginTypeNames())
{
@@ -302,7 +302,7 @@
{
TestCaseUtils.initializeTestBackend(true);
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("description", "foo")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/PasswordPolicyImportPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/PasswordPolicyImportPluginTestCase.java
index 34acf2d..4d6f5e6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/PasswordPolicyImportPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/PasswordPolicyImportPluginTestCase.java
@@ -184,7 +184,7 @@
public Object[][] getInvalidConfigs()
throws Exception
{
- ArrayList<Entry> entries = new ArrayList<Entry>();
+ ArrayList<Entry> entries = new ArrayList<>();
for (String s : PluginType.getPluginTypeNames())
{
if (s.equalsIgnoreCase("ldifimport"))
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
index f99bc1b..88bc571 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
@@ -23,7 +23,7 @@
*
* Copyright 2008-2010 Sun Microsystems, Inc.
* Portions copyright 2011 profiq s.r.o.
- * Portions Copyright 2014 ForgeRock AS
+ * Portions Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.plugins;
@@ -1031,7 +1031,7 @@
*/
private ModifyOperation
addAttrEntry(DN dn, String attrTypeString, String... attrValStrings) {
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
AttributeType attrType = getAttrType(attrTypeString);
AttributeBuilder builder = new AttributeBuilder(attrType, attrTypeString);
for(String valString : attrValStrings) {
@@ -1053,7 +1053,7 @@
*/
private ModifyOperation
replaceAttrEntry(DN dn, String attrTypeString, String... attrValStrings) {
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
AttributeType attrType = getAttrType(attrTypeString);
AttributeBuilder builder = new AttributeBuilder(attrType, attrTypeString);
for(String valString : attrValStrings) {
@@ -1078,7 +1078,7 @@
*/
private void
deleteAttrsEntry(DN dn, String... attrTypeStrings) throws Exception {
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
for(String attrTypeString : attrTypeStrings) {
AttributeType attrType = getAttrType(attrTypeString);
mods.add(new Modification(ModificationType.DELETE,
@@ -1119,7 +1119,7 @@
InternalClientConnection conn = getRootConnection();
SubtreeDeleteControl control = new SubtreeDeleteControl(true);
- List<Control> controls = new ArrayList<Control>(1);
+ List<Control> controls = new ArrayList<>(1);
controls.add(control);
for (String dn : dns)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/SambaPasswordPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/SambaPasswordPluginTestCase.java
index 41eedd5..005f03e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/SambaPasswordPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/SambaPasswordPluginTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2011-2012 profiq s.r.o.
- * Portions Copyright 2011-2014 ForgeRock AS.
+ * Portions Copyright 2011-2015 ForgeRock AS.
*/
package org.opends.server.plugins;
@@ -139,9 +139,8 @@
* Samba administrative user needs a permission to manipulate user accounts.
* Hence, we add a very permissive ACI.
*/
- InternalClientConnection conn = InternalClientConnection
- .getRootConnection();
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ InternalClientConnection conn = InternalClientConnection.getRootConnection();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.ADD, Attributes.create("aci",
"(target=\"ldap:///uid=*,o=test\")(targetattr=\"*\")"
@@ -221,10 +220,9 @@
TestCaseUtils.addEntry(testEntry);
// Perform the modify operation
- InternalClientConnection conn = InternalClientConnection
- .getRootConnection();
+ InternalClientConnection conn = InternalClientConnection.getRootConnection();
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.REPLACE, Attributes.create(
"userPassword", "password")));
@@ -301,7 +299,7 @@
InternalClientConnection conn = new InternalClientConnection(authInfo);
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.REPLACE, Attributes.create(
"userPassword", "password")));
@@ -348,7 +346,7 @@
InternalClientConnection conn = new InternalClientConnection(authInfo);
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.REPLACE, Attributes.create(
"userPassword", "password1")));
@@ -398,7 +396,7 @@
InternalClientConnection conn = InternalClientConnection
.getRootConnection();
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.ADD, Attributes.create(
"userPassword", "password1")));
@@ -707,7 +705,7 @@
InternalClientConnection conn = InternalClientConnection
.getRootConnection();
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.REPLACE, Attributes.create(
"userPassword", "password")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java
index 5a2bf3b..bed7547 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java
@@ -666,16 +666,13 @@
public static List<Control> createShortCircuitControlList(int resultCode,
String section)
{
- ArrayList<Control> controlList = new ArrayList<Control>(1);
+ ArrayList<Control> controlList = new ArrayList<>(1);
controlList.add(createShortCircuitControl(resultCode, section));
return controlList;
}
- /**
- * Registered short circuits for operations regardless of controls.
- */
- private static Map<String,Integer> shortCircuits =
- new ConcurrentHashMap<String, Integer>();
+ /** Registered short circuits for operations regardless of controls. */
+ private static Map<String, Integer> shortCircuits = new ConcurrentHashMap<>();
/**
* Register a short circuit for the given operation type and plugin point.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java
index c2d22ba..c01d49e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java
@@ -386,9 +386,8 @@
@Test
public void testModOperationNameContexts() throws Exception {
replaceAttrInEntry(uidConfigDN,dsConfigAttrType,"mail");
- LinkedList<Modification> mods = new LinkedList<Modification>();
- addMods(mods,"mail",ModificationType.REPLACE,"userx@test","userxx@test",
- "user1t@test");
+ LinkedList<Modification> mods = new LinkedList<>();
+ addMods(mods,"mail",ModificationType.REPLACE,"userx@test","userxx@test", "user1t@test");
//Fail because user1t@test already exists under "o=people,o=test".
doMods(mods, DN.valueOf("uid=5user.5,ou=People,o=test"),
ResultCode.CONSTRAINT_VIOLATION);
@@ -401,8 +400,7 @@
ResultCode.CONSTRAINT_VIOLATION);
mods.clear();
addMods(mods,"pager",ModificationType.ADD,"2-999-1234","1-999-5678");
- addMods(mods,"mail",ModificationType.REPLACE,"userx@test","userxx@test",
- "user1t@test");
+ addMods(mods,"mail",ModificationType.REPLACE,"userx@test","userxx@test", "user1t@test");
//Ok because adding mail value user1t@test to entry that already
//contains mail value user1t@test.
doMods(mods, DN.valueOf("uid=1user.1,ou=People,o=test"),
@@ -730,7 +728,7 @@
*/
private void
deleteAttrsFromEntry(DN dn, String... attrTypeStrings) throws Exception {
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
for(String attrTypeString : attrTypeStrings) {
AttributeType attrType = getAttrType(attrTypeString);
mods.add(new Modification(ModificationType.DELETE,
@@ -743,7 +741,7 @@
private void
replaceAttrInEntry(DN dn, String attrTypeString, String... attrValStrings) {
- LinkedList<Modification> mods = new LinkedList<Modification>();
+ LinkedList<Modification> mods = new LinkedList<>();
AttributeType attrType = getAttrType(attrTypeString);
AttributeBuilder builder = new AttributeBuilder(attrType, attrTypeString);
for(String valString : attrValStrings) {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/UpdatePreOpPlugin.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/UpdatePreOpPlugin.java
index 49f3d12..9680bf9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/UpdatePreOpPlugin.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/UpdatePreOpPlugin.java
@@ -121,11 +121,11 @@
// We assume that there is only one of these active at a time.
instance = this;
- setAttributes = new ArrayList<Attribute>();
- removeAttributes = new ArrayList<AttributeType>();
- addObjectClasses = new ArrayList<ObjectClass>();
- removeObjectClasses = new ArrayList<ObjectClass>();
- modifications = new ArrayList<Modification>();
+ setAttributes = new ArrayList<>();
+ removeAttributes = new ArrayList<>();
+ addObjectClasses = new ArrayList<>();
+ removeObjectClasses = new ArrayList<>();
+ modifications = new ArrayList<>();
}
@@ -142,7 +142,7 @@
for (Attribute a : setAttributes)
{
- ArrayList<Attribute> attrList = new ArrayList<Attribute>(1);
+ ArrayList<Attribute> attrList = new ArrayList<>(1);
attrList.add(a);
addOperation.setAttribute(a.getAttributeType(), attrList);
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
index c9a4482..fe1e2c0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
@@ -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.protocols.internal;
@@ -312,14 +312,14 @@
ByteString dn = ByteString.valueOf("cn=test,o=test");
- ArrayList<RawAttribute> attrs = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> attrs = new ArrayList<>();
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("top"));
values.add(ByteString.valueOf("device"));
attrs.add(new LDAPAttribute("objectClass", values));
- values = new ArrayList<ByteString>();
+ values = new ArrayList<>();
values.add(ByteString.valueOf("test"));
attrs.add(new LDAPAttribute("cn", values));
@@ -559,10 +559,10 @@
"objectClass: device",
"cn: test");
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
values.add(ByteString.valueOf("This is a test"));
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
+ ArrayList<RawModification> mods = new ArrayList<>();
mods.add(new LDAPModification(ModificationType.REPLACE,
new LDAPAttribute("description", values)));
@@ -590,7 +590,7 @@
"objectClass: device",
"cn: test");
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("description", "This is a test")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java
index 86f23a1..6945fc0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS
+ * Portions Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.protocols.internal;
@@ -105,7 +105,7 @@
assertEquals(message.getBindResponseProtocolOp().getResultCode(), 0);
- ArrayList<RawAttribute> attrList = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> attrList = new ArrayList<>();
attrList.add(RawAttribute.create("objectClass", "organization"));
attrList.add(RawAttribute.create("o", "test"));
@@ -139,7 +139,7 @@
assertFalse(DirectoryServer.entryExists(DN.valueOf("o=test")));
- Hashtable<String,String> env = new Hashtable<String,String>();
+ Hashtable<String,String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.ldap.factory.socket",
@@ -228,7 +228,7 @@
assertTrue(DirectoryServer.entryExists(DN.valueOf("o=test")));
- Hashtable<String,String> env = new Hashtable<String,String>();
+ Hashtable<String,String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.ldap.factory.socket",
@@ -312,7 +312,7 @@
assertTrue(DirectoryServer.entryExists(DN.valueOf("o=test")));
- Hashtable<String,String> env = new Hashtable<String,String>();
+ Hashtable<String,String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.ldap.factory.socket",
@@ -403,9 +403,8 @@
assertEquals(message.getBindResponseProtocolOp().getResultCode(), 0);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
- mods.add(RawModification.create(ModificationType.REPLACE, "description",
- "foo"));
+ ArrayList<RawModification> mods = new ArrayList<>();
+ mods.add(RawModification.create(ModificationType.REPLACE, "description", "foo"));
ModifyRequestProtocolOp modifyRequest =
new ModifyRequestProtocolOp(ByteString.valueOf("o=test"), mods);
@@ -436,7 +435,7 @@
assertTrue(DirectoryServer.entryExists(DN.valueOf("o=test")));
- Hashtable<String,String> env = new Hashtable<String,String>();
+ Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.ldap.factory.socket",
@@ -450,8 +449,7 @@
ModificationItem[] mods =
{
- new ModificationItem(DirContext.REPLACE_ATTRIBUTE,
- new BasicAttribute("description", "foo"))
+ new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("description", "foo"))
};
context.modifyAttributes("o=test", mods);
@@ -534,7 +532,7 @@
assertFalse(DirectoryServer.entryExists(DN.valueOf("ou=Users,o=test")));
- Hashtable<String,String> env = new Hashtable<String,String>();
+ Hashtable<String,String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.ldap.factory.socket",
@@ -622,7 +620,7 @@
assertTrue(DirectoryServer.entryExists(DN.valueOf("o=test")));
- Hashtable<String,String> env = new Hashtable<String,String>();
+ Hashtable<String,String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.ldap.factory.socket",
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/TestInternalSearchListener.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/TestInternalSearchListener.java
index 6390bbf..09e0d4c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/TestInternalSearchListener.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/TestInternalSearchListener.java
@@ -56,8 +56,8 @@
*/
public TestInternalSearchListener()
{
- searchEntries = new ArrayList<SearchResultEntry>();
- searchReferences = new ArrayList<SearchResultReference>();
+ searchEntries = new ArrayList<>();
+ searchReferences = new ArrayList<>();
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxConnectTest.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxConnectTest.java
index 27ccd6f..9d40d04 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxConnectTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxConnectTest.java
@@ -476,7 +476,7 @@
private void configureJmx(Entry entry) throws Exception {
- ArrayList<LocalizableMessage> reasons = new ArrayList<LocalizableMessage>();
+ ArrayList<LocalizableMessage> reasons = new ArrayList<>();
// Get the Jmx connection handler from the core server
JmxConnectionHandler jmxConnectionHandler = getJmxConnectionHandler();
@@ -502,7 +502,7 @@
*/
private OpendsJmxConnector connect(String user, String password, int jmxPort)
throws MalformedURLException, IOException {
- Map<String, Object> env = new HashMap<String, Object>();
+ Map<String, Object> env = new HashMap<>();
// Provide the credentials required by the server to successfully
// perform user authentication
@@ -536,7 +536,7 @@
*/
private OpendsJmxConnector sslConnect(String user, String password,
long jmxPort) throws Exception {
- Map<String, Object> env = new HashMap<String, Object>();
+ Map<String, Object> env = new HashMap<>();
// Provide the credentials required by the server to successfully
// perform user authentication
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
index cb08ba5..ae22f89 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
@@ -219,9 +219,8 @@
// Build the array of connections we will use to perform the tests.
JmxConnectionHandler jmxCtx = getJmxConnectionHandler();
- ArrayList<JmxClientConnection> connList =
- new ArrayList<JmxClientConnection>();
- ArrayList<Boolean> successList = new ArrayList<Boolean>();
+ ArrayList<JmxClientConnection> connList = new ArrayList<>();
+ ArrayList<Boolean> successList = new ArrayList<>();
String userDN ;
Entry userEntry ;
AuthenticationInfo authInfo;
@@ -381,7 +380,7 @@
{
OpendsJmxConnector opendsConnector;
int jmxPort = TestCaseUtils.getServerJmxPort() ;
- HashMap<String, Object> env = new HashMap<String, Object>();
+ HashMap<String, Object> env = new HashMap<>();
String user = "cn=Unprivileged JMX Root,cn=Root DNs,cn=config";
String password = "password";
String[] credentials = new String[] { user, password };
@@ -407,7 +406,7 @@
// Add JMX_READ privilege
InternalClientConnection rootConnection = getRootConnection();
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.ADD, Attributes.create(
"ds-privilege-name", "jmx-read")));
ModifyOperation modifyOperation =
@@ -430,7 +429,7 @@
}
// remove JMX_READ privilege
- mods = new ArrayList<Modification>();
+ mods = new ArrayList<>();
mods.add(new Modification(ModificationType.DELETE,
Attributes.create("ds-privilege-name", "jmx-read")));
modifyOperation =
@@ -578,7 +577,7 @@
"givenName: ProxyV1",
"sn: Test");
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new ProxiedAuthV1Control(
DN.valueOf("cn=PWReset Target,o=test")));
@@ -605,7 +604,7 @@
// Try to modify the entry to add a description.
- ArrayList<Modification> mods = new ArrayList<Modification>(1);
+ ArrayList<Modification> mods = new ArrayList<>(1);
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("description", "foo")));
@@ -693,7 +692,7 @@
boolean hasProxyPrivilege = conn.hasPrivilege(Privilege.PROXIED_AUTH, null);
DN targetDN = DN.valueOf("cn=PWReset Target,o=test");
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new ProxiedAuthV1Control(targetDN));
@@ -764,7 +763,7 @@
"givenName: ProxyV2",
"sn: Test");
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new ProxiedAuthV2Control(
ByteString.valueOf("dn:cn=PWReset Target,o=test")));
@@ -794,7 +793,7 @@
// Try to modify the entry to add a description.
- ArrayList<Modification> mods = new ArrayList<Modification>(1);
+ ArrayList<Modification> mods = new ArrayList<>(1);
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("description", "foo")));
@@ -889,7 +888,7 @@
boolean hasProxyPrivilege = conn.hasPrivilege(Privilege.PROXIED_AUTH, null);
DN targetDN = DN.valueOf("cn=PWReset Target,o=test");
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new ProxiedAuthV2Control(ByteString.valueOf("dn:" + targetDN)));
@@ -969,7 +968,7 @@
// Modify the user entry to add the JMX_READ privilege and verify that
// the client connection reflects that.
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.ADD,
Attributes.create("ds-privilege-name", "jmx-read")));
ModifyOperation modifyOperation = rootConnection.processModify(dn, mods);
@@ -1016,7 +1015,7 @@
// Update the set of root privileges to include proxied auth.
InternalClientConnection conn = getRootConnection();
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.ADD,
Attributes.create("ds-cfg-default-root-privilege-name",
"proxied-auth")));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxTestCase.java
index ff423a0..980072f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS.
+ * Portions Copyright 2013-2015 ForgeRock AS.
*/
package org.opends.server.protocols.jmx;
@@ -122,7 +122,7 @@
*/
private void enableJmx() throws Exception
{
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
InternalClientConnection conn = InternalClientConnection
.getRootConnection();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/PostConnectedDisconnectTest.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/PostConnectedDisconnectTest.java
index 5d6b969..8bc6b20 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/PostConnectedDisconnectTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/PostConnectedDisconnectTest.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.protocols.jmx;
@@ -116,9 +116,8 @@
int postDisconnectBefore = InvocationCounterPlugin.getPostDisconnectCount();
// Create a new client connection
- HashMap<String, Object> env = new HashMap<String, Object>();
- String[] credentials = new String[] { "cn=Privileged User,o=test",
- "password" };
+ HashMap<String, Object> env = new HashMap<>();
+ String[] credentials = new String[] { "cn=Privileged User,o=test", "password" };
env.put("jmx.remote.credentials", credentials);
env.put("jmx.remote.x.client.connection.check.period",0);
OpendsJmxConnector opendsConnector = new OpendsJmxConnector("localhost",
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java
index 2c92926..f215900 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java
@@ -256,7 +256,7 @@
message = r.readMessage();
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), 0);
- ArrayList<RawAttribute> addAttrs = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> addAttrs = new ArrayList<>();
addAttrs.add(RawAttribute.create("objectClass", "inetOrgPerson"));
addAttrs.add(RawAttribute.create("uid", "user.7"));
addAttrs.add(RawAttribute.create("cn", "user 7"));
@@ -277,7 +277,7 @@
assertEquals(addResponse.getResultCode(),0);
//Create a SEARCH request to search for this added entry.
- LinkedHashSet<String> attrs = new LinkedHashSet<String>();
+ LinkedHashSet<String> attrs = new LinkedHashSet<>();
//Request only the interesting attributes.
attrs.add("sn");
attrs.add("userCertificate;binary");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
index f1ec59e..c0f9046 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LDAPv2TestCase.java
@@ -186,14 +186,13 @@
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), 0);
- ArrayList<RawAttribute> addAttrs = new ArrayList<RawAttribute>();
+ ArrayList<RawAttribute> addAttrs = new ArrayList<>();
addAttrs.add(RawAttribute.create("objectClass", "organizationalUnit"));
addAttrs.add(RawAttribute.create("ou", "People"));
AddRequestProtocolOp addRequest =
- new AddRequestProtocolOp(ByteString.valueOf("ou=People,o=test"),
- addAttrs);
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ new AddRequestProtocolOp(ByteString.valueOf("ou=People,o=test"), addAttrs);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
message = new LDAPMessage(2, addRequest, controls);
w.writeMessage(message);
@@ -231,7 +230,7 @@
new BindRequestProtocolOp(
ByteString.valueOf("cn=Directory Manager"), 2,
ByteString.valueOf("password"));
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
LDAPMessage message = new LDAPMessage(1, bindRequest, controls);
w.writeMessage(message);
@@ -279,7 +278,7 @@
CompareRequestProtocolOp compareRequest =
new CompareRequestProtocolOp(ByteString.valueOf("o=test"),
"o", ByteString.valueOf("test"));
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
message = new LDAPMessage(2, compareRequest, controls);
w.writeMessage(message);
@@ -328,7 +327,7 @@
DeleteRequestProtocolOp deleteRequest =
new DeleteRequestProtocolOp(ByteString.valueOf("o=test"));
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
message = new LDAPMessage(2, deleteRequest, controls);
w.writeMessage(message);
@@ -375,13 +374,12 @@
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), 0);
- ArrayList<RawModification> mods = new ArrayList<RawModification>();
- mods.add(RawModification.create(ModificationType.REPLACE,
- "description", "foo"));
+ ArrayList<RawModification> mods = new ArrayList<>();
+ mods.add(RawModification.create(ModificationType.REPLACE, "description", "foo"));
ModifyRequestProtocolOp modifyRequest =
new ModifyRequestProtocolOp(ByteString.valueOf("o=test"), mods);
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
message = new LDAPMessage(2, modifyRequest, controls);
w.writeMessage(message);
@@ -431,7 +429,7 @@
ModifyDNRequestProtocolOp modifyDNRequest =
new ModifyDNRequestProtocolOp(ByteString.valueOf("o=test"),
ByteString.valueOf("cn=test"), false);
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
message = new LDAPMessage(2, modifyDNRequest, controls);
w.writeMessage(message);
@@ -483,7 +481,7 @@
SearchScope.BASE_OBJECT,
DereferenceAliasesPolicy.NEVER, 0, 0, false,
LDAPFilter.objectClassPresent(), null);
- ArrayList<Control> controls = new ArrayList<Control>(1);
+ ArrayList<Control> controls = new ArrayList<>(1);
controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
message = new LDAPMessage(2, searchRequest, controls);
w.writeMessage(message);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java
index 4b2e342..04902a6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS
+ * Portions Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.protocols.ldap;
@@ -92,11 +92,11 @@
int numValues,
String prefix)
{
- List<RawAttribute> attributes = new ArrayList<RawAttribute>();
+ List<RawAttribute> attributes = new ArrayList<>();
for (int i = 0; i < numAttributes; i++)
{
- ArrayList<ByteString> values = new ArrayList<ByteString>();
+ ArrayList<ByteString> values = new ArrayList<>();
for (int j = 0; j < numValues; j++)
{
values.add(ByteString.valueOf(prefix + "Value" + i + "." + j));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
index 374d01b..ecaaae6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
@@ -130,7 +130,7 @@
//Test to make sure the constructor with result code, message, dn, and
//referral params works.
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -261,7 +261,7 @@
AddResponseProtocolOp addEncoded;
AddResponseProtocolOp addDecoded;
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -292,7 +292,7 @@
assertEquals(addDecoded.getMatchedDN(), null);
//Test case for a full empty referral url param.
- ArrayList<String> emptyReferralURLs = new ArrayList<String>();
+ ArrayList<String> emptyReferralURLs = new ArrayList<>();
addEncoded = new AddResponseProtocolOp(resultCode, resultMsg, dn,
emptyReferralURLs);
builder.clear();
@@ -366,7 +366,7 @@
StringBuilder buffer = new StringBuilder();
StringBuilder key = new StringBuilder();
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java
index e22ce0c..5adc7e2 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java
@@ -71,7 +71,7 @@
@Test
public void testBindRequestToString() throws Exception
{
- List<String> referralURLs=new ArrayList<String>();
+ List<String> referralURLs = new ArrayList<>();
referralURLs.add(url);
DN responseDn = DN.valueOf(dn);
ByteString serverSASLCredentials =
@@ -173,7 +173,7 @@
@Test
public void testBindResponseEncodeDecode() throws Exception {
- List<String> referralURLs=new ArrayList<String>();
+ List<String> referralURLs=new ArrayList<>();
referralURLs.add(url);
DN responseDn = DN.valueOf(dn);
ByteString serverSASLCredentials =
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
index 37e3076..d43d77c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
@@ -129,7 +129,7 @@
//Test to make sure the constructor with result code, message, dn, and
//referral params works.
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -260,7 +260,7 @@
CompareResponseProtocolOp deleteEncoded;
CompareResponseProtocolOp deleteDecoded;
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -294,7 +294,7 @@
assertEquals(deleteDecoded.getMatchedDN(), null);
//Test case for a full empty referral url param.
- ArrayList<String> emptyReferralURLs = new ArrayList<String>();
+ ArrayList<String> emptyReferralURLs = new ArrayList<>();
deleteEncoded = new CompareResponseProtocolOp(resultCode, resultMsg, dn,
emptyReferralURLs);
builder.clear();
@@ -328,7 +328,7 @@
StringBuilder buffer = new StringBuilder();
StringBuilder key = new StringBuilder();
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -358,7 +358,7 @@
StringBuilder buffer = new StringBuilder();
StringBuilder key = new StringBuilder();
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
index a0fc89c..ca34477 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
@@ -131,7 +131,7 @@
//Test to make sure the constructor with result code, message, dn, and
//referral params works.
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -262,7 +262,7 @@
DeleteResponseProtocolOp deleteEncoded;
DeleteResponseProtocolOp deleteDecoded;
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -296,7 +296,7 @@
assertEquals(deleteDecoded.getMatchedDN(), null);
//Test case for a full empty referral url param.
- ArrayList<String> emptyReferralURLs = new ArrayList<String>();
+ ArrayList<String> emptyReferralURLs = new ArrayList<>();
deleteEncoded = new DeleteResponseProtocolOp(resultCode, resultMsg, dn,
emptyReferralURLs);
builder.clear();
@@ -358,7 +358,7 @@
StringBuilder buffer = new StringBuilder();
StringBuilder key = new StringBuilder();
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
index f6a45d3..0ab67b7 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
@@ -314,7 +314,7 @@
GoodHandlerEntry.addAttribute(a13, null);
GoodHandlerEntry.addAttribute(a14, null);
GoodHandlerEntry.addAttribute(a15, null);
- List<LocalizableMessage> reasons = new LinkedList<LocalizableMessage>();
+ List<LocalizableMessage> reasons = new LinkedList<>();
LDAPConnectionHandlerCfg config = LdapTestCase.getConfiguration(GoodHandlerEntry);
//see if we're ok
boolean ret=LDAPConnHandler.isConfigurationChangeAcceptable(config, reasons);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java
index dd43f14..601afb4 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPFilter.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.opends.server.protocols.ldap;
@@ -90,8 +90,8 @@
ByteString.valueOf("\\test*(Value)"));
LDAPFilter presense = LDAPFilter.createPresenceFilter("login");
- ArrayList<ByteString> any = new ArrayList<ByteString>(0);
- ArrayList<ByteString> multiAny = new ArrayList<ByteString>(1);
+ ArrayList<ByteString> any = new ArrayList<>(0);
+ ArrayList<ByteString> multiAny = new ArrayList<>(1);
multiAny.add(ByteString.valueOf("\\wid*(get)"));
multiAny.add(ByteString.valueOf("*"));
@@ -136,13 +136,13 @@
ByteString.valueOf("\\John* (Doe)"),
false);
- ArrayList<RawFilter> list1 = new ArrayList<RawFilter>();
+ ArrayList<RawFilter> list1 = new ArrayList<>();
list1.add(equal);
list1.add(approx);
LDAPFilter and = LDAPFilter.createANDFilter(list1);
- ArrayList<RawFilter> list2 = new ArrayList<RawFilter>();
+ ArrayList<RawFilter> list2 = new ArrayList<>();
list2.add(substring1);
list2.add(extensible1);
list2.add(and);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
index 0c6771e..23f5270 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
@@ -135,7 +135,7 @@
//Test to make sure the constructor with result code, message, dn, and
//referral params works.
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -266,7 +266,7 @@
ModifyDNResponseProtocolOp deleteEncoded;
ModifyDNResponseProtocolOp deleteDecoded;
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -300,7 +300,7 @@
assertEquals(deleteDecoded.getMatchedDN(), null);
//Test case for a full empty referral url param.
- ArrayList<String> emptyReferralURLs = new ArrayList<String>();
+ ArrayList<String> emptyReferralURLs = new ArrayList<>();
deleteEncoded = new ModifyDNResponseProtocolOp(resultCode, resultMsg, dn,
emptyReferralURLs);
builder.clear();
@@ -363,7 +363,7 @@
StringBuilder buffer = new StringBuilder();
StringBuilder key = new StringBuilder();
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java
index ab39393..9f6e33a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS
+ * Portions Copyright 2013-2015 ForgeRock AS
*/
package org.opends.server.protocols.ldap;
@@ -87,7 +87,7 @@
private List<RawModification> generateModifications(int numAttributes,
String prefix)
{
- List<RawModification> modifies = new ArrayList<RawModification>();
+ List<RawModification> modifies = new ArrayList<>();
ModificationType modificationType;
for(int i = 0; i < numAttributes; i++)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
index 0b6d934..dca09e2 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
@@ -131,7 +131,7 @@
//Test to make sure the constructor with result code, message, dn, and
//referral params works.
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -262,7 +262,7 @@
ModifyResponseProtocolOp modifyEncoded;
ModifyResponseProtocolOp modifyDecoded;
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
@@ -296,7 +296,7 @@
assertEquals(modifyDecoded.getMatchedDN(), null);
//Test case for a full empty referral url param.
- ArrayList<String> emptyReferralURLs = new ArrayList<String>();
+ ArrayList<String> emptyReferralURLs = new ArrayList<>();
modifyEncoded = new ModifyResponseProtocolOp(resultCode, resultMsg, dn,
emptyReferralURLs);
builder.clear();
@@ -359,7 +359,7 @@
StringBuilder buffer = new StringBuilder();
StringBuilder key = new StringBuilder();
- ArrayList<String> referralURLs = new ArrayList<String>();
+ ArrayList<String> referralURLs = new ArrayList<>();
referralURLs.add("ds1.example.com");
referralURLs.add("ds2.example.com");
referralURLs.add("ds3.example.com");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java
index c69e882..c8d5e65 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestSearchProtocolOp.java
@@ -56,7 +56,7 @@
private int timeLimit = Integer.MAX_VALUE;
private boolean typesOnly = true;
private LDAPFilter filter = LDAPFilter.objectClassPresent();
- private LinkedHashSet<String> attributes = new LinkedHashSet<String>(
+ private LinkedHashSet<String> attributes = new LinkedHashSet<>(
Arrays.asList("description", "cn", "cn;optionA"));
/**
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/DependencyTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/DependencyTest.java
index f7ee69e..b7a4332 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/DependencyTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/DependencyTest.java
@@ -170,7 +170,7 @@
}
// configure and start replication of TEST_ROOT_DN_STRING on the server
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
replServers.add("localhost:"+replServerPort);
DomainFakeCfg domainConf = new DomainFakeCfg(baseDN, serverId, replServers);
domainConf.setHeartbeatInterval(100000);
@@ -273,7 +273,7 @@
replServer = new ReplicationServer(conf);
// configure and start replication of TEST_ROOT_DN_STRING on the server
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
replServers.add("localhost:"+replServerPort);
DomainFakeCfg domainConf = new DomainFakeCfg(baseDN, serverId, replServers);
domainConf.setHeartbeatInterval(100000);
@@ -442,7 +442,7 @@
}
// configure and start replication of TEST_ROOT_DN_STRING on the server
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
replServers.add("localhost:"+replServerPort);
DomainFakeCfg domainConf = new DomainFakeCfg(baseDN, serverId, replServers);
domain = MultimasterReplication.createNewDomain(domainConf);
@@ -552,7 +552,7 @@
}
// configure and start replication of TEST_ROOT_DN_STRING on the server
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
replServers.add("localhost:"+replServerPort);
DomainFakeCfg domainConf = new DomainFakeCfg(baseDN, serverId, replServers);
domain = MultimasterReplication.createNewDomain(domainConf);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
index 1f8478b..73ac230 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
@@ -328,7 +328,7 @@
private ReplicationServer createReplicationServer(int replServerId,
boolean all, String testCase) throws Exception
{
- SortedSet<String> servers = new TreeSet<String>();
+ SortedSet<String> servers = new TreeSet<>();
if (all)
{
if (replServerId != replServerId1)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/InitOnLineTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/InitOnLineTest.java
index aba0dbe..6ec34b3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/InitOnLineTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/InitOnLineTest.java
@@ -472,7 +472,7 @@
private ReplicationServer createReplicationServer(int replServerId,
String testCase) throws Exception
{
- SortedSet<String> servers = new TreeSet<String>();
+ SortedSet<String> servers = new TreeSet<>();
if (replServerId != replServer1ID)
servers.add("localhost:" + getReplServerPort(replServer1ID));
if (replServerId != replServer2ID)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
index 9c08f76..7ec22c9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -112,9 +112,9 @@
protected InternalClientConnection connection;
/** Created entries that will be deleted on class cleanup. */
- protected final Set<DN> entriesToCleanup = new HashSet<DN>();
+ protected final Set<DN> entriesToCleanup = new HashSet<>();
/** Created config entries that will be deleted on class cleanup. */
- protected final Set<DN> configEntriesToCleanup = new HashSet<DN>();
+ protected final Set<DN> configEntriesToCleanup = new HashSet<>();
/** Replicated suffix (replication domain). */
protected Entry synchroServerEntry;
@@ -616,7 +616,7 @@
protected List<Modification> generatemods(String attrName, String attrValue)
{
Attribute attr = Attributes.create(attrName, attrValue);
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
Modification mod = new Modification(ModificationType.REPLACE, attr);
mods.add(mod);
return mods;
@@ -876,7 +876,7 @@
final int timeOut = 5000; // 5 seconds max to wait for the desired message
final long startTime = System.currentTimeMillis();
- final List<ReplicationMsg> msgs = new ArrayList<ReplicationMsg>();
+ final List<ReplicationMsg> msgs = new ArrayList<>();
boolean timedOut = false;
while (!timedOut)
{
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/SchemaReplicationTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/SchemaReplicationTest.java
index 88e87ad..f3122be 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/SchemaReplicationTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/SchemaReplicationTest.java
@@ -128,7 +128,7 @@
// Modify the schema
Attribute attr = Attributes.create("attributetypes",
"( 2.5.44.77.33 NAME 'dummy' )");
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
Modification mod = new Modification(ModificationType.ADD, attr);
mods.add(mod);
ModifyOperation modOp = connection.processModify(baseDN, mods);
@@ -145,7 +145,7 @@
Assertions.assertThat(receivedOp).isInstanceOf(ModifyOperation.class);
ModifyOperation receivedModifyOperation = (ModifyOperation) receivedOp;
- this.rcvdMods = new ArrayList<Modification>();
+ this.rcvdMods = new ArrayList<>();
for (RawModification m : receivedModifyOperation.getRawModifications())
{
this.rcvdMods.add(m.toModification());
@@ -231,7 +231,7 @@
// create a schema change Notification
Attribute attr = Attributes.create("attributetypes",
"( 2.5.44.76.35 NAME 'push' )");
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
Modification mod = new Modification(ModificationType.ADD, attr);
mods.add(mod);
@@ -251,7 +251,7 @@
Assertions.assertThat(receivedOp).isInstanceOf(ModifyOperation.class);
ModifyOperation receivedModifyOperation = (ModifyOperation) receivedOp;
- this.rcvdMods = new ArrayList<Modification>();
+ this.rcvdMods = new ArrayList<>();
for (RawModification m : receivedModifyOperation.getRawModifications())
{
this.rcvdMods.add(m.toModification());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java
index 7753f48..74ccec6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/StressTest.java
@@ -119,7 +119,7 @@
int count = TOTAL_MESSAGES;
// Create a number of writer thread that will loop modifying the entry
- List<Thread> writerThreadList = new LinkedList<Thread>();
+ List<Thread> writerThreadList = new LinkedList<>();
for (int n = 0; n < 1; n++)
{
BrokerWriter writer = new BrokerWriter(count);
@@ -322,7 +322,7 @@
else
attr = Attributes.create("received-messages", String
.valueOf(reader.getCurrentCount()));
- List<Attribute> list = new LinkedList<Attribute>();
+ List<Attribute> list = new LinkedList<>();
list.add(attr);
attr = Attributes.create("base-dn", "ou=People," + TEST_ROOT_DN_STRING);
list.add(attr);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/UpdateOperationTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/UpdateOperationTest.java
index b1ecf93..3a7d77f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/UpdateOperationTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/UpdateOperationTest.java
@@ -480,7 +480,7 @@
// Replay a replace of a value B at time t2 on a second server.
Attribute attr = Attributes.create(attrType, "B");
Modification mod = new Modification(ModificationType.REPLACE, attr);
- List<Modification> mods = new ArrayList<Modification>(1);
+ List<Modification> mods = new ArrayList<>(1);
mods.add(mod);
ModifyMsg modMsg = new ModifyMsg(t2, dn1, mods, entryuuid);
broker.publish(modMsg);
@@ -490,7 +490,7 @@
// Replay an add of a value A at time t1 on a first server.
attr = Attributes.create(attrType, "A");
mod = new Modification(ModificationType.ADD, attr);
- mods = new ArrayList<Modification>(1);
+ mods = new ArrayList<>(1);
mods.add(mod);
modMsg = new ModifyMsg(t1, dn1, mods, entryuuid);
broker.publish(modMsg);
@@ -522,7 +522,7 @@
// Replay an delete of attribute displayname at time t2 on a second server.
attr = Attributes.empty(attrType);
mod = new Modification(ModificationType.DELETE, attr);
- mods = new ArrayList<Modification>(1);
+ mods = new ArrayList<>(1);
mods.add(mod);
modMsg = new ModifyMsg(t2, dn1, mods, entryuuid);
broker.publish(modMsg);
@@ -532,7 +532,7 @@
// Replay a replace of a value A at time t1 on a first server.
attr = Attributes.create(attrType, "A");
mod = new Modification(ModificationType.REPLACE, attr);
- mods = new ArrayList<Modification>(1);
+ mods = new ArrayList<>(1);
mods.add(mod);
modMsg = new ModifyMsg(t1, dn1, mods, entryuuid);
broker.publish(modMsg);
@@ -1463,7 +1463,7 @@
*/
private void consumeAllMessages(ReplicationBroker broker)
{
- final List<ReplicationMsg> msgs = new ArrayList<ReplicationMsg>();
+ final List<ReplicationMsg> msgs = new ArrayList<>();
try
{
while (true)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java
index b0b1a9c..9d11f7b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java
@@ -73,7 +73,7 @@
public class MonitorAssertions
{
- private Map<String, Long> attributeValues = new HashMap<String, Long>();
+ private Map<String, Long> attributeValues = new HashMap<>();
public MonitorAssertions(DN baseDN) throws Exception
{
@@ -1500,7 +1500,7 @@
return Collections.emptyMap();
// Parse and store values
- Map<Integer,Integer> resultMap = new HashMap<Integer,Integer>();
+ Map<Integer,Integer> resultMap = new HashMap<>();
for (ByteString val : attrs.get(0))
{
StringTokenizer strtok = new StringTokenizer(val.toString(), ":");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/DomainFakeCfg.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/DomainFakeCfg.java
index 538ff53..82cc6da 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/DomainFakeCfg.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/DomainFakeCfg.java
@@ -67,10 +67,10 @@
/** Group id. */
private final int groupId;
/** Referrals urls to be published to other servers of the topology. */
- private SortedSet<String> refUrls = new TreeSet<String>();
+ private SortedSet<String> refUrls = new TreeSet<>();
- private final SortedSet<String> fractionalExcludes = new TreeSet<String>();
- private final SortedSet<String> fractionalIncludes = new TreeSet<String>();
+ private final SortedSet<String> fractionalExcludes = new TreeSet<>();
+ private final SortedSet<String> fractionalIncludes = new TreeSet<>();
private ExternalChangelogDomainCfg eclCfg =
new ExternalChangelogDomainFakeCfg(true, null, null);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/FractionalReplicationTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/FractionalReplicationTest.java
index 253fabc..dd44fe4 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/FractionalReplicationTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/FractionalReplicationTest.java
@@ -521,7 +521,7 @@
*/
private void createReplicationServer(String testCase) throws Exception
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
String dir = testName + RS_ID + testCase + "Db";
ReplServerFakeConfiguration conf =
@@ -615,7 +615,7 @@
throws Exception
{
// Create modifications on the fractional attributes
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
boolean first = true;
for (String fracCfgValue : fractionalConf)
{
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/GroupIdHandshakeTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/GroupIdHandshakeTest.java
index c31661f..f058b41 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/GroupIdHandshakeTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/GroupIdHandshakeTest.java
@@ -206,7 +206,7 @@
*/
private SortedSet<String> createRSListForTestCase(String testCase)
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
if (testCase.equals("testRSWithSameGroupIds"))
{
@@ -231,7 +231,7 @@
private ReplicationServer createReplicationServer(int serverId, int groupId,
String testCase) throws Exception
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
int port = -1;
if (serverId == RS1_ID)
{
@@ -489,7 +489,7 @@
/**
* Change group id of RS3 to 1
*/
- SortedSet<String> otherReplServers = new TreeSet<String>();
+ SortedSet<String> otherReplServers = new TreeSet<>();
otherReplServers.add("localhost:" + rs1Port);
otherReplServers.add("localhost:" + rs2Port);
String dir = "groupIdHandshakeTest" + RS3_ID + testCase + "Db";
@@ -501,7 +501,7 @@
/**
* Change group id of RS1 to 3: DS1 and DS2 should reconnect to RS3
*/
- otherReplServers = new TreeSet<String>();
+ otherReplServers = new TreeSet<>();
otherReplServers.add("localhost:" + rs2Port);
otherReplServers.add("localhost:" + rs3Port);
dir = "groupIdHandshakeTest" + RS1_ID + testCase + "Db";
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
index df4da1a..fb5480a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java
@@ -68,7 +68,7 @@
private final int serverId = 123;
- private final SortedSet<String> replServers = new TreeSet<String>();
+ private final SortedSet<String> replServers = new TreeSet<>();
private static class TestBroker extends ReplicationBroker
{
@@ -199,7 +199,7 @@
logger.error(LocalizableMessage.raw("Second historical value: %s", av));
}
- LinkedList<ReplicationMsg> opList = new LinkedList<ReplicationMsg>();
+ LinkedList<ReplicationMsg> opList = new LinkedList<>();
TestBroker session = new TestBroker(opList);
CSN csn = new CSN(startTime, 0, serverId);
@@ -214,7 +214,7 @@
logger.error(LocalizableMessage.raw(hv[1]));
CSN fromCSN = new CSN(hv[1]);
- opList = new LinkedList<ReplicationMsg>();
+ opList = new LinkedList<>();
session = new TestBroker(opList);
result = rd1.buildAndPublishMissingChanges(fromCSN, session);
@@ -297,7 +297,7 @@
"description: foo");
assertEquals(resultCode, 0);
- LinkedList<ReplicationMsg> opList = new LinkedList<ReplicationMsg>();
+ LinkedList<ReplicationMsg> opList = new LinkedList<>();
TestBroker session = new TestBroker(opList);
// Call the buildAndPublishMissingChanges and check that this method
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java
index 498769b..ac0dfa4 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalTest.java
@@ -334,7 +334,7 @@
{
Attribute attr = Attributes.create(attrType.getNormalizedPrimaryName(), newValue);
Modification mod = new Modification(ModificationType.ADD, attr);
- List<Modification> mods = new ArrayList<Modification>(1);
+ List<Modification> mods = new ArrayList<>(1);
mods.add(mod);
broker.publish(new ModifyMsg(changeNum, dn, mods, entryuuid));
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java
index ada8e6e..e6c4f42 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java
@@ -67,7 +67,7 @@
// using a replication server that is not started
int replServerPort = TestCaseUtils.findFreePort();
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
replServers.add("localhost:" + replServerPort);
DomainFakeCfg domainConf =
new DomainFakeCfg(baseDn, serverId, replServers);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
index d692623..e2658df 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
@@ -360,7 +360,7 @@
builder.add("value1");
builder.add("value2");
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
entry.addAttribute(builder.toAttribute(), duplicateValues);
@@ -415,7 +415,7 @@
builder.add("value3");
builder.add("value4");
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
entry.addAttribute(builder.toAttribute(), duplicateValues);
@@ -461,7 +461,7 @@
// Create a single valued attribute with value : "value1"
// add this attribute to the entry.
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
Attribute attribute = Attributes.create(EMPLOYEENUMBER, "value1");
entry.addAttribute(attribute, duplicateValues);
@@ -494,7 +494,7 @@
// Create a single valued attribute with value : "value1"
// add this attribute to the entry.
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
Attribute attribute = Attributes.create(EMPLOYEENUMBER, "value1");
entry.addAttribute(attribute, duplicateValues);
@@ -532,7 +532,7 @@
builder.add("value1");
builder.add("value2");
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
entry.addAttribute(builder.toAttribute(), duplicateValues);
// load historical from the entry
@@ -581,7 +581,7 @@
// Create a single valued attribute with value : "value1"
// add this attribute to the entry.
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
Attribute attribute = Attributes.create(DISPLAYNAME, "value1");
entry.addAttribute(attribute, duplicateValues);
Attribute attrDel = buildSyncHist(DISPLAYNAME,
@@ -664,7 +664,7 @@
builder.add("value3");
builder.add("value4");
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
entry.addAttribute(builder.toAttribute(), duplicateValues);
// load historical from the entry
@@ -742,7 +742,7 @@
builder.add("value3");
builder.add("value4");
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
entry.addAttribute(builder.toAttribute(), duplicateValues);
// load historical from the entry
@@ -804,7 +804,7 @@
// Create a single valued attribute with value : "value1"
// add this attribute to the entry.
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
Attribute attribute = Attributes.create(DISPLAYNAME, "value1");
entry.addAttribute(attribute, duplicateValues);
@@ -903,7 +903,7 @@
attr = Attributes.create(DESCRIPTION, "Init Value");
Modification mod2 = new Modification(ModificationType.ADD, attr);
- List<Modification> mods = new LinkedList<Modification>();
+ List<Modification> mods = new LinkedList<>();
mods.add(mod1);
mods.add(mod2);
@@ -961,11 +961,11 @@
attr = Attributes.empty(DESCRIPTION);
Modification mod2 = new Modification(ModificationType.REPLACE, attr);
- List<Modification> mods = new LinkedList<Modification>();
+ List<Modification> mods = new LinkedList<>();
mods.add(mod1);
mods.add(mod2);
- List<Modification> mods2 = new LinkedList<Modification>(mods);
+ List<Modification> mods2 = new LinkedList<>(mods);
replayModifies(entry, hist, mods, 12);
assertEquals(hist.encodeAndPurge(), attrDel);
assertEquals(mods.size(), 2,
@@ -1004,7 +1004,7 @@
attr = Attributes.create(DESCRIPTION, "Init Value");
Modification mod2 = new Modification(ModificationType.DELETE, attr);
- List<Modification> mods = new LinkedList<Modification>();
+ List<Modification> mods = new LinkedList<>();
mods.add(mod1);
mods.add(mod2);
@@ -1241,7 +1241,7 @@
* for all these tests.
*/
DN dn = DN.valueOf(TEST_ROOT_DN_STRING);
- Map<ObjectClass, String> objectClasses = new HashMap<ObjectClass, String>();
+ Map<ObjectClass, String> objectClasses = new HashMap<>();
ObjectClass org = DirectoryServer.getObjectClass(ORGANIZATION);
objectClasses.put(org, ORGANIZATION);
@@ -1252,15 +1252,12 @@
UUID uuid = UUID.randomUUID();
// Create the att values list
- ArrayList<Attribute> uuidList = new ArrayList<Attribute>(1);
- Attribute uuidAttr = Attributes.create(entryuuidAttrType, uuid
- .toString());
+ ArrayList<Attribute> uuidList = new ArrayList<>(1);
+ Attribute uuidAttr = Attributes.create(entryuuidAttrType, uuid.toString());
uuidList.add(uuidAttr);
// Add the uuid in the entry
- Map<AttributeType, List<Attribute>> operationalAttributes = entry
- .getOperationalAttributes();
-
+ Map<AttributeType, List<Attribute>> operationalAttributes = entry.getOperationalAttributes();
operationalAttributes.put(entryuuidAttrType, uuidList);
return entry;
}
@@ -1352,7 +1349,7 @@
InternalClientConnection.getRootConnection();
CSN t = new CSN(date, 0, 0);
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
mods.add(mod);
ModifyOperationBasis modOpBasis =
@@ -1567,7 +1564,7 @@
builder.add("value1");
builder.add("value2");
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
entry.addAttribute(builder.toAttribute(), duplicateValues);
// load historical from the entry
@@ -1626,7 +1623,7 @@
builder.add("value2");
builder.add("value3");
- List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ List<ByteString> duplicateValues = new LinkedList<>();
entry.addAttribute(builder.toAttribute(), duplicateValues);
// load historical from the entry
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java
index f97220c..ad72289 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java
@@ -340,7 +340,7 @@
private ReplicationServer createReplicationServer(int serverId, String suffix)
throws ConfigException
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
int port = -1;
if (serverId == RS1_ID)
{
@@ -370,7 +370,7 @@
private LDAPReplicationDomain createReplicationDomain(DN baseDn, int serverId)
throws Exception
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
// Create a domain with two replication servers
replServers.add("localhost:" + rs1Port);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java
index 94007b2..533f29b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java
@@ -108,7 +108,7 @@
*/
private SortedSet<String> createRSListForTestCase(String testCase)
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
final int nbRSs = getNbRSs(testCase);
for (int i = 0; i < nbRSs; i++)
@@ -143,7 +143,7 @@
private ReplicationServer createReplicationServer(int rsIndex,
int weight, String testCase) throws Exception
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
int nbRSs = getNbRSs(testCase);
for (int i = 0; i < nbRSs; i++)
@@ -166,7 +166,7 @@
private ReplicationServerCfg createReplicationServerConfigWithNewWeight
(int rsIndex, int weight, String testCase)
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
if ("testFailoversAndWeightChanges".equals(testCase)
|| "testSpreadLoad".equals(testCase))
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/StateMachineTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/StateMachineTest.java
index 6453127..d2ae777 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/StateMachineTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/StateMachineTest.java
@@ -182,7 +182,7 @@
private ReplicationServer createReplicationServer(String testCase,
int degradedStatusThreshold) throws Exception
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
String dir = "stateMachineTest" + RS1_ID + testCase + "Db";
ReplServerFakeConfiguration conf =
@@ -198,7 +198,7 @@
@SuppressWarnings("unchecked")
private LDAPReplicationDomain createReplicationDomain(int dsId) throws Exception
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
replServers.add("localhost:" + rs1Port);
DomainFakeCfg domainConf = new DomainFakeCfg(EXAMPLE_DN_, dsId, replServers);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TestSynchronousReplayQueue.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TestSynchronousReplayQueue.java
index 34489a6..23bad7b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TestSynchronousReplayQueue.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TestSynchronousReplayQueue.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2013 ForgeRock AS.
+ * Portions copyright 2013-2015 ForgeRock AS.
*/
package org.opends.server.replication.plugin;
@@ -38,10 +38,9 @@
* <p>
* Not all the methods are implemented.
*/
-@SuppressWarnings("javadoc")
public class TestSynchronousReplayQueue implements BlockingQueue<UpdateToReplay>
{
- private LinkedList<UpdateToReplay> list = new LinkedList<UpdateToReplay>();
+ private LinkedList<UpdateToReplay> list = new LinkedList<>();
@Override
public boolean add(UpdateToReplay e)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TopologyViewTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TopologyViewTest.java
index 21b6960..646d2d9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TopologyViewTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TopologyViewTest.java
@@ -82,27 +82,27 @@
/** Assured conf definitions. */
private static final AssuredType DS1_AT = AssuredType.NOT_ASSURED;
private static final int DS1_SDL = -1;
- private static SortedSet<String> DS1_RU = new TreeSet<String>();
+ private static SortedSet<String> DS1_RU = new TreeSet<>();
private static final AssuredType DS2_AT = AssuredType.SAFE_READ;
private static final int DS2_SDL = -1;
- private static SortedSet<String> DS2_RU = new TreeSet<String>();
+ private static SortedSet<String> DS2_RU = new TreeSet<>();
private static final AssuredType DS3_AT = AssuredType.SAFE_DATA;
private static final int DS3_SDL = 1;
- private static SortedSet<String> DS3_RU = new TreeSet<String>();
+ private static SortedSet<String> DS3_RU = new TreeSet<>();
private static final AssuredType DS4_AT = AssuredType.SAFE_READ;
private static final int DS4_SDL = -1;
- private static SortedSet<String> DS4_RU = new TreeSet<String>();
+ private static SortedSet<String> DS4_RU = new TreeSet<>();
private static final AssuredType DS5_AT = AssuredType.SAFE_DATA;
private static final int DS5_SDL = 2;
- private static SortedSet<String> DS5_RU = new TreeSet<String>();
+ private static SortedSet<String> DS5_RU = new TreeSet<>();
private static final AssuredType DS6_AT = AssuredType.SAFE_READ;
private static final int DS6_SDL = -1;
- private static SortedSet<String> DS6_RU = new TreeSet<String>();
+ private static SortedSet<String> DS6_RU = new TreeSet<>();
private static String LOCAL_HOST_NAME;
@@ -317,7 +317,7 @@
*/
private SortedSet<String> createRSListExceptOne(int rsIdToExclude)
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
if (rsIdToExclude != RS1_ID)
{
@@ -377,7 +377,7 @@
private LDAPReplicationDomain createReplicationDomain(int dsId)
throws Exception
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
int groupId = -1;
AssuredType assuredType = null;
int assuredSdLevel = -100;
@@ -774,7 +774,7 @@
AssuredType assuredType = null;
int assuredSdLevel = -100;
SortedSet<String> refUrls = null;
- Set<String> eclIncludes = new HashSet<String>();
+ Set<String> eclIncludes = new HashSet<>();
short protocolVersion = ProtocolVersion.getCurrentVersion();
switch (dsId)
@@ -835,8 +835,8 @@
*/
private TopoView createTheoreticalTopoViewForStep(int step)
{
- List<DSInfo> dsList = new ArrayList<DSInfo>();
- List<RSInfo> rsList = new ArrayList<RSInfo>();
+ List<DSInfo> dsList = new ArrayList<>();
+ List<RSInfo> rsList = new ArrayList<>();
switch (step)
{
@@ -1020,8 +1020,7 @@
rd.getGroupId(), rd.getRefUrls(),
rd.getEclIncludes(), rd.getEclIncludesForDeletes(),
ProtocolVersion.getCurrentVersion());
- final List<DSInfo> dsList =
- new ArrayList<DSInfo>(rd.getReplicaInfos().values());
+ final List<DSInfo> dsList = new ArrayList<>(rd.getReplicaInfos().values());
dsList.add(dsInfo);
TopoView dsTopoView = new TopoView(dsList, rd.getRsInfos());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java
index 032d349..e2ef8c4 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.opends.server.replication.protocol;
@@ -194,20 +194,19 @@
// Create VLAST message
Attribute objectClass = Attributes.create(DirectoryServer
.getObjectClassAttributeType(), "organization");
- HashMap<ObjectClass, String> objectClassList = new HashMap<ObjectClass, String>();
+ HashMap<ObjectClass, String> objectClassList = new HashMap<>();
objectClassList.put(DirectoryServer.getObjectClass("organization"),
"organization");
Attribute attr = Attributes.create("o", "com");
List<Attribute> userAttributes = newList(attr);
- HashMap<AttributeType, List<Attribute>> userAttList = new HashMap<AttributeType, List<Attribute>>();
+ HashMap<AttributeType, List<Attribute>> userAttList = new HashMap<>();
userAttList.put(attr.getAttributeType(), userAttributes);
attr = Attributes.create("creatorsName", "dc=creator");
List<Attribute> operationalAttributes = newList(attr);
- HashMap<AttributeType,List<Attribute>> opList=
- new HashMap<AttributeType,List<Attribute>>();
+ HashMap<AttributeType, List<Attribute>> opList = new HashMap<>();
opList.put(attr.getAttributeType(), operationalAttributes);
CSN csn = new CSN(TimeThread.getTime(), 123, 45);
@@ -463,7 +462,7 @@
Modification mod3 = new Modification(ModificationType.ADD, attr3);
List<Modification> mods3 = newList(mod3);
- List<Modification> mods4 = new ArrayList<Modification>();
+ List<Modification> mods4 = new ArrayList<>();
for (int i = 0; i < 10; i++)
{
Attribute attr = Attributes.create("description", "string" + i);
@@ -639,7 +638,7 @@
Modification mod3 = new Modification(ModificationType.ADD, attr3);
List<Modification> mods3 = newList(mod3);
- List<Modification> mods4 = new ArrayList<Modification>();
+ List<Modification> mods4 = new ArrayList<>();
for (int i = 0; i < 10; i++)
{
Attribute attr = Attributes.create("description", "string" + i);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/SynchronizationMsgTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/SynchronizationMsgTest.java
index 7575201..b94762e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/SynchronizationMsgTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/SynchronizationMsgTest.java
@@ -104,7 +104,7 @@
Modification mod3 = new Modification(ModificationType.ADD, attr3);
List<Modification> mods3 = newList(mod3);
- List<Modification> mods4 = new ArrayList<Modification>();
+ List<Modification> mods4 = new ArrayList<>();
for (int i = 0; i < 10; i++)
{
Attribute attr = Attributes.create("description", "string" + i);
@@ -341,7 +341,7 @@
Modification mod3 = new Modification(ModificationType.ADD, attr3);
List<Modification> mods3 = newList(mod3);
- List<Modification> mods4 = new ArrayList<Modification>();
+ List<Modification> mods4 = new ArrayList<>();
for (int i = 0; i < 10; i++)
{
Attribute attr = Attributes.create("description", "string" + i);
@@ -439,22 +439,18 @@
Attribute objectClass = Attributes.create(DirectoryServer
.getObjectClassAttributeType(), "organization");
- Map<ObjectClass, String> objectClassList =
- new HashMap<ObjectClass, String>();
- objectClassList.put(DirectoryServer.getObjectClass("organization"),
- "organization");
+ Map<ObjectClass, String> objectClassList = new HashMap<>();
+ objectClassList.put(DirectoryServer.getObjectClass("organization"), "organization");
Attribute attr = Attributes.create("o", "com");
List<Attribute> userAttributes = newList(attr);
- Map<AttributeType, List<Attribute>> userAttList =
- new HashMap<AttributeType, List<Attribute>>();
+ Map<AttributeType, List<Attribute>> userAttList = new HashMap<>();
userAttList.put(attr.getAttributeType(), userAttributes);
attr = Attributes.create("creatorsname", "dc=creator");
List<Attribute> operationalAttributes = newList(attr);
- Map<AttributeType, List<Attribute>> opList =
- new HashMap<AttributeType, List<Attribute>>();
+ Map<AttributeType, List<Attribute>> opList = new HashMap<>();
opList.put(attr.getAttributeType(), operationalAttributes);
CSN csn = new CSN(TimeThread.getTime(), 123, 45);
@@ -854,26 +850,26 @@
@DataProvider(name = "createStartSessionData")
public Object[][] createStartSessionData()
{
- List<String> urls1 = new ArrayList<String>();
+ List<String> urls1 = new ArrayList<>();
urls1.add("ldap://ldap.iplanet.com/" + TEST_ROOT_DN_STRING + "??sub?(sn=Jensen)");
urls1.add("ldaps://ldap.iplanet.com:4041/uid=bjensen,ou=People," +
TEST_ROOT_DN_STRING + "?cn,mail,telephoneNumber");
- List<String> urls2 = new ArrayList<String>();
+ List<String> urls2 = new ArrayList<>();
urls2.add("ldap://ldap.example.com/" + TEST_ROOT_DN_STRING + "?objectClass?one");
urls2.add("ldap://host.example.com/ou=people," + TEST_ROOT_DN_STRING + "???(sn=a*)");
- List<String> urls3 = new ArrayList<String>();
+ List<String> urls3 = new ArrayList<>();
urls3.add("ldaps://host:port/dc=foo??sub?(sn=John Doe)");
urls3.add("ldap://jnumail1.state.ak.us/o=state.ak.us?mail,departmentnumber"
+ "?sub?(&(departmentnumber=04*) (l=Juneau))");
- List<String> urls4 = new ArrayList<String>();
+ List<String> urls4 = new ArrayList<>();
- List<String> urls5 = new ArrayList<String>();
+ List<String> urls5 = new ArrayList<>();
urls5.add("ldaps://host:port/dc=foo??sub?(sn=One Entry)");
- List<String> urls6 = new ArrayList<String>();
+ List<String> urls6 = new ArrayList<>();
urls6.add("ldaps://host:port/dc=foo??sub?(sn=One Entry)");
urls6.add("ldaps://host:port/dc=foo??sub?(sn=Second Entry)");
urls6.add("ldaps://host:port/dc=foo??sub?(sn=Third Entry)");
@@ -1173,16 +1169,16 @@
public void addMsgPerfs(String rawDN, boolean isAssured, AssuredMode assuredMode,
byte safeDataLevel, List<Attribute> entryAttrList) throws Exception
{
- Map<ObjectClass, String> objectClassList = new HashMap<ObjectClass, String>();
+ Map<ObjectClass, String> objectClassList = new HashMap<>();
objectClassList.put(DirectoryServer.getObjectClass("organization"), "organization");
Attribute attr = Attributes.create("o", "com");
- Map<AttributeType, List<Attribute>> userAttList = new HashMap<AttributeType, List<Attribute>>();
+ Map<AttributeType, List<Attribute>> userAttList = new HashMap<>();
userAttList.put(attr.getAttributeType(), newList(attr));
attr = Attributes.create("creatorsname", "dc=creator");
- Map<AttributeType, List<Attribute>> opList = new HashMap<AttributeType,List<Attribute>>();
+ Map<AttributeType, List<Attribute>> opList = new HashMap<>();
opList.put(attr.getAttributeType(), newList(attr));
CSN csn = new CSN(TimeThread.getTime(), 123, 45);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java
index 4604541..a62f401 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/AssuredReplicationServerTest.java
@@ -410,7 +410,7 @@
private SortedSet<String> generateOtherReplicationServerUrls(
int excludedRsPort, int totalNbRS)
{
- SortedSet<String> replServers = new TreeSet<String>();
+ SortedSet<String> replServers = new TreeSet<>();
if (totalNbRS >= 2)
{
addIfNotSame(replServers, rsPorts[0], excludedRsPort);
@@ -608,8 +608,7 @@
private int timeoutUpdates;
private int wrongStatusUpdates;
private int replayErrorUpdates;
- private final Map<Integer, Integer> serverNotAcknowledgedUpdates =
- new HashMap<Integer, Integer>();
+ private final Map<Integer, Integer> serverNotAcknowledgedUpdates = new HashMap<>();
private int receivedUpdates;
private int receivedUpdatesAcked;
private int receivedUpdatesNotAcked;
@@ -1306,7 +1305,7 @@
private Object[][] testSafeDataLevelHighProvider()
{
// Construct all possible combinations of parameters
- List<List<Object>> objectArrayList = new ArrayList<List<Object>>();
+ List<List<Object>> objectArrayList = new ArrayList<>();
// Safe Data Level
objectArrayList = addPossibleParameters(objectArrayList, 2, 3);
@@ -1380,7 +1379,7 @@
*/
private List<List<Object>> addPossibleParameters(List<List<Object>> objectArrayList, Object... possibleParameters)
{
- List<List<Object>> newObjectArrayList = new ArrayList<List<Object>>();
+ List<List<Object>> newObjectArrayList = new ArrayList<>();
if (objectArrayList.size() == 0)
{
@@ -1398,7 +1397,7 @@
// Add each possible parameter to the already existing list
for (Object possibleParameter : possibleParameters)
{
- final List<Object> newObjectArray = new ArrayList<Object>(objectArray);
+ final List<Object> newObjectArray = new ArrayList<>(objectArray);
newObjectArray.add(possibleParameter);
newObjectArrayList.add(newObjectArray);
}
@@ -1717,7 +1716,7 @@
*/
private Set<Integer> computeExpectedServersInError(List<Integer> eligibleServers, List<Integer> expectedServers)
{
- Set<Integer> expectedServersInError = new HashSet<Integer>(eligibleServers);
+ Set<Integer> expectedServersInError = new HashSet<>(eligibleServers);
expectedServersInError.removeAll(expectedServers);
return expectedServersInError;
}
@@ -1790,7 +1789,7 @@
*/
private List<Integer> computeEligibleServersSafeData(int fakeRs1Gid, long fakeRs1GenId, int fakeRs2Gid, long fakeRs2GenId, int fakeRs3Gid, long fakeRs3GenId)
{
- List<Integer> eligibleServers = new ArrayList<Integer>(3);
+ List<Integer> eligibleServers = new ArrayList<>(3);
if (areGroupAndGenerationIdOk(fakeRs1Gid, fakeRs1GenId))
{
eligibleServers.add(FRS1_ID);
@@ -1828,7 +1827,7 @@
int rs2Gid, long rs2GenId, int rs2Scen,
int rs3Gid, long rs3GenId, int rs3Scen)
{
- List<Integer> expectedServers = new ArrayList<Integer>();
+ List<Integer> expectedServers = new ArrayList<>();
assertRSExpectations(expectedServers, rs1Gid, rs1GenId, rs1Scen, FRS1_ID);
assertRSExpectations(expectedServers, rs2Gid, rs2GenId, rs2Scen, FRS2_ID);
assertRSExpectations(expectedServers, rs3Gid, rs3GenId, rs3Scen, FRS3_ID);
@@ -1861,7 +1860,7 @@
@DataProvider(name = "testSafeDataFromRSProvider")
private Object[][] testSafeDataFromRSProvider()
{
- List<List<Object>> objectArrayList = new ArrayList<List<Object>>();
+ List<List<Object>> objectArrayList = new ArrayList<>();
// Safe Data Level
objectArrayList = addPossibleParameters(objectArrayList, 1, 2, 3);
@@ -2257,7 +2256,7 @@
@DataProvider(name = "testSafeReadOneRSComplexProvider")
private Object[][] testSafeReadOneRSComplexProvider()
{
- List<List<Object>> objectArrayList = new ArrayList<List<Object>>();
+ List<List<Object>> objectArrayList = new ArrayList<>();
// Other additional DS group id
objectArrayList = addPossibleParameters(objectArrayList, DEFAULT_GID, OTHER_GID);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java
index c8f59af..5cb1072 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java
@@ -159,7 +159,7 @@
private ReplicationServer createReplicationServer(int changelogId,
boolean all, String suffix) throws Exception
{
- SortedSet<String> servers = new TreeSet<String>();
+ SortedSet<String> servers = new TreeSet<>();
if (all)
{
if (changelogId != changelog1ID)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java
index 093f6cf..c859386 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerTest.java
@@ -662,7 +662,7 @@
changelogs[i] = null;
// create the 2 connected replicationServer
- SortedSet<String> servers = new TreeSet<String>();
+ SortedSet<String> servers = new TreeSet<>();
servers.add(
"localhost:" + ((i == 0) ? changelogPorts[1] : changelogPorts[0]));
ReplServerFakeConfiguration conf =
@@ -757,7 +757,7 @@
{
// create the 1rst replicationServer, the second one will be created later
- SortedSet<String> servers = new TreeSet<String>();
+ SortedSet<String> servers = new TreeSet<>();
servers.add("localhost:" + changelogPorts[1]);
ReplServerFakeConfiguration conf =
new ReplServerFakeConfiguration(changelogPorts[0], "replicationServerTestChangelogChainingDb"+0, replicationDbImplementation,
@@ -809,7 +809,7 @@
ModifyDNMsg modDNMsg = new ModifyDNMsg(localOp);
broker1.publish(modDNMsg);
- SortedSet<String> servers = new TreeSet<String>();
+ SortedSet<String> servers = new TreeSet<>();
servers.add("localhost:"+changelogPorts[0]);
ReplServerFakeConfiguration conf = new ReplServerFakeConfiguration(
changelogPorts[1], null, replicationDbImplementation, 0, changelogIds[1], 0, 100, null);
@@ -834,7 +834,7 @@
private List<ReplicationMsg> receiveReplicationMsgs(ReplicationBroker broker2, int nbMessagesExpected)
{
- List<ReplicationMsg> msgs = new ArrayList<ReplicationMsg>(nbMessagesExpected);
+ List<ReplicationMsg> msgs = new ArrayList<>(nbMessagesExpected);
for (int i = 0; i < nbMessagesExpected; i++)
{
try
@@ -1122,7 +1122,7 @@
changelogs[i] = null;
// create the 2 replicationServer
// and connect the first one to the other one
- SortedSet<String> servers = new TreeSet<String>();
+ SortedSet<String> servers = new TreeSet<>();
// Connect only replicationServer[0] to ReplicationServer[1]
// and not the other way
@@ -1170,7 +1170,7 @@
// Then change the config to remove replicationServer[1] from
// the configuration of replicationServer[0]
- SortedSet<String> servers = new TreeSet<String>();
+ SortedSet<String> servers = new TreeSet<>();
// Configure replicationServer[0] to be disconnected from ReplicationServer[1]
ReplServerFakeConfiguration conf =
new ReplServerFakeConfiguration(changelogPorts[0], "changelogDb0", replicationDbImplementation,
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/BlockLogReaderWriterTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/BlockLogReaderWriterTest.java
index 91238e2..61f344a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/BlockLogReaderWriterTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/BlockLogReaderWriterTest.java
@@ -433,7 +433,7 @@
private List<Integer> getShuffledKeys(long fileSizeInBytes, int numberOfKeys)
{
final int numberOfValues = (int) fileSizeInBytes / INT_RECORD_SIZE;
- final List<Integer> values = new ArrayList<Integer>(numberOfValues);
+ final List<Integer> values = new ArrayList<>(numberOfValues);
for (int i = 0; i < numberOfValues; i++)
{
values.add(i+1);
@@ -461,7 +461,7 @@
/** Helper to build a list of records. */
private List<Record<Integer, Integer>> records(int...keys)
{
- List<Record<Integer, Integer>> records = new ArrayList<Record<Integer, Integer>>();
+ List<Record<Integer, Integer>> records = new ArrayList<>();
for (int key : keys)
{
records.add(Record.from(key, key));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ChangeNumberIndexerTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ChangeNumberIndexerTest.java
index 973d8f0..d9cd028 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ChangeNumberIndexerTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ChangeNumberIndexerTest.java
@@ -164,9 +164,9 @@
CursorOptions options = new CursorOptions(LESS_THAN_OR_EQUAL_TO_KEY, ON_MATCHING_KEY, null);
multiDomainCursor = new MultiDomainDBCursor(domainDB, options);
initialState = new ChangelogState();
- replicaDBCursors = new HashMap<ReplicaId, SequentialDBCursor>();
- domainDBCursors = new HashMap<DN, DomainDBCursor>();
- domainNewestCSNs = new HashMap<DN, ServerState>();
+ replicaDBCursors = new HashMap<>();
+ domainDBCursors = new HashMap<>();
+ domainNewestCSNs = new HashMap<>();
when(changelogDB.getChangeNumberIndexDB()).thenReturn(cnIndexDB);
when(changelogDB.getReplicationDomainDB()).thenReturn(domainDB);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ECLMultiDomainDBCursorTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ECLMultiDomainDBCursorTest.java
index 2bcd446..b44a7bc 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ECLMultiDomainDBCursorTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ECLMultiDomainDBCursorTest.java
@@ -58,7 +58,7 @@
private CursorOptions options;
private MultiDomainDBCursor multiDomainCursor;
private ECLMultiDomainDBCursor eclCursor;
- private final Set<DN> eclEnabledDomains = new HashSet<DN>();
+ private final Set<DN> eclEnabledDomains = new HashSet<>();
private ECLEnabledDomainPredicate predicate = new ECLEnabledDomainPredicate()
{
@Override
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/FileReplicaDBTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/FileReplicaDBTest.java
index f9e445b..dbded3e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/FileReplicaDBTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/FileReplicaDBTest.java
@@ -180,7 +180,7 @@
replicaDB = newReplicaDB(replicationServer);
final CSN[] csns = generateCSNs(1, System.currentTimeMillis(), 5);
- final ArrayList<CSN> csns2 = new ArrayList<CSN>(Arrays.asList(csns));
+ final ArrayList<CSN> csns2 = new ArrayList<>(Arrays.asList(csns));
csns2.remove(csns[3]);
for (CSN csn : csns2)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/LogTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/LogTest.java
index 3880ae8..89de646 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/LogTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/LogTest.java
@@ -284,7 +284,7 @@
Log<String, String> writeLog2 = openLog(LogFileTest.RECORD_PARSER))
{
writeLog1.append(Record.from("key020", "starting record"));
- AtomicReference<ChangelogException> exceptionRef = new AtomicReference<ChangelogException>();
+ AtomicReference<ChangelogException> exceptionRef = new AtomicReference<>();
Thread write1 = getWriteLogThread(writeLog1, "a", exceptionRef);
Thread write2 = getWriteLogThread(writeLog2, "b", exceptionRef);
write1.run();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironmentTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironmentTest.java
index 57025f7..18eb58f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironmentTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/ReplicationEnvironmentTest.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2014 ForgeRock AS.
+ * Copyright 2014-2015 ForgeRock AS.
*/
package org.opends.server.replication.server.changelog.file;
@@ -120,7 +120,7 @@
public void testReadChangelogStateWithMultipleDN() throws Exception
{
Log<Long,ChangeNumberIndexRecord> cnDB = null;
- List<Log<CSN,UpdateMsg>> replicaDBs = new ArrayList<Log<CSN,UpdateMsg>>();
+ List<Log<CSN,UpdateMsg>> replicaDBs = new ArrayList<>();
try
{
File rootPath = new File(TEST_DIRECTORY_CHANGELOG);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/SequentialDBCursor.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/SequentialDBCursor.java
index c1d7507..76bd2c9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/SequentialDBCursor.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/SequentialDBCursor.java
@@ -48,7 +48,7 @@
*/
public SequentialDBCursor(UpdateMsg... msgs)
{
- this.msgs = new ArrayList<UpdateMsg>(Arrays.asList(msgs));
+ this.msgs = new ArrayList<>(Arrays.asList(msgs));
}
public void add(UpdateMsg msg)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ComputeBestServerTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ComputeBestServerTest.java
index 72d88a1..ebed185 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ComputeBestServerTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ComputeBestServerTest.java
@@ -118,8 +118,7 @@
private Map<Integer, ReplicationServerInfo> newRSInfos(
ReplicationServerInfo... rsInfos)
{
- Map<Integer, ReplicationServerInfo> results =
- new HashMap<Integer, ReplicationServerInfo>();
+ Map<Integer, ReplicationServerInfo> results = new HashMap<>();
for (ReplicationServerInfo rsInfo : rsInfos)
{
results.put(rsInfo.getServerId(), rsInfo);
@@ -259,7 +258,7 @@
private void containsOnly(final Map<Integer, LocalizableMessage> evaluations,
MapEntry... entries)
{
- final List<MapEntry> notFound = new ArrayList<MapEntry>(Arrays.asList(entries));
+ final List<MapEntry> notFound = new ArrayList<>(Arrays.asList(entries));
for (Iterator<MapEntry> iter = notFound.iterator(); iter.hasNext();)
{
final MapEntry entry = iter.next();
@@ -286,7 +285,7 @@
/** Contains ordinal for each message. */
private Map<Integer, Integer> getOrdinal(Map<Integer, LocalizableMessage> evaluations)
{
- final Map<Integer, Integer> result = new LinkedHashMap<Integer, Integer>();
+ final Map<Integer, Integer> result = new LinkedHashMap<>();
for (Entry<Integer, LocalizableMessage> entry : evaluations.entrySet())
{
result.put(entry.getKey(), entry.getValue().ordinal());
@@ -667,7 +666,7 @@
* Expected winner: the RS
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "AwinnerHost:123", 0L, (byte)1, 1),
EMPTY_SET);
@@ -684,7 +683,7 @@
* Excepted winner: first in the list
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "BwinnerHost:123", 0L, (byte)1, 1),
EMPTY_SET);
@@ -707,7 +706,7 @@
* Excepted winner: R2 (still no connected DS)
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1));
@@ -731,7 +730,7 @@
* and have same weight
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "DwinnerHost:123", 0L, (byte)1, 1),
newSet(1));
@@ -754,7 +753,7 @@
* Excepted winner: RS2 -> 2 DSs on each RS
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1, 2));
@@ -777,7 +776,7 @@
* Excepted winner: RS2 -> go to perfect load balance
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1));
@@ -801,7 +800,7 @@
* highest weight
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1));
@@ -825,7 +824,7 @@
* highest weight
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1, 2));
@@ -849,7 +848,7 @@
* highest weight
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1));
@@ -875,7 +874,7 @@
* Excepted winner: RS1 -> misses more DSs than RS3
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "JwinnerHost:123", 0L, (byte)1, 5),
newSet(1, 2, 3));
@@ -905,7 +904,7 @@
* Excepted winner: RS2 (stay connected to it as load correctly spread)
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1));
@@ -928,7 +927,7 @@
* Excepted winner: RS2 (one must disconnect from RS1)
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1, 2));
@@ -952,7 +951,7 @@
* one with the lowest id so not DS with server id 2)
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "MwinnerHost:123", 0L, (byte)1, 1),
newSet(1, 2));
@@ -976,7 +975,7 @@
* Excepted winner: RS2 no change as load correctly spread
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 3),
newSet(1, 2, 3, 4, 5, 6));
@@ -1009,7 +1008,7 @@
* previous test where the loads were ok)
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 3),
newSet(1, 2, 3, 4));
@@ -1040,7 +1039,7 @@
* is one of the two lowest ids connected to RS4
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "PwinnerHost:123", 0L, (byte)1, 3),
newSet(1, 2, 3, 4));
@@ -1071,7 +1070,7 @@
* is not one of the two lowest ids connected to RS4
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 3),
newSet(1, 2, 3, 4));
@@ -1104,7 +1103,7 @@
* previous test where the loads were ok)
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte) 1, 3),
newSet(1, 2, 3, 4));
@@ -1137,7 +1136,7 @@
* RS.
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "RwinnerHost:123", 0L, (byte)1, 1),
newSet(1, 2));
@@ -1165,7 +1164,7 @@
* Note: Same test as before, but not with the lowest local DS server id
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "SwinnerHost:123", 0L, (byte)1, 1),
newSet(1, 2));
@@ -1191,7 +1190,7 @@
* the local server would not stop going and coming back between RSs.
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "TwinnerHost:123", 0L, (byte)1, 1),
newSet(1, 2));
@@ -1220,7 +1219,7 @@
* the local server would not stop going and coming back between RSs.
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "UwinnerHost:123", 0L, (byte)1, 1),
newSet(1, 2, 3));
@@ -1247,7 +1246,7 @@
* RS3
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "looserHost:123", 0L, (byte)1, 1),
newSet(1, 2));
@@ -1274,7 +1273,7 @@
* DS server id 1 should disconnect for reconnection to RS3
*/
- rsInfos = new HashMap<Integer, ReplicationServerInfo>();
+ rsInfos = new HashMap<>();
put(rsInfos,
new RSInfo(11, "WwinnerHost:123", 0L, (byte)1, 1),
newSet(1, 2));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationBrokerTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationBrokerTest.java
index 1eace5c..a19a1c1 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationBrokerTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationBrokerTest.java
@@ -20,7 +20,7 @@
*
* CDDL HEADER END
*
- * Copyright 2014 ForgeRock AS
+ * Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.replication.service;
@@ -84,8 +84,7 @@
{
return Collections.emptyMap();
}
- final Map<Integer, ReplicationServerInfo> map =
- new HashMap<Integer, ReplicationServerInfo>();
+ final Map<Integer, ReplicationServerInfo> map = new HashMap<>();
for (ReplicationServerInfo info : infos)
{
map.put(info.getServerId(), info);
@@ -146,7 +145,7 @@
private Map<Integer, DSInfo> newMap(DSInfo... dsInfos)
{
- final Map<Integer, DSInfo> results = new HashMap<Integer, DSInfo>();
+ final Map<Integer, DSInfo> results = new HashMap<>();
for (DSInfo dsInfo : dsInfos)
{
results.put(dsInfo.getDsId(), dsInfo);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationDomainTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationDomainTest.java
index b6fec1d..4544b0b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationDomainTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationDomainTest.java
@@ -105,12 +105,12 @@
"ReplicationDomainTestDb2", 100, "localhost:" + replServerPort1);
SortedSet<String> servers = newSortedSet("localhost:" + replServerPort1);
- BlockingQueue<UpdateMsg> rcvQueue1 = new LinkedBlockingQueue<UpdateMsg>();
+ BlockingQueue<UpdateMsg> rcvQueue1 = new LinkedBlockingQueue<>();
domain1 = new FakeReplicationDomain(
testService, domain1ServerId, servers, 100, 1000, rcvQueue1);
SortedSet<String> servers2 = newSortedSet("localhost:" + replServerPort2);
- BlockingQueue<UpdateMsg> rcvQueue2 = new LinkedBlockingQueue<UpdateMsg>();
+ BlockingQueue<UpdateMsg> rcvQueue2 = new LinkedBlockingQueue<>();
domain2 = new FakeReplicationDomain(
testService, domain2ServerId, servers2, 100, 1000, rcvQueue2);
@@ -262,7 +262,7 @@
"ReplicationDomainTestDb", 100000, "localhost:" + replServerPort);
SortedSet<String> servers = newSortedSet("localhost:" + replServerPort);
- BlockingQueue<UpdateMsg> rcvQueue1 = new LinkedBlockingQueue<UpdateMsg>();
+ BlockingQueue<UpdateMsg> rcvQueue1 = new LinkedBlockingQueue<>();
domain1 = new FakeReplicationDomain(
testService, domain1ServerId, servers, 1000, 100000, rcvQueue1);
@@ -522,7 +522,7 @@
replServer = createReplicationServer(replServerID, SENDERPORT,
"ReplicationDomainTestDb", 100, servers);
- BlockingQueue<UpdateMsg> rcvQueue1 = new LinkedBlockingQueue<UpdateMsg>();
+ BlockingQueue<UpdateMsg> rcvQueue1 = new LinkedBlockingQueue<>();
domain1 = new FakeStressReplicationDomain(
testService, 2, servers, 1000, rcvQueue1);
@@ -555,7 +555,7 @@
replServer = createReplicationServer(replServerID, RECEIVERPORT,
"ReplicationDomainTestDb", 100, servers);
- BlockingQueue<UpdateMsg> rcvQueue1 = new LinkedBlockingQueue<UpdateMsg>();
+ BlockingQueue<UpdateMsg> rcvQueue1 = new LinkedBlockingQueue<>();
domain1 = new FakeStressReplicationDomain(
testService, 1, servers, 100000, rcvQueue1);
/*
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/CollationMatchingRuleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/CollationMatchingRuleTest.java
index 1ac9da9..9e403ee 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/CollationMatchingRuleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/CollationMatchingRuleTest.java
@@ -263,12 +263,12 @@
@Test
public void testSortControlLTERule() throws Exception
{
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(user4);
expectedDNOrder.add(user3);
expectedDNOrder.add(user2);
expectedDNOrder.add(user1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
requestControls.add(new ServerSideSortRequestControl("displayname:fr"));
ValidateSortControl("displayname:fr-FR.6:=A*", expectedDNOrder, requestControls);
}
@@ -281,12 +281,12 @@
@Test
public void testSortControlEQRule() throws Exception
{
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(user4);
expectedDNOrder.add(user3);
expectedDNOrder.add(user2);
expectedDNOrder.add(user1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
requestControls.add(new ServerSideSortRequestControl("displayname:es"));
ValidateSortControl("displayname:es.6:=A*", expectedDNOrder, requestControls);
}
@@ -299,12 +299,12 @@
@Test
public void testSortControlGTRule() throws Exception
{
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(user1);
expectedDNOrder.add(user2);
expectedDNOrder.add(user3);
expectedDNOrder.add(user4);
- ArrayList<Control> requestControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
requestControls.add(new ServerSideSortRequestControl("-displayname:en"));
ValidateSortControl("displayname:en-US.6:=A*", expectedDNOrder, requestControls);
}
@@ -318,12 +318,12 @@
@Test
public void testVLVSortControl() throws Exception
{
- ArrayList<DN> expectedDNOrder = new ArrayList<DN>();
+ ArrayList<DN> expectedDNOrder = new ArrayList<>();
expectedDNOrder.add(user4);
expectedDNOrder.add(user3);
expectedDNOrder.add(user2);
expectedDNOrder.add(user1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
requestControls.add(new ServerSideSortRequestControl("displayname:fr"));
requestControls.add(new VLVRequestControl(0, 4, 1, 0));
ValidateSortControl("objectclass=inetOrgPerson", expectedDNOrder, requestControls);
@@ -353,7 +353,7 @@
private ArrayList<DN> getDNs(InternalSearchOperation internalSearch)
{
- ArrayList<DN> results = new ArrayList<DN>();
+ ArrayList<DN> results = new ArrayList<>();
for (Entry e : internalSearch.getSearchEntries())
{
results.add(e.getName());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/GenericSchemaTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/GenericSchemaTestCase.java
index 260cd2e..cf2dc36 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/GenericSchemaTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/GenericSchemaTestCase.java
@@ -85,7 +85,7 @@
@Test
public void testEnsureValidSyntaxOIDs()
{
- TreeSet<String> invalidOIDs = new TreeSet<String>();
+ TreeSet<String> invalidOIDs = new TreeSet<>();
Schema schema = DirectoryServer.getSchema();
for (Syntax as : schema.getSyntaxes().values())
@@ -123,7 +123,7 @@
@Test
public void testEnsureValidMatchingRuleOIDs()
{
- TreeSet<String> invalidOIDs = new TreeSet<String>();
+ TreeSet<String> invalidOIDs = new TreeSet<>();
Schema schema = DirectoryServer.getSchema();
for (MatchingRule mr : schema.getMatchingRules().values())
@@ -164,7 +164,7 @@
public void testEnsureValidAttributeTypeOIDs()
throws Exception
{
- TreeSet<String> invalidOIDs = new TreeSet<String>();
+ TreeSet<String> invalidOIDs = new TreeSet<>();
String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
File schemaDir = new File(new File(buildRoot, "resource"), "schema");
@@ -241,7 +241,7 @@
public void testEnsureValidObjectClassOIDs()
throws Exception
{
- TreeSet<String> invalidOIDs = new TreeSet<String>();
+ TreeSet<String> invalidOIDs = new TreeSet<>();
String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
File schemaDir = new File(new File(buildRoot, "resource"), "schema");
@@ -317,7 +317,7 @@
public void testEnsureValidNameFormOIDs()
throws Exception
{
- TreeSet<String> invalidOIDs = new TreeSet<String>();
+ TreeSet<String> invalidOIDs = new TreeSet<>();
String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
File schemaDir = new File(new File(buildRoot, "resource"), "schema");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/LDAPSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/LDAPSyntaxTest.java
index 7576bc6..2925e44 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/LDAPSyntaxTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/LDAPSyntaxTest.java
@@ -238,7 +238,7 @@
//There are other ways of doing it but we will extract the OID
//from the attribute values and then check to see if our
//OID is found in the result set or not.
- List<String> syntaxList = new ArrayList<String>();
+ List<String> syntaxList = new ArrayList<>();
while(iter.hasNext())
{
//parse the OIDs.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/EncodePasswordTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/EncodePasswordTestCase.java
index 9de90f8..3b2aca0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/EncodePasswordTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/EncodePasswordTestCase.java
@@ -93,8 +93,8 @@
@DataProvider(name = "invalidArgs")
public Object[][] getInvalidArgumentLists()
{
- ArrayList<String[]> argLists = new ArrayList<String[]>();
- ArrayList<String> reasonList = new ArrayList<String>();
+ ArrayList<String[]> argLists = new ArrayList<>();
+ ArrayList<String> reasonList = new ArrayList<>();
String[] args = new String[] {};
argLists.add(args);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java
index 7178b74..b291155 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java
@@ -172,8 +172,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -201,8 +201,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -228,8 +228,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -256,8 +256,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -291,8 +291,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -326,8 +326,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
requestControls.add(new PasswordPolicyRequestControl());
@@ -356,19 +356,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
try
{
- authHandler.doSASLBind(null, null, null, saslProperties, requestControls,
- responseControls);
+ authHandler.doSASLBind(null, null, null, saslProperties, requestControls, responseControls);
}
finally
{
@@ -392,19 +388,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
try
{
- authHandler.doSASLBind(null, null, "", saslProperties, requestControls,
- responseControls);
+ authHandler.doSASLBind(null, null, "", saslProperties, requestControls, responseControls);
}
finally
{
@@ -428,11 +420,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -465,12 +455,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("testDoSASLBindAnonymousDisabled");
saslProperties.put("trace", propList);
@@ -509,12 +497,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("testDoSASLBindAnonymous");
saslProperties.put("trace", propList);
@@ -548,11 +534,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -585,12 +569,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("testDoSASLBindAnonymousMultivaluedTrace");
propList.add("aSecondTraceStringWhichIsInvalid");
saslProperties.put("trace", propList);
@@ -632,12 +614,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("testDoSASLBindAnonymousInvalidProperty");
saslProperties.put("invalid", propList);
@@ -678,14 +658,12 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
requestControls.add(new PasswordPolicyRequestControl());
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("testDoSASLBindAnonymous");
saslProperties.put("trace", propList);
@@ -736,12 +714,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -795,12 +771,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -833,12 +807,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -877,12 +849,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("");
saslProperties.put("authid", propList);
@@ -935,12 +905,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -991,12 +959,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -1033,8 +999,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LinkedHashMap<String,List<String>> saslProperties = null;
@@ -1071,11 +1037,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -1112,12 +1076,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
propList.add("u:test.user");
saslProperties.put("authid", propList);
@@ -1157,16 +1119,14 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("foo");
saslProperties.put("invalid", propList);
@@ -1220,14 +1180,12 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
requestControls.add(new PasswordPolicyRequestControl());
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -1279,16 +1237,14 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
@@ -1343,16 +1299,14 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
@@ -1397,16 +1351,14 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
@@ -1435,8 +1387,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LinkedHashMap<String,List<String>> saslProperties = null;
@@ -1473,11 +1425,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -1512,13 +1462,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("foo");
saslProperties.put("invalid", propList);
LDAPAuthenticationHandler authHandler =
@@ -1554,13 +1502,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
propList.add("u:test.user");
saslProperties.put("authid", propList);
@@ -1597,13 +1543,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("");
saslProperties.put("authid", propList);
LDAPAuthenticationHandler authHandler =
@@ -1639,17 +1583,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
propList.add("dc=example,dc=com");
saslProperties.put("realm", propList);
@@ -1703,17 +1645,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("auth");
saslProperties.put("qop", propList);
@@ -1745,21 +1685,19 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("auth-int");
saslProperties.put("qop", propList);
@@ -1797,21 +1735,19 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("auth-conf");
saslProperties.put("qop", propList);
@@ -1848,21 +1784,19 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("invalid");
saslProperties.put("qop", propList);
@@ -1899,21 +1833,19 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("auth");
propList.add("auth-int");
propList.add("auth-conf");
@@ -1952,21 +1884,19 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("ldap/value1");
propList.add("ldap/value2");
saslProperties.put("digest-uri", propList);
@@ -2004,21 +1934,19 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
propList.add("u:test.user");
saslProperties.put("authzid", propList);
@@ -2056,17 +1984,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:invalid");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
@@ -2105,17 +2031,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("u:nosuchuser");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
@@ -2168,17 +2092,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("u:nosuchuser");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
@@ -2229,17 +2151,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("u:nosuchuser");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
propList.add("o=test");
saslProperties.put("realm", propList);
@@ -2293,18 +2213,16 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
requestControls.add(new PasswordPolicyRequestControl());
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
@@ -2363,11 +2281,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -2426,11 +2342,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -2487,12 +2401,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("foo");
saslProperties.put("invalid", valueList);
@@ -2554,13 +2466,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
requestControls.add(new PasswordPolicyRequestControl());
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -2587,8 +2497,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LinkedHashMap<String,List<String>> saslProperties = null;
@@ -2624,11 +2534,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -2662,13 +2570,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("");
saslProperties.put("authid", valueList);
@@ -2704,13 +2610,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
valueList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", valueList);
@@ -2747,17 +2651,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("u:test.user");
valueList.add("dn:uid=test.user,o=test");
saslProperties.put("authzid", valueList);
@@ -2794,17 +2696,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("kdc1");
valueList.add("kdc2");
saslProperties.put("kdc", valueList);
@@ -2841,17 +2741,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("auth");
valueList.add("auth-int");
valueList.add("auth-conf");
@@ -2890,17 +2788,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("auth-int");
saslProperties.put("qop", valueList);
@@ -2937,17 +2833,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("auth-conf");
saslProperties.put("qop", valueList);
@@ -2983,17 +2877,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("invalid");
saslProperties.put("qop", valueList);
@@ -3029,17 +2921,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("realm1");
valueList.add("realm2");
saslProperties.put("realm", valueList);
@@ -3076,17 +2966,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("foo");
saslProperties.put("invalid", valueList);
@@ -3122,13 +3010,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("auth");
saslProperties.put("qop", valueList);
@@ -3183,12 +3069,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -3240,12 +3124,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -3275,8 +3157,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LinkedHashMap<String,List<String>> saslProperties = null;
@@ -3312,11 +3194,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -3350,13 +3230,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("dn:uid=test.user,o=test");
valueList.add("u:test.user");
saslProperties.put("authid", valueList);
@@ -3393,13 +3271,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("");
saslProperties.put("authid", valueList);
@@ -3435,17 +3311,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("dn:uid=test.user,o=test");
valueList.add("u:test.user");
saslProperties.put("authzid", valueList);
@@ -3482,17 +3356,15 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", valueList);
- valueList = new ArrayList<String>();
+ valueList = new ArrayList<>();
valueList.add("foo");
saslProperties.put("invalid", valueList);
@@ -3528,13 +3400,11 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
-
- ArrayList<String> valueList = new ArrayList<String>();
+ ArrayList<String> valueList = new ArrayList<>();
valueList.add("dn:uid=test.user,o=test");
saslProperties.put("authzid", valueList);
@@ -3573,12 +3443,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=does.not.exist,o=test");
saslProperties.put("authid", propList);
@@ -3622,12 +3490,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=does.not.exist,o=test");
saslProperties.put("authid", propList);
@@ -3672,14 +3538,12 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
requestControls.add(new PasswordPolicyRequestControl());
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -3733,8 +3597,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -3762,8 +3626,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -3806,8 +3670,8 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -3839,12 +3703,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("testDoSASLBindAnonymous");
saslProperties.put("trace", propList);
@@ -3893,12 +3755,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
@@ -3947,16 +3807,14 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
- propList = new ArrayList<String>();
+ propList = new ArrayList<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, this.hostname, messageID);
@@ -4011,11 +3869,9 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
@@ -4057,12 +3913,10 @@
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
- ArrayList<Control> requestControls = new ArrayList<Control>();
- ArrayList<Control> responseControls = new ArrayList<Control>();
-
- LinkedHashMap<String,List<String>> saslProperties =
- new LinkedHashMap<String,List<String>>();
- ArrayList<String> propList = new ArrayList<String>();
+ ArrayList<Control> requestControls = new ArrayList<>();
+ ArrayList<Control> responseControls = new ArrayList<>();
+ LinkedHashMap<String, List<String>> saslProperties = new LinkedHashMap<>();
+ ArrayList<String> propList = new ArrayList<>();
propList.add("dn:uid=test.user,o=test");
saslProperties.put("authid", propList);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPCompareTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPCompareTestCase.java
index 4513154..4eace84 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPCompareTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPCompareTestCase.java
@@ -108,8 +108,8 @@
@DataProvider(name = "invalidArgs")
public Object[][] getInvalidArgumentLists()
{
- ArrayList<String[]> argLists = new ArrayList<String[]>();
- ArrayList<String> reasonList = new ArrayList<String>();
+ ArrayList<String[]> argLists = new ArrayList<>();
+ ArrayList<String> reasonList = new ArrayList<>();
String[] args = {};
argLists.add(args);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPDeleteTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPDeleteTestCase.java
index 5c01612..fffa323 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPDeleteTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPDeleteTestCase.java
@@ -93,8 +93,8 @@
@DataProvider(name = "invalidArgs")
public Object[][] getInvalidArgumentLists()
{
- ArrayList<String[]> argLists = new ArrayList<String[]>();
- ArrayList<String> reasonList = new ArrayList<String>();
+ ArrayList<String[]> argLists = new ArrayList<>();
+ ArrayList<String> reasonList = new ArrayList<>();
String[] args = new String[]
{
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPModifyTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPModifyTestCase.java
index d841562..be111e3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPModifyTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPModifyTestCase.java
@@ -116,8 +116,8 @@
@DataProvider(name = "invalidArgs")
public Object[][] getInvalidArgumentLists()
{
- ArrayList<String[]> argLists = new ArrayList<String[]>();
- ArrayList<String> reasonList = new ArrayList<String>();
+ ArrayList<String[]> argLists = new ArrayList<>();
+ ArrayList<String> reasonList = new ArrayList<>();
String[] args;
args = new String[]
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPPasswordModifyTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPPasswordModifyTestCase.java
index 2c9d32c..b820a1b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPPasswordModifyTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPPasswordModifyTestCase.java
@@ -98,8 +98,8 @@
@DataProvider(name = "invalidArgs")
public Object[][] getInvalidArgumentLists()
{
- ArrayList<String[]> argLists = new ArrayList<String[]>();
- ArrayList<String> reasonList = new ArrayList<String>();
+ ArrayList<String[]> argLists = new ArrayList<>();
+ ArrayList<String> reasonList = new ArrayList<>();
String[] args = {};
argLists.add(args);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPSearchTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPSearchTestCase.java
index b8b1335..8e011c6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPSearchTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/LDAPSearchTestCase.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.tools;
@@ -107,8 +107,8 @@
@DataProvider(name = "invalidArgs")
public Object[][] getInvalidArgumentLists()
{
- ArrayList<String[]> argLists = new ArrayList<String[]>();
- ArrayList<String> reasonList = new ArrayList<String>();
+ ArrayList<String[]> argLists = new ArrayList<>();
+ ArrayList<String> reasonList = new ArrayList<>();
String[] args = {};
argLists.add(args);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/ListBackendsTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/ListBackendsTestCase.java
index 3adf612..0373d39 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/ListBackendsTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/ListBackendsTestCase.java
@@ -79,8 +79,8 @@
@DataProvider(name = "invalidArgs")
public Object[][] getInvalidArgumentLists()
{
- ArrayList<String[]> argLists = new ArrayList<String[]>();
- ArrayList<String> reasonList = new ArrayList<String>();
+ ArrayList<String[]> argLists = new ArrayList<>();
+ ArrayList<String> reasonList = new ArrayList<>();
String[] args = new String[] {};
argLists.add(args);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/RebuildIndexTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/RebuildIndexTestCase.java
index 2ffb30d..9100388 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/RebuildIndexTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/RebuildIndexTestCase.java
@@ -75,7 +75,7 @@
// Add the airius.com suffix to userRoot
final InternalClientConnection rootConnection =
InternalClientConnection.getRootConnection();
- final ArrayList<Modification> mods = new ArrayList<Modification>();
+ final ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.ADD,
Attributes.create("ds-cfg-base-dn", baseDN)));
// Backend should be disabled.
@@ -99,7 +99,7 @@
// remove the airius.com suffix to userRoot
final InternalClientConnection rootConnection =
InternalClientConnection.getRootConnection();
- final ArrayList<Modification> mods = new ArrayList<Modification>();
+ final ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.DELETE,
Attributes.create("ds-cfg-base-dn", baseDN)));
mods.add(new Modification(ModificationType.REPLACE,
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java
index 58ef2c7..c55fabf 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java
@@ -67,7 +67,7 @@
*/
private String[] setArgs(String... args)
{
- final List<String> argsList = new LinkedList<String>();
+ final List<String> argsList = new LinkedList<>();
argsList.add("--configFile");
argsList.add(configFilePath);
if (args != null)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/VerifyIndexTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/VerifyIndexTestCase.java
index df4d3e2..e88b0c3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/VerifyIndexTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/VerifyIndexTestCase.java
@@ -72,7 +72,7 @@
// Add the airius.com suffix to userRoot
InternalClientConnection rootConnection =
InternalClientConnection.getRootConnection();
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.ADD,
Attributes.create("ds-cfg-base-dn", "o=airius.com")));
String userRootDN = "ds-cfg-backend-id=userRoot,cn=Backends,cn=config";
@@ -94,7 +94,7 @@
// remove the airius.com suffix to userRoot
InternalClientConnection rootConnection =
InternalClientConnection.getRootConnection();
- ArrayList<Modification> mods = new ArrayList<Modification>();
+ ArrayList<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.DELETE,
Attributes.create("ds-cfg-base-dn", "o=airius.com")));
String userRootDN = "ds-cfg-backend-id=userRoot,cn=Backends,cn=config";
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java b/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java
index 447ea3c..82ead66 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeBuilderTest.java
@@ -1204,7 +1204,7 @@
throws Exception
{
// Check containsAll().
- Set<ByteString> expectedValues = new HashSet<ByteString>();
+ Set<ByteString> expectedValues = new HashSet<>();
for (String value : values)
{
expectedValues.add(ByteString.valueOf(value));
@@ -1215,12 +1215,12 @@
if (values.length > 1)
{
- Set<ByteString> subSet = new HashSet<ByteString>(expectedValues);
+ Set<ByteString> subSet = new HashSet<>(expectedValues);
subSet.remove(subSet.iterator());
Assert.assertTrue(a.containsAll(subSet));
}
- Set<ByteString> bigSet = new HashSet<ByteString>(expectedValues);
+ Set<ByteString> bigSet = new HashSet<>(expectedValues);
bigSet.add(ByteString.valueOf("xxxx"));
Assert.assertFalse(a.containsAll(bigSet));
@@ -1427,7 +1427,7 @@
options.length)));
}
- List<String> tmp = new ArrayList<String>(Arrays.asList(options));
+ List<String> tmp = new ArrayList<>(Arrays.asList(options));
tmp.add("xxxx");
Assert.assertFalse(a.hasAllOptions(tmp));
@@ -1764,7 +1764,7 @@
Assert.assertFalse(a.optionsEqual(Collections.singleton(options[0])));
}
- Set<String> stmp = new HashSet<String>(Arrays.asList(options));
+ Set<String> stmp = new HashSet<>(Arrays.asList(options));
stmp.add("xxxx");
Assert.assertFalse(a.optionsEqual(stmp));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/AttributesTest.java b/opendj-server-legacy/src/test/java/org/opends/server/types/AttributesTest.java
index 54a0b91..31d3624 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/AttributesTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/AttributesTest.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.types;
@@ -217,7 +217,7 @@
public void testMergeWithDuplicates(int testCase, Attribute a1, Attribute a2,
Attribute e, Attribute d) throws Exception
{
- List<ByteString> duplicates = new LinkedList<ByteString>();
+ List<ByteString> duplicates = new LinkedList<>();
Attribute actual = Attributes.merge(a1, a2, duplicates);
Assert.assertEquals(actual, e);
@@ -275,7 +275,7 @@
public void testSubtractWithMissingValues(int testCase, Attribute a1,
Attribute a2, Attribute e, Attribute m) throws Exception
{
- List<ByteString> missingValues = new LinkedList<ByteString>();
+ List<ByteString> missingValues = new LinkedList<>();
Attribute actual = Attributes.subtract(a1, a2, missingValues);
Assert.assertEquals(actual, e);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/DirectoryExceptionTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/types/DirectoryExceptionTestCase.java
index 2e8e8eb..70a824a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/DirectoryExceptionTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/DirectoryExceptionTestCase.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.types;
@@ -146,7 +146,7 @@
LocalizableMessage msg = LocalizableMessage.raw("Test Constructor 4");
DN dn = DN.valueOf("cn=Test Constructor 4,dc=example,dc=com");
Exception e = new Exception("Test Constructor 4 Exception");
- List<String> refs = new ArrayList<String>();
+ List<String> refs = new ArrayList<>();
refs.add("ldap://ldap.example.com/cn=Test Constructor 4,dc=example,dc=com");
validateException(new DirectoryException(resultCode, msg, dn, refs, e));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/LockManagerTest.java b/opendj-server-legacy/src/test/java/org/opends/server/types/LockManagerTest.java
index 7511e81..7ae6db7 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/LockManagerTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/LockManagerTest.java
@@ -243,7 +243,7 @@
final LockManager lockManager = new LockManager();
// Acquire 100 different locks. The first few locks should be evicted from the cache.
- final LinkedList<DNLock> locks = new LinkedList<DNLock>();
+ final LinkedList<DNLock> locks = new LinkedList<>();
for (int i = 0; i < 100; i++)
{
locks.add(lockManager.tryWriteLockEntry(dn(i)));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
index 30a980e..7b36328 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
@@ -110,8 +110,7 @@
* A Map of client connections that should be used when performing operations
* and whether config read operations should be successful.
*/
- private Map<InternalClientConnection, Boolean> connections =
- new HashMap<InternalClientConnection, Boolean>();
+ private Map<InternalClientConnection, Boolean> connections = new HashMap<>();
/**
* Make sure that the server is running and that an appropriate set of
@@ -507,7 +506,7 @@
{
assertEquals(conn.hasPrivilege(Privilege.CONFIG_WRITE, null), hasPrivilege);
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("ds-cfg-size-limit", "2000")));
@@ -631,7 +630,7 @@
assertEquals(conn.hasPrivilege(Privilege.SUBENTRY_WRITE, null),
hasPrivilege);
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("subtreeSpecification",
"{base \"ou=doesnotexist\"}")));
@@ -870,7 +869,7 @@
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " +
"X-ORIGIN 'PrivilegeTestCase' )";
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.ADD,
Attributes.create("attributetypes", attrDefinition)));
@@ -1176,7 +1175,7 @@
"givenName: ProxyV1",
"sn: Test");
- List<Control> controls = new ArrayList<Control>(1);
+ List<Control> controls = new ArrayList<>(1);
controls.add(new ProxiedAuthV1Control(DN.valueOf("cn=PWReset Target,o=test")));
@@ -1195,7 +1194,7 @@
// Try to modify the entry to add a description.
- List<Modification> mods = new ArrayList<Modification>(1);
+ List<Modification> mods = new ArrayList<>(1);
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("description", "foo")));
@@ -1259,7 +1258,7 @@
boolean hasProxyPrivilege = conn.hasPrivilege(Privilege.PROXIED_AUTH, null);
DN targetDN = DN.valueOf("cn=PWReset Target,o=test");
- List<Control> controls = new ArrayList<Control>(1);
+ List<Control> controls = new ArrayList<>(1);
controls.add(new ProxiedAuthV1Control(targetDN));
@@ -1321,7 +1320,7 @@
"givenName: ProxyV2",
"sn: Test");
- List<Control> controls = new ArrayList<Control>(1);
+ List<Control> controls = new ArrayList<>(1);
controls.add(new ProxiedAuthV2Control(ByteString.valueOf("dn:cn=PWReset Target,o=test")));
@@ -1341,7 +1340,7 @@
// Try to modify the entry to add a description.
- List<Modification> mods = new ArrayList<Modification>(1);
+ List<Modification> mods = new ArrayList<>(1);
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("description", "foo")));
@@ -1406,7 +1405,7 @@
boolean hasProxyPrivilege = conn.hasPrivilege(Privilege.PROXIED_AUTH, null);
DN targetDN = DN.valueOf("cn=PWReset Target,o=test");
- List<Control> controls = new ArrayList<Control>(1);
+ List<Control> controls = new ArrayList<>(1);
controls.add(new ProxiedAuthV2Control(ByteString.valueOf("dn:" + targetDN)));
@@ -2293,7 +2292,7 @@
// Modify the user entry to add the CONFIG_READ privilege and verify that
// the client connection reflects that.
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.ADD, Attributes.create(
"ds-privilege-name", "config-read")));
ModifyOperation modifyOperation = rootConnection.processModify(
@@ -2344,7 +2343,7 @@
// Update the set of root privileges to include proxied auth.
InternalClientConnection internalRootConn = getRootConnection();
- List<Modification> mods = new ArrayList<Modification>();
+ List<Modification> mods = new ArrayList<>();
mods.add(new Modification(ModificationType.ADD,
Attributes.create("ds-cfg-default-root-privilege-name",
"proxied-auth")));
@@ -2385,13 +2384,13 @@
@Test
public void testConfigurablePrivilegeSets()
{
- Set<String> serverPrivNames = new HashSet<String>();
+ Set<String> serverPrivNames = new HashSet<>();
for (Privilege p : Privilege.values())
{
serverPrivNames.add(p.toString());
}
- Set<String> defaultRootPrivNames = new HashSet<String>();
+ Set<String> defaultRootPrivNames = new HashSet<>();
for (RootDNCfgDefn.DefaultRootPrivilegeName p :
RootDNCfgDefn.DefaultRootPrivilegeName.values())
{
@@ -2401,7 +2400,7 @@
"default root privilege " + p);
}
- Set<String> disableablePrivNames = new HashSet<String>();
+ Set<String> disableablePrivNames = new HashSet<>();
for (DisabledPrivilege p : DisabledPrivilege.values())
{
disableablePrivNames.add(p.toString());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java b/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
index 395638c..6fb6e1e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
@@ -125,7 +125,7 @@
0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
- List<String[]> allParameters = new ArrayList<String[]>();
+ List<String[]> allParameters = new ArrayList<>();
for (int i = 0; i < CHAR_NIBBLES.length; i++) {
char highNibble = CHAR_NIBBLES[i];
byte highByteNibble = BYTE_NIBBLES[i];
@@ -182,7 +182,7 @@
final char[] INVALID_NIBBBLES = {'g', 'z', 'G', 'Z', '-', '=', '+', '\00', ')',
'n', 't', '\\'};
- List<String> invalidEscapeSequences = new ArrayList<String>();
+ List<String> invalidEscapeSequences = new ArrayList<>();
for (char validNibble : VALID_NIBBLES)
{
@@ -195,7 +195,7 @@
invalidEscapeSequences.add("\\" + validNibble);
}
- List<String[]> allParameters = new ArrayList<String[]>();
+ List<String[]> allParameters = new ArrayList<>();
for (String invalidEscape : invalidEscapeSequences) {
// Exact match
allParameters.add(new String[]{"(sn=" + invalidEscape + ")"});
@@ -477,7 +477,7 @@
private List<String> getEntriesExcluding(List<String> matchedEntries) {
- List<String> unmatched = new ArrayList<String>(ALL_ENTRIES_LDIF);
+ List<String> unmatched = new ArrayList<>(ALL_ENTRIES_LDIF);
unmatched.removeAll(matchedEntries);
return unmatched;
}
@@ -490,12 +490,12 @@
private List<String> unmatchedEntriesLdif;
private FilterType filterType;
- private LinkedHashSet<SearchFilter> filterComponents = new LinkedHashSet<SearchFilter>();
+ private LinkedHashSet<SearchFilter> filterComponents = new LinkedHashSet<>();
private SearchFilter notComponent;
private ByteString assertionValue;
private AttributeType attributeType;
private ByteString subInitialElement;
- private List<ByteString> subAnyElements = new ArrayList<ByteString>();
+ private List<ByteString> subAnyElements = new ArrayList<>();
private ByteString subFinalElement;
private String matchingRuleId;
private boolean dnAttributes;
@@ -675,7 +675,7 @@
description.attributeType = DirectoryServer.getAttributeType(attributeType);
description.subInitialElement = ByteString.valueOf(subInitial);
- description.subAnyElements = new ArrayList<ByteString>();
+ description.subAnyElements = new ArrayList<>();
if (subAny != null)
{
for (String s : subAny)
@@ -699,7 +699,7 @@
private List<FilterDescription> getNotFilters(List<FilterDescription> filters) {
- List<FilterDescription> notFilters = new ArrayList<FilterDescription>();
+ List<FilterDescription> notFilters = new ArrayList<>();
for (FilterDescription filter: filters) {
notFilters.add(filter.negate());
@@ -712,8 +712,8 @@
private FilterDescription getAndFilter(List<FilterDescription> filters) {
FilterDescription andFilter = new FilterDescription();
- List<String> matchedEntries = new ArrayList<String>(ALL_ENTRIES_LDIF);
- List<SearchFilter> filterComponents = new ArrayList<SearchFilter>();
+ List<String> matchedEntries = new ArrayList<>(ALL_ENTRIES_LDIF);
+ List<SearchFilter> filterComponents = new ArrayList<>();
for (FilterDescription filter: filters) {
matchedEntries.retainAll(filter.matchedEntriesLdif);
@@ -721,7 +721,7 @@
}
andFilter.searchFilter = SearchFilter.createANDFilter(filterComponents);
- andFilter.filterComponents = new LinkedHashSet<SearchFilter>(filterComponents);
+ andFilter.filterComponents = new LinkedHashSet<>(filterComponents);
andFilter.filterType = FilterType.AND;
@@ -733,7 +733,7 @@
private List<FilterDescription> getAndFilters(List<FilterDescription> filters) {
- List<FilterDescription> andFilters = new ArrayList<FilterDescription>();
+ List<FilterDescription> andFilters = new ArrayList<>();
for (FilterDescription first: filters) {
for (FilterDescription second: filters) {
@@ -748,8 +748,8 @@
private FilterDescription getOrFilter(List<FilterDescription> filters) {
FilterDescription orFilter = new FilterDescription();
- List<String> unmatchedEntries = new ArrayList<String>(ALL_ENTRIES_LDIF);
- List<SearchFilter> filterComponents = new ArrayList<SearchFilter>();
+ List<String> unmatchedEntries = new ArrayList<>(ALL_ENTRIES_LDIF);
+ List<SearchFilter> filterComponents = new ArrayList<>();
for (FilterDescription filter: filters) {
unmatchedEntries.retainAll(filter.unmatchedEntriesLdif);
@@ -757,7 +757,7 @@
}
orFilter.searchFilter = SearchFilter.createORFilter(filterComponents);
- orFilter.filterComponents = new LinkedHashSet<SearchFilter>(filterComponents);
+ orFilter.filterComponents = new LinkedHashSet<>(filterComponents);
orFilter.filterType = FilterType.OR;
@@ -772,7 +772,7 @@
private List<FilterDescription> getOrFilters(List<FilterDescription> filters) {
- List<FilterDescription> orFilters = new ArrayList<FilterDescription>();
+ List<FilterDescription> orFilters = new ArrayList<>();
for (FilterDescription first: filters) {
for (FilterDescription second: filters) {
@@ -825,7 +825,7 @@
* @see #getMinimalFilterDescriptionList
*/
private List<FilterDescription> getFilterDescriptionList() throws Exception {
- List<FilterDescription> baseDescriptions = new ArrayList<FilterDescription>();
+ List<FilterDescription> baseDescriptions = new ArrayList<>();
baseDescriptions.addAll(getEqualityFilters());
baseDescriptions.addAll(getInequalityFilters());
@@ -833,7 +833,7 @@
baseDescriptions.addAll(getSubstringFilters());
baseDescriptions.addAll(getNotFilters(baseDescriptions));
- List<FilterDescription> allDescriptions = new ArrayList<FilterDescription>();
+ List<FilterDescription> allDescriptions = new ArrayList<>();
allDescriptions.addAll(getAndFilters(baseDescriptions));
allDescriptions.addAll(getOrFilters(baseDescriptions));
@@ -844,8 +844,8 @@
protected List<FilterDescription> getMinimalFilterDescriptionList() throws Exception {
- List<FilterDescription> baseDescriptions = new ArrayList<FilterDescription>();
- List<FilterDescription> allDescriptions = new ArrayList<FilterDescription>();
+ List<FilterDescription> baseDescriptions = new ArrayList<>();
+ List<FilterDescription> allDescriptions = new ArrayList<>();
baseDescriptions.addAll(getEqualityFilters().subList(0, 1));
baseDescriptions.addAll(getInequalityFilters().subList(0, 2));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/SmallMapTest.java b/opendj-server-legacy/src/test/java/org/opends/server/types/SmallMapTest.java
index f0ce54e..17a474f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/SmallMapTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/SmallMapTest.java
@@ -20,7 +20,7 @@
*
* CDDL HEADER END
*
- * Copyright 2014 ForgeRock AS
+ * Copyright 2014-2015 ForgeRock AS
*/
package org.opends.server.types;
@@ -40,7 +40,7 @@
@Test
public void testPutAndSize() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
assertEquals(map.size(), 0);
assertEquals(map.put(1, "one"), null);
assertEquals(map.size(), 1);
@@ -55,7 +55,7 @@
@Test(dependsOnMethods = { "testPutAndSize" })
public void testGet() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
assertEquals(map.get(1), null);
assertEquals(map.get(2), null);
map.put(1, "one");
@@ -72,8 +72,8 @@
@Test(dependsOnMethods = { "testPutAndSize" })
public void testPutAll() throws Exception
{
- final SmallMap<Integer, String> map = new SmallMap<Integer, String>();
- final HashMap<Integer, String> hashMap = new HashMap<Integer, String>();
+ final SmallMap<Integer, String> map = new SmallMap<>();
+ final HashMap<Integer, String> hashMap = new HashMap<>();
map.putAll(hashMap);
assertEquals(map.size(), 0);
hashMap.put(1, "one");
@@ -85,7 +85,7 @@
@Test(dependsOnMethods = { "testPutAndSize" })
public void testRemove() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
assertEquals(map.size(), 0);
assertEquals(map.remove(2), null);
assertEquals(map.remove(1), null);
@@ -106,7 +106,7 @@
@Test(dependsOnMethods = { "testPutAndSize" })
public void testContains() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
assertDoesNotContain(map, entry(2, "two"));
map.put(1, null);
@@ -126,7 +126,7 @@
@Test(dependsOnMethods = { "testPutAndSize" })
public void testClear() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
map.clear();
assertEquals(map.size(), 0);
@@ -143,7 +143,7 @@
@Test(dependsOnMethods = { "testPutAndSize" })
public void testEntrySetSize() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
assertEquals(map.entrySet().size(), 0);
map.put(1, "one");
@@ -158,7 +158,7 @@
@Test(dependsOnMethods = { "testEntrySetSize" })
public void testEntrySetIterator() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
assertThat(map.entrySet().iterator()).isEmpty();
map.put(1, "one");
@@ -174,7 +174,7 @@
@Test(dependsOnMethods = { "testEntrySetIterator" })
public void testEntrySetIteratorNextRemove() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
map.put(1, "one");
Iterator<Entry<Integer, String>> iter = map.entrySet().iterator();
assertTrue(iter.hasNext());
@@ -189,7 +189,7 @@
expectedExceptions = { NoSuchElementException.class })
public void testEntrySetIteratorNextThrowsNoSuchElementException() throws Exception
{
- SmallMap<Integer, String> map = new SmallMap<Integer, String>();
+ SmallMap<Integer, String> map = new SmallMap<>();
map.put(1, "one");
Iterator<Entry<Integer, String>> iter = map.entrySet().iterator();
assertTrue(iter.hasNext());
@@ -200,7 +200,7 @@
private <K, V> Entry<K, V> entry(K key, V value)
{
- return new AbstractMap.SimpleImmutableEntry<K, V>(key, value);
+ return new AbstractMap.SimpleImmutableEntry<>(key, value);
}
private void assertContains(SmallMap<Integer, String> map,
@@ -243,7 +243,7 @@
@Test(expectedExceptions = { NullPointerException.class })
public void testPutAllRejectsNull() throws Exception
{
- final HashMap<Integer, String> map = new HashMap<Integer, String>();
+ final HashMap<Integer, String> map = new HashMap<>();
map.put(null, null);
new SmallMap<Integer, String>().putAll(map);
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestAttributeType.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestAttributeType.java
index 7714b47..a2b7731 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestAttributeType.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestAttributeType.java
@@ -132,7 +132,7 @@
definition.append("( ");
definition.append(oid);
- LinkedHashSet<String> nameSet = new LinkedHashSet<String>();
+ LinkedHashSet<String> nameSet = new LinkedHashSet<>();
if (primaryName != null)
{
nameSet.add(primaryName);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestCommonSchemaElements.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestCommonSchemaElements.java
index 2b20109..1a90ae3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestCommonSchemaElements.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestCommonSchemaElements.java
@@ -202,12 +202,12 @@
}
if (extraProperties == null) {
- extraProperties = new HashMap<String, List<String>>();
+ extraProperties = new HashMap<>();
}
List<String> l = extraProperties.get(name);
if (l == null) {
- l = new ArrayList<String>();
+ l = new ArrayList<>();
extraProperties.put(name, l);
}
l.addAll(Arrays.asList(values));
@@ -267,7 +267,7 @@
}
if (this.names == null) {
- this.names = new LinkedList<String>();
+ this.names = new LinkedList<>();
}
this.names.addAll(Arrays.asList(names));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java
index e3c6a5b..56d3c01 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java
@@ -271,7 +271,7 @@
*/
@Test
public void testCreateWithMultipleRDNs2() throws Exception {
- ArrayList<RDN> rdnList = new ArrayList<RDN>();
+ ArrayList<RDN> rdnList = new ArrayList<>();
rdnList.add(RDN.decode("dc=foo"));
rdnList.add(RDN.decode("dc=opends"));
rdnList.add(RDN.decode("dc=org"));
@@ -531,7 +531,7 @@
*/
@DataProvider(name = "namingContexts")
public Object[][] getNamingContexts() {
- ArrayList<DN> contextList = new ArrayList<DN>();
+ ArrayList<DN> contextList = new ArrayList<>();
contextList.addAll(DirectoryServer.getPublicNamingContexts().keySet());
contextList.addAll(DirectoryServer.getPrivateNamingContexts().keySet());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java
index 6f7a5a4..b335eac 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestEntry.java
@@ -97,8 +97,7 @@
"Unable to resolve object class extensibleObject");
}
- HashMap<ObjectClass, String> objectClasses =
- new HashMap<ObjectClass, String>();
+ HashMap<ObjectClass, String> objectClasses = new HashMap<>();
objectClasses.put(top, top.getNameOrOID());
objectClasses.put(extensible, extensible.getNameOrOID());
@@ -110,7 +109,7 @@
for (String value : values) {
builder.add(value);
}
- ArrayList<Attribute> attributes = new ArrayList<Attribute>();
+ ArrayList<Attribute> attributes = new ArrayList<>();
attributes.add(builder.toAttribute());
testEntry.putAttribute(type, attributes);
@@ -197,7 +196,7 @@
.getAttributeType("supportedldapversion");
String[] values = new String[] { "-4", "-2", "0", "1", "3" };
- HashSet<Integer> expected = new HashSet<Integer>();
+ HashSet<Integer> expected = new HashSet<>();
for (String value : values) {
expected.add(Integer.valueOf(value));
}
@@ -249,13 +248,13 @@
// Relative to the root DN.
DN rootDN = DN.rootDN();
- Set<SubtreeSpecification> expected = new HashSet<SubtreeSpecification>();
+ Set<SubtreeSpecification> expected = new HashSet<>();
for (String value : values) {
expected.add(SubtreeSpecification.valueOf(rootDN, value));
}
Entry entry = createTestEntry(type, values);
- Set<SubtreeSpecification> result = new HashSet<SubtreeSpecification>();
+ Set<SubtreeSpecification> result = new HashSet<>();
List<Attribute> attributes = entry.getAttribute(type, true);
for (Attribute a : attributes)
{
@@ -321,7 +320,7 @@
assertFalse(e.hasAttribute(uidType, options));
assertTrue(e.hasAttribute(mnType, options));
- options = new LinkedHashSet<String>();
+ options = new LinkedHashSet<>();
assertTrue(e.hasAttribute(ocType, options));
assertTrue(e.hasAttribute(cnType, options));
assertTrue(e.hasAttribute(nameType, options));
@@ -565,7 +564,7 @@
assertEquals(attrs.size(), 1);
- options = new LinkedHashSet<String>();
+ options = new LinkedHashSet<>();
attrs = e.getAttribute(ocType, options);
assertNotNull(attrs);
assertEquals(attrs.size(), 1);
@@ -778,7 +777,7 @@
assertNull(attrs);
- options = new LinkedHashSet<String>();
+ options = new LinkedHashSet<>();
attrs = e.getUserAttribute(ocType, options);
assertNull(attrs);
@@ -925,7 +924,7 @@
assertEquals(attrs.size(), 1);
- options = new LinkedHashSet<String>();
+ options = new LinkedHashSet<>();
attrs = e.getOperationalAttribute(ocType, options);
assertNull(attrs);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java
index 54920b5..531f664 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java
@@ -111,7 +111,7 @@
definition.append("( ");
definition.append(oid);
- LinkedHashSet<String> nameSet = new LinkedHashSet<String>();
+ LinkedHashSet<String> nameSet = new LinkedHashSet<>();
if (primaryName != null)
{
nameSet.add(primaryName);
@@ -296,7 +296,7 @@
}
if (this.requiredAttributeTypes == null) {
- this.requiredAttributeTypes = new LinkedHashSet<AttributeType>();
+ this.requiredAttributeTypes = new LinkedHashSet<>();
}
this.requiredAttributeTypes.addAll(Arrays.asList(types));
@@ -316,7 +316,7 @@
}
if (this.optionalAttributeTypes == null) {
- this.optionalAttributeTypes = new LinkedHashSet<AttributeType>();
+ this.optionalAttributeTypes = new LinkedHashSet<>();
}
this.optionalAttributeTypes.addAll(Arrays.asList(types));
@@ -510,7 +510,7 @@
ObjectClassBuilder builder2 = new ObjectClassBuilder("parent2","3.4.5");
builder2.addOptionalAttributeTypes(types[3], types[4], types[5]);
ObjectClass parent2 = builder2.getInstance();
- Set<ObjectClass> superiors = new LinkedHashSet<ObjectClass>();
+ Set<ObjectClass> superiors = new LinkedHashSet<>();
superiors.add(parent1);
superiors.add(parent2);
ObjectClassBuilder builder3 = new ObjectClassBuilder("child", "6.7.8");
@@ -577,7 +577,7 @@
ObjectClassBuilder builder2 = new ObjectClassBuilder("parent2","3.4.5");
builder2.addOptionalAttributeTypes(types[3], types[4], types[5]);
ObjectClass parent2 = builder2.getInstance();
- Set<ObjectClass> superiors = new LinkedHashSet<ObjectClass>();
+ Set<ObjectClass> superiors = new LinkedHashSet<>();
superiors.add(parent1);
superiors.add(parent2);
ObjectClassBuilder builder3 = new ObjectClassBuilder("child", "6.7.8");
@@ -778,7 +778,7 @@
builder = new ObjectClassBuilder("parent2","3.4.5");
builder.addRequiredAttributeTypes(types[3], types[4], types[5]);
ObjectClass parent2 = builder.getInstance();
- Set<ObjectClass> superiors = new LinkedHashSet<ObjectClass>();
+ Set<ObjectClass> superiors = new LinkedHashSet<>();
superiors.add(parent1);
superiors.add(parent2);
builder = new ObjectClassBuilder("child", "6.7.8");
@@ -845,7 +845,7 @@
builder = new ObjectClassBuilder("parent2","3.4.5");
builder.addRequiredAttributeTypes(types[3], types[4], types[5]);
ObjectClass parent2 = builder.getInstance();
- Set<ObjectClass> superiors = new LinkedHashSet<ObjectClass>();
+ Set<ObjectClass> superiors = new LinkedHashSet<>();
superiors.add(parent1);
superiors.add(parent2);
builder = new ObjectClassBuilder("child", "6.7.8");
@@ -1014,7 +1014,7 @@
builder = new ObjectClassBuilder("parent2",
"2.3.4");
ObjectClass parent2 = builder.getInstance();
- Set<ObjectClass> superiors = new LinkedHashSet<ObjectClass>();
+ Set<ObjectClass> superiors = new LinkedHashSet<>();
superiors.add(parent1);
superiors.add(parent2);
builder = new ObjectClassBuilder("child", "1.2.3.4");
@@ -1098,7 +1098,7 @@
builder = new ObjectClassBuilder("parent2","2.2.2");
ObjectClass parent2 = builder.getInstance();
- Set<ObjectClass> superiors = new LinkedHashSet<ObjectClass>();
+ Set<ObjectClass> superiors = new LinkedHashSet<>();
superiors.add(parent1);
superiors.add(parent2);
builder = new ObjectClassBuilder("child", "1.2.3");
@@ -1601,7 +1601,7 @@
boolean isValid) throws Exception {
ObjectClassBuilder builder = new ObjectClassBuilder("testType", "1.2.3");
builder.setObjectClassType(type);
- Set<ObjectClass> superiors = new LinkedHashSet<ObjectClass>();
+ Set<ObjectClass> superiors = new LinkedHashSet<>();
superiors.add(parent1);
superiors.add(parent2);
builder.setSuperior(superiors);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java
index b3c1191..af99e20 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestRDN.java
@@ -154,9 +154,9 @@
*/
@Test
public void testConstructorMultiAVAList() throws Exception {
- ArrayList<AttributeType> typeList = new ArrayList<AttributeType>();
- ArrayList<String> nameList = new ArrayList<String>();
- ArrayList<ByteString> valueList = new ArrayList<ByteString>();
+ ArrayList<AttributeType> typeList = new ArrayList<>();
+ ArrayList<String> nameList = new ArrayList<>();
+ ArrayList<ByteString> valueList = new ArrayList<>();
typeList.add(AT_DC);
nameList.add(AT_DC.getNameOrOID());
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeRuleTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeRuleTestCase.java
index 0fb55b0..234d2b8 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeRuleTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeRuleTestCase.java
@@ -88,38 +88,38 @@
EntryDNVirtualAttributeProvider provider =
new EntryDNVirtualAttributeProvider();
- LinkedHashSet<DN> dnSet1 = new LinkedHashSet<DN>(1);
+ LinkedHashSet<DN> dnSet1 = new LinkedHashSet<>(1);
dnSet1.add(DN.valueOf("o=test"));
- LinkedHashSet<DN> dnSet2 = new LinkedHashSet<DN>(1);
+ LinkedHashSet<DN> dnSet2 = new LinkedHashSet<>(1);
dnSet2.add(DN.valueOf("dc=example,dc=com"));
- LinkedHashSet<DN> dnSet3 = new LinkedHashSet<DN>(2);
+ LinkedHashSet<DN> dnSet3 = new LinkedHashSet<>(2);
dnSet3.add(DN.valueOf("o=test"));
dnSet3.add(DN.valueOf("dc=example,dc=com"));
- LinkedHashSet<DN> groupSet1 = new LinkedHashSet<DN>(1);
+ LinkedHashSet<DN> groupSet1 = new LinkedHashSet<>(1);
groupSet1.add(DN.valueOf("cn=Test Group,o=test"));
- LinkedHashSet<DN> groupSet2 = new LinkedHashSet<DN>(1);
+ LinkedHashSet<DN> groupSet2 = new LinkedHashSet<>(1);
groupSet2.add(DN.valueOf("cn=Example Group,o=test"));
- LinkedHashSet<DN> groupSet3= new LinkedHashSet<DN>(2);
+ LinkedHashSet<DN> groupSet3= new LinkedHashSet<>(2);
groupSet3.add(DN.valueOf("cn=Test Group,o=test"));
groupSet3.add(DN.valueOf("cn=Example Group,o=test"));
- LinkedHashSet<SearchFilter> filterSet1 = new LinkedHashSet<SearchFilter>(1);
+ LinkedHashSet<SearchFilter> filterSet1 = new LinkedHashSet<>(1);
filterSet1.add(SearchFilter.objectClassPresent());
- LinkedHashSet<SearchFilter> filterSet2 = new LinkedHashSet<SearchFilter>(1);
+ LinkedHashSet<SearchFilter> filterSet2 = new LinkedHashSet<>(1);
filterSet2.add(SearchFilter.createFilterFromString("(o=test)"));
- LinkedHashSet<SearchFilter> filterSet3 = new LinkedHashSet<SearchFilter>(1);
+ LinkedHashSet<SearchFilter> filterSet3 = new LinkedHashSet<>(1);
filterSet3.add(SearchFilter.createFilterFromString("(foo=bar)"));
- LinkedHashSet<SearchFilter> filterSet4 = new LinkedHashSet<SearchFilter>(2);
+ LinkedHashSet<SearchFilter> filterSet4 = new LinkedHashSet<>(2);
filterSet4.add(SearchFilter.createFilterFromString("(o=test)"));
filterSet4.add(SearchFilter.createFilterFromString("(foo=bar)"));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java
index da4d26a..d630664 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/VirtualAttributeTestCase.java
@@ -127,7 +127,7 @@
assertTrue(virtualAttribute.contains(ByteString.valueOf("o=test")));
assertFalse(virtualAttribute.contains(ByteString.valueOf("o=not test")));
- LinkedHashSet<ByteString> testValues = new LinkedHashSet<ByteString>();
+ LinkedHashSet<ByteString> testValues = new LinkedHashSet<>();
testValues.add(ByteString.valueOf("o=test"));
assertTrue(virtualAttribute.containsAll(testValues));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/util/PackageInfoTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/util/PackageInfoTestCase.java
index 5386b25..a7e97f1 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/util/PackageInfoTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/util/PackageInfoTestCase.java
@@ -83,7 +83,7 @@
public Object[][] getADSSourceDirectories()
{
File adsSourceRoot = new File(sourceRoot, "ads");
- ArrayList<File> sourceDirs = new ArrayList<File>();
+ ArrayList<File> sourceDirs = new ArrayList<>();
getSourceDirectories(adsSourceRoot, sourceDirs);
Object[][] returnArray = new Object[sourceDirs.size()][1];
@@ -108,7 +108,7 @@
public Object[][] getAdminSourceDirectories()
{
File adminSourceRoot = new File(sourceRoot, "admin");
- ArrayList<File> sourceDirs = new ArrayList<File>();
+ ArrayList<File> sourceDirs = new ArrayList<>();
getSourceDirectories(adminSourceRoot, sourceDirs);
Object[][] returnArray = new Object[sourceDirs.size()][1];
@@ -133,7 +133,7 @@
public Object[][] getBuildToolsSourceDirectories()
{
File buildToolsSourceRoot = new File(sourceRoot, "build-tools");
- ArrayList<File> sourceDirs = new ArrayList<File>();
+ ArrayList<File> sourceDirs = new ArrayList<>();
getSourceDirectories(buildToolsSourceRoot, sourceDirs);
Object[][] returnArray = new Object[sourceDirs.size()][1];
@@ -158,7 +158,7 @@
public Object[][] getDSMLSourceDirectories()
{
File dsmlSourceRoot = new File(sourceRoot, "dsml");
- ArrayList<File> sourceDirs = new ArrayList<File>();
+ ArrayList<File> sourceDirs = new ArrayList<>();
getSourceDirectories(dsmlSourceRoot, sourceDirs);
Object[][] returnArray = new Object[sourceDirs.size()][1];
@@ -183,7 +183,7 @@
public Object[][] getGUIToolsSourceDirectories()
{
File guiToolsSourceRoot = new File(sourceRoot, "guitools");
- ArrayList<File> sourceDirs = new ArrayList<File>();
+ ArrayList<File> sourceDirs = new ArrayList<>();
getSourceDirectories(guiToolsSourceRoot, sourceDirs);
Object[][] returnArray = new Object[sourceDirs.size()][1];
@@ -208,7 +208,7 @@
public Object[][] getQuickSetupSourceDirectories()
{
File quickSetupSourceRoot = new File(sourceRoot, "quicksetup");
- ArrayList<File> sourceDirs = new ArrayList<File>();
+ ArrayList<File> sourceDirs = new ArrayList<>();
getSourceDirectories(quickSetupSourceRoot, sourceDirs);
Object[][] returnArray = new Object[sourceDirs.size()][1];
@@ -233,7 +233,7 @@
public Object[][] getServerSourceDirectories()
{
File serverSourceRoot = new File(sourceRoot, "server");
- ArrayList<File> sourceDirs = new ArrayList<File>();
+ ArrayList<File> sourceDirs = new ArrayList<>();
getSourceDirectories(serverSourceRoot, sourceDirs);
Object[][] returnArray = new Object[sourceDirs.size()][1];
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/util/TestAddChangeRecordEntry.java b/opendj-server-legacy/src/test/java/org/opends/server/util/TestAddChangeRecordEntry.java
index 111199e..d795f9d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/util/TestAddChangeRecordEntry.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/util/TestAddChangeRecordEntry.java
@@ -68,9 +68,9 @@
// start the server.
TestCaseUtils.startServer();
- attributes = new HashMap<AttributeType, List<Attribute>>();
+ attributes = new HashMap<>();
attribute = Attributes.create("cn", "hello world");
- ArrayList<Attribute> alist = new ArrayList<Attribute>(1);
+ ArrayList<Attribute> alist = new ArrayList<>(1);
alist.add(attribute);
attributes.put(attribute.getAttributeType(), alist);
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java b/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java
index fbdc196..db63972 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFReader.java
@@ -453,7 +453,7 @@
dn = DN.valueOf("cn=Fiona Jensen, ou=Marketing, dc=airius, dc=com");
Assert.assertEquals(add.getDN(), dn);
- List<Attribute> attrs = new ArrayList<Attribute>();
+ List<Attribute> attrs = new ArrayList<>();
AttributeBuilder builder = new AttributeBuilder(AT_OC, "objectclass");
builder.add("top");
builder.add("person");
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFWriter.java b/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFWriter.java
index 57ce46d..f0d9373 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFWriter.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/util/TestLDIFWriter.java
@@ -303,7 +303,7 @@
},
};
- List<Entry[]> entries = new LinkedList<Entry[]>();
+ List<Entry[]> entries = new LinkedList<>();
for (String[] s : input) {
DN dn = DN.valueOf(s[0]);
@@ -411,7 +411,7 @@
LDIFWriter ldifWriter = writer.getLDIFWriter();
- List<Modification> mods = new LinkedList<Modification>();
+ List<Modification> mods = new LinkedList<>();
for (RawModification lmod : change.getModifications()) {
mods.add(lmod.toModification());
}
@@ -543,7 +543,7 @@
*/
private <T extends ChangeRecordEntry> List<Object[]> createChangeRecords(
Class<T> theClass, String[] inputLDIF) throws Exception {
- List<Object[]> changes = new LinkedList<Object[]>();
+ List<Object[]> changes = new LinkedList<>();
for (String ldifString : inputLDIF) {
byte[] bytes = StaticUtils.getBytes(ldifString);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/util/TestModifyChangeRecordEntry.java b/opendj-server-legacy/src/test/java/org/opends/server/util/TestModifyChangeRecordEntry.java
index 6b7f746..2be530d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/util/TestModifyChangeRecordEntry.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/util/TestModifyChangeRecordEntry.java
@@ -70,7 +70,7 @@
TestCaseUtils.startServer();
// Create a simple set of modifications.
- modifications = new ArrayList<RawModification>();
+ modifications = new ArrayList<>();
attribute = Attributes.create("cn", "hello world");
LDAPAttribute lattribute = new LDAPAttribute(attribute);
LDAPModification modification = new LDAPModification(
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java b/opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java
index 3210088..af84392 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/util/TestStaticUtils.java
@@ -98,7 +98,7 @@
*/
@DataProvider(name = "getBytesTestData")
public Object[][] createGetBytesTestData() {
- List<String> strings = new LinkedList<String>();
+ List<String> strings = new LinkedList<>();
// Some simple strings.
strings.add("");
@@ -379,7 +379,7 @@
*/
@DataProvider(name = "isDigitTestData")
public Object[][] createIsDigitTestData() {
- List<Object[]> data = new LinkedList<Object[]>();
+ List<Object[]> data = new LinkedList<>();
for (char c = '0'; c <= '9'; c++) {
data.add(new Object[] { c, true });
@@ -415,7 +415,7 @@
*/
@DataProvider(name = "isAlphaTestData")
public Object[][] createIsAlphaTestData() {
- List<Object[]> data = new LinkedList<Object[]>();
+ List<Object[]> data = new LinkedList<>();
for (char c = 'a'; c <= 'z'; c++) {
data.add(new Object[] { c, true });
@@ -461,7 +461,7 @@
*/
@DataProvider(name = "isHexDigitTestData")
public Object[][] createIsHexDigitTestData() {
- List<Object[]> data = new LinkedList<Object[]>();
+ List<Object[]> data = new LinkedList<>();
for (char c = 'a'; c <= 'f'; c++) {
data.add(new Object[] { c, true });
@@ -564,7 +564,7 @@
*/
@DataProvider(name = "needsBase64EncodingTestData")
public Object[][] createNeedsBase64EncodingTestData() {
- List<Object[]> data = new LinkedList<Object[]>();
+ List<Object[]> data = new LinkedList<>();
// Check SAFE-INIT-CHAR.
for (char c = '\u0000'; c < '\u0100'; c++) {
@@ -709,7 +709,7 @@
@Test(dataProvider = "listToArrayTestData")
public void testListToArray(String[] strings) throws Exception {
if (strings != null) {
- List<String> list = new ArrayList<String>(strings.length);
+ List<String> list = new ArrayList<>(strings.length);
for (String string : strings) {
list.add(string);
}
@@ -960,7 +960,7 @@
public void testRecursiveDelete() throws Exception {
File dir0 = TestCaseUtils.createTemporaryDirectory("dst");
- List<File> files = new LinkedList<File>();
+ List<File> files = new LinkedList<>();
File dir1 = new File(dir0, "one");
dir1.mkdir();
--
Gitblit v1.10.0