From 0b84d2442ea178dc9989a239f26be28327476c48 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 28 Apr 2015 09:24:26 +0000
Subject: [PATCH] AutoRefactor'ed use diamond operator
---
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java | 5
opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFTestCase.java | 16
opendj-svn-property-check-maven-plugin/src/main/java/org/forgerock/maven/CheckSVNPropertyMojo.java | 2
opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java | 9
opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PostReadRequestControl.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java | 22
opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java | 5
opendj-core/src/test/java/org/forgerock/opendj/ldif/TemplateTagTestcase.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/Matcher.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResponseImpl.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/SearchResultReferenceImpl.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPUrl.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/EnumSyntaxImpl.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaUtils.java | 27
opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java | 7
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSchemaElementTestCase.java | 3
opendj-core/src/test/java/org/forgerock/opendj/ldap/MemoryBackendTestCase.java | 12
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SubstringMatchingRuleTest.java | 5
opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/ConcatSchemaMojo.java | 21
opendj-core/src/test/java/org/forgerock/opendj/ldap/MockScheduler.java | 8
opendj-core/src/main/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactory.java | 20
opendj-core/src/test/java/org/forgerock/opendj/ldap/LDAPServer.java | 9
opendj-core/src/main/java/org/forgerock/opendj/ldap/RequestHandlerFactoryAdapter.java | 34
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/NameFormTestCase.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaElement.java | 10
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java | 10
opendj-core/src/main/java/org/forgerock/opendj/io/ASN1InputStreamReader.java | 11
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Context.java | 5
opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFEntryWriterTestCase.java | 79 +-
opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/ProxyBackend.java | 18
opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractAttribute.java | 4
opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java | 14
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/DataSource.java | 8
opendj-core/src/test/java/org/forgerock/opendj/ldap/EntryTestCase.java | 42
opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/TestUtils.java | 4
opendj-core/src/main/java/org/forgerock/opendj/io/ASN1OutputStreamWriter.java | 5
opendj-core/src/test/java/org/forgerock/opendj/ldap/AbstractAsynchronousConnectionTestCase.java | 6
opendj-core/src/main/java/com/forgerock/opendj/util/StringPrepProfile.java | 13
opendj-core/src/main/java/org/forgerock/opendj/ldap/Connections.java | 14
opendj-core/src/test/java/org/forgerock/opendj/ldap/FilterTestCase.java | 10
opendj-core/src/test/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactoryTestCase.java | 4
opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateConfigMojo.java | 7
opendj-core/src/main/java/org/forgerock/opendj/ldap/CachedConnectionPool.java | 12
opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIF.java | 11
opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/AbstractRequestImpl.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/LDAPSyntaxDescriptionSyntaxImpl.java | 4
opendj-core/src/test/java/org/forgerock/opendj/ldap/AddressMaskTestCase.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeType.java | 2
opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/SearchRequestImpl.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/ServerSideSortRequestControl.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java | 54 +-
opendj-core/src/main/java/org/forgerock/opendj/ldap/AuthenticatedConnectionFactory.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/FacsimileNumberSyntaxImpl.java | 3
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Utils.java | 9
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ObjectAttributeMapper.java | 16
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRule.java | 10
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/GenerateCoreSchema.java | 12
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/MatchingRuleTestCase.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaImpl.java | 8
opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeFilter.java | 9
opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityResponseControlTestCase.java | 8
opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityRequestControlTestCase.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/SortKey.java | 4
opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedRequest.java | 28 -
opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFEntryReader.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeParser.java | 8
opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.java | 5
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java | 10
opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/Proxy.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFReader.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPOptions.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/ResultCode.java | 4
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java | 11
opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateManifestClassPathMojo.java | 2
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TimeBasedMatchingRulesImpl.java | 4
opendj-core/src/main/java/com/forgerock/opendj/util/Iterables.java | 16
opendj-core/src/main/java/org/forgerock/opendj/ldap/MemoryBackend.java | 2
opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/GetEffectiveRightsRequestControl.java | 10
opendj-core/src/main/java/org/forgerock/opendj/ldap/Entries.java | 13
opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/DigestMD5SASLBindRequestImpl.java | 8
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ReferenceAttributeMapper.java | 13
opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java | 4
opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplateTest.java | 4
opendj-core/src/test/java/org/forgerock/opendj/ldap/ConnectionPoolTestCase.java | 9
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AbstractLDAPAttributeMapper.java | 5
opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractLoadBalancingAlgorithm.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFStream.java | 14
opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFChangeRecordWriterTestCase.java | 101 ++--
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPCompare.java | 2
opendj-core/src/main/java/com/forgerock/opendj/util/Iterators.java | 16
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java | 3
opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TeletexTerminalIdentifierSyntaxImpl.java | 3
opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/StartTLSExtendedRequestImpl.java | 6
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java | 4
opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java | 8
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AddRate.java | 4
opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedResult.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/Filter.java | 22
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DeliveryMethodSyntaxImpl.java | 3
opendj-core/src/main/java/org/forgerock/opendj/ldap/InternalConnection.java | 4
opendj-core/src/test/java/org/forgerock/opendj/ldif/EntryGeneratorTestCase.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaBuilder.java | 60 +-
opendj-core/src/main/java/org/forgerock/opendj/io/LDAP.java | 12
opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromiseImpl.java | 4
opendj-server/src/main/java/org/forgerock/opendj/server/setup/cli/SetupCli.java | 12
opendj-server/src/main/java/org/forgerock/opendj/server/core/AbstractDataProvider.java | 9
opendj-core/src/main/java/org/forgerock/opendj/ldap/Option.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaSupportedLocales.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/ConnectionState.java | 22
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java | 6
opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java | 8
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ModRate.java | 2
opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/ModelUtils.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/GSSAPISASLBindRequestImpl.java | 17
opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResultImpl.java | 4
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java | 4
opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java | 6
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImplTest.java | 4
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleUse.java | 10
opendj-core/src/main/java/com/forgerock/opendj/util/Collections2.java | 8
opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/MatchedValuesRequestControl.java | 8
opendj-core/src/test/java/org/forgerock/opendj/ldap/ConditionResultTestCase.java | 4
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/LDAPCollectionResourceProvider.java | 22
opendj-core/src/main/java/org/forgerock/opendj/ldif/EntryGenerator.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/RDN.java | 6
opendj-core/src/main/java/org/forgerock/opendj/io/ASN1ByteSequenceReader.java | 5
opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromises.java | 6
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java | 6
opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeDescription.java | 7
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImpl.java | 8
opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFChangeRecordReader.java | 10
135 files changed, 637 insertions(+), 750 deletions(-)
diff --git a/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedRequest.java b/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedRequest.java
index 70e5884..535b59c 100644
--- a/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedRequest.java
+++ b/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedRequest.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2013 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package com.forgerock.opendj.ldap.extensions;
@@ -253,54 +253,34 @@
private String targetUser = "";
- private final List<PasswordPolicyStateOperation> operations =
- new ArrayList<PasswordPolicyStateOperation>();
+ private final List<PasswordPolicyStateOperation> operations = new ArrayList<>();
static final String PASSWORD_POLICY_DN_NAME = "Password Policy DN";
-
static final String ACCOUNT_DISABLED_STATE_NAME = "Account Disabled State";
-
static final String ACCOUNT_EXPIRATION_TIME_NAME = "Account Expiration Time";
-
static final String SECONDS_UNTIL_ACCOUNT_EXPIRATION_NAME = "Seconds Until Account Expiration";
-
static final String PASSWORD_CHANGED_TIME_NAME = "Password Changed Time";
-
static final String PASSWORD_EXPIRATION_WARNED_TIME_NAME = "Password Expiration Warned Time";
-
static final String SECONDS_UNTIL_PASSWORD_EXPIRATION_NAME =
"Seconds Until Password Expiration";
-
static final String SECONDS_UNTIL_PASSWORD_EXPIRATION_WARNING_NAME =
"Seconds Until Password Expiration Warning";
-
static final String AUTHENTICATION_FAILURE_TIMES_NAME = "Authentication Failure Times";
-
static final String SECONDS_UNTIL_AUTHENTICATION_FAILURE_UNLOCK_NAME =
"Seconds Until Authentication Failure Unlock";
-
static final String REMAINING_AUTHENTICATION_FAILURE_COUNT_NAME =
"Remaining Authentication Failure Count";
-
static final String LAST_LOGIN_TIME_NAME = "Last Login Time";
-
static final String SECONDS_UNTIL_IDLE_LOCKOUT_NAME = "Seconds Until Idle Lockout";
-
static final String PASSWORD_RESET_STATE_NAME = "Password Reset State";
-
static final String SECONDS_UNTIL_PASSWORD_RESET_LOCKOUT_NAME =
"Seconds Until Password Reset Lockout";
-
static final String GRACE_LOGIN_USE_TIMES_NAME = "Grace Login Use Times";
-
static final String REMAINING_GRACE_LOGIN_COUNT_NAME = "Remaining Grace Login Count";
-
static final String PASSWORD_CHANGED_BY_REQUIRED_TIME_NAME =
"Password Changed By Required Time";
-
static final String SECONDS_UNTIL_REQUIRED_CHANGE_TIME_NAME =
"Seconds Until Required Change Time";
-
static final String PASSWORD_HISTORY_NAME = "Password History";
/**
@@ -367,7 +347,7 @@
// See if we have any values
if (reader.hasNextElement()) {
reader.readStartSequence();
- final ArrayList<ByteString> values = new ArrayList<ByteString>();
+ final ArrayList<ByteString> values = new ArrayList<>();
while (reader.hasNextElement()) {
values.add(reader.readOctetString());
}
@@ -769,7 +749,7 @@
if (dates == null) {
operations.add(property);
} else {
- final ArrayList<ByteString> times = new ArrayList<ByteString>(dates.length);
+ final ArrayList<ByteString> times = new ArrayList<>(dates.length);
for (final Date date : dates) {
times.add(toByteString(date));
}
diff --git a/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedResult.java b/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedResult.java
index 64c4fbd..817ca09 100644
--- a/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedResult.java
+++ b/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedResult.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package com.forgerock.opendj.ldap.extensions;
@@ -40,8 +41,7 @@
AbstractExtendedResult<PasswordPolicyStateExtendedResult> implements
PasswordPolicyStateOperationContainer {
private String targetUser = "";
- private final List<PasswordPolicyStateOperation> operations =
- new ArrayList<PasswordPolicyStateOperation>();
+ private final List<PasswordPolicyStateOperation> operations = new ArrayList<>();
/**
* Creates a new password policy state extended result with the provided
diff --git a/opendj-core/src/main/java/com/forgerock/opendj/util/Collections2.java b/opendj-core/src/main/java/com/forgerock/opendj/util/Collections2.java
index fe3086a..d89d95c 100644
--- a/opendj-core/src/main/java/com/forgerock/opendj/util/Collections2.java
+++ b/opendj-core/src/main/java/com/forgerock/opendj/util/Collections2.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS.
+ * Portions Copyright 2014-2015 ForgeRock AS.
*/
package com.forgerock.opendj.util;
@@ -225,7 +225,7 @@
@Override
public List<N> subList(final int fromIndex, final int toIndex) {
final List<M> subList = collection.subList(fromIndex, toIndex);
- return new TransformedList<M, N>(subList, funcMtoN, funcNtoM);
+ return new TransformedList<>(subList, funcMtoN, funcNtoM);
}
}
@@ -255,7 +255,7 @@
public static <M, N> Collection<N> transformedCollection(final Collection<M> collection,
final Function<? super M, ? extends N, NeverThrowsException> funcMtoN,
final Function<? super N, ? extends M, NeverThrowsException> funcNtoM) {
- return new TransformedCollection<M, N, Collection<M>>(collection, funcMtoN, funcNtoM);
+ return new TransformedCollection<>(collection, funcMtoN, funcNtoM);
}
/**
@@ -283,7 +283,7 @@
public static <M, N> List<N> transformedList(final List<M> list,
final Function<? super M, ? extends N, NeverThrowsException> funcMtoN,
final Function<? super N, ? extends M, NeverThrowsException> funcNtoM) {
- return new TransformedList<M, N>(list, funcMtoN, funcNtoM);
+ return new TransformedList<>(list, funcMtoN, funcNtoM);
}
/** Prevent instantiation. */
diff --git a/opendj-core/src/main/java/com/forgerock/opendj/util/Iterables.java b/opendj-core/src/main/java/com/forgerock/opendj/util/Iterables.java
index 9790833..d92b941 100644
--- a/opendj-core/src/main/java/com/forgerock/opendj/util/Iterables.java
+++ b/opendj-core/src/main/java/com/forgerock/opendj/util/Iterables.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2013-2014 ForgeRock AS.
+ * Portions copyright 2013-2015 ForgeRock AS.
*/
package com.forgerock.opendj.util;
@@ -128,7 +128,7 @@
}
}
- private static final Iterable<Object> EMPTY_ITERABLE = new EmptyIterable<Object>();
+ private static final Iterable<Object> EMPTY_ITERABLE = new EmptyIterable<>();
/**
* Returns an iterable containing the elements of {@code a}. The returned
@@ -142,7 +142,7 @@
* @return An iterable containing the elements of {@code a}.
*/
public static <M> Iterable<M> arrayIterable(final M[] a) {
- return new ArrayIterable<M>(a);
+ return new ArrayIterable<>(a);
}
/**
@@ -180,7 +180,7 @@
*/
public static <M, P> Iterable<M> filteredIterable(final Iterable<M> iterable,
final Predicate<? super M, P> predicate, final P p) {
- return new FilteredIterable<M, P>(iterable, predicate, p);
+ return new FilteredIterable<>(iterable, predicate, p);
}
/**
@@ -200,7 +200,7 @@
*/
public static <M> Iterable<M> filteredIterable(final Iterable<M> iterable,
final Predicate<? super M, Void> predicate) {
- return new FilteredIterable<M, Void>(iterable, predicate, null);
+ return new FilteredIterable<>(iterable, predicate, null);
}
/**
@@ -233,7 +233,7 @@
* @return An iterable containing the single element {@code value}.
*/
public static <M> Iterable<M> singletonIterable(final M value) {
- return new SingletonIterable<M>(value);
+ return new SingletonIterable<>(value);
}
/**
@@ -307,7 +307,7 @@
*/
public static <M, N> Iterable<N> transformedIterable(final Iterable<M> iterable,
final Function<? super M, ? extends N, NeverThrowsException> function) {
- return new TransformedIterable<M, N>(iterable, function);
+ return new TransformedIterable<>(iterable, function);
}
/**
@@ -324,7 +324,7 @@
* support element removal via the {@code remove()}.
*/
public static <M> Iterable<M> unmodifiableIterable(final Iterable<M> iterable) {
- return new UnmodifiableIterable<M>(iterable);
+ return new UnmodifiableIterable<>(iterable);
}
/** Prevent instantiation. */
diff --git a/opendj-core/src/main/java/com/forgerock/opendj/util/Iterators.java b/opendj-core/src/main/java/com/forgerock/opendj/util/Iterators.java
index e84b662..24a3011 100644
--- a/opendj-core/src/main/java/com/forgerock/opendj/util/Iterators.java
+++ b/opendj-core/src/main/java/com/forgerock/opendj/util/Iterators.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS.
+ * Portions Copyright 2014-2015 ForgeRock AS.
*/
package com.forgerock.opendj.util;
@@ -217,7 +217,7 @@
}
}
- private static final Iterator<Object> EMPTY_ITERATOR = new EmptyIterator<Object>();
+ private static final Iterator<Object> EMPTY_ITERATOR = new EmptyIterator<>();
/**
* Returns an iterator over the elements contained in {@code a}. The
@@ -231,7 +231,7 @@
* @return An iterator over the elements contained in {@code a}.
*/
public static <M> Iterator<M> arrayIterator(final M[] a) {
- return new ArrayIterator<M>(a);
+ return new ArrayIterator<>(a);
}
/**
@@ -269,7 +269,7 @@
*/
public static <M, P> Iterator<M> filteredIterator(final Iterator<M> iterator,
final Predicate<? super M, P> predicate, final P p) {
- return new FilteredIterator<M, P>(iterator, predicate, p);
+ return new FilteredIterator<>(iterator, predicate, p);
}
/**
@@ -289,7 +289,7 @@
*/
public static <M> Iterator<M> filteredIterator(final Iterator<M> iterator,
final Predicate<? super M, Void> predicate) {
- return new FilteredIterator<M, Void>(iterator, predicate, null);
+ return new FilteredIterator<>(iterator, predicate, null);
}
/**
@@ -304,7 +304,7 @@
* @return An iterator containing the single element {@code value}.
*/
public static <M> Iterator<M> singletonIterator(final M value) {
- return new SingletonIterator<M>(value);
+ return new SingletonIterator<>(value);
}
/**
@@ -326,7 +326,7 @@
*/
public static <M, N> Iterator<N> transformedIterator(final Iterator<M> iterator,
final Function<? super M, ? extends N, NeverThrowsException> function) {
- return new TransformedIterator<M, N>(iterator, function);
+ return new TransformedIterator<>(iterator, function);
}
/**
@@ -343,7 +343,7 @@
* element removal via the {@code remove()}.
*/
public static <M> Iterator<M> unmodifiableIterator(final Iterator<M> iterator) {
- return new UnmodifiableIterator<M>(iterator);
+ return new UnmodifiableIterator<>(iterator);
}
/** Prevent instantiation. */
diff --git a/opendj-core/src/main/java/com/forgerock/opendj/util/StringPrepProfile.java b/opendj-core/src/main/java/com/forgerock/opendj/util/StringPrepProfile.java
index 0c0c694..58b849f 100644
--- a/opendj-core/src/main/java/com/forgerock/opendj/util/StringPrepProfile.java
+++ b/opendj-core/src/main/java/com/forgerock/opendj/util/StringPrepProfile.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package com.forgerock.opendj.util;
@@ -39,22 +40,18 @@
* complete list of such rules, refer to Section 4.2, RFC 4517.
*/
public final class StringPrepProfile {
- /**
- * A Table defining the mapped code-points as per RFC 3454.
- */
+ /** A Table defining the mapped code-points as per RFC 3454. */
private static final class MappingTable {
/** Set of chars which are deleted from the incoming value. */
- private static final HashSet<Character> MAP_2_NULL = new HashSet<Character>();
-
+ private static final HashSet<Character> MAP_2_NULL = new HashSet<>();
/** Set of chars which are replaced by a SPACE when found. */
- private static final HashSet<Character> MAP_2_SPACE = new HashSet<Character>();
+ private static final HashSet<Character> MAP_2_SPACE = new HashSet<>();
/**
* Table for case-folding. Map of Character and String containing
* uppercase and lowercase value as the key-value pair.
*/
- private static final HashMap<Character, String> CASE_MAP_TABLE =
- new HashMap<Character, String>();
+ private static final HashMap<Character, String> CASE_MAP_TABLE = new HashMap<>();
static {
// Appendix B.1 RFC 3454.
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1ByteSequenceReader.java b/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1ByteSequenceReader.java
index 0b517d2..5fe1c38 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1ByteSequenceReader.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1ByteSequenceReader.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.io;
@@ -50,7 +50,7 @@
private int peekLength = -1;
private final int maxElementSize;
private ByteSequenceReader reader;
- private final LinkedList<ByteSequenceReader> readerStack;
+ private final LinkedList<ByteSequenceReader> readerStack = new LinkedList<>();
/**
* Creates a new ASN1 reader whose source is the provided byte sequence
@@ -64,7 +64,6 @@
*/
ASN1ByteSequenceReader(final ByteSequenceReader reader, final int maxElementSize) {
this.reader = reader;
- this.readerStack = new LinkedList<ByteSequenceReader>();
this.maxElementSize = maxElementSize;
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1InputStreamReader.java b/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1InputStreamReader.java
index 0de13a5..081c352 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1InputStreamReader.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1InputStreamReader.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.io;
@@ -54,8 +54,8 @@
private int lengthBytesNeeded;
private final int maxElementSize;
private InputStream in;
- private final LinkedList<InputStream> streamStack;
- private byte[] buffer;
+ private final LinkedList<InputStream> streamStack = new LinkedList<>();
+ private byte[] buffer = new byte[512];
/**
* Creates a new ASN1 reader whose source is the provided input stream and
@@ -69,15 +69,12 @@
*/
ASN1InputStreamReader(final InputStream stream, final int maxElementSize) {
this.in = stream;
- this.streamStack = new LinkedList<InputStream>();
- this.buffer = new byte[512];
this.maxElementSize = maxElementSize;
}
/** {@inheritDoc} */
public void close() throws IOException {
- // Calling close of SizeLimitInputStream should close the parent
- // stream.
+ // Calling close of SizeLimitInputStream should close the parent stream.
in.close();
streamStack.clear();
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1OutputStreamWriter.java b/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1OutputStreamWriter.java
index 8db739f..d100db7 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1OutputStreamWriter.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1OutputStreamWriter.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2009 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.io;
@@ -50,7 +50,7 @@
private final OutputStream rootStream;
private OutputStream out;
- private final ArrayList<ByteStringBuilder> streamStack;
+ private final ArrayList<ByteStringBuilder> streamStack = new ArrayList<>();
private int stackDepth;
private final int maxBufferSize;
@@ -67,7 +67,6 @@
this.out = stream;
this.rootStream = stream;
this.maxBufferSize = Math.max(maxBufferSize, BUFFER_INIT_SIZE);
- this.streamStack = new ArrayList<ByteStringBuilder>();
this.stackDepth = -1;
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/io/LDAP.java b/opendj-core/src/main/java/org/forgerock/opendj/io/LDAP.java
index c093c44..03aad25 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/io/LDAP.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/io/LDAP.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.io;
@@ -491,7 +491,7 @@
*/
public static <R extends ASN1Reader> LDAPReader<R> getReader(final R asn1Reader,
final DecodeOptions options) {
- return new LDAPReader<R>(asn1Reader, options);
+ return new LDAPReader<>(asn1Reader, options);
}
/**
@@ -506,7 +506,7 @@
* ASN.1 writer.
*/
public static <W extends ASN1Writer> LDAPWriter<W> getWriter(final W asn1Writer) {
- return new LDAPWriter<W>(asn1Writer);
+ return new LDAPWriter<>(asn1Writer);
}
/**
@@ -691,7 +691,7 @@
reader.readStartSequence(LDAP.TYPE_FILTER_AND);
try {
if (reader.hasNextElement()) {
- final List<Filter> subFilters = new LinkedList<Filter>();
+ final List<Filter> subFilters = new LinkedList<>();
do {
subFilters.add(readFilter(reader));
} while (reader.hasNextElement());
@@ -787,7 +787,7 @@
reader.readStartSequence(LDAP.TYPE_FILTER_OR);
try {
if (reader.hasNextElement()) {
- final List<Filter> subFilters = new LinkedList<Filter>();
+ final List<Filter> subFilters = new LinkedList<>();
do {
subFilters.add(readFilter(reader));
} while (reader.hasNextElement());
@@ -815,7 +815,7 @@
}
final List<ByteString> anySubstrings;
if (reader.hasNextElement() && (reader.peekType() == LDAP.TYPE_SUBANY)) {
- anySubstrings = new LinkedList<ByteString>();
+ anySubstrings = new LinkedList<>();
do {
anySubstrings.add(reader.readOctetString(LDAP.TYPE_SUBANY));
} while (reader.hasNextElement() && (reader.peekType() == LDAP.TYPE_SUBANY));
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractAttribute.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractAttribute.java
index b8b2c3c..0a5c529 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractAttribute.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractAttribute.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -284,7 +284,7 @@
return false;
}
- final Map<ByteString, T> valuesToRetain = new HashMap<ByteString, T>(values.size());
+ final Map<ByteString, T> valuesToRetain = new HashMap<>(values.size());
for (final T value : values) {
valuesToRetain.put(normalizeValue(this, ByteString.valueOf(value)), value);
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractLoadBalancingAlgorithm.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractLoadBalancingAlgorithm.java
index 07d38f9..2e04549 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractLoadBalancingAlgorithm.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractLoadBalancingAlgorithm.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS.
+ * Portions Copyright 2011-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -278,7 +278,7 @@
final ScheduledExecutorService scheduler) {
Reject.ifNull(factories, unit);
- this.monitoredFactories = new ArrayList<MonitoredConnectionFactory>(factories.size());
+ this.monitoredFactories = new ArrayList<>(factories.size());
int i = 0;
for (final ConnectionFactory f : factories) {
this.monitoredFactories.add(new MonitoredConnectionFactory(f, i++));
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeDescription.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeDescription.java
index 29a85c6..bb650f0 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeDescription.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeDescription.java
@@ -350,9 +350,8 @@
/** {@inheritDoc} */
@Override
protected WeakHashMap<Schema, Map<String, AttributeDescription>> initialValue() {
- return new WeakHashMap<Schema, Map<String, AttributeDescription>>();
+ return new WeakHashMap<>();
}
-
};
/** Object class attribute description. */
@@ -913,10 +912,10 @@
// Multiple options need sorting and duplicates removed - we could
// optimize a bit further here for 2 option attribute descriptions.
- final List<String> options = new LinkedList<String>();
+ final List<String> options = new LinkedList<>();
options.add(option);
- final SortedSet<String> normalizedOptions = new TreeSet<String>();
+ final SortedSet<String> normalizedOptions = new TreeSet<>();
normalizedOptions.add(normalizedOption);
while (i < length) {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeFilter.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeFilter.java
index d5345db..8249bab 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeFilter.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeFilter.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -410,12 +410,13 @@
private void allocatedRequestedAttributes() {
if (requestedAttributes.isEmpty()) {
- requestedAttributes = new HashMap<AttributeDescription, AttributeDescription>();
+ requestedAttributes = new HashMap<>();
}
}
private Attribute filterAttribute(final Attribute attribute) {
- return typesOnly ? Attributes.emptyAttribute(attribute.getAttributeDescription())
- : attribute;
+ return typesOnly
+ ? Attributes.emptyAttribute(attribute.getAttributeDescription())
+ : attribute;
}
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeParser.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeParser.java
index f14f0d8..919978f 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeParser.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeParser.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2012-2014 ForgeRock AS.
+ * Copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -333,15 +333,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 b : attribute) {
result.add(f.apply(b));
}
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-core/src/main/java/org/forgerock/opendj/ldap/AuthenticatedConnectionFactory.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AuthenticatedConnectionFactory.java
index d15fb31..c931d48 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/AuthenticatedConnectionFactory.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/AuthenticatedConnectionFactory.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.forgerock.opendj.ldap;
@@ -140,7 +140,7 @@
@Override
public Promise<Connection, LdapException> getConnectionAsync() {
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
return parentFactory.getConnectionAsync()
.thenAsync(
new AsyncFunction<Connection, BindResult, LdapException>() {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/CachedConnectionPool.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/CachedConnectionPool.java
index 06c60e1..d1dc638 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/CachedConnectionPool.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/CachedConnectionPool.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.forgerock.opendj.ldap;
@@ -121,7 +121,7 @@
* attempts succeed, which is unlikely (if one fails, then they are
* all likely to fail).
*/
- final List<QueueElement> waitingPromises = new LinkedList<CachedConnectionPool.QueueElement>();
+ final List<QueueElement> waitingPromises = new LinkedList<>();
synchronized (queue) {
while (hasWaitingPromises()) {
waitingPromises.add(queue.removeFirst());
@@ -198,7 +198,7 @@
* the listener may be immediately invoked so ensure
* that it is already in the list.
*/
- listeners = new CopyOnWriteArrayList<ConnectionEventListener>();
+ listeners = new CopyOnWriteArrayList<>();
listeners.add(listener);
connection.addConnectionEventListener(this);
} else {
@@ -589,7 +589,7 @@
* Obtain a list of expired connections but don't close them yet
* since we don't want to hold the lock too long.
*/
- idleConnections = new LinkedList<Connection>();
+ idleConnections = new LinkedList<>();
final long timeoutMillis = timeService.now() - idleTimeoutMillis;
int nonCoreConnectionCount = currentPoolSize() - corePoolSize;
for (QueueElement holder = queue.peek(); nonCoreConnectionCount > 0
@@ -704,7 +704,7 @@
private final ScheduledFuture<?> idleTimeoutFuture;
private final long idleTimeoutMillis;
private final int maxPoolSize;
- private final LinkedList<QueueElement> queue = new LinkedList<QueueElement>();
+ private final LinkedList<QueueElement> queue = new LinkedList<>();
private final ReferenceCountedObject<ScheduledExecutorService>.Reference scheduler;
/**
@@ -756,7 +756,7 @@
* Remove any connections which are waiting in the queue as these
* can be closed immediately.
*/
- idleConnections = new LinkedList<Connection>();
+ idleConnections = new LinkedList<>();
while (hasWaitingConnections()) {
final QueueElement holder = queue.removeFirst();
idleConnections.add(holder.getWaitingConnection());
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Connections.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Connections.java
index 43fc6f1..d7fe7eb 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Connections.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Connections.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.forgerock.opendj.ldap;
@@ -430,8 +430,8 @@
public static ConnectionFactory newInternalConnectionFactory(
final RequestHandler<RequestContext> requestHandler) {
Reject.ifNull(requestHandler);
- return new InternalConnectionFactory<Void>(Connections
- .<Void> newServerConnectionFactory(requestHandler), null);
+ return new InternalConnectionFactory<>(
+ Connections.<Void> newServerConnectionFactory(requestHandler), null);
}
/**
@@ -464,7 +464,7 @@
public static <C> ConnectionFactory newInternalConnectionFactory(
final RequestHandlerFactory<C, RequestContext> factory, final C clientContext) {
Reject.ifNull(factory);
- return new InternalConnectionFactory<C>(newServerConnectionFactory(factory), clientContext);
+ return new InternalConnectionFactory<>(newServerConnectionFactory(factory), clientContext);
}
/**
@@ -497,7 +497,7 @@
public static <C> ConnectionFactory newInternalConnectionFactory(
final ServerConnectionFactory<C, Integer> factory, final C clientContext) {
Reject.ifNull(factory);
- return new InternalConnectionFactory<C>(factory, clientContext);
+ return new InternalConnectionFactory<>(factory, clientContext);
}
/**
@@ -587,7 +587,7 @@
public static <C> ServerConnectionFactory<C, Integer> newServerConnectionFactory(
final RequestHandler<RequestContext> requestHandler) {
Reject.ifNull(requestHandler);
- return new RequestHandlerFactoryAdapter<C>(new RequestHandlerFactory<C, RequestContext>() {
+ return new RequestHandlerFactoryAdapter<>(new RequestHandlerFactory<C, RequestContext>() {
@Override
public RequestHandler<RequestContext> handleAccept(final C clientContext) {
return requestHandler;
@@ -622,7 +622,7 @@
public static <C> ServerConnectionFactory<C, Integer> newServerConnectionFactory(
final RequestHandlerFactory<C, RequestContext> factory) {
Reject.ifNull(factory);
- return new RequestHandlerFactoryAdapter<C>(factory);
+ return new RequestHandlerFactoryAdapter<>(factory);
}
/**
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.java
index b19c56b..fe1c5e9 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.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.forgerock.opendj.ldap;
@@ -82,9 +82,8 @@
/** {@inheritDoc} */
@Override
protected WeakHashMap<Schema, Map<String, DN>> initialValue() {
- return new WeakHashMap<Schema, Map<String, DN>>();
+ return new WeakHashMap<>();
}
-
};
/**
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Entries.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Entries.java
index 02d912e..b471b33 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Entries.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Entries.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap;
@@ -623,10 +623,10 @@
* attributes in order to avoid matching rule based
* comparisons.
*/
- final Set<ByteString> oldValues = new LinkedHashSet<ByteString>(afrom);
- final Set<ByteString> newValues = new LinkedHashSet<ByteString>(ato);
+ final Set<ByteString> oldValues = new LinkedHashSet<>(afrom);
+ final Set<ByteString> newValues = new LinkedHashSet<>(ato);
- final Set<ByteString> deletedValues = new LinkedHashSet<ByteString>(oldValues);
+ final Set<ByteString> deletedValues = new LinkedHashSet<>(oldValues);
deletedValues.removeAll(newValues);
diffDeleteValues(request, deletedValues.size() == afrom.size() ? afrom
: new LinkedAttribute(adfrom, deletedValues));
@@ -726,8 +726,7 @@
if (objectClassAttribute == null) {
return Collections.emptySet();
} else {
- final Set<ObjectClass> objectClasses =
- new HashSet<ObjectClass>(objectClassAttribute.size());
+ final Set<ObjectClass> objectClasses = new HashSet<>(objectClassAttribute.size());
for (final ByteString v : objectClassAttribute) {
final String objectClassName = v.toString();
final ObjectClass objectClass;
@@ -1014,7 +1013,7 @@
* Use a hash set for membership checking rather than the attribute
* in order to avoid matching rule based comparisons.
*/
- final Set<ByteString> oldValues = new LinkedHashSet<ByteString>(afrom);
+ final Set<ByteString> oldValues = new LinkedHashSet<>(afrom);
return !oldValues.containsAll(ato);
} else {
return !afrom.equals(ato);
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Filter.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Filter.java
index bc840bf..a8bd511 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Filter.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Filter.java
@@ -485,7 +485,7 @@
Reject.ifNull(subFilter);
return new Filter(new AndImpl(Collections.singletonList(subFilter)));
} else {
- final List<Filter> subFiltersList = new ArrayList<Filter>(subFilters.size());
+ final List<Filter> subFiltersList = new ArrayList<>(subFilters.size());
for (final Filter subFilter : subFilters) {
Reject.ifNull(subFilter);
subFiltersList.add(subFilter);
@@ -512,7 +512,7 @@
Reject.ifNull(subFilters[0]);
return new Filter(new AndImpl(Collections.singletonList(subFilters[0])));
} else {
- final List<Filter> subFiltersList = new ArrayList<Filter>(subFilters.length);
+ final List<Filter> subFiltersList = new ArrayList<>(subFilters.length);
for (final Filter subFilter : subFilters) {
Reject.ifNull(subFilter);
subFiltersList.add(subFilter);
@@ -766,7 +766,7 @@
Reject.ifNull(subFilter);
return new Filter(new OrImpl(Collections.singletonList(subFilter)));
} else {
- final List<Filter> subFiltersList = new ArrayList<Filter>(subFilters.size());
+ final List<Filter> subFiltersList = new ArrayList<>(subFilters.size());
for (final Filter subFilter : subFilters) {
Reject.ifNull(subFilter);
subFiltersList.add(subFilter);
@@ -793,7 +793,7 @@
Reject.ifNull(subFilters[0]);
return new Filter(new OrImpl(Collections.singletonList(subFilters[0])));
} else {
- final List<Filter> subFiltersList = new ArrayList<Filter>(subFilters.length);
+ final List<Filter> subFiltersList = new ArrayList<>(subFilters.length);
for (final Filter subFilter : subFilters) {
Reject.ifNull(subFilter);
subFiltersList.add(subFilter);
@@ -857,7 +857,7 @@
Reject.ifNull(anySubstring);
anySubstringList = Collections.singletonList(ByteString.valueOf(anySubstring));
} else {
- anySubstringList = new ArrayList<ByteString>(anySubstrings.size());
+ anySubstringList = new ArrayList<>(anySubstrings.size());
for (final Object anySubstring : anySubstrings) {
Reject.ifNull(anySubstring);
@@ -978,10 +978,9 @@
final byte[] valueBytes = getBytes(filterString.substring(equalPos, endPos));
// Find the locations of all the asterisks in the value. Also, check to
- // see if there are any escaped values, since they will need special
- // treatment.
+ // see if there are any escaped values, since they will need special treatment.
boolean hasEscape = false;
- final LinkedList<Integer> asteriskPositions = new LinkedList<Integer>();
+ final LinkedList<Integer> asteriskPositions = new LinkedList<>();
for (int i = 0; i < valueBytes.length; i++) {
if (valueBytes[i] == ASTERISK) {
asteriskPositions.add(i);
@@ -1011,9 +1010,8 @@
subInitial = ByteString.wrap(valueBytes, 0, firstPos);
}
- // Next, process through the rest of the asterisks to get the subAny
- // values.
- final ArrayList<ByteString> subAny = new ArrayList<ByteString>();
+ // Next, process through the rest of the asterisks to get the subAny values.
+ final ArrayList<ByteString> subAny = new ArrayList<>();
for (final int asteriskPos : asteriskPositions) {
final int length = asteriskPos - firstPos - 1;
@@ -1502,7 +1500,7 @@
if (subFilters != null) {
subFilters.add(subFilter);
} else if (firstFilter != null) {
- subFilters = new LinkedList<Filter>();
+ subFilters = new LinkedList<>();
subFilters.add(firstFilter);
subFilters.add(subFilter);
firstFilter = null;
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactory.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactory.java
index ea590dd..2e90f0a 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactory.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactory.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.forgerock.opendj.ldap;
@@ -140,15 +140,13 @@
* the current heart beat completes.
*/
private final Queue<Runnable> pendingBindOrStartTLSRequests =
- new ConcurrentLinkedQueue<Runnable>();
+ new ConcurrentLinkedQueue<>();
/**
* List of pending responses for all active operations. These will be
- * signalled if no heart beat is detected within the permitted timeout
- * period.
+ * signaled if no heart beat is detected within the permitted timeout period.
*/
- private final Queue<ResultHandler<?>> pendingResults =
- new ConcurrentLinkedQueue<ResultHandler<?>>();
+ private final Queue<ResultHandler<?>> pendingResults = new ConcurrentLinkedQueue<>();
/** Internal connection state. */
private final ConnectionState state = new ConnectionState();
@@ -577,7 +575,7 @@
}
private <R extends Result> LdapPromise<R> timestampPromise(LdapPromise<R> wrappedPromise) {
- final LdapPromiseImpl<R> outerPromise = new LdapPromiseImplWrapper<R>(wrappedPromise);
+ final LdapPromiseImpl<R> outerPromise = new LdapPromiseImplWrapper<>(wrappedPromise);
pendingResults.add(outerPromise);
wrappedPromise.onSuccess(new SuccessHandler<R>() {
@Override
@@ -831,10 +829,8 @@
*/
private final long timeoutMS;
- /**
- * List of valid connections to which heartbeats will be sent.
- */
- private final List<ConnectionImpl> validConnections = new LinkedList<ConnectionImpl>();
+ /** List of valid connections to which heartbeats will be sent. */
+ private final List<ConnectionImpl> validConnections = new LinkedList<>();
HeartBeatConnectionFactory(final ConnectionFactory factory, final long interval,
final long timeout, final TimeUnit unit, final SearchRequest heartBeat,
@@ -908,7 +904,7 @@
public Promise<Connection, LdapException> getConnectionAsync() {
acquireScheduler(); // Protect scheduler.
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
final PromiseImpl<Connection, LdapException> promise = PromiseImpl.create();
// Request a connection and return the promise representing the heartbeat.
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/InternalConnection.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/InternalConnection.java
index d60e381..b348df6 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/InternalConnection.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/InternalConnection.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2011-2014 ForgeRock AS.
+ * Portions copyright 2011-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -60,7 +60,7 @@
*/
final class InternalConnection extends AbstractAsynchronousConnection {
private final ServerConnection<Integer> serverConnection;
- private final List<ConnectionEventListener> listeners = new CopyOnWriteArrayList<ConnectionEventListener>();
+ private final List<ConnectionEventListener> listeners = new CopyOnWriteArrayList<>();
private final AtomicInteger messageID = new AtomicInteger();
/**
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPOptions.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPOptions.java
index a3c5737..a8fd382 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPOptions.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPOptions.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -67,8 +67,8 @@
private boolean useStartTLS;
private long timeoutInMillis = DEFAULT_TIMEOUT;
private long connectTimeoutInMillis = DEFAULT_CONNECT_TIMEOUT;
- private final List<String> enabledCipherSuites = new LinkedList<String>();
- private final List<String> enabledProtocols = new LinkedList<String>();
+ private final List<String> enabledCipherSuites = new LinkedList<>();
+ private final List<String> enabledProtocols = new LinkedList<>();
/**
* Creates a new set of connection options with default settings. SSL will
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPUrl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPUrl.java
index a8ff686..e0008dc 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPUrl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPUrl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -209,7 +209,7 @@
/**
* Set containing characters that do not need to be encoded.
*/
- private static final Set<Character> VALID_CHARS = new HashSet<Character>();
+ private static final Set<Character> VALID_CHARS = new HashSet<>();
static {
// Refer to RFC 3986 for more details.
@@ -597,7 +597,7 @@
private List<String> parseAttributes(final String attrDesc) {
final StringTokenizer token = new StringTokenizer(attrDesc, String.valueOf(COMMA_CHAR));
- final List<String> parsedAttrs = new ArrayList<String>(token.countTokens());
+ final List<String> parsedAttrs = new ArrayList<>(token.countTokens());
while (token.hasMoreElements()) {
parsedAttrs.add(token.nextToken());
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java
index 8faf910..be134fa 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -175,7 +175,7 @@
return true;
}
- final Map<ByteString, T> valuesToRetain = new HashMap<ByteString, T>(values.size());
+ final Map<ByteString, T> valuesToRetain = new HashMap<>(values.size());
for (final T value : values) {
valuesToRetain.put(normalizeValue(attribute, ByteString.valueOf(value)), value);
}
@@ -236,7 +236,7 @@
return false;
}
- attribute.multipleValues = new LinkedHashMap<ByteString, ByteString>(2);
+ attribute.multipleValues = new LinkedHashMap<>(2);
attribute.multipleValues.put(attribute.normalizedSingleValue, attribute.singleValue);
attribute.multipleValues.put(normalizedValue, value);
attribute.singleValue = null;
@@ -474,8 +474,7 @@
this.singleValue = other.singleValue;
this.normalizedSingleValue = other.normalizedSingleValue;
if (other.multipleValues != null) {
- this.multipleValues =
- new LinkedHashMap<ByteString, ByteString>(other.multipleValues);
+ this.multipleValues = new LinkedHashMap<>(other.multipleValues);
}
} else {
addAll(attribute);
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Matcher.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Matcher.java
index bd013b0..b8a8461 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Matcher.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Matcher.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -225,7 +225,7 @@
return TRUE;
}
- final List<MatcherImpl> subMatchers = new ArrayList<MatcherImpl>(subFilters.size());
+ final List<MatcherImpl> subMatchers = new ArrayList<>(subFilters.size());
for (final Filter f : subFilters) {
subMatchers.add(f.accept(this, schema));
}
@@ -443,7 +443,7 @@
return FALSE;
}
- final List<MatcherImpl> subMatchers = new ArrayList<MatcherImpl>(subFilters.size());
+ final List<MatcherImpl> subMatchers = new ArrayList<>(subFilters.size());
for (final Filter f : subFilters) {
subMatchers.add(f.accept(this, schema));
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/MemoryBackend.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/MemoryBackend.java
index 9da47d5..880c7cc 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/MemoryBackend.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/MemoryBackend.java
@@ -102,7 +102,7 @@
*/
public final class MemoryBackend implements RequestHandler<RequestContext> {
private final DecodeOptions decodeOptions;
- private final ConcurrentSkipListMap<DN, Entry> entries = new ConcurrentSkipListMap<DN, Entry>();
+ private final ConcurrentSkipListMap<DN, Entry> entries = new ConcurrentSkipListMap<>();
private final Schema schema;
private final Object writeLock = new Object();
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Option.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Option.java
index 58c4609..9f5dec5 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/Option.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/Option.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2014 ForgeRock AS
+ * Copyright 2014-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap;
@@ -59,7 +59,7 @@
* value.
*/
public static <T> Option<T> of(Class<T> type, T defaultValue) {
- return new Option<T>(type, defaultValue);
+ return new Option<>(type, defaultValue);
}
private Option(Class<T> type, T defaultValue) {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/RDN.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/RDN.java
index 80d1337..d6d69ef 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/RDN.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/RDN.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2011-2012 ForgeRock AS.
+ * Portions copyright 2011-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -158,7 +158,7 @@
reader.mark();
if (reader.remaining() > 0 && reader.read() == '+') {
- final List<AVA> avas = new ArrayList<AVA>();
+ final List<AVA> avas = new ArrayList<>();
avas.add(firstAVA);
do {
@@ -477,7 +477,7 @@
}
private Iterator<AVA> getSortedAvas() {
- TreeSet<AVA> sortedAvas = new TreeSet<AVA>();
+ TreeSet<AVA> sortedAvas = new TreeSet<>();
for (AVA ava : avas) {
sortedAvas.add(ava);
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/RequestHandlerFactoryAdapter.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/RequestHandlerFactoryAdapter.java
index 0f7275a..bf9ce11 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/RequestHandlerFactoryAdapter.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/RequestHandlerFactoryAdapter.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2011-2014 ForgeRock AS
+ * Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap;
@@ -156,7 +156,7 @@
switch (state) {
case PENDING:
if (cancelRequestListeners == null) {
- cancelRequestListeners = new LinkedList<CancelRequestListener>();
+ cancelRequestListeners = new LinkedList<>();
}
cancelRequestListeners.add(listener);
break;
@@ -287,7 +287,7 @@
/* Switch to CANCEL_REQUESTED state. */
cancelRequestReason = reason;
if (cancelResultHandler != null) {
- cancelResultHandlers = new LinkedList<ExtendedResultHandlerHolder<?>>();
+ cancelResultHandlers = new LinkedList<>();
cancelResultHandlers.add(new ExtendedResultHandlerHolder<R>(cancelRequest,
cancelResultHandler));
}
@@ -302,7 +302,7 @@
*/
if (cancelResultHandler != null) {
if (cancelResultHandlers == null) {
- cancelResultHandlers = new LinkedList<ExtendedResultHandlerHolder<?>>();
+ cancelResultHandlers = new LinkedList<>();
}
cancelResultHandlers.add(new ExtendedResultHandlerHolder<R>(cancelRequest,
cancelResultHandler));
@@ -450,8 +450,7 @@
private static final class ServerConnectionImpl implements ServerConnection<Integer> {
private final AtomicBoolean isClosed = new AtomicBoolean();
- private final ConcurrentHashMap<Integer, RequestContextImpl<?, ?>> pendingRequests =
- new ConcurrentHashMap<Integer, RequestContextImpl<?, ?>>();
+ private final ConcurrentHashMap<Integer, RequestContextImpl<?, ?>> pendingRequests = new ConcurrentHashMap<>();
private final RequestHandler<RequestContext> requestHandler;
private ServerConnectionImpl(final RequestHandler<RequestContext> requestHandler) {
@@ -476,8 +475,7 @@
final IntermediateResponseHandler intermediateResponseHandler,
final ResultHandler<Result> resultHandler) {
final RequestContextImpl<Result, ResultHandler<Result>> requestContext =
- new RequestContextImpl<Result, ResultHandler<Result>>(this, resultHandler,
- messageID, true);
+ new RequestContextImpl<>(this, resultHandler, messageID, true);
if (addPendingRequest(requestContext)) {
requestHandler.handleAdd(requestContext, request, intermediateResponseHandler,
requestContext);
@@ -491,8 +489,7 @@
final IntermediateResponseHandler intermediateResponseHandler,
final ResultHandler<BindResult> resultHandler) {
final RequestContextImpl<BindResult, ResultHandler<BindResult>> requestContext =
- new RequestContextImpl<BindResult, ResultHandler<BindResult>>(this,
- resultHandler, messageID, false);
+ new RequestContextImpl<>(this, resultHandler, messageID, false);
if (addPendingRequest(requestContext)) {
requestHandler.handleBind(requestContext, version, request,
intermediateResponseHandler, requestContext);
@@ -505,8 +502,7 @@
final IntermediateResponseHandler intermediateResponseHandler,
final ResultHandler<CompareResult> resultHandler) {
final RequestContextImpl<CompareResult, ResultHandler<CompareResult>> requestContext =
- new RequestContextImpl<CompareResult, ResultHandler<CompareResult>>(this,
- resultHandler, messageID, true);
+ new RequestContextImpl<>(this, resultHandler, messageID, true);
if (addPendingRequest(requestContext)) {
requestHandler.handleCompare(requestContext, request, intermediateResponseHandler,
requestContext);
@@ -540,8 +536,7 @@
final IntermediateResponseHandler intermediateResponseHandler,
final ResultHandler<Result> resultHandler) {
final RequestContextImpl<Result, ResultHandler<Result>> requestContext =
- new RequestContextImpl<Result, ResultHandler<Result>>(this, resultHandler,
- messageID, true);
+ new RequestContextImpl<>(this, resultHandler, messageID, true);
if (addPendingRequest(requestContext)) {
requestHandler.handleDelete(requestContext, request, intermediateResponseHandler,
requestContext);
@@ -574,8 +569,7 @@
* do this in order to monitor the number of pending operations.
*/
final RequestContextImpl<R, ResultHandler<R>> requestContext =
- new RequestContextImpl<R, ResultHandler<R>>(this, resultHandler, messageID,
- false);
+ new RequestContextImpl<>(this, resultHandler, messageID, false);
if (addPendingRequest(requestContext)) {
// Find and cancel the request.
final RequestContextImpl<?, ?> cancelledRequest =
@@ -596,7 +590,7 @@
// StartTLS requests cannot be cancelled.
boolean isCancelSupported = !request.getOID().equals(StartTLSExtendedRequest.OID);
final RequestContextImpl<R, ResultHandler<R>> requestContext =
- new RequestContextImpl<R, ResultHandler<R>>(this, resultHandler, messageID, isCancelSupported);
+ new RequestContextImpl<>(this, resultHandler, messageID, isCancelSupported);
if (addPendingRequest(requestContext)) {
requestHandler.handleExtendedRequest(requestContext, request,
@@ -611,8 +605,7 @@
final IntermediateResponseHandler intermediateResponseHandler,
final ResultHandler<Result> resultHandler) {
final RequestContextImpl<Result, ResultHandler<Result>> requestContext =
- new RequestContextImpl<Result, ResultHandler<Result>>(this, resultHandler,
- messageID, true);
+ new RequestContextImpl<>(this, resultHandler, messageID, true);
if (addPendingRequest(requestContext)) {
requestHandler.handleModify(requestContext, request, intermediateResponseHandler,
requestContext);
@@ -625,8 +618,7 @@
final IntermediateResponseHandler intermediateResponseHandler,
final ResultHandler<Result> resultHandler) {
final RequestContextImpl<Result, ResultHandler<Result>> requestContext =
- new RequestContextImpl<Result, ResultHandler<Result>>(this, resultHandler,
- messageID, true);
+ new RequestContextImpl<>(this, resultHandler, messageID, true);
if (addPendingRequest(requestContext)) {
requestHandler.handleModifyDN(requestContext, request, intermediateResponseHandler,
requestContext);
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/ResultCode.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/ResultCode.java
index fa24936..b9de4c0 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/ResultCode.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/ResultCode.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2013 ForgeRock AS.
+ * Portions copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -194,7 +194,7 @@
//@Checkstyle:on
}
- private static final Map<Integer, ResultCode> ELEMENTS = new LinkedHashMap<Integer, ResultCode>();
+ private static final Map<Integer, ResultCode> ELEMENTS = new LinkedHashMap<>();
private static final List<ResultCode> IMMUTABLE_ELEMENTS = Collections.unmodifiableList(new ArrayList<ResultCode>(
ELEMENTS.values()));
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/SortKey.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/SortKey.java
index 178c0f4..dd7217e 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/SortKey.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/SortKey.java
@@ -190,7 +190,7 @@
Reject.ifNull(schema, keys);
Reject.ifFalse(!keys.isEmpty(), "keys must not be empty");
- final List<Comparator<Entry>> comparators = new ArrayList<Comparator<Entry>>(keys.size());
+ final List<Comparator<Entry>> comparators = new ArrayList<>(keys.size());
for (final SortKey key : keys) {
comparators.add(key.comparator(schema));
}
@@ -260,7 +260,7 @@
public static Comparator<Entry> comparator(final String sortKeys) {
Reject.ifNull(sortKeys);
- final List<Comparator<Entry>> comparators = new LinkedList<Comparator<Entry>>();
+ final List<Comparator<Entry>> comparators = new LinkedList<>();
final StringTokenizer tokenizer = new StringTokenizer(sortKeys, ",");
while (tokenizer.hasMoreTokens()) {
final String token = tokenizer.nextToken().trim();
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/GetEffectiveRightsRequestControl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/GetEffectiveRightsRequestControl.java
index 2a11679..184e522 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/GetEffectiveRightsRequestControl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/GetEffectiveRightsRequestControl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.controls;
@@ -162,11 +162,9 @@
throw DecodeException.error(message);
}
- // There is an sequence containing an attribute
- // list, try to
- // decode it.
+ // There is an sequence containing an attribute list, try to decode it.
if (reader.hasNextElement()) {
- attributes = new LinkedList<AttributeType>();
+ attributes = new LinkedList<>();
reader.readStartSequence();
while (reader.hasNextElement()) {
// Decode as an attribute type.
@@ -273,7 +271,7 @@
List<AttributeType> copyOfAttributes;
if (attributes != null && attributes.length > 0) {
- copyOfAttributes = new ArrayList<AttributeType>(attributes.length);
+ copyOfAttributes = new ArrayList<>(attributes.length);
for (final String attribute : attributes) {
copyOfAttributes.add(Schema.getDefaultSchema().getAttributeType(attribute));
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/MatchedValuesRequestControl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/MatchedValuesRequestControl.java
index 591fd60..f2594c8 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/MatchedValuesRequestControl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/MatchedValuesRequestControl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.controls;
@@ -189,7 +189,7 @@
throw DecodeException.error(message);
}
- final LinkedList<Filter> filters = new LinkedList<Filter>();
+ final LinkedList<Filter> filters = new LinkedList<>();
do {
final Filter filter = LDAP.readFilter(reader);
try {
@@ -251,7 +251,7 @@
if (filters.size() == 1) {
copyOfFilters = Collections.singletonList(validateFilter(filters.iterator().next()));
} else {
- copyOfFilters = new ArrayList<Filter>(filters.size());
+ copyOfFilters = new ArrayList<>(filters.size());
for (final Filter filter : filters) {
copyOfFilters.add(validateFilter(filter));
}
@@ -285,7 +285,7 @@
final String... filters) {
Reject.ifFalse(filters.length > 0, "filters is empty");
- final List<Filter> parsedFilters = new ArrayList<Filter>(filters.length);
+ final List<Filter> parsedFilters = new ArrayList<>(filters.length);
for (final String filter : filters) {
parsedFilters.add(validateFilter(Filter.valueOf(filter)));
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PostReadRequestControl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PostReadRequestControl.java
index c33ab16..7d16df0 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PostReadRequestControl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PostReadRequestControl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.controls;
@@ -131,7 +131,7 @@
if (reader.hasNextElement()) {
final String firstAttribute = reader.readOctetStringAsString();
if (reader.hasNextElement()) {
- attributes = new ArrayList<String>();
+ attributes = new ArrayList<>();
attributes.add(firstAttribute);
do {
attributes.add(reader.readOctetStringAsString());
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java
index 09e086e..feccc06 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2012-2014 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.controls;
@@ -132,7 +132,7 @@
if (reader.hasNextElement()) {
final String firstAttribute = reader.readOctetStringAsString();
if (reader.hasNextElement()) {
- attributes = new ArrayList<String>();
+ attributes = new ArrayList<>();
attributes.add(firstAttribute);
do {
attributes.add(reader.readOctetStringAsString());
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/ServerSideSortRequestControl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/ServerSideSortRequestControl.java
index a5a5662..66539db 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/ServerSideSortRequestControl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/ServerSideSortRequestControl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.controls;
@@ -140,7 +140,7 @@
throw DecodeException.error(message);
}
- final List<SortKey> keys = new LinkedList<SortKey>();
+ final List<SortKey> keys = new LinkedList<>();
while (reader.hasNextElement()) {
reader.readStartSequence();
final String attrName = reader.readOctetStringAsString();
@@ -246,7 +246,7 @@
final String sortKeys) {
Reject.ifNull(sortKeys);
- final List<SortKey> keys = new LinkedList<SortKey>();
+ final List<SortKey> keys = new LinkedList<>();
final StringTokenizer tokenizer = new StringTokenizer(sortKeys, ",");
while (tokenizer.hasMoreTokens()) {
final String token = tokenizer.nextToken().trim();
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/AbstractRequestImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/AbstractRequestImpl.java
index 9a5268e..b61d568 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/AbstractRequestImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/AbstractRequestImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.requests;
@@ -58,7 +58,7 @@
return null;
}
- private final List<Control> controls = new LinkedList<Control>();
+ private final List<Control> controls = new LinkedList<>();
AbstractRequestImpl() {
// No implementation required.
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/DigestMD5SASLBindRequestImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/DigestMD5SASLBindRequestImpl.java
index 355961a..078a4d2 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/DigestMD5SASLBindRequestImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/DigestMD5SASLBindRequestImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.requests;
@@ -77,7 +77,7 @@
this.realm = initialBindRequest.getRealm();
// Create property map containing all the parameters.
- final Map<String, String> props = new HashMap<String, String>();
+ final Map<String, String> props = new HashMap<>();
final List<String> qopValues = initialBindRequest.getQOPs();
if (!qopValues.isEmpty()) {
@@ -213,7 +213,7 @@
}
- private final Map<String, String> additionalAuthParams = new LinkedHashMap<String, String>();
+ private final Map<String, String> additionalAuthParams = new LinkedHashMap<>();
private String authenticationID;
private String authorizationID;
@@ -221,7 +221,7 @@
private Integer maxReceiveBufferSize;
private Integer maxSendBufferSize;
private byte[] password;
- private final List<String> qopValues = new LinkedList<String>();
+ private final List<String> qopValues = new LinkedList<>();
private String realm;
/**
* Do not use primitives for these so that we can distinguish between default
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/GSSAPISASLBindRequestImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/GSSAPISASLBindRequestImpl.java
index e2e1d03..e00a61c 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/GSSAPISASLBindRequestImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/GSSAPISASLBindRequestImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.requests;
@@ -87,14 +87,14 @@
"No password specified for GSSAPI SASL authentication"));
}
- final Map<String, Object> state = new HashMap<String, Object>();
+ final Map<String, Object> state = new HashMap<>();
state.put("javax.security.auth.login.name", authenticationID);
state.put("javax.security.auth.login.password", password.toString().toCharArray());
state.put("javax.security.auth.useSubjectCredsOnly", "true");
state.put("java.security.krb5.realm", realm);
state.put("java.security.krb5.kdc", kdc);
- final Map<String, Object> options = new HashMap<String, Object>();
+ final Map<String, Object> options = new HashMap<>();
options.put("tryFirstPass", "true");
options.put("useTicketCache", "true");
options.put("doNotPrompt", "true");
@@ -169,11 +169,8 @@
Subject.doAs(subject, new PrivilegedExceptionAction<SaslClient>() {
@Override
public SaslClient run() throws LdapException {
- /*
- * Create property map containing all the
- * parameters.
- */
- final Map<String, String> props = new HashMap<String, String>();
+ // Create property map containing all the parameters.
+ final Map<String, String> props = new HashMap<>();
final List<String> qopValues = initialBindRequest.getQOPs();
if (!qopValues.isEmpty()) {
@@ -292,7 +289,7 @@
}
- private final Map<String, String> additionalAuthParams = new LinkedHashMap<String, String>();
+ private final Map<String, String> additionalAuthParams = new LinkedHashMap<>();
/** Ignored if subject is non-null. */
private String authenticationID;
@@ -304,7 +301,7 @@
private Integer maxSendBufferSize;
private byte[] password;
- private final List<String> qopValues = new LinkedList<String>();
+ private final List<String> qopValues = new LinkedList<>();
private String realm;
/**
* Don't use primitives for these so that we can distinguish between default
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java
index 973dffc..9ef22c2 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.requests;
@@ -42,7 +42,7 @@
* Modify request implementation.
*/
final class ModifyRequestImpl extends AbstractRequestImpl<ModifyRequest> implements ModifyRequest {
- private final List<Modification> changes = new LinkedList<Modification>();
+ private final List<Modification> changes = new LinkedList<>();
private DN name;
ModifyRequestImpl(final DN name) {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/SearchRequestImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/SearchRequestImpl.java
index 986d48b..1c46b10 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/SearchRequestImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/SearchRequestImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.requests;
@@ -40,7 +40,7 @@
* Search request implementation.
*/
final class SearchRequestImpl extends AbstractRequestImpl<SearchRequest> implements SearchRequest {
- private final List<String> attributes = new LinkedList<String>();
+ private final List<String> attributes = new LinkedList<>();
private DereferenceAliasesPolicy dereferenceAliasesPolicy = DereferenceAliasesPolicy.NEVER;
private Filter filter;
private DN name;
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/StartTLSExtendedRequestImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/StartTLSExtendedRequestImpl.java
index dde1d94..64d5a7a 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/StartTLSExtendedRequestImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/StartTLSExtendedRequestImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.requests;
@@ -87,10 +87,10 @@
private static final ExtendedResultDecoder<ExtendedResult> RESULT_DECODER = new ResultDecoder();
/** The list of cipher suite. */
- private final List<String> enabledCipherSuites = new LinkedList<String>();
+ private final List<String> enabledCipherSuites = new LinkedList<>();
/** The list of protocols. */
- private final List<String> enabledProtocols = new LinkedList<String>();
+ private final List<String> enabledProtocols = new LinkedList<>();
private SSLContext sslContext;
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResponseImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResponseImpl.java
index 9503968..59a235b 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResponseImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResponseImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012-2013 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.responses;
@@ -57,7 +57,7 @@
return null;
}
- private final List<Control> controls = new LinkedList<Control>();
+ private final List<Control> controls = new LinkedList<>();
AbstractResponseImpl() {
// No implementation required.
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResultImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResultImpl.java
index 9d72600..1e8911d 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResultImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/AbstractResultImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.responses;
@@ -46,7 +46,7 @@
private Throwable cause;
private String diagnosticMessage = "";
private String matchedDN = "";
- private final List<String> referralURIs = new LinkedList<String>();
+ private final List<String> referralURIs = new LinkedList<>();
private ResultCode resultCode;
AbstractResultImpl(final Result result) {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/SearchResultReferenceImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/SearchResultReferenceImpl.java
index b6a9c6d..29e7b6a 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/SearchResultReferenceImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/SearchResultReferenceImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2012 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.responses;
@@ -38,7 +38,7 @@
final class SearchResultReferenceImpl extends AbstractResponseImpl<SearchResultReference> implements
SearchResultReference {
- private final List<String> uris = new LinkedList<String>();
+ private final List<String> uris = new LinkedList<>();
SearchResultReferenceImpl(final SearchResultReference searchResultReference) {
super(searchResultReference);
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImpl.java
index c2acdcc..d85cfe2 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2014 ForgeRock AS
+ * Portions copyright 2014-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -151,7 +151,7 @@
return factory.createMatchAllQuery();
}
- final Collection<T> subqueries = new LinkedList<T>();
+ final Collection<T> subqueries = new LinkedList<>();
if (normInitial != null) {
// relies on the fact that equality indexes are also ordered
subqueries.add(rangeMatch(factory, equalityIndexId, normInitial));
@@ -208,7 +208,7 @@
// index substring length, and read those keys.
// Eliminate duplicates by putting the keys into a set.
- final TreeSet<ByteSequence> substringKeys = new TreeSet<ByteSequence>();
+ final TreeSet<ByteSequence> substringKeys = new TreeSet<>();
// Example: The value is ABCDE and the substring length is 3.
// We produce the keys ABC BCD CDE.
@@ -307,7 +307,7 @@
.get(assertionValue, reader.pos()));
}
if (anyStrings == null) {
- anyStrings = new LinkedList<ByteSequence>();
+ anyStrings = new LinkedList<>();
}
anyStrings.add(bytes);
} else {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeType.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeType.java
index af9ed47..12adfd2 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeType.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeType.java
@@ -62,7 +62,7 @@
/** A fluent API for incrementally constructing attribute type. */
public static final class Builder extends SchemaElementBuilder<Builder> {
private String oid;
- private final List<String> names = new LinkedList<String>();
+ private final List<String> names = new LinkedList<>();
private AttributeUsage attributeUsage;
private boolean isCollective;
private boolean isNoUserModification;
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaImpl.java
index 36b7634..7389cbf 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaImpl.java
@@ -942,20 +942,20 @@
*/
private static void addCollationMatchingRules(final SchemaBuilder builder) {
// Build an intermediate map to ensure each locale name appears only once
- final Map<String, Locale> localesCache = new TreeMap<String, Locale>();
+ final Map<String, Locale> localesCache = new TreeMap<>();
for (Locale locale : Locale.getAvailableLocales()) {
localesCache.put(localeName(locale), locale);
}
// Build a intermediate map to list all available oids with their locale names
// An oid can be associated to multiple locale names
- final Map<String, List<String>> oidsCache = new HashMap<String, List<String>>();
+ final Map<String, List<String>> oidsCache = new HashMap<>();
for (final String localeName: localesCache.keySet()) {
String oid = JVM_SUPPORTED_LOCALE_NAMES_TO_OIDS.get(localeName);
if (oid != null) {
List<String> names = oidsCache.get(oid);
if (names == null) {
- names = new ArrayList<String>(5);
+ names = new ArrayList<>(5);
oidsCache.put(oid, names);
}
names.add(localeName);
@@ -1009,7 +1009,7 @@
*/
private static String[] collationMatchingRuleNames(final List<String> localeNames, final int numSuffix,
final String symbolicSuffix) {
- final List<String> names = new ArrayList<String>();
+ final List<String> names = new ArrayList<>();
for (String localeName : localeNames) {
if (symbolicSuffix.isEmpty()) {
// the default rule
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaSupportedLocales.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaSupportedLocales.java
index 42f9533..f1d91fb 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaSupportedLocales.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/CoreSchemaSupportedLocales.java
@@ -49,7 +49,7 @@
* To add support for a new locale to collation matching rules, add its name as key and the corresponding oid as
* value.
*/
- private static final Map<String, String> LOCALE_NAMES_TO_OIDS = new HashMap<String, String>();
+ private static final Map<String, String> LOCALE_NAMES_TO_OIDS = new HashMap<>();
/**
* Same as {@link CoreSchemaSupportedLocales#LOCALE_NAMES_TO_OIDS}, but it contains the old locale names
@@ -59,7 +59,7 @@
* but the JVM only works with the old locale names.
* @see CoreSchemaSupportedLocales#LOCALE_NAMES_TO_OIDS
*/
- private static final Map<String, String> JVM_SUPPORTED_LOCALE_NAMES_TO_OIDS = new HashMap<String, String>();
+ private static final Map<String, String> JVM_SUPPORTED_LOCALE_NAMES_TO_OIDS = new HashMap<>();
static {
LOCALE_NAMES_TO_OIDS.put("af", "1.3.6.1.4.1.42.2.27.9.4.1.1");
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRule.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRule.java
index 30006f4..8ee8a84 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRule.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRule.java
@@ -55,10 +55,10 @@
/** A fluent API for incrementally constructing DIT structure rules. */
public static final class Builder extends SchemaElementBuilder<Builder> {
private int ruleID;
- private final List<String> names = new LinkedList<String>();
+ private final List<String> names = new LinkedList<>();
private boolean isObsolete;
private String nameFormOID;
- private final Set<Integer> superiorRuleIDs = new LinkedHashSet<Integer>();
+ private final Set<Integer> superiorRuleIDs = new LinkedHashSet<>();
Builder(final DITStructureRule structureRule, final SchemaBuilder builder) {
super(builder);
@@ -478,18 +478,16 @@
}
if (!superiorRuleIDs.isEmpty()) {
- superiorRules = new HashSet<DITStructureRule>(superiorRuleIDs.size());
- DITStructureRule rule;
+ superiorRules = new HashSet<>(superiorRuleIDs.size());
for (final Integer id : superiorRuleIDs) {
try {
- rule = schema.getDITStructureRule(id);
+ superiorRules.add(schema.getDITStructureRule(id));
} catch (final UnknownSchemaElementException e) {
final LocalizableMessage message =
ERR_ATTR_SYNTAX_DSR_UNKNOWN_RULE_ID.get(getNameOrRuleID(), id);
failValidation(invalidSchemaElements, warnings, message);
return false;
}
- superiorRules.add(rule);
}
}
superiorRules = Collections.unmodifiableSet(superiorRules);
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DeliveryMethodSyntaxImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DeliveryMethodSyntaxImpl.java
index 5194739..0216bed 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DeliveryMethodSyntaxImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DeliveryMethodSyntaxImpl.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.schema;
@@ -59,7 +60,7 @@
/**
* The set of values that may be used as delivery methods.
*/
- private static final HashSet<String> ALLOWED_VALUES = new HashSet<String>();
+ private static final HashSet<String> ALLOWED_VALUES = new HashSet<>();
{
ALLOWED_VALUES.add("any");
ALLOWED_VALUES.add("mhs");
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/EnumSyntaxImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/EnumSyntaxImpl.java
index d314735..f9f7984 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/EnumSyntaxImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/EnumSyntaxImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2014 ForgeRock AS
+ * Portions copyright 2014-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -58,7 +58,7 @@
EnumSyntaxImpl(final String oid, final List<String> entries) {
Reject.ifNull(oid, entries);
this.oid = oid;
- final List<String> entryStrings = new ArrayList<String>(entries.size());
+ final List<String> entryStrings = new ArrayList<>(entries.size());
for (final String entry : entries) {
final String normalized = normalize(ByteString.valueOf(entry));
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/FacsimileNumberSyntaxImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/FacsimileNumberSyntaxImpl.java
index bf40840..ed8ba66 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/FacsimileNumberSyntaxImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/FacsimileNumberSyntaxImpl.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.schema;
@@ -61,7 +62,7 @@
* The set of allowed fax parameter values, formatted entirely in lowercase
* characters.
*/
- public static final HashSet<String> ALLOWED_FAX_PARAMETERS = new HashSet<String>(7);
+ public static final HashSet<String> ALLOWED_FAX_PARAMETERS = new HashSet<>(7);
static {
ALLOWED_FAX_PARAMETERS.add("twodimensional");
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/GenerateCoreSchema.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/GenerateCoreSchema.java
index 1e111a6..71ed13d 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/GenerateCoreSchema.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/GenerateCoreSchema.java
@@ -23,6 +23,7 @@
*
* Copyright 2009 Sun Microsystems, Inc.
* Portions Copyright 2014 Manuel Gaupp
+ * Portions Copyright 2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.schema;
@@ -40,7 +41,7 @@
* Tool for generating CoreSchema.java.
*/
final class GenerateCoreSchema {
- private static final Set<String> ABBREVIATIONS = new HashSet<String>(Arrays.asList("SASL",
+ private static final Set<String> ABBREVIATIONS = new HashSet<>(Arrays.asList("SASL",
"LDAP", "DN", "DIT", "RDN", "JPEG", "OID", "UUID", "IA5", "UID", "UTC", "X500", "X121",
"C", "CN", "O", "OU", "L", "DC", "ISDN", "SN", "ST"));
@@ -55,7 +56,7 @@
final Schema schema = Schema.getCoreSchema();
- final SortedMap<String, Syntax> syntaxes = new TreeMap<String, Syntax>();
+ final SortedMap<String, Syntax> syntaxes = new TreeMap<>();
for (final Syntax syntax : schema.getSyntaxes()) {
if (isOpenDSOID(syntax.getOID())) {
continue;
@@ -67,7 +68,7 @@
syntaxes.put(fieldName, syntax);
}
- final SortedMap<String, MatchingRule> matchingRules = new TreeMap<String, MatchingRule>();
+ final SortedMap<String, MatchingRule> matchingRules = new TreeMap<>();
for (final MatchingRule matchingRule : schema.getMatchingRules()) {
if (isOpenDSOID(matchingRule.getOID()) || isCollationMatchingRule(matchingRule.getOID())) {
continue;
@@ -78,8 +79,7 @@
matchingRules.put(fieldName, matchingRule);
}
- final SortedMap<String, AttributeType> attributeTypes =
- new TreeMap<String, AttributeType>();
+ final SortedMap<String, AttributeType> attributeTypes = new TreeMap<>();
for (final AttributeType attributeType : schema.getAttributeTypes()) {
if (isOpenDSOID(attributeType.getOID())) {
continue;
@@ -89,7 +89,7 @@
attributeTypes.put(fieldName, attributeType);
}
- final SortedMap<String, ObjectClass> objectClasses = new TreeMap<String, ObjectClass>();
+ final SortedMap<String, ObjectClass> objectClasses = new TreeMap<>();
for (final ObjectClass objectClass : schema.getObjectClasses()) {
if (isOpenDSOID(objectClass.getOID())) {
continue;
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/LDAPSyntaxDescriptionSyntaxImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/LDAPSyntaxDescriptionSyntaxImpl.java
index d9d9ca3..ee6d62a 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/LDAPSyntaxDescriptionSyntaxImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/LDAPSyntaxDescriptionSyntaxImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2011-2014 ForgeRock AS
+ * Portions copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -129,7 +129,7 @@
// single quotes separated by spaces followed by a close
// parenthesis.
if (extraProperties.isEmpty()) {
- extraProperties = new HashMap<String, List<String>>();
+ extraProperties = new HashMap<>();
}
extraProperties.put(tokenName, SchemaUtils.readExtensions(reader));
} else {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java
index f57b37a..b9f1ea5 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java
@@ -62,7 +62,7 @@
/** A fluent API for incrementally constructing matching rules. */
public static final class Builder extends SchemaElementBuilder<Builder> {
private String oid;
- private final List<String> names = new LinkedList<String>();
+ private final List<String> names = new LinkedList<>();
private boolean isObsolete;
private String syntaxOID;
private MatchingRuleImpl impl;
@@ -387,7 +387,6 @@
* @return The OID for this schema definition.
*/
public String getOID() {
-
return oid;
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleUse.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleUse.java
index 3e2d34a..3a1ce56 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleUse.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleUse.java
@@ -56,9 +56,9 @@
/** A fluent API for incrementally constructing matching rule uses. */
public static final class Builder extends SchemaElementBuilder<Builder> {
private String oid;
- private final List<String> names = new LinkedList<String>();
+ private final List<String> names = new LinkedList<>();
private boolean isObsolete;
- private final Set<String> attributeOIDs = new LinkedHashSet<String>();
+ private final Set<String> attributeOIDs = new LinkedHashSet<>();
Builder(MatchingRuleUse mru, SchemaBuilder builder) {
super(builder, mru);
@@ -483,17 +483,15 @@
throw new SchemaException(message, e);
}
- attributes = new HashSet<AttributeType>(attributeOIDs.size());
- AttributeType attributeType;
+ attributes = new HashSet<>(attributeOIDs.size());
for (final String attribute : attributeOIDs) {
try {
- attributeType = schema.getAttributeType(attribute);
+ attributes.add(schema.getAttributeType(attribute));
} catch (final UnknownSchemaElementException e) {
final LocalizableMessage message =
ERR_ATTR_SYNTAX_MRUSE_UNKNOWN_ATTR1.get(getNameOrOID(), attribute);
throw new SchemaException(message, e);
}
- attributes.add(attributeType);
}
attributes = Collections.unmodifiableSet(attributes);
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java
index 23ae1cc..48c4d5f 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java
@@ -62,11 +62,11 @@
/** A fluent API for incrementally constructing object classes. */
public static final class Builder extends SchemaElementBuilder<Builder> {
private boolean isObsolete;
- private final List<String> names = new LinkedList<String>();
+ private final List<String> names = new LinkedList<>();
private String oid;
- private final Set<String> optionalAttributes = new LinkedHashSet<String>();
- private final Set<String> requiredAttributes = new LinkedHashSet<String>();
- private final Set<String> superiorClasses = new LinkedHashSet<String>();
+ private final Set<String> optionalAttributes = new LinkedHashSet<>();
+ private final Set<String> requiredAttributes = new LinkedHashSet<>();
+ private final Set<String> superiorClasses = new LinkedHashSet<>();
private ObjectClassType type;
Builder(final ObjectClass oc, final SchemaBuilder builder) {
@@ -775,7 +775,7 @@
boolean derivesTop = getObjectClassType() != ObjectClassType.STRUCTURAL;
if (!superiorClassOIDs.isEmpty()) {
- superiorClasses = new HashSet<ObjectClass>(superiorClassOIDs.size());
+ superiorClasses = new HashSet<>(superiorClassOIDs.size());
ObjectClass superiorClass;
for (final String superClassOid : superiorClassOIDs) {
try {
@@ -852,7 +852,7 @@
// Inherit all required attributes from superior class.
Iterator<AttributeType> i = superiorClass.getRequiredAttributes().iterator();
if (i.hasNext() && requiredAttributes == Collections.EMPTY_SET) {
- requiredAttributes = new HashSet<AttributeType>();
+ requiredAttributes = new HashSet<>();
}
while (i.hasNext()) {
requiredAttributes.add(i.next());
@@ -861,7 +861,7 @@
// Inherit all optional attributes from superior class.
i = superiorClass.getRequiredAttributes().iterator();
if (i.hasNext() && requiredAttributes == Collections.EMPTY_SET) {
- requiredAttributes = new HashSet<AttributeType>();
+ requiredAttributes = new HashSet<>();
}
while (i.hasNext()) {
requiredAttributes.add(i.next());
@@ -885,7 +885,7 @@
}
if (oid.equals(EXTENSIBLE_OBJECT_OBJECTCLASS_OID)) {
- declaredOptionalAttributes = new HashSet<AttributeType>(requiredAttributeOIDs.size());
+ declaredOptionalAttributes = new HashSet<>(requiredAttributeOIDs.size());
for (final AttributeType attributeType : schema.getAttributeTypes()) {
if (attributeType.getUsage() == AttributeUsage.USER_APPLICATIONS) {
declaredOptionalAttributes.add(attributeType);
@@ -894,8 +894,7 @@
optionalAttributes = declaredRequiredAttributes;
} else {
if (!requiredAttributeOIDs.isEmpty()) {
- declaredRequiredAttributes =
- new HashSet<AttributeType>(requiredAttributeOIDs.size());
+ declaredRequiredAttributes = new HashSet<>(requiredAttributeOIDs.size());
AttributeType attributeType;
for (final String requiredAttribute : requiredAttributeOIDs) {
try {
@@ -919,8 +918,7 @@
}
if (!optionalAttributeOIDs.isEmpty()) {
- declaredOptionalAttributes =
- new HashSet<AttributeType>(optionalAttributeOIDs.size());
+ declaredOptionalAttributes = new HashSet<>(optionalAttributeOIDs.size());
AttributeType attributeType;
for (final String optionalAttribute : optionalAttributeOIDs) {
try {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java
index b8ead17..ed69340 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
* Portions Copyright 2014 Manuel Gaupp
*/
package org.forgerock.opendj.ldap.schema;
@@ -1715,7 +1715,7 @@
// one structural object class.
ObjectClass structuralObjectClass = null;
final Attribute objectClassAttribute = entry.getAttribute(objectClass());
- final List<ObjectClass> objectClasses = new LinkedList<ObjectClass>();
+ final List<ObjectClass> objectClasses = new LinkedList<>();
if (objectClassAttribute != null) {
for (final ByteString v : objectClassAttribute) {
final String objectClassName = v.toString();
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaBuilder.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaBuilder.java
index bdd5521..7e93d70 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaBuilder.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaBuilder.java
@@ -2166,7 +2166,7 @@
if (attrs == null) {
name2AttributeTypes.put(lowerName, Collections.singletonList(attribute));
} else if (attrs.size() == 1) {
- attrs = new ArrayList<AttributeType>(attrs);
+ attrs = new ArrayList<>(attrs);
attrs.add(attribute);
name2AttributeTypes.put(lowerName, attrs);
} else {
@@ -2197,7 +2197,7 @@
if (rules == null) {
name2ContentRules.put(lowerName, Collections.singletonList(rule));
} else if (rules.size() == 1) {
- rules = new ArrayList<DITContentRule>(rules);
+ rules = new ArrayList<>(rules);
rules.add(rule);
name2ContentRules.put(lowerName, rules);
} else {
@@ -2228,7 +2228,7 @@
if (rules == null) {
name2StructureRules.put(lowerName, Collections.singletonList(rule));
} else if (rules.size() == 1) {
- rules = new ArrayList<DITStructureRule>(rules);
+ rules = new ArrayList<>(rules);
rules.add(rule);
name2StructureRules.put(lowerName, rules);
} else {
@@ -2259,7 +2259,7 @@
if (uses == null) {
name2MatchingRuleUses.put(lowerName, Collections.singletonList(use));
} else if (uses.size() == 1) {
- uses = new ArrayList<MatchingRuleUse>(uses);
+ uses = new ArrayList<>(uses);
uses.add(use);
name2MatchingRuleUses.put(lowerName, uses);
} else {
@@ -2292,7 +2292,7 @@
if (rules == null) {
name2MatchingRules.put(lowerName, Collections.singletonList(rule));
} else if (rules.size() == 1) {
- rules = new ArrayList<MatchingRule>(rules);
+ rules = new ArrayList<>(rules);
rules.add(rule);
name2MatchingRules.put(lowerName, rules);
} else {
@@ -2322,7 +2322,7 @@
if (forms == null) {
name2NameForms.put(lowerName, Collections.singletonList(form));
} else if (forms.size() == 1) {
- forms = new ArrayList<NameForm>(forms);
+ forms = new ArrayList<>(forms);
forms.add(form);
name2NameForms.put(lowerName, forms);
} else {
@@ -2352,7 +2352,7 @@
if (classes == null) {
name2ObjectClasses.put(lowerName, Collections.singletonList(oc));
} else if (classes.size() == 1) {
- classes = new ArrayList<ObjectClass>(classes);
+ classes = new ArrayList<>(classes);
classes.add(oc);
name2ObjectClasses.put(lowerName, classes);
} else {
@@ -2430,26 +2430,26 @@
if (numericOID2Syntaxes == null) {
options = defaultSchemaOptions();
- numericOID2Syntaxes = new LinkedHashMap<String, Syntax>();
- numericOID2MatchingRules = new LinkedHashMap<String, MatchingRule>();
- numericOID2MatchingRuleUses = new LinkedHashMap<String, MatchingRuleUse>();
- numericOID2AttributeTypes = new LinkedHashMap<String, AttributeType>();
- numericOID2ObjectClasses = new LinkedHashMap<String, ObjectClass>();
- numericOID2NameForms = new LinkedHashMap<String, NameForm>();
- numericOID2ContentRules = new LinkedHashMap<String, DITContentRule>();
- id2StructureRules = new LinkedHashMap<Integer, DITStructureRule>();
+ numericOID2Syntaxes = new LinkedHashMap<>();
+ numericOID2MatchingRules = new LinkedHashMap<>();
+ numericOID2MatchingRuleUses = new LinkedHashMap<>();
+ numericOID2AttributeTypes = new LinkedHashMap<>();
+ numericOID2ObjectClasses = new LinkedHashMap<>();
+ numericOID2NameForms = new LinkedHashMap<>();
+ numericOID2ContentRules = new LinkedHashMap<>();
+ id2StructureRules = new LinkedHashMap<>();
- name2MatchingRules = new LinkedHashMap<String, List<MatchingRule>>();
- name2MatchingRuleUses = new LinkedHashMap<String, List<MatchingRuleUse>>();
- name2AttributeTypes = new LinkedHashMap<String, List<AttributeType>>();
- name2ObjectClasses = new LinkedHashMap<String, List<ObjectClass>>();
- name2NameForms = new LinkedHashMap<String, List<NameForm>>();
- name2ContentRules = new LinkedHashMap<String, List<DITContentRule>>();
- name2StructureRules = new LinkedHashMap<String, List<DITStructureRule>>();
+ name2MatchingRules = new LinkedHashMap<>();
+ name2MatchingRuleUses = new LinkedHashMap<>();
+ name2AttributeTypes = new LinkedHashMap<>();
+ name2ObjectClasses = new LinkedHashMap<>();
+ name2NameForms = new LinkedHashMap<>();
+ name2ContentRules = new LinkedHashMap<>();
+ name2StructureRules = new LinkedHashMap<>();
- objectClass2NameForms = new HashMap<String, List<NameForm>>();
- nameForm2StructureRules = new HashMap<String, List<DITStructureRule>>();
- warnings = new LinkedList<LocalizableMessage>();
+ objectClass2NameForms = new HashMap<>();
+ nameForm2StructureRules = new HashMap<>();
+ warnings = new LinkedList<>();
}
if (copyOnWriteSchema != null) {
@@ -2624,7 +2624,7 @@
// Attribute types need special processing because they have
// hierarchical dependencies.
- final List<AttributeType> invalidAttributeTypes = new LinkedList<AttributeType>();
+ final List<AttributeType> invalidAttributeTypes = new LinkedList<>();
for (final AttributeType attributeType : numericOID2AttributeTypes.values()) {
attributeType.validate(schema, invalidAttributeTypes, warnings);
}
@@ -2635,7 +2635,7 @@
// Object classes need special processing because they have hierarchical
// dependencies.
- final List<ObjectClass> invalidObjectClasses = new LinkedList<ObjectClass>();
+ final List<ObjectClass> invalidObjectClasses = new LinkedList<>();
for (final ObjectClass objectClass : numericOID2ObjectClasses.values()) {
objectClass.validate(schema, invalidObjectClasses, warnings);
}
@@ -2665,7 +2665,7 @@
if (forms == null) {
objectClass2NameForms.put(ocOID, Collections.singletonList(form));
} else if (forms.size() == 1) {
- forms = new ArrayList<NameForm>(forms);
+ forms = new ArrayList<>(forms);
forms.add(form);
objectClass2NameForms.put(ocOID, forms);
} else {
@@ -2690,7 +2690,7 @@
// DIT structure rules need special processing because they have
// hierarchical dependencies.
- final List<DITStructureRule> invalidStructureRules = new LinkedList<DITStructureRule>();
+ final List<DITStructureRule> invalidStructureRules = new LinkedList<>();
for (final DITStructureRule rule : id2StructureRules.values()) {
rule.validate(schema, invalidStructureRules, warnings);
}
@@ -2706,7 +2706,7 @@
if (rules == null) {
nameForm2StructureRules.put(ocOID, Collections.singletonList(rule));
} else if (rules.size() == 1) {
- rules = new ArrayList<DITStructureRule>(rules);
+ rules = new ArrayList<>(rules);
rules.add(rule);
nameForm2StructureRules.put(ocOID, rules);
} else {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaElement.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaElement.java
index 91a50e7..89fe8f7 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaElement.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaElement.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2011 ForgeRock AS
+ * Portions copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -56,13 +56,13 @@
SchemaElementBuilder(final SchemaBuilder schemaBuilder) {
this.schemaBuilder = schemaBuilder;
this.description = "";
- this.extraProperties = new LinkedHashMap<String, List<String>>(1);
+ this.extraProperties = new LinkedHashMap<>(1);
}
SchemaElementBuilder(final SchemaBuilder schemaBuilder, final SchemaElement copy) {
this.schemaBuilder = schemaBuilder;
this.description = copy.description;
- this.extraProperties = new LinkedHashMap<String, List<String>>(copy.extraProperties);
+ this.extraProperties = new LinkedHashMap<>(copy.extraProperties);
}
/*
@@ -156,7 +156,7 @@
T extraProperties0(final String extensionName, final String... extensionValues) {
if (this.extraProperties.get(extensionName) != null) {
final List<String> tempExtraProperties =
- new ArrayList<String>(this.extraProperties.get(extensionName));
+ new ArrayList<>(this.extraProperties.get(extensionName));
tempExtraProperties.addAll(Arrays.asList(extensionValues));
this.extraProperties.put(extensionName, tempExtraProperties);
} else {
@@ -187,7 +187,7 @@
T removeExtraProperty0(final String extensionName, final String... extensionValues) {
if (this.extraProperties.get(extensionName) != null && extensionValues.length > 0) {
final List<String> tempExtraProperties =
- new ArrayList<String>(this.extraProperties.get(extensionName));
+ new ArrayList<>(this.extraProperties.get(extensionName));
tempExtraProperties.removeAll(Arrays.asList(extensionValues));
this.extraProperties.put(extensionName, tempExtraProperties);
} else if (this.extraProperties.get(extensionName) != null) {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaUtils.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaUtils.java
index bb53236..f72569e 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaUtils.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaUtils.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2011-2014 ForgeRock AS
+ * Portions copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -97,7 +97,7 @@
if (c == ')') {
values = Collections.emptyList();
} else {
- values = new ArrayList<String>();
+ values = new ArrayList<>();
do {
reader.reset();
values.add(readQuotedString(reader));
@@ -145,7 +145,7 @@
if (c == ')') {
values = Collections.emptyList();
} else {
- values = new LinkedList<String>();
+ values = new LinkedList<>();
do {
reader.reset();
values.add(readQuotedDescriptor(reader, allowCompatChars));
@@ -407,7 +407,7 @@
try {
final char c = reader.read();
if (c == '(') {
- values = new LinkedHashSet<String>();
+ values = new LinkedHashSet<>();
do {
values.add(readOID(reader, allowCompatChars));
@@ -518,7 +518,7 @@
try {
final char c = reader.read();
if (c == '(') {
- values = new LinkedHashSet<Integer>();
+ values = new LinkedHashSet<>();
do {
values.add(readRuleID(reader));
@@ -595,14 +595,13 @@
final Map<String, List<String>> extraProperties) {
if (extraProperties == null || extraProperties.isEmpty()) {
return Collections.emptyMap();
- } else {
- final Map<String, List<String>> tmp =
- new LinkedHashMap<String, List<String>>(extraProperties.size());
- for (final Map.Entry<String, List<String>> e : extraProperties.entrySet()) {
- tmp.put(e.getKey(), unmodifiableCopyOfList(e.getValue()));
- }
- return Collections.unmodifiableMap(tmp);
}
+
+ final Map<String, List<String>> tmp = new LinkedHashMap<>(extraProperties.size());
+ for (final Map.Entry<String, List<String>> e : extraProperties.entrySet()) {
+ tmp.put(e.getKey(), unmodifiableCopyOfList(e.getValue()));
+ }
+ return Collections.unmodifiableMap(tmp);
}
static <E> List<E> unmodifiableCopyOfList(final List<E> l) {
@@ -611,7 +610,7 @@
} else if (l.size() == 1) {
return Collections.singletonList(l.get(0));
} else {
- final List<E> copy = new LinkedList<E>(l);
+ final List<E> copy = new LinkedList<>(l);
return Collections.unmodifiableList(copy);
}
}
@@ -622,7 +621,7 @@
} else if (s.size() == 1) {
return Collections.singleton(s.iterator().next());
} else {
- final Set<E> copy = new LinkedHashSet<E>(s);
+ final Set<E> copy = new LinkedHashSet<>(s);
return Collections.unmodifiableSet(copy);
}
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TeletexTerminalIdentifierSyntaxImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TeletexTerminalIdentifierSyntaxImpl.java
index 2fb9765..69547ae 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TeletexTerminalIdentifierSyntaxImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TeletexTerminalIdentifierSyntaxImpl.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.schema;
@@ -58,7 +59,7 @@
* The set of allowed fax parameter values, formatted entirely in lowercase
* characters.
*/
- private static final HashSet<String> ALLOWED_TTX_PARAMETERS = new HashSet<String>(5);
+ private static final HashSet<String> ALLOWED_TTX_PARAMETERS = new HashSet<>(5);
static {
ALLOWED_TTX_PARAMETERS.add("graphic");
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TimeBasedMatchingRulesImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TimeBasedMatchingRulesImpl.java
index c34e311..9adec0c 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TimeBasedMatchingRulesImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TimeBasedMatchingRulesImpl.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -320,7 +320,7 @@
int assertMonth = buffer.getInt(16);
int assertYear = buffer.getInt(20);
- List<T> queries = new ArrayList<T>();
+ List<T> queries = new ArrayList<>();
if (assertSecond >= 0) {
queries.add(createExactMatchQuery(factory, assertSecond, SECOND));
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/ConnectionState.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/ConnectionState.java
index 4b1baf1..3a416d0 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/ConnectionState.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/ConnectionState.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013-2014 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.spi;
@@ -252,26 +252,16 @@
*/
private volatile LdapException connectionError;
- /**
- * {@code true} if the connection has failed due to a disconnect
- * notification.
- */
+ /** Whether the connection has failed due to a disconnect notification. */
private boolean failedDueToDisconnect;
- /**
- * Registered event listeners.
- */
- private final List<ConnectionEventListener> listeners =
- new LinkedList<ConnectionEventListener>();
+ /** Registered event listeners. */
+ private final List<ConnectionEventListener> listeners = new LinkedList<>();
- /**
- * Internal state implementation.
- */
+ /** Internal state implementation. */
private volatile State state = State.VALID;
- /**
- * Creates a new connection state which is initially valid.
- */
+ /** Creates a new connection state which is initially valid. */
public ConnectionState() {
// Nothing to do.
}
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromiseImpl.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromiseImpl.java
index fb19c1f..846b8e8 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromiseImpl.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromiseImpl.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2014 ForgeRock AS.
+ * Copyright 2014-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.spi;
@@ -77,7 +77,7 @@
* @return a new {@link LdapPromiseImpl}
*/
public static <S> LdapPromiseImpl<S> newLdapPromiseImpl(int requestID) {
- return new LdapPromiseImpl<S>(PromiseImpl.<S, LdapException> create(), requestID);
+ return new LdapPromiseImpl<>(PromiseImpl.<S, LdapException> create(), requestID);
}
@Override
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromises.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromises.java
index 4ca5cb8..c0d6847 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromises.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/spi/LdapPromises.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2014 ForgeRock AS.
+ * Copyright 2014-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.spi;
@@ -220,7 +220,7 @@
public static <S extends ExtendedResult> ExtendedResultLdapPromiseImpl<S> newExtendedLdapPromise(
final int requestID, final ExtendedRequest<S> request,
final IntermediateResponseHandler intermediateResponseHandler, final Connection connection) {
- return new ExtendedResultLdapPromiseImpl<S>(requestID, request, intermediateResponseHandler, connection);
+ return new ExtendedResultLdapPromiseImpl<>(requestID, request, intermediateResponseHandler, connection);
}
/**
@@ -264,7 +264,7 @@
}
static <R> LdapPromise<R> wrap(Promise<R, LdapException> wrappedPromise, int requestID) {
- return new LdapPromiseWrapper<R, Promise<R, LdapException>>(wrappedPromise, requestID);
+ return new LdapPromiseWrapper<>(wrappedPromise, requestID);
}
private LdapPromises() {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFReader.java b/opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFReader.java
index df261c4..2d3cddf 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFReader.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFReader.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2011-2013 ForgeRock AS
+ * Portions copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldif;
@@ -338,7 +338,7 @@
final LDIFRecord readLDIFRecord() throws IOException {
// Read the entry lines into a buffer.
final StringBuilder lastLineBuilder = new StringBuilder();
- final LinkedList<String> ldifLines = new LinkedList<String>();
+ final LinkedList<String> ldifLines = new LinkedList<>();
long recordLineNumber = 0;
final int stateStart = 0;
final int stateStartCommentLine = 1;
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFStream.java b/opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFStream.java
index 1a20da0..84a0b96 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFStream.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldif/AbstractLDIFStream.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2011-2013 ForgeRock AS
+ * Portions copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldif;
@@ -42,14 +42,14 @@
* Common LDIF reader/writer functionality.
*/
abstract class AbstractLDIFStream {
- final Set<AttributeDescription> excludeAttributes = new HashSet<AttributeDescription>();
- final Set<DN> excludeBranches = new HashSet<DN>();
- final List<Matcher> excludeFilters = new LinkedList<Matcher>();
+ final Set<AttributeDescription> excludeAttributes = new HashSet<>();
+ final Set<DN> excludeBranches = new HashSet<>();
+ final List<Matcher> excludeFilters = new LinkedList<>();
boolean excludeOperationalAttributes;
boolean excludeUserAttributes;
- final Set<AttributeDescription> includeAttributes = new HashSet<AttributeDescription>();
- final Set<DN> includeBranches = new HashSet<DN>();
- final List<Matcher> includeFilters = new LinkedList<Matcher>();
+ final Set<AttributeDescription> includeAttributes = new HashSet<>();
+ final Set<DN> includeBranches = new HashSet<>();
+ final List<Matcher> includeFilters = new LinkedList<>();
AbstractLDIFStream() {
// Nothing to do.
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldif/EntryGenerator.java b/opendj-core/src/main/java/org/forgerock/opendj/ldif/EntryGenerator.java
index 6ea50ff..4be8f22 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldif/EntryGenerator.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldif/EntryGenerator.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2013 ForgeRock AS
+ * Portions Copyright 2013-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldif;
@@ -70,7 +70,7 @@
private TemplateFile templateFile;
/** Warnings issued by the parsing of the template file. */
- private final List<LocalizableMessage> warnings = new LinkedList<LocalizableMessage>();
+ private final List<LocalizableMessage> warnings = new LinkedList<>();
/** Indicates if the generator is closed. */
private boolean isClosed;
@@ -118,7 +118,7 @@
private boolean generateBranches = true;
/** Dictionary of constants to use in the template file. */
- private Map<String, String> constants = new HashMap<String, String>();
+ private Map<String, String> constants = new HashMap<>();
/**
* Creates a generator using default values.
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIF.java b/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIF.java
index a16b124..49b1a8d 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIF.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIF.java
@@ -20,7 +20,7 @@
*
* CDDL HEADER END
*
- * Copyright 2011-2014 ForgeRock AS
+ * Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldif;
@@ -320,7 +320,7 @@
* If {@code ldifLines} was {@code null}.
*/
public static List<Entry> makeEntries(String... ldifLines) {
- List<Entry> entries = new ArrayList<Entry>();
+ List<Entry> entries = new ArrayList<>();
LDIFEntryReader reader = new LDIFEntryReader(ldifLines);
try {
while (reader.hasNext()) {
@@ -526,8 +526,7 @@
// Move the renamed entries into a separate map
// in order to avoid cases where the renamed subtree overlaps.
- final SortedMap<byte[], byte[]> renamedEntries =
- new TreeMap<byte[], byte[]>(DN_ORDER);
+ final SortedMap<byte[], byte[]> renamedEntries = new TreeMap<>(DN_ORDER);
// @formatter:off
final Iterator<Map.Entry<byte[], byte[]>> i =
@@ -796,7 +795,7 @@
}
private static List<byte[][]> readEntriesAsList(final EntryReader reader) throws IOException {
- final List<byte[][]> entries = new ArrayList<byte[][]>();
+ final List<byte[][]> entries = new ArrayList<>();
while (reader.hasNext()) {
final Entry entry = reader.readEntry();
@@ -810,7 +809,7 @@
private static TreeMap<byte[], byte[]> readEntriesAsMap(final EntryReader reader)
throws IOException {
- final TreeMap<byte[], byte[]> entries = new TreeMap<byte[], byte[]>(DN_ORDER);
+ final TreeMap<byte[], byte[]> entries = new TreeMap<>(DN_ORDER);
while (reader.hasNext()) {
final Entry entry = reader.readEntry();
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFChangeRecordReader.java b/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFChangeRecordReader.java
index 7bcbb51..5218abb 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFChangeRecordReader.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFChangeRecordReader.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2011-2013 ForgeRock AS
+ * Portions copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldif;
@@ -427,7 +427,7 @@
}
if (controls == null) {
- controls = new LinkedList<Control>();
+ controls = new LinkedList<>();
}
controls.add(parseControl(entryDN, record, ldifLine, pair.value));
@@ -473,7 +473,7 @@
// Use an Entry for the AttributeSequence.
final Entry entry = new LinkedHashMapEntry(entryDN);
boolean schemaValidationFailure = false;
- final List<LocalizableMessage> schemaErrors = new LinkedList<LocalizableMessage>();
+ final List<LocalizableMessage> schemaErrors = new LinkedList<>();
if (lastLDIFLine != null
// This line was read when looking for the change type.
@@ -532,9 +532,9 @@
throws DecodeException {
final ModifyRequest modifyRequest = Requests.newModifyRequest(entryDN);
final KeyValuePair pair = new KeyValuePair();
- final List<ByteString> attributeValues = new ArrayList<ByteString>();
+ final List<ByteString> attributeValues = new ArrayList<>();
boolean schemaValidationFailure = false;
- final List<LocalizableMessage> schemaErrors = new LinkedList<LocalizableMessage>();
+ final List<LocalizableMessage> schemaErrors = new LinkedList<>();
while (record.iterator.hasNext()) {
String ldifLine = readLDIFRecordKeyValuePair(record, pair, false);
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFEntryReader.java b/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFEntryReader.java
index 1176b5b..fade05e 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFEntryReader.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFEntryReader.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2011-2013 ForgeRock AS
+ * Portions copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldif;
@@ -397,7 +397,7 @@
// Use an Entry for the AttributeSequence.
final Entry entry = new LinkedHashMapEntry(entryDN);
boolean schemaValidationFailure = false;
- final List<LocalizableMessage> schemaErrors = new LinkedList<LocalizableMessage>();
+ final List<LocalizableMessage> schemaErrors = new LinkedList<>();
while (record.iterator.hasNext()) {
final String ldifLine = record.iterator.next();
if (!readLDIFRecordAttributeValue(record, ldifLine, entry, schemaErrors)) {
diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java b/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java
index 90c06c9..4c84d45 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java
@@ -110,7 +110,7 @@
* 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 final Map<String, String[]> fileLines = new HashMap<String, String[]>();
+ private final Map<String, String[]> fileLines = new HashMap<>();
/** The index of the next first name value that should be used. */
private int firstNameIndex;
@@ -131,16 +131,16 @@
private int nameUniquenessCounter = 1;
/** The set of branch definitions for this template file. */
- private final Map<DN, Branch> branches = new LinkedHashMap<DN, Branch>();
+ private final Map<DN, Branch> branches = new LinkedHashMap<>();
/** The set of constant definitions for this template file. */
private final Map<String, String> constants;
/** The set of registered tags for this template file. */
- private final Map<String, TemplateTag> registeredTags = new LinkedHashMap<String, TemplateTag>();
+ private final Map<String, TemplateTag> registeredTags = new LinkedHashMap<>();
/** The set of template definitions for this template file. */
- private final Map<String, Template> templates = new LinkedHashMap<String, Template>();
+ private final Map<String, Template> templates = new LinkedHashMap<>();
/** The random number generator for this template file. */
private final Random random;
@@ -422,9 +422,9 @@
* Structure to hold template data during parsing of the template.
*/
private static class TemplateData {
- final Map<String, TemplateTag> tags = new LinkedHashMap<String, TemplateTag>();
- final Map<DN, Branch> branches = new LinkedHashMap<DN, Branch>();
- final Map<String, Template> templates = new LinkedHashMap<String, Template>();
+ final Map<String, TemplateTag> tags = new LinkedHashMap<>();
+ final Map<DN, Branch> branches = new LinkedHashMap<>();
+ final Map<String, Template> templates = new LinkedHashMap<>();
}
/**
@@ -607,7 +607,7 @@
*/
private String[] parseLinesUntilEndOfBlock(final int startLineNumber, final String startLine,
final String[] lines, final List<LocalizableMessage> warnings) {
- final List<String> lineList = new ArrayList<String>();
+ final List<String> lineList = new ArrayList<>();
String line = startLine;
lineList.add(line);
@@ -761,9 +761,9 @@
// that's not one of those.
int lineCount = 1;
Template parentTemplate = null;
- final List<AttributeType> rdnAttributes = new ArrayList<AttributeType>();
- final List<String> subordinatesTemplateNames = new ArrayList<String>();
- final List<Integer> numberOfentriesPerTemplate = new ArrayList<Integer>();
+ final List<AttributeType> rdnAttributes = new ArrayList<>();
+ final List<String> subordinatesTemplateNames = new ArrayList<>();
+ final List<Integer> numberOfentriesPerTemplate = new ArrayList<>();
for (; lineCount < templateLines.length; lineCount++) {
final int lineNumber = startLineNumber + lineCount;
@@ -946,7 +946,7 @@
int phase = PARSING_STATIC_TEXT;
int previousPhase = PARSING_STATIC_TEXT;
- final List<TemplateTag> tagList = new ArrayList<TemplateTag>();
+ final List<TemplateTag> tagList = new ArrayList<>();
StringBuilder buffer = new StringBuilder();
for (; pos < length; pos++) {
@@ -1084,7 +1084,7 @@
}
}
- final List<String> args = new ArrayList<String>();
+ final List<String> args = new ArrayList<>();
while (tokenizer.hasMoreTokens()) {
args.add(tokenizer.nextToken().trim());
}
@@ -1136,7 +1136,7 @@
// is the number of characters to use from the attribute value. The
// arguments will be delimited by colons.
final StringTokenizer tokenizer = new StringTokenizer(tagString, ":");
- final List<String> args = new ArrayList<String>();
+ final List<String> args = new ArrayList<>();
while (tokenizer.hasMoreTokens()) {
args.add(tokenizer.nextToken());
}
@@ -1266,7 +1266,7 @@
* If a problem occurs while reading the lines.
*/
private List<String> readLines(final BufferedReader reader) throws IOException {
- final List<String> lines = new ArrayList<String>();
+ final List<String> lines = new ArrayList<>();
while (true) {
final String line = reader.readLine();
if (line == null) {
@@ -1401,8 +1401,8 @@
this.extraLines = extraLines;
// The RDN template lines are based on the DN.
- final List<LocalizableMessage> warnings = new ArrayList<LocalizableMessage>();
- rdnLines = new ArrayList<TemplateLine>();
+ final List<LocalizableMessage> warnings = new ArrayList<>();
+ rdnLines = new ArrayList<>();
for (final AVA ava : branchDN.rdn()) {
final Attribute attribute = ava.toAttribute();
for (final ByteString value : attribute.toArray()) {
@@ -1417,7 +1417,7 @@
final Schema schema, final List<LocalizableMessage> warnings) throws DecodeException {
final StaticTextTag tag = new StaticTextTag();
tag.initializeForBranch(schema, templateFile, this, new String[] { value }, 0, warnings);
- final List<TemplateTag> tags = new ArrayList<TemplateTag>();
+ final List<TemplateTag> tags = new ArrayList<>();
tags.add(tag);
return tags;
}
@@ -1430,7 +1430,7 @@
*/
private void completeBranchInitialization(final Map<String, Template> templates,
boolean generateBranches) throws DecodeException {
- subordinateTemplates = new ArrayList<Template>();
+ subordinateTemplates = new ArrayList<>();
for (int i = 0; i < subordinateTemplateNames.size(); i++) {
subordinateTemplates.add(templates.get(subordinateTemplateNames.get(i).toLowerCase()));
if (subordinateTemplates.get(i) == null) {
@@ -1499,7 +1499,7 @@
*/
private TemplateEntry buildBranchEntry(boolean generateBranches) {
final TemplateEntry entry = new TemplateEntry(this);
- final List<TemplateLine> lines = new ArrayList<TemplateLine>(rdnLines);
+ final List<TemplateLine> lines = new ArrayList<>(rdnLines);
lines.addAll(extraLines);
for (final TemplateLine line : lines) {
line.generateLine(entry);
@@ -1629,7 +1629,7 @@
* the template file.
*/
void completeTemplateInitialization(final Map<String, Template> templates) throws DecodeException {
- subTemplates = new ArrayList<Template>();
+ subTemplates = new ArrayList<>();
for (final String subordinateName : subTemplateNames) {
final Template template = templates.get(subordinateName.toLowerCase());
if (template == null) {
@@ -1642,8 +1642,8 @@
}
private void ensureAllRDNAttributesAreDefined() throws DecodeException {
- Set<AttributeType> rdnAttrs = new HashSet<AttributeType>(rdnAttributes);
- List<AttributeType> templateAttrs = new ArrayList<AttributeType>();
+ Set<AttributeType> rdnAttrs = new HashSet<>(rdnAttributes);
+ List<AttributeType> templateAttrs = new ArrayList<>();
for (TemplateLine line : templateLines) {
templateAttrs.add(line.getAttributeType());
}
@@ -1829,7 +1829,7 @@
* A list of template values is never empty in the map, it always has
* at least one element.
*/
- private final LinkedHashMap<AttributeType, List<TemplateValue>> attributes;
+ private final LinkedHashMap<AttributeType, List<TemplateValue>> attributes = new LinkedHashMap<>();
/**
* The template used to generate this entry if it is associated with a
@@ -1846,7 +1846,6 @@
*/
TemplateEntry(final Branch branch) {
dn = branch.getBranchDN();
- attributes = new LinkedHashMap<AttributeType, List<TemplateValue>>();
template = null;
parentDN = null;
}
@@ -1863,7 +1862,6 @@
TemplateEntry(final Template template, final DN parentDN) {
this.template = template;
this.parentDN = parentDN;
- attributes = new LinkedHashMap<AttributeType, List<TemplateValue>>();
}
DN getParentDN() {
@@ -1878,7 +1876,7 @@
*/
DN getDN() {
if (dn == null) {
- final Collection<AVA> avas = new ArrayList<AVA>();
+ final Collection<AVA> avas = new ArrayList<>();
for (final AttributeType attrType : template.getRDNAttributes()) {
final TemplateValue templateValue = getValue(attrType);
if (templateValue == null) {
@@ -1926,7 +1924,7 @@
void addValue(TemplateValue value) {
List<TemplateValue> values = attributes.get(value.getAttributeType());
if (values == null) {
- values = new ArrayList<TemplateValue>();
+ values = new ArrayList<>();
attributes.put(value.getAttributeType(), values);
}
values.add(value);
diff --git a/opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityRequestControlTestCase.java b/opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityRequestControlTestCase.java
index 260c375..5ca577f 100644
--- a/opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityRequestControlTestCase.java
+++ b/opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityRequestControlTestCase.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package com.forgerock.opendj.ldap.controls;
@@ -49,8 +50,7 @@
public class AccountUsabilityRequestControlTestCase extends ControlsTestCase {
@Test
public void testControl() throws Exception {
- // Send this control with a search request and see that you get
- // a valid response.
+ // Send this control with a search request and see that you get a valid response.
final SearchRequest req =
Requests.newSearchRequest(DN.valueOf("uid=user.1,ou=people,o=test"),
SearchScope.BASE_OBJECT, Filter.objectClassPresent());
@@ -58,7 +58,7 @@
AccountUsabilityRequestControl.newControl(false);
req.addControl(control);
final Connection con = TestCaseUtils.getInternalConnection();
- final List<SearchResultEntry> entries = new ArrayList<SearchResultEntry>();
+ final List<SearchResultEntry> entries = new ArrayList<>();
con.search(req, entries);
assertTrue(entries.size() > 0);
final SearchResultEntry entry = entries.get(0);
diff --git a/opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityResponseControlTestCase.java b/opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityResponseControlTestCase.java
index 61922d1..f8ca5bf 100644
--- a/opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityResponseControlTestCase.java
+++ b/opendj-core/src/test/java/com/forgerock/opendj/ldap/controls/AccountUsabilityResponseControlTestCase.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package com.forgerock.opendj.ldap.controls;
@@ -58,7 +59,7 @@
Requests.newSearchRequest(DN.valueOf("uid=user.1,ou=people,o=test"),
SearchScope.BASE_OBJECT, Filter.objectClassPresent());
final Connection con = TestCaseUtils.getInternalConnection();
- final List<SearchResultEntry> entries = new ArrayList<SearchResultEntry>();
+ final List<SearchResultEntry> entries = new ArrayList<>();
con.search(req, entries);
assertTrue(entries.size() > 0);
final SearchResultEntry entry = entries.get(0);
@@ -69,8 +70,7 @@
@Test
public void testValidResponseControl() throws Exception {
- // Send this control with a search request and see that you get
- // a valid response.
+ // Send this control with a search request and see that you get a valid response.
final SearchRequest req =
Requests.newSearchRequest(DN.valueOf("uid=user.1,ou=people,o=test"),
SearchScope.BASE_OBJECT, Filter.objectClassPresent());
@@ -78,7 +78,7 @@
AccountUsabilityRequestControl.newControl(false);
req.addControl(control);
final Connection con = TestCaseUtils.getInternalConnection();
- final List<SearchResultEntry> entries = new ArrayList<SearchResultEntry>();
+ final List<SearchResultEntry> entries = new ArrayList<>();
con.search(req, entries);
assertTrue(entries.size() > 0);
final SearchResultEntry entry = entries.get(0);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/AbstractAsynchronousConnectionTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/AbstractAsynchronousConnectionTestCase.java
index 8204140..e6949f0 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/AbstractAsynchronousConnectionTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/AbstractAsynchronousConnectionTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS.
+ * Portions Copyright 2011-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -336,7 +336,7 @@
final Connection mockConnection = new MockConnection(ResultCode.SUCCESS, entry);
final SearchRequest searchRequest =
newSearchRequest("cn=test", SearchScope.BASE_OBJECT, "(objectClass=*)");
- List<SearchResultEntry> entries = new LinkedList<SearchResultEntry>();
+ List<SearchResultEntry> entries = new LinkedList<>();
assertThat(mockConnection.search(searchRequest, entries).getResultCode()).isEqualTo(
ResultCode.SUCCESS);
assertThat(entries.size()).isEqualTo(1);
@@ -348,7 +348,7 @@
final Connection mockConnection = new MockConnection(ResultCode.UNWILLING_TO_PERFORM);
final SearchRequest searchRequest =
newSearchRequest("cn=test", SearchScope.BASE_OBJECT, "(objectClass=*)");
- List<SearchResultEntry> entries = new LinkedList<SearchResultEntry>();
+ List<SearchResultEntry> entries = new LinkedList<>();
try {
mockConnection.search(searchRequest, entries);
failWasExpected(LdapException.class);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/AddressMaskTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/AddressMaskTestCase.java
index 0c9d7f5..8108527 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/AddressMaskTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/AddressMaskTestCase.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.forgerock.opendj.ldap;
@@ -178,7 +178,7 @@
private boolean match(String[] rules, String[] addrs, String[] hostNames)
throws UnknownHostException {
int i = 0;
- Collection<AddressMask> m = new ArrayList<AddressMask>(rules.length);
+ Collection<AddressMask> m = new ArrayList<>(rules.length);
for (i = 0; i < rules.length; i++) {
m.add(AddressMask.valueOf(rules[i]));
}
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/ConditionResultTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/ConditionResultTestCase.java
index d18dec9..555a797 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/ConditionResultTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/ConditionResultTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS
+ * Portions Copyright 2014-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap;
@@ -48,7 +48,7 @@
public Iterator<Object[]> allPermutationsUpTo4Operands() {
final ConditionResult[] values = ConditionResult.values();
- final List<Object[]> results = new ArrayList<Object[]>();
+ final List<Object[]> results = new ArrayList<>();
results.add(new Object[] { new ConditionResult[0] });
for (int arrayLength = 1; arrayLength <= 4; arrayLength++) {
final ConditionResult[] template = new ConditionResult[arrayLength];
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/ConnectionPoolTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/ConnectionPoolTestCase.java
index 3bda9fc..2934683 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/ConnectionPoolTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/ConnectionPoolTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS.
+ * Portions Copyright 2011-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -93,7 +93,7 @@
*/
@Test
public void testConnectionEventListenerError() throws Exception {
- final List<ConnectionEventListener> listeners = new LinkedList<ConnectionEventListener>();
+ final List<ConnectionEventListener> listeners = new LinkedList<>();
final Connection mockConnection = mockConnection(listeners);
final ConnectionFactory factory = mockConnectionFactory(mockConnection);
final ConnectionPool pool = newFixedConnectionPool(factory, 1);
@@ -120,7 +120,7 @@
*/
@Test
public void testConnectionEventListenerUnsolicitedNotification() throws Exception {
- final List<ConnectionEventListener> listeners = new LinkedList<ConnectionEventListener>();
+ final List<ConnectionEventListener> listeners = new LinkedList<>();
final Connection mockConnection = mockConnection(listeners);
final ConnectionFactory factory = mockConnectionFactory(mockConnection);
final ConnectionPool pool = newFixedConnectionPool(factory, 1);
@@ -525,8 +525,7 @@
}
}).when(factory).getConnectionAsync();
- List<Promise<? extends Connection, LdapException>> promises =
- new ArrayList<Promise<? extends Connection, LdapException>>();
+ List<Promise<? extends Connection, LdapException>> promises = new ArrayList<>();
for (int i = 0; i < poolSize + 1; i++) {
promises.add(pool.getConnectionAsync());
}
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/EntryTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/EntryTestCase.java
index 5721f28..edcdd17 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/EntryTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/EntryTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2012 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -107,7 +107,7 @@
@Test(dataProvider = "EntryFactory")
public void testAddAttributeAttributeCollection(final EntryFactory factory) throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ final List<ByteString> duplicateValues = new LinkedList<>();
assertThat(entry.addAttribute(new LinkedAttribute("sn", "sn"), duplicateValues)).isTrue();
assertThat(entry.getAttribute(AD_SN)).hasSize(1);
assertThat(duplicateValues).hasSize(0);
@@ -117,7 +117,7 @@
public void testAddAttributeAttributeCollectionValueMissing(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ final List<ByteString> duplicateValues = new LinkedList<>();
assertThat(entry.addAttribute(new LinkedAttribute("cn", "newcn"), duplicateValues))
.isTrue();
assertThat(entry.getAttribute(AD_CN)).hasSize(2);
@@ -128,7 +128,7 @@
public void testAddAttributeAttributeCollectionValuePresent(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> duplicateValues = new LinkedList<ByteString>();
+ final List<ByteString> duplicateValues = new LinkedList<>();
assertThat(entry.addAttribute(new LinkedAttribute("cn", "test"), duplicateValues))
.isFalse();
assertThat(entry.getAttribute(AD_CN)).hasSize(1);
@@ -208,7 +208,7 @@
public void testContainsAttributeAttributeCustomMissing(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(emptyAttribute(AD_CUSTOM2), missingValues)).isFalse();
assertThat(missingValues).isEmpty();
}
@@ -217,7 +217,7 @@
public void testContainsAttributeAttributeCustomPresent1(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(emptyAttribute(AD_CUSTOM1), missingValues)).isTrue();
assertThat(missingValues).isEmpty();
}
@@ -226,7 +226,7 @@
public void testContainsAttributeAttributeCustomPresent2(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(emptyAttribute("custom1"), missingValues)).isTrue();
assertThat(missingValues).isEmpty();
}
@@ -235,7 +235,7 @@
public void testContainsAttributeAttributeCustomValueMissing1(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(
entry.containsAttribute(singletonAttribute(AD_CUSTOM2, "missing"), missingValues))
.isFalse();
@@ -245,7 +245,7 @@
@Test(dataProvider = "EntryFactory")
public void testContainsAttributeAttributeMissing(final EntryFactory factory) throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(emptyAttribute(AD_SN), missingValues)).isFalse();
assertThat(missingValues).isEmpty();
}
@@ -253,7 +253,7 @@
@Test(dataProvider = "EntryFactory")
public void testContainsAttributeAttributePresent1(final EntryFactory factory) throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(emptyAttribute(AD_CN), missingValues)).isTrue();
assertThat(missingValues).isEmpty();
}
@@ -261,7 +261,7 @@
@Test(dataProvider = "EntryFactory")
public void testContainsAttributeAttributePresent2(final EntryFactory factory) throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(emptyAttribute("cn"), missingValues)).isTrue();
assertThat(missingValues).isEmpty();
}
@@ -270,7 +270,7 @@
public void testContainsAttributeAttributeValueCustomMissing2(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(
entry.containsAttribute(singletonAttribute(AD_CUSTOM1, "missing"), missingValues))
.isFalse();
@@ -281,7 +281,7 @@
public void testContainsAttributeAttributeValueCustomPresent(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(
entry.containsAttribute(singletonAttribute(AD_CUSTOM1, "custom1"), missingValues))
.isTrue();
@@ -292,7 +292,7 @@
public void testContainsAttributeAttributeValueMissing1(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(singletonAttribute(AD_SN, "missing"), missingValues))
.isFalse();
assertThat(missingValues).hasSize(1);
@@ -302,7 +302,7 @@
public void testContainsAttributeAttributeValueMissing2(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(singletonAttribute(AD_CN, "missing"), missingValues))
.isFalse();
assertThat(missingValues).hasSize(1);
@@ -312,7 +312,7 @@
public void testContainsAttributeAttributeValuePresent(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.containsAttribute(singletonAttribute(AD_CN, "test"), missingValues))
.isTrue();
assertThat(missingValues).isEmpty();
@@ -619,7 +619,7 @@
@Test(dataProvider = "EntryFactory")
public void testRemoveAttributeAttributeMissing(final EntryFactory factory) throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.removeAttribute(emptyAttribute(AD_SN), missingValues)).isFalse();
assertThat(missingValues).isEmpty();
}
@@ -627,7 +627,7 @@
@Test(dataProvider = "EntryFactory")
public void testRemoveAttributeAttributePresent(final EntryFactory factory) throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.removeAttribute(emptyAttribute(AD_CN), missingValues)).isTrue();
assertThat(entry.getAttribute(AD_CN)).isNull();
assertThat(missingValues).isEmpty();
@@ -637,7 +637,7 @@
public void testRemoveAttributeAttributeValueMissing1(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.removeAttribute(singletonAttribute(AD_CN, "missing"), missingValues))
.isFalse();
assertThat(entry.getAttribute(AD_CN)).isNotNull();
@@ -648,7 +648,7 @@
public void testRemoveAttributeAttributeValueMissing2(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.removeAttribute(singletonAttribute(AD_SN, "missing"), missingValues))
.isFalse();
assertThat(missingValues).hasSize(1);
@@ -658,7 +658,7 @@
public void testRemoveAttributeAttributeValuePresent(final EntryFactory factory)
throws Exception {
final Entry entry = createTestEntry(factory);
- final List<ByteString> missingValues = new LinkedList<ByteString>();
+ final List<ByteString> missingValues = new LinkedList<>();
assertThat(entry.removeAttribute(singletonAttribute(AD_CN, "test"), missingValues))
.isTrue();
assertThat(entry.getAttribute(AD_CN)).isNull();
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/FilterTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/FilterTestCase.java
index b364f19..8d87f48 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/FilterTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/FilterTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions copyright 2011-2012 ForgeRock AS
+ * Portions copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap;
@@ -68,8 +68,8 @@
Filter.lessOrEqual("dob", ByteString.valueOf("\\test*(Value)"));
final Filter presense = Filter.present("login");
- final ArrayList<ByteString> any = new ArrayList<ByteString>(0);
- final ArrayList<ByteString> multiAny = new ArrayList<ByteString>(1);
+ final ArrayList<ByteString> any = new ArrayList<>(0);
+ final ArrayList<ByteString> multiAny = new ArrayList<>(1);
multiAny.add(ByteString.valueOf("\\wid*(get)"));
multiAny.add(ByteString.valueOf("*"));
@@ -104,13 +104,13 @@
Filter.extensible("2.4.6.8.19", null, ByteString
.valueOf("\\John* (Doe)"), false);
- final ArrayList<Filter> list1 = new ArrayList<Filter>();
+ final ArrayList<Filter> list1 = new ArrayList<>();
list1.add(equal);
list1.add(approx);
final Filter and = Filter.and(list1);
- final ArrayList<Filter> list2 = new ArrayList<Filter>();
+ final ArrayList<Filter> list2 = new ArrayList<>();
list2.add(substring1);
list2.add(extensible1);
list2.add(and);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactoryTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactoryTestCase.java
index e650e16..beb7396 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactoryTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/HeartBeatConnectionFactoryTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013-2014 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -391,7 +391,7 @@
}
private void mockConnectionWithInitialHeartbeatResult(final ResultCode initialHeartBeatResult) {
- listeners = new LinkedList<ConnectionEventListener>();
+ listeners = new LinkedList<>();
connection = mockConnection(listeners);
when(connection.isValid()).thenReturn(true);
mockHeartBeatResponse(connection, listeners, initialHeartBeatResult);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/LDAPServer.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/LDAPServer.java
index a52dfdb..5f15d68 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/LDAPServer.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/LDAPServer.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap;
@@ -229,7 +229,7 @@
if (saslServer == null
|| !saslServer.getMechanismName().equalsIgnoreCase(saslMech)) {
- final Map<String, String> props = new HashMap<String, String>();
+ final Map<String, String> props = new HashMap<>();
props.put(Sasl.QOP, "auth-conf,auth-int,auth");
saslServer =
Sasl.createSaslServer(saslMech, "ldap",
@@ -488,7 +488,7 @@
}
/** The mapping between entry DNs and the corresponding entries. */
- private final ConcurrentHashMap<DN, Entry> entryMap = new ConcurrentHashMap<DN, Entry>();
+ private final ConcurrentHashMap<DN, Entry> entryMap = new ConcurrentHashMap<>();
/** The LDAP listener. */
private LDAPListener listener;
/** Whether the server is running. */
@@ -498,8 +498,7 @@
* The mapping between the message id and the requests the server is
* currently handling.
*/
- private final ConcurrentHashMap<Integer, AbandonableRequest> requestsInProgress =
- new ConcurrentHashMap<Integer, AbandonableRequest>();
+ private final ConcurrentHashMap<Integer, AbandonableRequest> requestsInProgress = new ConcurrentHashMap<>();
private SSLContext sslContext;
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/MemoryBackendTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/MemoryBackendTestCase.java
index 8e813ab..31eadf3 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/MemoryBackendTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/MemoryBackendTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013-2014 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -450,7 +450,7 @@
@Test
public void testSearchSubtreeReturnsAllEntries() throws Exception {
final Connection connection = getConnection();
- Collection<SearchResultEntry> entries = new ArrayList<SearchResultEntry>();
+ Collection<SearchResultEntry> entries = new ArrayList<>();
connection.search(Requests.newSearchRequest("dc=com", SearchScope.WHOLE_SUBTREE, "(objectclass=*)"), entries);
assertThat(entries).hasSize(numberOfEntriesInBackend);
}
@@ -458,7 +458,7 @@
@Test
public void testSearchSubordinatesReturnsAllEntries() throws Exception {
final Connection connection = getConnection();
- Collection<SearchResultEntry> entries = new ArrayList<SearchResultEntry>();
+ Collection<SearchResultEntry> entries = new ArrayList<>();
connection.search(Requests.newSearchRequest("dc=com", SearchScope.SUBORDINATES, "(objectclass=*)"), entries);
assertThat(entries).hasSize(numberOfEntriesInBackend - 1);
}
@@ -467,7 +467,7 @@
public void testSearchSubordinatesEntries() throws Exception {
int numberOfUsers = 5;
final Connection connection = getConnection();
- Collection<SearchResultEntry> entries = new ArrayList<SearchResultEntry>();
+ Collection<SearchResultEntry> entries = new ArrayList<>();
connection.search(Requests.newSearchRequest("ou=People,dc=example,dc=com", SearchScope.SUBORDINATES,
"(objectclass=*)"), entries);
assertThat(entries).hasSize(numberOfUsers);
@@ -476,7 +476,7 @@
@Test
public void testSearchSubtreeWithSizeLimit() throws Exception {
final Connection connection = getConnection();
- Collection<SearchResultEntry> entries = new ArrayList<SearchResultEntry>();
+ Collection<SearchResultEntry> entries = new ArrayList<>();
try {
connection.search(
Requests.newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=*)").
@@ -498,7 +498,7 @@
@Test
public void testSearchPagedResults() throws Exception {
final Connection connection = getConnection();
- final List<SearchResultEntry> entries = new ArrayList<SearchResultEntry>();
+ final List<SearchResultEntry> entries = new ArrayList<>();
final SearchRequest search =
Requests.newSearchRequest("ou=people,dc=example,dc=com", SearchScope.WHOLE_SUBTREE,
"(uid=*)");
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/MockScheduler.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/MockScheduler.java
index 7f7cbea..5176413 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/MockScheduler.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/MockScheduler.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap;
@@ -114,7 +114,7 @@
}
/** Saved scheduled tasks. */
- private final List<Callable<?>> tasks = new CopyOnWriteArrayList<Callable<?>>();
+ private final List<Callable<?>> tasks = new CopyOnWriteArrayList<>();
MockScheduler() {
// Nothing to do.
@@ -249,13 +249,13 @@
}
private <T> ScheduledCallableFuture<T> onceOnly(final Callable<T> callable) {
- final ScheduledCallableFuture<T> wrapped = new ScheduledCallableFuture<T>(callable, true);
+ final ScheduledCallableFuture<T> wrapped = new ScheduledCallableFuture<>(callable, true);
tasks.add(wrapped);
return wrapped;
}
private <T> ScheduledCallableFuture<T> repeated(final Callable<T> callable) {
- final ScheduledCallableFuture<T> wrapped = new ScheduledCallableFuture<T>(callable, false);
+ final ScheduledCallableFuture<T> wrapped = new ScheduledCallableFuture<>(callable, false);
tasks.add(wrapped);
return wrapped;
}
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSchemaElementTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSchemaElementTestCase.java
index 10e4dfe..302d9af 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSchemaElementTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSchemaElementTestCase.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.schema;
@@ -100,7 +101,7 @@
*/
@Test
public final void testGetExtraProperty() throws Exception {
- final List<String> values = new ArrayList<String>();
+ final List<String> values = new ArrayList<>();
values.add("one");
values.add("two");
final Map<String, List<String>> props = Collections.singletonMap("test", values);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImplTest.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImplTest.java
index 0d42bab..47c6ca1 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImplTest.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImplTest.java
@@ -20,7 +20,7 @@
*
* CDDL HEADER END
*
- * Copyright 2014 ForgeRock AS
+ * Copyright 2014-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -268,7 +268,7 @@
Assertions.assertThat(indexer.getIndexID()).isEqualTo("substring");
final IndexingOptions options = newIndexingOptions();
- final TreeSet<ByteString> keys = new TreeSet<ByteString>();
+ final TreeSet<ByteString> keys = new TreeSet<>();
indexer.createKeys(Schema.getCoreSchema(), valueOf("ABCDE"), options, keys);
Assertions.assertThat(keys).containsOnly((Object[]) toByteStrings("ABC", "BCD", "CDE", "DE", "E"));
}
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java
index afb471a..f54cb49 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -1075,7 +1075,7 @@
private void assertConformsToSchema(final Entry entry, final Schema schema,
final SchemaValidationPolicy policy) {
- final List<LocalizableMessage> errorMessages = new LinkedList<LocalizableMessage>();
+ final List<LocalizableMessage> errorMessages = new LinkedList<>();
assertThat(schema.validateEntry(entry, policy, errorMessages)).as(errorMessages.toString())
.isTrue();
}
@@ -1086,7 +1086,7 @@
private void assertDoesNotConformToSchema(final Entry entry, final Schema schema,
final SchemaValidationPolicy policy) {
- final List<LocalizableMessage> errorMessages = new LinkedList<LocalizableMessage>();
+ final List<LocalizableMessage> errorMessages = new LinkedList<>();
assertThat(schema.validateEntry(entry, policy, errorMessages)).as(errorMessages.toString())
.isFalse();
}
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/MatchingRuleTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/MatchingRuleTestCase.java
index 1f52275..5b9292d 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/MatchingRuleTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/MatchingRuleTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.schema;
@@ -713,8 +713,8 @@
*/
@Test
public final void testCreatesMatchingRulesUsingChainingMethods() {
- final Map<String, List<String>> extraProperties = new TreeMap<String, List<String>>();
- final List<String> extra = new ArrayList<String>();
+ final Map<String, List<String>> extraProperties = new TreeMap<>();
+ final List<String> extra = new ArrayList<>();
extra.add("Custom");
extraProperties.put("X-ORIGIN", extra);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/NameFormTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/NameFormTestCase.java
index 0bb07cf..98e0301 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/NameFormTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/NameFormTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.schema;
@@ -781,8 +781,8 @@
*/
@Test
public final void testCreatesANewFormUsingChainingMethods() {
- final Map<String, List<String>> extraProperties = new TreeMap<String, List<String>>();
- final List<String> extra = new ArrayList<String>();
+ final Map<String, List<String>> extraProperties = new TreeMap<>();
+ final List<String> extra = new ArrayList<>();
extra.add("EntrySchemaCheckingTestCase");
extraProperties.put("X-ORIGIN", extra);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SubstringMatchingRuleTest.java b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SubstringMatchingRuleTest.java
index cdec418..ff2c969 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SubstringMatchingRuleTest.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SubstringMatchingRuleTest.java
@@ -22,6 +22,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions Copyright 2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldap.schema;
@@ -139,7 +140,7 @@
// Get the instance of the rule to be tested.
final MatchingRule rule = getRule();
- final List<ByteSequence> anyList = new ArrayList<ByteSequence>(anys.length);
+ final List<ByteSequence> anyList = new ArrayList<>(anys.length);
for (final String middleSub : anys) {
anyList.add(ByteString.valueOf(middleSub));
}
@@ -184,7 +185,7 @@
final ByteString normalizedValue = rule.normalizeAttributeValue(ByteString.valueOf(value));
final StringBuilder printableMiddleSubs = new StringBuilder();
- final List<ByteSequence> middleList = new ArrayList<ByteSequence>(middleSubs.length);
+ final List<ByteSequence> middleList = new ArrayList<>(middleSubs.length);
printableMiddleSubs.append("*");
for (final String middleSub : middleSubs) {
printableMiddleSubs.append(middleSub);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldif/EntryGeneratorTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldif/EntryGeneratorTestCase.java
index f1e3c02..504cade 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldif/EntryGeneratorTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldif/EntryGeneratorTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldif;
@@ -384,7 +384,7 @@
// Previous behaviour showed "missingVar" on line 5.
TemplateFile templateFile = new TemplateFile(schema, null, resourcePath);
- List<LocalizableMessage> warns = new ArrayList<LocalizableMessage>();
+ List<LocalizableMessage> warns = new ArrayList<>();
try {
templateFile.parse(lines, warns);
@@ -428,7 +428,7 @@
@Test(dataProvider = "validTemplates")
public void testParsingEscapeCharInTemplate(String testName, String[] lines) throws Exception {
TemplateFile templateFile = new TemplateFile(schema, null, resourcePath);
- List<LocalizableMessage> warns = new ArrayList<LocalizableMessage>();
+ List<LocalizableMessage> warns = new ArrayList<>();
templateFile.parse(lines, warns);
assertThat(warns).isEmpty();
}
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFChangeRecordWriterTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFChangeRecordWriterTestCase.java
index e7eb016..360fd4e 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFChangeRecordWriterTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFChangeRecordWriterTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2011 ForgeRock AS
+ * Copyright 2011-2015 ForgeRock AS
* Portions copyright 2012 ForgeRock AS.
*/
@@ -98,7 +98,7 @@
*/
@Test
public void testSetExcludeAllOperationalAttributesTrue() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -124,7 +124,7 @@
*/
@Test
public void testSetExcludeAllOperationalAttributesFalse() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -145,7 +145,7 @@
*/
@Test
public void testSetExcludeAllUserAttributesTrue() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -167,7 +167,7 @@
*/
@Test
public void testSetExcludeAllUserAttributesFalse() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -189,8 +189,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetExcludeAttributeDoesntAllowNull() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
try {
@@ -208,7 +207,7 @@
*/
@Test
public void testSetExcludeBranchWrongDN() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final DN dn = DN.valueOf("dc=example.com");
@@ -232,7 +231,7 @@
*/
@Test
public void testSetExcludeBranchWithNoMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final DN dn = DN.valueOf("dc=example,dc=com");
@@ -254,7 +253,7 @@
*/
@Test
public void testSetExcludeBranchWithMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final DN dn = DN.valueOf("dc=example,dc=org");
@@ -278,8 +277,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetExcludeBranchDoesntAllowNull() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
try {
@@ -298,7 +296,7 @@
@Test
public void testSetExcludeAttributeWithMatch() throws Exception {
final AttributeDescription attribute = AttributeDescription.valueOf("cn");
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -325,7 +323,7 @@
@Test
public void testSetExcludeAttributeWithNoMatch() throws Exception {
final AttributeDescription attribute = AttributeDescription.valueOf("vip");
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -350,7 +348,7 @@
*/
@Test
public void testSetIncludeAttributeWithMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -376,7 +374,7 @@
*/
@Test
public void testSetIncludeAttributeWithNoMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -399,7 +397,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetIncludeAttributeDoesntAllowNull() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
try {
writer.setIncludeAttribute(null);
@@ -417,7 +415,7 @@
* If the test failed unexpectedly.
*/ @Test
public void testSetIncludeBranchWithNoMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final DN dn = DN.valueOf("dc=example,dc=org");
@@ -440,7 +438,7 @@
*/
@Test
public void testSetIncludeBranchWithMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final DN dn = DN.valueOf("dc=example,dc=com");
@@ -464,7 +462,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetIncludeBranchDoesntAllowNull() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
try {
writer.setIncludeBranch(null);
@@ -481,7 +479,7 @@
*/
@Test(enabled = false)
public void testSetAddUserFriendlyComments() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final CharSequence comment = "A simple comment";
@@ -502,7 +500,7 @@
public void testWriteCommentUsingTheWrapFunction() throws Exception {
final CharSequence comment = "Lorem ipsum dolor sit amet, consectetur adipisicing elit";
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
int wrapColumn = 15;
@@ -529,7 +527,7 @@
public void testWriteCommentUsingTheWrapFunctionShortComment() throws Exception {
final CharSequence comment = "Lorem ipsum dolor";
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
int wrapColumn = 30;
@@ -555,7 +553,7 @@
public void testWriteCommentUsingTheWrapFunctionNoEmptySpace() throws Exception {
final CharSequence comment = "Lorem ipsumdolorsitamet,consecteturadipisicingelit";
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
int wrapColumn = 15;
@@ -578,7 +576,7 @@
*/
@Test
public void testWriteChangeRecord() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -606,7 +604,7 @@
*/
@Test
public void testWriteAddRequest() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final AddRequest changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -624,7 +622,7 @@
*/
@Test
public void testWriteAddRequestNoBranchExcluded() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final DN dnAdd = DN.valueOf("uid=scarter,ou=People,dc=example,dc=com");
@@ -652,7 +650,7 @@
*/
@Test
public void testWriteAddRequestBranchExcluded() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final DN dnAdd = DN.valueOf("uid=scarter,ou=People,dc=example,dc=com");
@@ -677,7 +675,7 @@
*/
@Test
public void testWriteAddRequestJpegAttributeOk() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final File file = File.createTempFile("sdk", ".jpeg");
final String url = file.toURI().toURL().toString();
@@ -711,7 +709,7 @@
*/
@Test
public void testWriteAddBinaryRequest() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -740,7 +738,7 @@
*/
@Test
public void testWriteAddBinaryNonAsciiRequest() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -769,7 +767,7 @@
*/
@Test
public void testWriteDeleteRequestBranchExcluded() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
final DeleteRequest changeRequest = (DeleteRequest) Requests.newChangeRecord(
@@ -793,7 +791,7 @@
*/
@Test
public void testWriteDeleteRequestBranchNotExcluded() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
final DeleteRequest changeRequest = (DeleteRequest) Requests.newChangeRecord(
@@ -821,7 +819,7 @@
*/
@Test
public void testWriteDeleteRequest() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -847,7 +845,7 @@
*/
@Test
public void testWriteDeleteRequestContainingControl() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final DN dn = DN.valueOf("uid=scarter,ou=People,dc=example,dc=com");
@@ -882,8 +880,7 @@
*/
@Test(expectedExceptions = LocalizedIllegalArgumentException.class)
public void testWriteDeleteRequestIllegalArguments() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -911,7 +908,7 @@
*/
@Test
public void testWriteModdnRequest() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -937,7 +934,7 @@
*/
@Test
public void testWriteModdnRequestNewSuperior() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
final ModifyDNRequest changeRequest = (ModifyDNRequest) Requests.newChangeRecord(
@@ -965,7 +962,7 @@
*/
@Test
public void testWriteModdnRequestDeleterdnFalse() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
final ModifyDNRequest changeRequest = (ModifyDNRequest) Requests.newChangeRecord(
@@ -992,7 +989,7 @@
*/
@Test
public void testWriteModifyRequest() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1023,7 +1020,7 @@
*/
@Test
public void testWriteModifyRequestUsingControl() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1052,7 +1049,7 @@
*/
@Test
public void testWriteModifyRequestNoModifications() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1077,7 +1074,7 @@
*/
@Test
public void testWriteModifyRequestFilterAttributesExcluded() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1108,7 +1105,7 @@
*/
@Test
public void testWriteModifyRequestBranchExcludedNoMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1140,7 +1137,7 @@
*/
@Test
public void testWriteModifyRequestBranchExcludedMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1169,7 +1166,7 @@
*/
@Test
public void testWriteModifyDNRequestBranchExcludedNoMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1198,7 +1195,7 @@
*/
@Test
public void testWriteModifyDNRequestBranchExcludedMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1226,7 +1223,7 @@
*/
@Test
public void testWriteModifyDNRequest() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
// @formatter:off
@@ -1252,7 +1249,7 @@
*/
@Test
public void testWriteMultipleChangeRecords() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
final ChangeRecord changeRequest = Requests.newAddRequest(getAddLDIFChangeRecord());
@@ -1338,7 +1335,7 @@
"home-phone: 415/697-8899"
);
// @formatter:on
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
writer.writeChangeRecord(changeRequest);
writer.close();
@@ -1354,7 +1351,7 @@
*/
@Test
public void testWriteComment() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
writer.writeComment("TLDIFChangeRecordWriter, this is a comment.");
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFEntryWriterTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFEntryWriterTestCase.java
index 0b7f135..63d9e27 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFEntryWriterTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFEntryWriterTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2012 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldif;
@@ -80,8 +80,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetExcludeAttributeDoesntAllowNull() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setExcludeAttribute(null);
@@ -97,7 +96,7 @@
@Test
public void testSetExcludeAttributeWithMatch() throws Exception {
final AttributeDescription attribute = AttributeDescription.valueOf("cn");
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setExcludeAttribute(attribute);
@@ -122,7 +121,7 @@
@Test
public void testSetExcludeAttributeWithNoMatch() throws Exception {
final AttributeDescription attribute = AttributeDescription.valueOf("vip");
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setExcludeAttribute(attribute);
@@ -147,8 +146,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetExcludeBranchDoesntAllowNull() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setExcludeBranch(null);
@@ -163,8 +161,7 @@
*/
@Test
public void testSetExcludeBranchWrongDN() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
DN dn = DN.valueOf("dc=example.com");
@@ -186,8 +183,7 @@
*/
@Test
public void testSetExcludeBranchWithNoMatch() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
DN dn = DN.valueOf("dc=example,dc=com");
@@ -208,8 +204,7 @@
*/
@Test
public void testSetExcludeBranchWithMatch() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
DN dn = DN.valueOf("dc=example,dc=org");
@@ -231,8 +226,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testsetExcludeFilterDoesntAllowNull() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setExcludeFilter(null);
@@ -248,8 +242,7 @@
*/
@Test
public void testSetExcludeFilterWithMatch() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
final Filter filter = Filter.equality("objectclass", "vip");
final Matcher excludeFilter = filter.matcher();
@@ -272,8 +265,7 @@
*/
@Test
public void testSetExcludeFilterWithNoMatch() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
final Filter filter = Filter.equality("objectclass", "person");
final Matcher excludeFilter = filter.matcher();
@@ -295,7 +287,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetIncludeAttributeDoesntAllowNull() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setIncludeAttribute(null);
writer.close();
@@ -310,7 +302,7 @@
*/
@Test
public void testSetIncludeAttributeWithMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setIncludeAttribute(AttributeDescription.valueOf("cn"));
writer.setIncludeAttribute(AttributeDescription.valueOf("sn"));
@@ -332,7 +324,7 @@
*/
@Test
public void testSetIncludeAttributeWithNoMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setIncludeAttribute(AttributeDescription.valueOf("manager"));
writer.writeEntry(getStandardEntry());
@@ -355,8 +347,7 @@
*/
@Test
public void testSetIncludeAttributeWithRepeatedAttributes() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setIncludeAttribute(AttributeDescription.valueOf("cn"));
writer.setIncludeAttribute(AttributeDescription.valueOf("sn"));
@@ -381,8 +372,7 @@
*/
@Test
public void testSetExcludeAllOperationalAttributesFalse() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
int opAttributes = 0;
@@ -412,8 +402,7 @@
*/
@Test
public void testSetExcludeAllOperationalAttributesTrue() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setExcludeAllOperationalAttributes(true);
@@ -438,8 +427,7 @@
*/
@Test
public void testSetExcludeAllUserAttributesFalse() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setExcludeAllUserAttributes(false);
@@ -460,8 +448,7 @@
*/
@Test
public void testSetExcludeAllUserAttributesTrue() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setExcludeAllUserAttributes(true);
@@ -486,7 +473,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetIncludeBranchDoesntAllowNull() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setIncludeBranch(null);
writer.close();
@@ -501,7 +488,7 @@
*/
@Test
public void testSetIncludeBranchWithMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
DN dn = DN.valueOf("dc=example,dc=com");
@@ -525,7 +512,7 @@
*/
@Test
public void testSetIncludeBranchWithNoMatch() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
DN dn = DN.valueOf("dc=opendj,dc=org");
@@ -548,8 +535,7 @@
*/
@Test
public void testSetIncludeFilterWithNoMatch() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
final Filter filter = Filter.equality("objectclass", "vip");
final Matcher includeFilter = filter.matcher();
@@ -571,8 +557,7 @@
*/
@Test
public void testSetIncludeFilterWithMatch() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
final Filter filter = Filter.equality("objectclass", "person");
final Matcher includeFilter = filter.matcher();
@@ -595,7 +580,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public void testSetIncludeFilterDoesntAllowNull() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.setIncludeFilter(null);
writer.writeEntry(getStandardEntry());
@@ -612,7 +597,7 @@
public void testWriteCommentUsingTheWrapFunction() throws Exception {
final CharSequence comment = "Lorem ipsum dolor sit amet, consectetur adipisicing elit";
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
int wrapColumn = 15;
@@ -639,7 +624,7 @@
public void testWriteCommentUsingTheWrapFunctionShortComment() throws Exception {
final CharSequence comment = "Lorem ipsum dolor";
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
int wrapColumn = 30;
@@ -665,7 +650,7 @@
public void testWriteCommentUsingTheWrapFunctionNoEmptySpace() throws Exception {
final CharSequence comment = "Lorem ipsumdolorsitamet,consecteturadipisicingelit";
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
int wrapColumn = 15;
@@ -692,7 +677,7 @@
final CharSequence comment1 = "This is a new comment";
final CharSequence comment2 = "Another one";
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.writeComment(comment1);
writer.writeComment(comment2);
@@ -712,7 +697,7 @@
*/
@Test(enabled = false)
public void testSetAddUserFriendlyComments() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
final CharSequence comment = "A simple comment";
@@ -732,7 +717,7 @@
*/
@Test
public void testWriteEntryUsingStandardEntry() throws Exception {
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
final int wrapColumn = 15;
writer.setWrapColumn(wrapColumn);
@@ -771,7 +756,7 @@
entry.addAttribute("typeOnly");
entry.addAttribute("localized;lang-fr", "\u00e7edilla");
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
writer.writeEntry(entry);
writer.close();
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFTestCase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFTestCase.java
index 79a5ed6..0472f2c 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFTestCase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2012 ForgeRock AS.
+ * Portions copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldif;
@@ -659,7 +659,7 @@
Entry e2 = new LinkedHashMapEntry("dn: uid=user.2,ou=People,dc=example,dc=com", "objectClass: person");
// @formatter:on
- Collection<Entry> collection = new ArrayList<Entry>();
+ Collection<Entry> collection = new ArrayList<>();
collection.add(e);
collection.add(e1);
collection.add(e2);
@@ -714,7 +714,7 @@
);
// @formatter:on
- final SortedMap<DN, Entry> sourceEntries = new TreeMap<DN, Entry>();
+ final SortedMap<DN, Entry> sourceEntries = new TreeMap<>();
sourceEntries.put(DN.valueOf("uid=user.0,ou=People,dc=example,dc=com"), e);
sourceEntries.put(DN.valueOf("uid=user.1,ou=People,dc=example,dc=com"), e1);
final Iterator<Entry> sourceIterator = sourceEntries.values().iterator();
@@ -764,7 +764,7 @@
"changetype: delete"
);
// @formatter:on
- final java.util.List<String> actual = new ArrayList<String>();
+ final java.util.List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
try {
@@ -816,8 +816,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public final void testLdifCopyToChangeRecordDoesntAllowNullReader() throws Exception {
-
- final java.util.List<String> actual = new ArrayList<String>();
+ final java.util.List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
LDIF.copyTo(null, writer);
@@ -839,7 +838,7 @@
);
// @formatter:on
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
try {
@@ -880,8 +879,7 @@
*/
@Test(expectedExceptions = NullPointerException.class)
public final void testLdifCopyToEntryWriterDoesntAllowNullReader() throws Exception {
-
- final List<String> actual = new ArrayList<String>();
+ final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
LDIF.copyTo(null, writer);
diff --git a/opendj-core/src/test/java/org/forgerock/opendj/ldif/TemplateTagTestcase.java b/opendj-core/src/test/java/org/forgerock/opendj/ldif/TemplateTagTestcase.java
index 777d297..e47e2a4 100644
--- a/opendj-core/src/test/java/org/forgerock/opendj/ldif/TemplateTagTestcase.java
+++ b/opendj-core/src/test/java/org/forgerock/opendj/ldif/TemplateTagTestcase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.ldif;
@@ -255,7 +255,7 @@
/** Helper method to build a template entry containing the provided values. */
private TemplateEntry templateEntry(String... values) {
TemplateEntry templateEntry = mock(TemplateEntry.class);
- List<TemplateValue> templateValues = new ArrayList<TemplateValue>();
+ List<TemplateValue> templateValues = new ArrayList<>();
for (String value : values) {
templateValues.add(templateValue(value));
}
diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java
index e332639..38f7b67 100644
--- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java
+++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.grizzly;
@@ -113,8 +113,7 @@
private final org.glassfish.grizzly.Connection<?> connection;
private final AtomicInteger nextMsgID = new AtomicInteger(1);
private final GrizzlyLDAPConnectionFactory factory;
- private final ConcurrentHashMap<Integer, ResultLdapPromiseImpl<?, ?>> pendingRequests =
- new ConcurrentHashMap<Integer, ResultLdapPromiseImpl<?, ?>>();
+ private final ConcurrentHashMap<Integer, ResultLdapPromiseImpl<?, ?>> pendingRequests = new ConcurrentHashMap<>();
private final Object stateLock = new Object();
/** Guarded by stateLock. */
private Result connectionInvalidReason;
@@ -240,7 +239,7 @@
notifyErrorOccurred = isFailed;
if (!isClosed) {
if (listeners == null) {
- listeners = new CopyOnWriteArrayList<ConnectionEventListener>();
+ listeners = new CopyOnWriteArrayList<>();
}
listeners.add(listener);
}
diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java
index 13c9b7f..35755a5 100644
--- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java
+++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2012-2014 ForgeRock AS.
+ * Portions Copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.grizzly;
@@ -756,7 +756,7 @@
final ClientContextImpl clientContext = LDAP_CONNECTION_ATTR.get(connection);
if (clientContext != null) {
final ServerConnection<Integer> conn = clientContext.getServerConnection();
- final ExtendedHandler<R> handler = new ExtendedHandler<R>(clientContext, messageID);
+ final ExtendedHandler<R> handler = new ExtendedHandler<>(clientContext, messageID);
conn.handleExtendedRequest(messageID, request, handler, handler);
}
}
diff --git a/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java b/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java
index bc68d0c..730f82a 100644
--- a/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java
+++ b/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
*/
package org.forgerock.opendj.grizzly;
@@ -520,8 +520,7 @@
@Test(dataProvider = "closeNotifyConfig")
public void testCloseNotify(final CloseNotify config) throws Exception {
final CountDownLatch connectLatch = new CountDownLatch(1);
- final AtomicReference<LDAPClientContext> contextHolder =
- new AtomicReference<LDAPClientContext>();
+ final AtomicReference<LDAPClientContext> contextHolder = new AtomicReference<>();
final ServerConnectionFactory<LDAPClientContext, Integer> mockServer =
mock(ServerConnectionFactory.class);
@@ -622,8 +621,7 @@
@Test
public void testUnsolicitedNotifications() throws Exception {
final CountDownLatch connectLatch = new CountDownLatch(1);
- final AtomicReference<LDAPClientContext> contextHolder =
- new AtomicReference<LDAPClientContext>();
+ final AtomicReference<LDAPClientContext> contextHolder = new AtomicReference<>();
final ServerConnectionFactory<LDAPClientContext, Integer> mockServer =
mock(ServerConnectionFactory.class);
diff --git a/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java b/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java
index 8886b23..70ede6b 100644
--- a/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java
+++ b/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2013-2014 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.grizzly;
@@ -103,8 +103,7 @@
private final Semaphore closeLatch = new Semaphore(0);
private final Semaphore connectLatch = new Semaphore(0);
private final Semaphore searchLatch = new Semaphore(0);
- private final AtomicReference<LDAPClientContext> context =
- new AtomicReference<LDAPClientContext>();
+ private final AtomicReference<LDAPClientContext> context = new AtomicReference<>();
private final LDAPListener server = createServer();
private final InetSocketAddress socketAddress = server.getSocketAddress();
private final ConnectionFactory factory = new LDAPConnectionFactory(socketAddress.getHostName(),
diff --git a/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/Proxy.java b/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/Proxy.java
index f2be0b8..c7da549 100644
--- a/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/Proxy.java
+++ b/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/Proxy.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.forgerock.opendj.examples;
@@ -87,8 +87,8 @@
// Create load balancer.
// --- JCite pools ---
- final List<ConnectionFactory> factories = new LinkedList<ConnectionFactory>();
- final List<ConnectionFactory> bindFactories = new LinkedList<ConnectionFactory>();
+ final List<ConnectionFactory> factories = new LinkedList<>();
+ final List<ConnectionFactory> bindFactories = new LinkedList<>();
for (int i = 4; i < args.length; i += 2) {
final String remoteAddress = args[i];
final int remotePort = Integer.parseInt(args[i + 1]);
diff --git a/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/ProxyBackend.java b/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/ProxyBackend.java
index 7095db6..6896013 100644
--- a/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/ProxyBackend.java
+++ b/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/ProxyBackend.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.forgerock.opendj.examples;
@@ -104,7 +104,7 @@
@Override
public void handleAdd(final RequestContext requestContext, final AddRequest request,
final IntermediateResponseHandler intermediateResponseHandler, final ResultHandler<Result> resultHandler) {
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
addProxiedAuthControl(request);
factory.getConnectionAsync().thenAsync(new AsyncFunction<Connection, Result, LdapException>() {
@@ -128,7 +128,7 @@
} else {
// Authenticate using a separate bind connection pool, because
// we don't want to change the state of the pooled connection.
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
proxiedAuthControl = null;
bindFactory.getConnectionAsync()
.thenAsync(new AsyncFunction<Connection, BindResult, LdapException>() {
@@ -155,7 +155,7 @@
final ResultHandler<CompareResult> resultHandler) {
addProxiedAuthControl(request);
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
factory.getConnectionAsync().thenAsync(new AsyncFunction<Connection, CompareResult, LdapException>() {
@Override
public Promise<CompareResult, LdapException> apply(Connection connection) throws LdapException {
@@ -171,7 +171,7 @@
final IntermediateResponseHandler intermediateResponseHandler, final ResultHandler<Result> resultHandler) {
addProxiedAuthControl(request);
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
factory.getConnectionAsync().thenAsync(new AsyncFunction<Connection, Result, LdapException>() {
@Override
public Promise<Result, LdapException> apply(Connection connection) throws LdapException {
@@ -198,7 +198,7 @@
// Forward all other extended operations.
addProxiedAuthControl(request);
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
factory.getConnectionAsync().thenAsync(new AsyncFunction<Connection, R, LdapException>() {
@Override
public Promise<R, LdapException> apply(Connection connection) throws LdapException {
@@ -216,7 +216,7 @@
final IntermediateResponseHandler intermediateResponseHandler, final ResultHandler<Result> resultHandler) {
addProxiedAuthControl(request);
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
factory.getConnectionAsync().thenAsync(new AsyncFunction<Connection, Result, LdapException>() {
@Override
public Promise<Result, LdapException> apply(Connection connection) throws LdapException {
@@ -232,7 +232,7 @@
final IntermediateResponseHandler intermediateResponseHandler, final ResultHandler<Result> resultHandler) {
addProxiedAuthControl(request);
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
factory.getConnectionAsync().thenAsync(new AsyncFunction<Connection, Result, LdapException>() {
@Override
public Promise<Result, LdapException> apply(Connection connection) throws LdapException {
@@ -249,7 +249,7 @@
final ResultHandler<Result> resultHandler) {
addProxiedAuthControl(request);
- final AtomicReference<Connection> connectionHolder = new AtomicReference<Connection>();
+ final AtomicReference<Connection> connectionHolder = new AtomicReference<>();
factory.getConnectionAsync().thenAsync(new AsyncFunction<Connection, Result, LdapException>() {
@Override
public Promise<Result, LdapException> apply(Connection connection) throws LdapException {
diff --git a/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java b/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java
index 5f78d81..bf7cfa9 100644
--- a/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java
+++ b/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.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.forgerock.opendj.examples;
@@ -342,8 +342,8 @@
private SearchResultEntry rewrite(final SearchResultEntry entry) {
// Replace server attributes with client attributes.
- final Set<Attribute> attrsToAdd = new HashSet<Attribute>();
- final Set<AttributeDescription> attrsToRemove = new HashSet<AttributeDescription>();
+ final Set<Attribute> attrsToAdd = new HashSet<>();
+ final Set<AttributeDescription> attrsToRemove = new HashSet<>();
for (final Attribute a : entry.getAllAttributes(serverAttributeDescription)) {
final AttributeDescription ad = a.getAttributeDescription();
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AddRate.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AddRate.java
index 8fc5555..80afe86 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AddRate.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AddRate.java
@@ -272,7 +272,7 @@
}
}
- private final ConcurrentSkipListMap<Long, String> dnEntriesAdded = new ConcurrentSkipListMap<Long, String>();
+ private final ConcurrentSkipListMap<Long, String> dnEntriesAdded = new ConcurrentSkipListMap<>();
private final ThreadLocal<Random> randomSeq = new ThreadLocal<Random>() {
@Override
protected Random initialValue() {
@@ -463,7 +463,7 @@
/* addrate specifics arguments */
deleteMode =
- new MultiChoiceArgument<DeleteStrategy>("deletemode", 'C', "deleteMode", false, true,
+ new MultiChoiceArgument<>("deletemode", 'C', "deleteMode", false, true,
INFO_DELETEMODE_PLACEHOLDER.get(), Arrays.asList(DeleteStrategy.values()), false,
INFO_ADDRATE_DESCRIPTION_DELETEMODE.get());
deleteMode.setDefaultValue(DeleteStrategy.FIFO.toString());
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java
index 134a50a..fe6907f 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java
@@ -439,7 +439,7 @@
argParser.addArgument(searchScope);
dereferencePolicy =
- new MultiChoiceArgument<DereferenceAliasesPolicy>("derefpolicy", 'a',
+ new MultiChoiceArgument<>("derefpolicy", 'a',
"dereferencePolicy", false, true, INFO_DEREFERENCE_POLICE_PLACEHOLDER
.get(), DereferenceAliasesPolicy.values(), false,
INFO_SEARCH_DESCRIPTION_DEREFERENCE_POLICY.get());
@@ -494,7 +494,7 @@
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
- final List<String> attributes = new LinkedList<String>();
+ final List<String> attributes = new LinkedList<>();
final ArrayList<String> filterAndAttributeStrings = argParser.getTrailingArguments();
if (filterAndAttributeStrings.size() > 0) {
/*The list of trailing arguments should be structured as follow:
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/DataSource.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/DataSource.java
index 6930153..46f2455 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/DataSource.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/DataSource.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
- * Portions copyright 2014 ForgeRock AS
+ * Portions copyright 2014-2015 ForgeRock AS
*/
package com.forgerock.opendj.ldap.tools;
@@ -58,7 +58,7 @@
private int next;
public IncrementLineFileDataSource(final String file) throws IOException {
- lines = new ArrayList<String>();
+ lines = new ArrayList<>();
final BufferedReader in = new BufferedReader(new FileReader(file));
try {
String line;
@@ -125,7 +125,7 @@
private final Random random;
public RandomLineFileDataSource(final long seed, final String file) throws IOException {
- lines = new ArrayList<String>();
+ lines = new ArrayList<>();
random = new Random(seed);
final BufferedReader in = new BufferedReader(new FileReader(file));
try {
@@ -183,7 +183,7 @@
private RandomStringDataSource(final int seed, final int length, final String charSet) {
this.length = length;
- final Set<Character> chars = new HashSet<Character>();
+ final Set<Character> chars = new HashSet<>();
for (int i = 0; i < charSet.length(); i++) {
final char c = charSet.charAt(i);
if (c == '[') {
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPCompare.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPCompare.java
index b4237fd..69cb2e6 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPCompare.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPCompare.java
@@ -242,7 +242,7 @@
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
- final ArrayList<String> dnStrings = new ArrayList<String>();
+ final ArrayList<String> dnStrings = new ArrayList<>();
final ArrayList<String> attrAndDNStrings = argParser.getTrailingArguments();
if (attrAndDNStrings.isEmpty()) {
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java
index 52bd8c1..22920b7 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java
@@ -391,7 +391,7 @@
// modifyOptions.setEncoding(encodingStr.getValue());
// modifyOptions.setDefaultAdd(defaultAdd.isPresent());
- controls = new LinkedList<Control>();
+ controls = new LinkedList<>();
if (controlStr.isPresent()) {
for (final String ctrlString : controlStr.getValues()) {
try {
@@ -433,7 +433,7 @@
if (preReadAttributes.isPresent()) {
final String valueStr = preReadAttributes.getValue();
final StringTokenizer tokenizer = new StringTokenizer(valueStr, ", ");
- final List<String> attributes = new LinkedList<String>();
+ final List<String> attributes = new LinkedList<>();
while (tokenizer.hasMoreTokens()) {
attributes.add(tokenizer.nextToken());
}
@@ -445,7 +445,7 @@
if (postReadAttributes.isPresent()) {
final String valueStr = postReadAttributes.getValue();
final StringTokenizer tokenizer = new StringTokenizer(valueStr, ", ");
- final List<String> attributes = new LinkedList<String>();
+ final List<String> attributes = new LinkedList<>();
while (tokenizer.hasMoreTokens()) {
attributes.add(tokenizer.nextToken());
}
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
index 79c16b4..5c92c6d 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
@@ -376,7 +376,7 @@
argParser.addArgument(encodingStr);
dereferencePolicy =
- new MultiChoiceArgument<DereferenceAliasesPolicy>("derefpolicy", 'a',
+ new MultiChoiceArgument<>("derefpolicy", 'a',
"dereferencePolicy", false, true, INFO_DEREFERENCE_POLICE_PLACEHOLDER
.get(), DereferenceAliasesPolicy.values(), false,
INFO_SEARCH_DESCRIPTION_DEREFERENCE_POLICY.get());
@@ -451,8 +451,8 @@
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
- final List<Filter> filters = new LinkedList<Filter>();
- final List<String> attributes = new LinkedList<String>();
+ final List<Filter> filters = new LinkedList<>();
+ final List<String> attributes = new LinkedList<>();
final ArrayList<String> filterAndAttributeStrings = argParser.getTrailingArguments();
if (filterAndAttributeStrings.size() > 0) {
/* The list of trailing arguments should be structured as follow:
@@ -617,8 +617,7 @@
}
}
- final ArrayList<PersistentSearchChangeType> ct =
- new ArrayList<PersistentSearchChangeType>(4);
+ final ArrayList<PersistentSearchChangeType> ct = new ArrayList<>(4);
if (tokenizer.hasMoreTokens()) {
final StringTokenizer st = new StringTokenizer(tokenizer.nextToken(), ", ");
if (!st.hasMoreTokens()) {
@@ -707,7 +706,7 @@
if (matchedValuesFilter.isPresent()) {
final LinkedList<String> mvFilterStrings = matchedValuesFilter.getValues();
- final List<Filter> mvFilters = new ArrayList<Filter>();
+ final List<Filter> mvFilters = new ArrayList<>();
for (final String s : mvFilterStrings) {
try {
final Filter f = Filter.valueOf(s);
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java
index 3749cd8..087e8d2 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java
@@ -173,8 +173,8 @@
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
- final List<Filter> filters = new LinkedList<Filter>();
- final List<String> attributes = new LinkedList<String>();
+ final List<Filter> filters = new LinkedList<>();
+ final List<String> attributes = new LinkedList<>();
final List<String> trailingArguments = argParser.getTrailingArguments();
if (trailingArguments.size() > 1) {
final List<String> filterAndAttributeStrings =
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ModRate.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ModRate.java
index 3545d8d..1910710 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ModRate.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ModRate.java
@@ -72,7 +72,7 @@
data = DataSource.generateData(dataSources, data);
}
mr = newModifyRequest(data);
- ResultHandler<Result> modRes = new UpdateStatsResultHandler<Result>(startTime);
+ ResultHandler<Result> modRes = new UpdateStatsResultHandler<>(startTime);
incrementIterationCount();
return connection.modifyAsync(mr).onSuccess(modRes).onFailure(modRes);
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java
index 17b60b3..cd094c3 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java
@@ -108,7 +108,7 @@
* Keys (Long in microseconds) of this map must respect this pattern: n * 500 000 + 5 000 000,
* where n is a natural integer.
*/
- private final ConcurrentSkipListMap<Long, AtomicLong> bigEtimes = new ConcurrentSkipListMap<Long, AtomicLong>();
+ private final ConcurrentSkipListMap<Long, AtomicLong> bigEtimes = new ConcurrentSkipListMap<>();
/**
* Initialize both index2Frequency and index2Etime arrays.
@@ -159,8 +159,8 @@
* percentiles.
*/
List<Long> getPercentile(double[] percentiles, long nbData) {
- List<Long> responseTimes = new ArrayList<Long>();
- Queue<Long> nbDataThresholds = new LinkedList<Long>();
+ List<Long> responseTimes = new ArrayList<>();
+ Queue<Long> nbDataThresholds = new LinkedList<>();
long nbDataSum = nbData;
for (int i = percentiles.length - 1; i >= 0; i--) {
@@ -669,7 +669,7 @@
protected final IntegerArgument maxIterationsArgument;
protected final IntegerArgument warmUpArgument;
- private final List<Thread> workerThreads = new ArrayList<Thread>();
+ private final List<Thread> workerThreads = new ArrayList<>();
PerformanceRunner(final PerformanceRunnerOptions options) throws ArgumentException {
ArgumentParser argParser = options.getArgumentParser();
@@ -850,7 +850,7 @@
}
final int run(final ConnectionFactory connectionFactory) {
- final List<Connection> connections = new ArrayList<Connection>();
+ final List<Connection> connections = new ArrayList<>();
Connection connection = null;
try {
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java
index b902936..af7dce3 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java
@@ -255,7 +255,7 @@
argParser.addArgument(searchScope);
dereferencePolicy =
- new MultiChoiceArgument<DereferenceAliasesPolicy>("derefpolicy", 'a',
+ new MultiChoiceArgument<>("derefpolicy", 'a',
"dereferencePolicy", false, true, INFO_DEREFERENCE_POLICE_PLACEHOLDER
.get(), DereferenceAliasesPolicy.values(), false,
INFO_SEARCH_DESCRIPTION_DEREFERENCE_POLICY.get());
@@ -295,7 +295,7 @@
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
- final List<String> attributes = new LinkedList<String>();
+ final List<String> attributes = new LinkedList<>();
final ArrayList<String> filterAndAttributeStrings = argParser.getTrailingArguments();
if (filterAndAttributeStrings.size() > 0) {
/* The list of trailing arguments should be structured as follow:
diff --git a/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/ConcatSchemaMojo.java b/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/ConcatSchemaMojo.java
index 9baa75c..6a29399 100644
--- a/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/ConcatSchemaMojo.java
+++ b/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/ConcatSchemaMojo.java
@@ -96,22 +96,21 @@
new File(outputFilePath).getParentFile().mkdirs();
// Get a sorted list of the files in the schema directory.
- TreeSet<String> schemaFileNames = new TreeSet<String>();
+ TreeSet<String> schemaFileNames = new TreeSet<>();
for (File f : new File(schemaDirectory).listFiles()) {
if (f.isFile()) {
schemaFileNames.add(f.getName());
}
}
- // Create a set of lists that will hold the schema elements read from the
- // files.
- LinkedList<String> attributeTypes = new LinkedList<String>();
- LinkedList<String> objectClasses = new LinkedList<String>();
- LinkedList<String> nameForms = new LinkedList<String>();
- LinkedList<String> ditContentRules = new LinkedList<String>();
- LinkedList<String> ditStructureRules = new LinkedList<String>();
- LinkedList<String> matchingRuleUses = new LinkedList<String>();
- LinkedList<String> ldapSyntaxes = new LinkedList<String>();
+ // Create a set of lists that will hold the schema elements read from the files.
+ LinkedList<String> attributeTypes = new LinkedList<>();
+ LinkedList<String> objectClasses = new LinkedList<>();
+ LinkedList<String> nameForms = new LinkedList<>();
+ LinkedList<String> ditContentRules = new LinkedList<>();
+ LinkedList<String> ditStructureRules = new LinkedList<>();
+ LinkedList<String> matchingRuleUses = new LinkedList<>();
+ LinkedList<String> ldapSyntaxes = new LinkedList<>();
int curLineNumber = 0;
// Open each of the files in order and read the elements that they contain,
@@ -119,7 +118,7 @@
for (String name : schemaFileNames) {
// Read the contents of the file into a list with one schema element per
// list element.
- LinkedList<StringBuilder> lines = new LinkedList<StringBuilder>();
+ LinkedList<StringBuilder> lines = new LinkedList<>();
try {
BufferedReader reader = new BufferedReader(new FileReader(new File(schemaDirectory, name)));
String line = reader.readLine();
diff --git a/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateConfigMojo.java b/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateConfigMojo.java
index 3196e97..88b4a4d 100644
--- a/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateConfigMojo.java
+++ b/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateConfigMojo.java
@@ -135,8 +135,7 @@
@Parameter(required = true, defaultValue = "true")
private Boolean isExtension;
- private final Map<String, StreamSourceFactory> componentDescriptors =
- new LinkedHashMap<String, StreamSourceFactory>();
+ private final Map<String, StreamSourceFactory> componentDescriptors = new LinkedHashMap<>();
private TransformerFactory stylesheetFactory;
private Templates stylesheetMetaJava;
private Templates stylesheetServerJava;
@@ -148,7 +147,7 @@
private Templates stylesheetProfileCLI;
private Templates stylesheetMessages;
private Templates stylesheetManifest;
- private final Queue<Future<?>> tasks = new LinkedList<Future<?>>();
+ private final Queue<Future<?>> tasks = new LinkedList<>();
private final URIResolver resolver = new URIResolver() {
@@ -297,7 +296,7 @@
}
// Generate package-info.java files.
- final Map<String, Templates> profileMap = new LinkedHashMap<String, Templates>();
+ final Map<String, Templates> profileMap = new LinkedHashMap<>();
profileMap.put("meta", stylesheetMetaPackageInfo);
profileMap.put("server", stylesheetServerPackageInfo);
profileMap.put("client", stylesheetClientPackageInfo);
diff --git a/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateManifestClassPathMojo.java b/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateManifestClassPathMojo.java
index a2a18f2..af2e859 100644
--- a/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateManifestClassPathMojo.java
+++ b/opendj-maven-plugin/src/main/java/org/forgerock/opendj/maven/GenerateManifestClassPathMojo.java
@@ -140,7 +140,7 @@
}
private List<String> getClasspathItems() throws DependencyResolutionRequiredException {
- final List<String> classpathItems = new ArrayList<String>();
+ final List<String> classpathItems = new ArrayList<>();
// add project dependencies
for (String artifactFile : project.getRuntimeClasspathElements()) {
diff --git a/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java b/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java
index 01655a7..6f21f66 100644
--- a/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java
+++ b/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java
@@ -136,7 +136,7 @@
* servlet if needed. However, make sure that it is closed on
* completion.
*/
- final AtomicReference<Connection> savedConnection = new AtomicReference<Connection>();
+ final AtomicReference<Connection> savedConnection = new AtomicReference<>();
final ServletSynchronizer sync = syncFactory.createServletSynchronizer(req, res);
sync.addAsyncListener(new Runnable() {
@@ -186,7 +186,7 @@
switch (authenticationMethod) {
case SIMPLE: {
final Map<String, Object> authzid;
- authzid = new LinkedHashMap<String, Object>(2);
+ authzid = new LinkedHashMap<>(2);
authzid.put(AUTHZID_DN, username);
authzid.put(AUTHZID_ID, username);
doBind(req, res, newSimpleBindRequest(username, password), chain, savedConnection, sync, username,
@@ -199,7 +199,7 @@
if (saslAuthzIdTemplate.startsWith("dn:")) {
final String bindDN = DN.format(saslAuthzIdTemplate.substring(3), schema, username).toString();
bindId = "dn:" + bindDN;
- authzid = new LinkedHashMap<String, Object>(2);
+ authzid = new LinkedHashMap<>(2);
authzid.put(AUTHZID_DN, bindDN);
authzid.put(AUTHZID_ID, username);
} else {
@@ -233,7 +233,7 @@
public void handleResult(final SearchResultEntry result) {
savedConnection.get().close();
final String bindDN = result.getName().toString();
- final Map<String, Object> authzid = new LinkedHashMap<String, Object>(2);
+ final Map<String, Object> authzid = new LinkedHashMap<>(2);
authzid.put(AUTHZID_DN, bindDN);
authzid.put(AUTHZID_ID, username);
doBind(req, res, newSimpleBindRequest(bindDN, password), chain, savedConnection, sync,
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AbstractLDAPAttributeMapper.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AbstractLDAPAttributeMapper.java
index 43006d5..5d3d8e8 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AbstractLDAPAttributeMapper.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AbstractLDAPAttributeMapper.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
- * Copyright 2013-2014 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -44,6 +44,7 @@
import org.forgerock.opendj.ldap.ModificationType;
import org.forgerock.util.promise.Function;
import org.forgerock.util.promise.NeverThrowsException;
+
/**
* An abstract LDAP attribute mapper which provides a simple mapping from a JSON
* value to a single LDAP attribute.
@@ -407,7 +408,7 @@
* delete(x) followed by add(x) is idempotent when
* adding/removing the same value.
*/
- modifications = new ArrayList<Modification>(2);
+ modifications = new ArrayList<>(2);
final Attribute deletedValues = new LinkedAttribute(oldLDAPAttribute);
deletedValues.removeAll(newLDAPAttribute);
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
index 436545e..0ee94a6 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
@@ -11,9 +11,8 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
-
package org.forgerock.opendj.rest2ldap;
import static org.forgerock.opendj.rest2ldap.Utils.i18n;
@@ -87,7 +86,7 @@
private final String dnFormatString;
private final String formatString;
- private final List<String> keys = new ArrayList<String>();
+ private final List<String> keys = new ArrayList<>();
private final Impl pimpl;
private final String template;
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Context.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Context.java
index 8b3d94a..1fddfc4 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Context.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Context.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
- * Copyright 2013-2014 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -77,8 +77,7 @@
private final CountDownLatch cachedPromiseLatch = new CountDownLatch(1);
private final SearchRequest cachedRequest;
private volatile Result cachedResult;
- private final ConcurrentLinkedQueue<SearchResultHandler> waitingResultHandlers =
- new ConcurrentLinkedQueue<SearchResultHandler>();
+ private final ConcurrentLinkedQueue<SearchResultHandler> waitingResultHandlers = new ConcurrentLinkedQueue<>();
CachedRead(final SearchRequest request, final SearchResultHandler resultHandler) {
this.cachedRequest = request;
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/LDAPCollectionResourceProvider.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/LDAPCollectionResourceProvider.java
index 32d91f2..c738021 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/LDAPCollectionResourceProvider.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/LDAPCollectionResourceProvider.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
- * Copyright 2012-2014 ForgeRock AS.
+ * Copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -264,11 +264,9 @@
public void handleResult(final DN dn) {
// Convert the patch operations to LDAP modifications.
List<Promise<List<Modification>, ResourceException>> promises =
- new ArrayList<Promise<List<Modification>, ResourceException>>(
- request.getPatchOperations().size());
+ new ArrayList<>(request.getPatchOperations().size());
for (final PatchOperation operation : request.getPatchOperations()) {
- final ResultHandlerFromPromise<List<Modification>> handler =
- new ResultHandlerFromPromise<List<Modification>>();
+ final ResultHandlerFromPromise<List<Modification>> handler = new ResultHandlerFromPromise<>();
attributeMapper.patch(c, new JsonPointer(), operation, handler);
promises.add(handler.promise);
}
@@ -735,12 +733,12 @@
final Set<String> requestedLDAPAttributes;
if (requestedAttributes.isEmpty()) {
// Full read.
- requestedLDAPAttributes = new LinkedHashSet<String>();
+ requestedLDAPAttributes = new LinkedHashSet<>();
attributeMapper.getLDAPAttributes(c, new JsonPointer(), new JsonPointer(),
requestedLDAPAttributes);
} else {
// Partial read.
- requestedLDAPAttributes = new LinkedHashSet<String>(requestedAttributes.size());
+ requestedLDAPAttributes = new LinkedHashSet<>(requestedAttributes.size());
for (final JsonPointer requestedAttribute : requestedAttributes) {
attributeMapper.getLDAPAttributes(c, new JsonPointer(), requestedAttribute,
requestedLDAPAttributes);
@@ -760,10 +758,9 @@
new QueryFilterVisitor<Void, ResultHandler<Filter>>() {
@Override
public Void visitAndFilter(final ResultHandler<Filter> p, final List<QueryFilter> subFilters) {
- List<Promise<Filter, ResourceException>> promises =
- new ArrayList<Promise<Filter, ResourceException>>(subFilters.size());
+ List<Promise<Filter, ResourceException>> promises = new ArrayList<>(subFilters.size());
for (final QueryFilter subFilter : subFilters) {
- final ResultHandlerFromPromise<Filter> handler = new ResultHandlerFromPromise<Filter>();
+ final ResultHandlerFromPromise<Filter> handler = new ResultHandlerFromPromise<>();
subFilter.accept(this, handler);
promises.add(handler.promise);
}
@@ -891,10 +888,9 @@
@Override
public Void visitOrFilter(final ResultHandler<Filter> p, final List<QueryFilter> subFilters) {
- List<Promise<Filter, ResourceException>> promises =
- new ArrayList<Promise<Filter, ResourceException>>(subFilters.size());
+ List<Promise<Filter, ResourceException>> promises = new ArrayList<>(subFilters.size());
for (final QueryFilter subFilter : subFilters) {
- final ResultHandlerFromPromise<Filter> handler = new ResultHandlerFromPromise<Filter>();
+ final ResultHandlerFromPromise<Filter> handler = new ResultHandlerFromPromise<>();
subFilter.accept(this, handler);
promises.add(handler.promise);
}
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ObjectAttributeMapper.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ObjectAttributeMapper.java
index 8a53292..b33026f 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ObjectAttributeMapper.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ObjectAttributeMapper.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
- * Copyright 2012-2014 ForgeRock AS.
+ * Copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -61,7 +61,7 @@
}
}
- private final Map<String, Mapping> mappings = new LinkedHashMap<String, Mapping>();
+ private final Map<String, Mapping> mappings = new LinkedHashMap<>();
ObjectAttributeMapper() {
// Nothing to do.
@@ -226,12 +226,8 @@
*/
return null;
} else {
- /*
- * Combine the sub-attributes into a single
- * JSON object.
- */
- final Map<String, Object> result =
- new LinkedHashMap<String, Object>(value.size());
+ // Combine the sub-attributes into a single JSON object.
+ final Map<String, Object> result = new LinkedHashMap<>(value.size());
for (final Map.Entry<String, JsonValue> e : value) {
result.put(e.getKey(), e.getValue().getObject());
}
@@ -297,7 +293,7 @@
case 1:
return value.get(0);
default:
- final List<T> attributes = new ArrayList<T>(value.size());
+ final List<T> attributes = new ArrayList<>(value.size());
for (final List<T> a : value) {
attributes.addAll(a);
}
@@ -313,7 +309,7 @@
*/
private Map<String, Mapping> checkMapping(final JsonPointer path, final JsonValue v)
throws ResourceException {
- final Map<String, Mapping> missingMappings = new LinkedHashMap<String, Mapping>(mappings);
+ final Map<String, Mapping> missingMappings = new LinkedHashMap<>(mappings);
if (v != null && !v.isNull()) {
if (v.isMap()) {
for (final String attribute : v.asMap().keySet()) {
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ReferenceAttributeMapper.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ReferenceAttributeMapper.java
index b4b743d..22cdb49 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ReferenceAttributeMapper.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ReferenceAttributeMapper.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
- * Copyright 2012-2014 ForgeRock AS.
+ * Copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -139,7 +139,7 @@
public void handleResult(final Filter result) {
// Search for all referenced entries and construct a filter.
final SearchRequest request = createSearchRequest(result);
- final List<Filter> subFilters = new LinkedList<Filter>();
+ final List<Filter> subFilters = new LinkedList<>();
final FailureHandler<LdapException> failureHandler = new FailureHandler<LdapException>() {
@Override
@@ -186,12 +186,11 @@
final ResultHandler<Attribute> h) {
/*
* For each value use the subordinate mapper to obtain the LDAP primary
- * key, the perform a search for each one to find the corresponding
- * entries.
+ * key, the perform a search for each one to find the corresponding entries.
*/
final Attribute newLDAPAttribute = new LinkedAttribute(ldapAttributeName);
final AtomicInteger pendingSearches = new AtomicInteger(newValues.size());
- final AtomicReference<ResourceException> exception = new AtomicReference<ResourceException>();
+ final AtomicReference<ResourceException> exception = new AtomicReference<>();
for (final Object value : newValues) {
mapper.create(c, path, new JsonValue(value), new ResultHandler<List<Attribute>>() {
@@ -310,7 +309,7 @@
return null;
} else {
// Combine values into a single JSON array.
- final List<Object> result = new ArrayList<Object>(value.size());
+ final List<Object> result = new ArrayList<>(value.size());
for (final JsonValue e : value) {
result.add(e.getObject());
}
@@ -335,7 +334,7 @@
private void readEntry(final Context c, final JsonPointer path, final DN dn,
final ResultHandler<JsonValue> handler) {
- final Set<String> requestedLDAPAttributes = new LinkedHashSet<String>();
+ final Set<String> requestedLDAPAttributes = new LinkedHashSet<>();
mapper.getLDAPAttributes(c, path, new JsonPointer(), requestedLDAPAttributes);
c.getConnection().readEntryAsync(dn, requestedLDAPAttributes)
.onSuccess(new SuccessHandler<SearchResultEntry>() {
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
index a0a3d26..c7cd8bb 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
@@ -11,9 +11,8 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
- * Copyright 2013-2014 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
-
package org.forgerock.opendj.rest2ldap;
import static org.forgerock.opendj.ldap.requests.Requests.newSearchRequest;
@@ -96,7 +95,7 @@
* A builder for incrementally constructing LDAP resource collections.
*/
public static final class Builder {
- private final List<Attribute> additionalLDAPAttributes = new LinkedList<Attribute>();
+ private final List<Attribute> additionalLDAPAttributes = new LinkedList<>();
private AuthorizationPolicy authzPolicy = AuthorizationPolicy.NONE;
private DN baseDN; // TODO: support template variables.
private AttributeDescription etagAttribute;
@@ -1083,8 +1082,7 @@
final JsonValue parent =
normalizeConnectionFactory(configuration,
current.get("inheritFrom").asString(), depth + 1);
- final Map<String, Object> normalized =
- new LinkedHashMap<String, Object>(parent.asMap());
+ final Map<String, Object> normalized = new LinkedHashMap<>(parent.asMap());
normalized.putAll(current.asMap());
normalized.remove("inheritFrom");
return new JsonValue(normalized);
@@ -1098,7 +1096,7 @@
final BindRequest bindRequest, final int connectionPoolSize,
final int heartBeatIntervalSeconds, final int heartBeatTimeoutMilliSeconds,
final LDAPOptions options) {
- final List<ConnectionFactory> servers = new ArrayList<ConnectionFactory>(config.size());
+ final List<ConnectionFactory> servers = new ArrayList<>(config.size());
for (final JsonValue server : config) {
final String host = server.get("hostname").required().asString();
final int port = server.get("port").required().asInteger();
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Utils.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Utils.java
index df07809..85a19b4 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Utils.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Utils.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
- * Copyright 2012-2014 ForgeRock AS.
+ * Copyright 2012-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -69,7 +69,7 @@
throw new IllegalStateException();
}
this.latch = new AtomicInteger(size);
- this.results = new ArrayList<V>(size);
+ this.results = new ArrayList<>(size);
this.handler = handler;
if (size == 0) {
// Invoke immediately.
@@ -148,7 +148,7 @@
* {@code size} asynchronous operations.
*/
static <V> ResultHandler<V> accumulate(final int size, final ResultHandler<List<V>> handler) {
- return new AccumulatingResultHandler<V>(size, handler);
+ return new AccumulatingResultHandler<>(size, handler);
}
static Object attributeToJson(final Attribute a) {
@@ -349,9 +349,8 @@
private static <T> List<T> asList(final Collection<T> c) {
if (c instanceof List) {
return (List<T>) c;
- } else {
- return new ArrayList<T>(c);
}
+ return new ArrayList<>(c);
}
/** Prevent instantiation. */
diff --git a/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplateTest.java b/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplateTest.java
index b2e8897..24a9d8b 100644
--- a/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplateTest.java
+++ b/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplateTest.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
- * Copyright 2013 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -124,7 +124,7 @@
}
private Map<String, Object> map(String... keyValues) {
- Map<String, Object> map = new LinkedHashMap<String, Object>();
+ Map<String, Object> map = new LinkedHashMap<>();
for (int i = 0; i < keyValues.length; i += 2) {
map.put(keyValues[i], keyValues[i + 1]);
}
diff --git a/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java b/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java
index bf631bf..f1df11c 100644
--- a/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java
+++ b/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
- * Copyright 2013-2014 ForgeRock AS.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -94,7 +94,7 @@
@Test
public void testQueryAll() throws Exception {
final Connection connection = newConnection();
- final List<Resource> resources = new LinkedList<Resource>();
+ final List<Resource> resources = new LinkedList<>();
final QueryResult result =
connection.query(ctx(), Requests.newQueryRequest("").setQueryFilter(
QueryFilter.alwaysTrue()), resources);
@@ -106,7 +106,7 @@
@Test
public void testQueryNone() throws Exception {
final Connection connection = newConnection();
- final List<Resource> resources = new LinkedList<Resource>();
+ final List<Resource> resources = new LinkedList<>();
final QueryResult result =
connection.query(ctx(), Requests.newQueryRequest("").setQueryFilter(
QueryFilter.alwaysFalse()), resources);
@@ -118,7 +118,7 @@
@Test
public void testQueryPageResultsCookie() throws Exception {
final Connection connection = newConnection();
- final List<Resource> resources = new ArrayList<Resource>();
+ final List<Resource> resources = new ArrayList<>();
// Read first page.
QueryResult result =
@@ -158,7 +158,7 @@
@Test
public void testQueryPageResultsIndexed() throws Exception {
final Connection connection = newConnection();
- final List<Resource> resources = new ArrayList<Resource>();
+ final List<Resource> resources = new ArrayList<>();
QueryResult result =
connection.query(ctx(), newQueryRequest("")
.setQueryFilter(QueryFilter.alwaysTrue()).setPageSize(2)
@@ -221,7 +221,7 @@
@Test
public void testPatchEmpty() throws Exception {
- final List<Request> requests = new LinkedList<Request>();
+ final List<Request> requests = new LinkedList<>();
final Connection connection = newConnection(requests);
final Resource resource1 = connection.patch(ctx(), newPatchRequest("/test1"));
checkResourcesAreEqual(resource1, getTestUser1(12345));
@@ -492,7 +492,7 @@
@Test
public void testUpdateNoChange() throws Exception {
- final List<Request> requests = new LinkedList<Request>();
+ final List<Request> requests = new LinkedList<>();
final Connection connection = newConnection(requests);
final Resource resource1 =
connection.update(ctx(), newUpdateRequest("/test1", getTestUser1(12345)));
diff --git a/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/TestUtils.java b/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/TestUtils.java
index c25c738..cef00f4 100644
--- a/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/TestUtils.java
+++ b/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/TestUtils.java
@@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
- * Copyright 2013 ForgeRock Inc.
+ * Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.rest2ldap;
@@ -84,7 +84,7 @@
* @return The list of parsed JSON pointers.
*/
public static List<JsonPointer> filter(final String... fields) {
- final List<JsonPointer> result = new ArrayList<JsonPointer>(fields.length);
+ final List<JsonPointer> result = new ArrayList<>(fields.length);
for (final String field : fields) {
result.add(new JsonPointer(field));
}
diff --git a/opendj-server/src/main/java/org/forgerock/opendj/server/core/AbstractDataProvider.java b/opendj-server/src/main/java/org/forgerock/opendj/server/core/AbstractDataProvider.java
index 41457a1..683c882 100644
--- a/opendj-server/src/main/java/org/forgerock/opendj/server/core/AbstractDataProvider.java
+++ b/opendj-server/src/main/java/org/forgerock/opendj/server/core/AbstractDataProvider.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
- * Portions Copyright 2013-2014 ForgeRock AS.
+ * Portions Copyright 2013-2015 ForgeRock AS.
*/
package org.forgerock.opendj.server.core;
@@ -44,12 +44,9 @@
private static final Logger debugLogger = LoggerFactory.getLogger(AbstractDataProvider.class);
/** The list of event listeners associated with this data provider. */
- private final List<DataProviderEventListener> eventListeners =
- new CopyOnWriteArrayList<DataProviderEventListener>();
+ private final List<DataProviderEventListener> eventListeners = new CopyOnWriteArrayList<>();
- /**
- * Creates a new abstract data provider.
- */
+ /** Creates a new abstract data provider. */
protected AbstractDataProvider() {
// No implementation required.
}
diff --git a/opendj-server/src/main/java/org/forgerock/opendj/server/setup/cli/SetupCli.java b/opendj-server/src/main/java/org/forgerock/opendj/server/setup/cli/SetupCli.java
index 7fc7b0e..f5f398f 100644
--- a/opendj-server/src/main/java/org/forgerock/opendj/server/setup/cli/SetupCli.java
+++ b/opendj-server/src/main/java/org/forgerock/opendj/server/setup/cli/SetupCli.java
@@ -20,7 +20,7 @@
*
* CDDL HEADER END
*
- * Copyright 2014 ForgeRock AS.
+ * Copyright 2014-2015 ForgeRock AS.
*/
package org.forgerock.opendj.server.setup.cli;
@@ -185,7 +185,7 @@
// Verifying provided informations.
try {
- final LinkedHashSet<LocalizableMessage> errorMessages = new LinkedHashSet<LocalizableMessage>();
+ final LinkedHashSet<LocalizableMessage> errorMessages = new LinkedHashSet<>();
checkServerPassword(errorMessages);
checkProvidedPorts(errorMessages);
checkImportDataArguments(errorMessages);
@@ -260,7 +260,7 @@
showUsage = addGlobal(CommonArguments.getShowUsage());
//Sub-commands && their arguments
- final ArrayList<SubCommand> subCommandList = new ArrayList<SubCommand>(2);
+ final ArrayList<SubCommand> subCommandList = new ArrayList<>(2);
createDirectoryServer = new SubCommand(argParser, "create-directory-server",
INFO_SETUP_SUBCOMMAND_CREATE_DIRECTORY_SERVER.get());
// TODO to complete.
@@ -343,11 +343,9 @@
* execution of the checking.
*/
private void checkProvidedPorts(final Collection<LocalizableMessage> errorMessages) {
- /*
- * Check that the provided ports do not match.
- */
+ // Check that the provided ports do not match.
try {
- final Set<Integer> ports = new HashSet<Integer>();
+ final Set<Integer> ports = new HashSet<>();
ports.add(ldapPort.getIntValue());
checkPortArgument(adminConnectorPort, ports, errorMessages);
diff --git a/opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/ModelUtils.java b/opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/ModelUtils.java
index eef7f67..21fe990 100644
--- a/opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/ModelUtils.java
+++ b/opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/ModelUtils.java
@@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
- * Copyright 2014 ForgeRock AS.
+ * Copyright 2014-2015 ForgeRock AS.
*/
package org.forgerock.opendj.server.setup.model;
@@ -37,7 +37,7 @@
static final String OBFUSCATED_VALUE = "******";
ArrayList<String> getSetupEquivalentCommandLine(final Model configuration) {
- final ArrayList<String> cmdLines = new ArrayList<String>();
+ final ArrayList<String> cmdLines = new ArrayList<>();
final ListenerSettings settings = configuration.getListenerSettings();
// Starts the server ?
diff --git a/opendj-svn-property-check-maven-plugin/src/main/java/org/forgerock/maven/CheckSVNPropertyMojo.java b/opendj-svn-property-check-maven-plugin/src/main/java/org/forgerock/maven/CheckSVNPropertyMojo.java
index c1a022f..8a3eff4 100644
--- a/opendj-svn-property-check-maven-plugin/src/main/java/org/forgerock/maven/CheckSVNPropertyMojo.java
+++ b/opendj-svn-property-check-maven-plugin/src/main/java/org/forgerock/maven/CheckSVNPropertyMojo.java
@@ -76,7 +76,7 @@
/** The overall SVN Client Manager. */
private final SVNClientManager svnClientManager = SVNClientManager.newInstance();
- private final List<String> errorFilePaths = new LinkedList<String>();
+ private final List<String> errorFilePaths = new LinkedList<>();
/** {@inheritDoc} **/
public void execute() throws MojoExecutionException, MojoFailureException {
--
Gitblit v1.10.0