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

Jean-Noel Rouvignac
27.18.2015 89c103b6b1164cc89c844dc3055586ffaab4070a
AutoRefactor'ed use diamond operator
72 files modified
948 ■■■■■ changed files
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentGroup.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentParser.java 30 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/AuthenticatedConnectionFactory.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommandBuilder.java 10 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/FileBasedArgument.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/MenuBuilder.java 28 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/MenuResult.java 14 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/MultiColumnPrinter.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/PromptingTrustManager.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ReturnCode.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommand.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java 37 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/TableBuilder.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/TextTablePrinter.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/AbstractManagedObjectDefinition.java 97 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/AggregationPropertyDefinition.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/BooleanPropertyDefinition.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java 10 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ConfigurationFramework.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DefaultManagedObject.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DefinedDefaultBehaviorProvider.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationUnit.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/EnumPropertyDefinition.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/InstantiableRelationDefinition.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ManagedObjectDefinitionResource.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ManagedObjectPath.java 36 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/OptionalRelationDefinition.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/PropertyDefinition.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/PropertyDefinitionUsageBuilder.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/Reference.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/RelationDefinition.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SetRelationDefinition.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SingletonRelationDefinition.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SizeUnit.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/Tag.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/MissingMandatoryPropertiesException.java 13 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/OperationRejectedException.java 8 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/DNBuilder.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPDriver.java 26 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPManagedObject.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/AbstractManagedObject.java 15 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/PropertySet.java 23 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/conditions/ContainsCondition.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/CLIProfile.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java 55 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/GetPropSubCommandHandler.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/ListSubCommandHandler.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/PropertyEditorModification.java 20 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/PropertyValueEditor.java 110 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SubCommandHandler.java 70 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SubCommandHandlerFactory.java 28 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigAddListenerAdaptor.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigChangeListenerAdaptor.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigChangeResult.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigDeleteListenerAdaptor.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConstraintViolationException.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagedObject.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagementContext.java 24 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/ConfigurationMock.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/RelativeInheritedDefaultBehaviorProviderTest.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/TestCfg.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/TestChildCfgDefn.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/TestParentCfgDefn.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/ValidateConfigDefinitionsTest.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/AggregationServerTest.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/DNBuilderTest.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/DefaultBehaviorTest.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentGroup.java
@@ -42,7 +42,7 @@
    /** Description for this group of arguments. */
    private LocalizableMessage description;
    /** List of arguments belonging to this group. */
    private List<Argument> args;
    private final List<Argument> args = new LinkedList<>();
    /** Governs groups position within usage statement. */
    private final Integer priority;
@@ -58,7 +58,6 @@
    public ArgumentGroup(final LocalizableMessage description, final int priority) {
        this.description = description;
        this.priority = priority;
        this.args = new LinkedList<Argument>();
    }
    /** {@inheritDoc} */
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentParser.java
@@ -104,7 +104,7 @@
    private Argument versionArgument;
    /** The set of unnamed trailing arguments that were provided for this parser. */
    private final ArrayList<String> trailingArguments = new ArrayList<String>();
    private final ArrayList<String> trailingArguments = new ArrayList<>();
    /**
     * Indicates whether this parser will allow additional unnamed arguments at
@@ -126,13 +126,13 @@
    private VersionHandler versionHandler;
    /** The set of arguments defined for this parser, referenced by short ID. */
    private final HashMap<Character, Argument> shortIDMap = new HashMap<Character, Argument>();
    private final HashMap<Character, Argument> shortIDMap = new HashMap<>();
    /** The set of arguments defined for this parser, referenced by long ID. */
    private final HashMap<String, Argument> longIDMap = new HashMap<String, Argument>();
    private final HashMap<String, Argument> longIDMap = new HashMap<>();
    /** The set of arguments defined for this parser, referenced by argument name. */
    private final HashMap<String, Argument> argumentMap = new HashMap<String, Argument>();
    private final HashMap<String, Argument> argumentMap = new HashMap<>();
    /** The total set of arguments defined for this parser. */
    private final LinkedList<Argument> argumentList = new LinkedList<Argument>();
    private final LinkedList<Argument> argumentList = new LinkedList<>();
    /** The maximum number of unnamed trailing arguments that may be provided. */
    private final int maxTrailingArguments;
@@ -164,7 +164,7 @@
    private String[] rawArguments;
    /** Set of argument groups. */
    protected final Set<ArgumentGroup> argumentGroups = new TreeSet<ArgumentGroup>();
    protected final Set<ArgumentGroup> argumentGroups = new TreeSet<>();
    /**
     * Group for arguments that have not been explicitly grouped. These will
@@ -756,7 +756,7 @@
                    + PROPERTY_SCRIPT_NAME + "'.");
        }
        Map<String, Object> map = new HashMap<String, Object>();
        final Map<String, Object> map = new HashMap<>();
        map.put("locale", Locale.getDefault().getLanguage());
        map.put("year", new SimpleDateFormat("yyyy").format(new Date()));
        map.put("name", scriptName);
@@ -788,16 +788,16 @@
     * @return              The RefSect1 element as a String.
     */
    protected String getOptionsRefSect1(String scriptName) {
        Map<String, Object> map = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        map.put("name", scriptName);
        map.put("title", REF_TITLE_OPTIONS.get());
        map.put("intro", REF_INTRO_OPTIONS.get(scriptName));
        Argument helpArgument = null;
        final boolean printHeaders = printUsageGroupHeaders();
        List<Map<String, Object>> groups = new LinkedList<Map<String, Object>>();
        List<Map<String, Object>> groups = new LinkedList<>();
        for (final ArgumentGroup argGroup : argumentGroups) {
            Map<String, Object> group = new HashMap<String, Object>();
            Map<String, Object> group = new HashMap<>();
            // Add the group's description if any
            if (argGroup.containsArguments() && printHeaders) {
@@ -809,7 +809,7 @@
                }
            }
            List<Map<String, Object>> options = new LinkedList<Map<String, Object>>();
            List<Map<String, Object>> options = new LinkedList<>();
            final SortedSet<Argument> args = sortArguments(argGroup.getArguments());
            for (final Argument a : args) {
                if (a.isHidden()) {
@@ -836,9 +836,9 @@
            }
        }
        if (helpArgument != null) {
            Map<String, Object> helpGroup = new HashMap<String, Object>();
            Map<String, Object> helpGroup = new HashMap<>();
            helpGroup.put("description", null);
            List<Map<String, Object>> options = new LinkedList<Map<String, Object>>();
            List<Map<String, Object>> options = new LinkedList<>();
            options.add(getArgumentMap(helpArgument));
            helpGroup.put("options", options);
            groups.add(helpGroup);
@@ -871,7 +871,7 @@
     * @return      A map containing information about an argument option
     */
    private Map<String, Object> getArgumentMap(final Argument a) {
        Map<String, Object> option = new HashMap<String, Object>();
        Map<String, Object> option = new HashMap<>();
        option.put("synopsis", getOptionSynopsis(a));
        option.put("description", eolToNewPara(a.getDescription()));
        String dv = a.getDefaultValue();
@@ -966,7 +966,7 @@
     * @return              The set of arguments in sorted order.
     */
    SortedSet<Argument> sortArguments(final List<Argument> arguments) {
        final SortedSet<Argument> result = new TreeSet<Argument>(new Comparator<Argument>() {
        final SortedSet<Argument> result = new TreeSet<>(new Comparator<Argument>() {
            /** {@inheritDoc} */
            @Override
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/AuthenticatedConnectionFactory.java
@@ -219,7 +219,7 @@
    /** {@inheritDoc} */
    @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>() {
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommandBuilder.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package com.forgerock.opendj.cli;
@@ -43,8 +43,8 @@
public class CommandBuilder {
    private String commandName;
    private String subcommandName;
    private ArrayList<Argument> args;
    private HashSet<Argument> obfuscatedArgs;
    private final ArrayList<Argument> args = new ArrayList<>();
    private final HashSet<Argument> obfuscatedArgs = new HashSet<>();
    /**
     * The separator used to link the lines of the resulting command-lines.
@@ -81,8 +81,6 @@
    public CommandBuilder(String commandName, String subcommandName) {
        this.commandName = commandName;
        this.subcommandName = subcommandName;
        args = new ArrayList<Argument>();
        obfuscatedArgs = new HashSet<Argument>();
    }
    /**
@@ -239,7 +237,7 @@
    }
    /** Chars that require special treatment when passing them to command-line. */
    private static final Set<Character> CHARSTOESCAPE = new TreeSet<Character>(Arrays.asList(
    private static final Set<Character> CHARSTOESCAPE = new TreeSet<>(Arrays.asList(
        ' ', '\t', '\n', '|', ';', '<', '>', '(', ')', '$', '`', '\\', '"', '\''));
    /**
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java
@@ -714,7 +714,7 @@
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static  MultiChoiceArgument<SearchScope> getSearchScope() throws ArgumentException {
        final MultiChoiceArgument<SearchScope> searchScope = new MultiChoiceArgument<SearchScope>(
        final MultiChoiceArgument<SearchScope> searchScope = new MultiChoiceArgument<>(
                OPTION_LONG_SEARCHSCOPE, OPTION_SHORT_SEARCHSCOPE, OPTION_LONG_SEARCHSCOPE, false, true,
                INFO_SEARCH_SCOPE_PLACEHOLDER.get(), SearchScope.values(), false,
                INFO_SEARCH_DESCRIPTION_SEARCH_SCOPE.get());
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/FileBasedArgument.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions copyright 2014 ForgeRock AS
 *      Portions copyright 2014-2015 ForgeRock AS
 */
package com.forgerock.opendj.cli;
@@ -54,11 +54,8 @@
 * multiple lines, then only the first line will be read.
 */
public final class FileBasedArgument extends Argument {
    /**
     * The mapping between filenames specified and the first lines read
     * from those files.
     */
    private final LinkedHashMap<String, String> namesToValues;
    /** The mapping between filenames specified and the first lines read from those files. */
    private final LinkedHashMap<String, String> namesToValues = new LinkedHashMap<>();
    /**
     * Creates a new file-based argument with the provided information.
@@ -103,8 +100,6 @@
            throws ArgumentException {
        super(name, shortIdentifier, longIdentifier, isRequired, isMultiValued, true,
                valuePlaceholder, defaultValue, propertyName, description);
        namesToValues = new LinkedHashMap<String, String>();
    }
    /**
@@ -138,8 +133,6 @@
            throws ArgumentException {
        super(name, shortIdentifier, longIdentifier, isRequired, false, true, valuePlaceholder,
                null, null, description);
        namesToValues = new LinkedHashMap<String, String>();
    }
    /**
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/MenuBuilder.java
@@ -70,7 +70,7 @@
        /** {@inheritDoc} */
        public MenuResult<T> invoke(ConsoleApplication app) throws ClientException {
            List<T> values = new ArrayList<T>();
            List<T> values = new ArrayList<>();
            for (MenuCallback<T> callback : callbacks) {
                MenuResult<T> result = callback.invoke(app);
                if (!result.isSuccess()) {
@@ -170,11 +170,11 @@
                        }
                    } else if (allowMultiSelect) {
                        // Use a composite call-back to collect all the results.
                        List<MenuCallback<T>> cl = new ArrayList<MenuCallback<T>>();
                        List<MenuCallback<T>> cl = new ArrayList<>();
                        for (String value : ninput.split(",")) {
                            // Make sure that there are no duplicates.
                            String nvalue = value.trim();
                            Set<String> choices = new HashSet<String>();
                            Set<String> choices = new HashSet<>();
                            if (choices.contains(nvalue)) {
                                app.println();
@@ -192,7 +192,7 @@
                            }
                        }
                        return new CompositeCallback<T>(cl);
                        return new CompositeCallback<>(cl);
                    } else if (!callbacks.containsKey(ninput)) {
                        app.println();
                        app.println(ERR_MENU_BAD_CHOICE_SINGLE.get());
@@ -308,17 +308,17 @@
    private final ConsoleApplication app;
    /** The char option call-backs. */
    private final List<MenuCallback<T>> charCallbacks = new ArrayList<MenuCallback<T>>();
    private final List<MenuCallback<T>> charCallbacks = new ArrayList<>();
    /** The char option keys (must be single-character messages). */
    private final List<LocalizableMessage> charKeys = new ArrayList<LocalizableMessage>();
    private final List<LocalizableMessage> charKeys = new ArrayList<>();
    /** The synopsis of char options. */
    private final List<LocalizableMessage> charSynopsis = new ArrayList<LocalizableMessage>();
    private final List<LocalizableMessage> charSynopsis = new ArrayList<>();
    /** Optional column headings. */
    private final List<LocalizableMessage> columnHeadings = new ArrayList<LocalizableMessage>();
    private final List<LocalizableMessage> columnHeadings = new ArrayList<>();
    /** Optional column widths. */
    private final List<Integer> columnWidths = new ArrayList<Integer>();
    private final List<Integer> columnWidths = new ArrayList<>();
    /** The call-back for the optional default action. */
    private MenuCallback<T> defaultCallback;
@@ -326,9 +326,9 @@
    private LocalizableMessage defaultDescription;
    /** The numeric option call-backs. */
    private final List<MenuCallback<T>> numericCallbacks = new ArrayList<MenuCallback<T>>();
    private final List<MenuCallback<T>> numericCallbacks = new ArrayList<>();
    /** The numeric option fields. */
    private final List<List<LocalizableMessage>> numericFields = new ArrayList<List<LocalizableMessage>>();
    private final List<List<LocalizableMessage>> numericFields = new ArrayList<>();
    /** The menu title. */
    private LocalizableMessage title;
@@ -444,7 +444,7 @@
     */
    public int addNumberedOption(LocalizableMessage description, MenuCallback<T> callback,
            LocalizableMessage... extraFields) {
        List<LocalizableMessage> fields = new ArrayList<LocalizableMessage>();
        List<LocalizableMessage> fields = new ArrayList<>();
        fields.add(description);
        if (extraFields != null) {
            fields.addAll(Arrays.asList(extraFields));
@@ -585,7 +585,7 @@
     */
    public Menu<T> toMenu() {
        TableBuilder nbuilder = new TableBuilder();
        Map<String, MenuCallback<T>> callbacks = new HashMap<String, MenuCallback<T>>();
        Map<String, MenuCallback<T>> callbacks = new HashMap<>();
        // Determine whether multiple columns should be used for numeric options
        boolean useMultipleColumns = threshold >= 0 && numericCallbacks.size() >= threshold;
@@ -669,7 +669,7 @@
            }
        }
        return new MenuImpl<T>(app, title, prompt, nbuilder, cbuilder, printer, callbacks, allowMultiSelect,
        return new MenuImpl<>(app, title, prompt, nbuilder, cbuilder, printer, callbacks, allowMultiSelect,
                defaultCallback, defaultDescription, nMaxTries);
    }
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/MenuResult.java
@@ -55,9 +55,7 @@
 */
public final class MenuResult<T> {
    /**
     * The type of result returned from the menu.
     */
    /** The type of result returned from the menu. */
    private static enum Type {
        /**
         * The user selected an option which did not return a result,
@@ -95,7 +93,7 @@
     * @return Returns a new menu result indicating that the menu should be displayed again.
     */
    public static <T> MenuResult<T> again() {
        return new MenuResult<T>(Type.AGAIN, Collections.<T> emptyList());
        return new MenuResult<>(Type.AGAIN, Collections.<T> emptyList());
    }
    /**
@@ -109,7 +107,7 @@
     *         back to the previous main menu if applicable.
     */
    public static <T> MenuResult<T> cancel() {
        return new MenuResult<T>(Type.CANCEL, Collections.<T> emptyList());
        return new MenuResult<>(Type.CANCEL, Collections.<T> emptyList());
    }
    /**
@@ -123,7 +121,7 @@
     *         outstanding tasks.
     */
    public static <T> MenuResult<T> quit() {
        return new MenuResult<T>(Type.QUIT, Collections.<T> emptyList());
        return new MenuResult<>(Type.QUIT, Collections.<T> emptyList());
    }
    /**
@@ -154,7 +152,7 @@
     *         retrieved using {@link #getValue()} or {@link #getValues()}.
     */
    public static <T> MenuResult<T> success(Collection<T> values) {
        return new MenuResult<T>(Type.SUCCESS, new ArrayList<T>(values));
        return new MenuResult<>(Type.SUCCESS, new ArrayList<>(values));
    }
    /**
@@ -208,7 +206,7 @@
     * @see #isSuccess()
     */
    public Collection<T> getValues() {
        return new ArrayList<T>(values);
        return new ArrayList<>(values);
    }
    /**
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/MultiColumnPrinter.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 *      Portions copyright 2012-2014 ForgeRock AS.
 *      Portions copyright 2012-2015 ForgeRock AS.
 */
package com.forgerock.opendj.cli;
@@ -137,8 +137,8 @@
    private int titleAlign = CENTER;
    private String border;
    private List<String[]> titleTable;
    private List<int[]> titleSpanTable;
    private final List<String[]> titleTable = new Vector<>();
    private final List<int[]> titleSpanTable = new Vector<>();
    private final int[] curLength;
    private final ConsoleApplication app;
@@ -191,9 +191,6 @@
     */
    public MultiColumnPrinter(final int numCol, final int gap, final String border, final int align,
            final ConsoleApplication app) {
        titleTable = new Vector<String[]>();
        titleSpanTable = new Vector<int[]>();
        curLength = new int[numCol];
        this.numCol = numCol;
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/PromptingTrustManager.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions copyright 2014 ForgeRock AS
 *      Portions copyright 2014-2015 ForgeRock AS
 */
package com.forgerock.opendj.cli;
@@ -336,7 +336,7 @@
        app.println(INFO_LDAP_CONN_PROMPT_SECURITY_TRUST_OPTION.get());
        app.println();
        final Map<String, TrustOption> menuOptions = new HashMap<String, TrustOption>();
        final Map<String, TrustOption> menuOptions = new HashMap<>();
        for (final TrustOption t : TrustOption.values()) {
            menuOptions.put(t.getChoice().toString(), t);
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ReturnCode.java
@@ -20,7 +20,7 @@
 *
 * CDDL HEADER END
 *
 *      Copyright 2014 ForgeRock AS.
 *      Copyright 2014-2015 ForgeRock AS.
 */
package com.forgerock.opendj.cli;
@@ -194,7 +194,7 @@
    CLIENT_SIDE_CONNECT_ERROR(91);
    private int returnCode;
    private static final Map<Integer, String> RETURNCODE = new HashMap<Integer, String>();
    private static final Map<Integer, String> RETURNCODE = new HashMap<>();
    static {
        for (final ReturnCode rc : ReturnCode.values()) {
            RETURNCODE.put(rc.get(), rc.name());
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommand.java
@@ -44,11 +44,11 @@
    private boolean isHidden;
    /** The mapping between the short argument IDs and the arguments for this subcommand. */
    private HashMap<Character, Argument> shortIDMap;
    private final HashMap<Character, Argument> shortIDMap = new HashMap<>();
    /** The mapping between the long argument IDs and the arguments for this subcommand. */
    private HashMap<String, Argument> longIDMap;
    private final HashMap<String, Argument> longIDMap = new HashMap<>();
    /** The list of arguments associated with this subcommand. */
    private LinkedList<Argument> arguments;
    private final LinkedList<Argument> arguments = new LinkedList<>();
    /** The description for this subcommand. */
    private LocalizableMessage description;
@@ -140,9 +140,6 @@
        }
        parser.addSubCommand(this);
        shortIDMap = new HashMap<Character, Argument>();
        longIDMap = new HashMap<String, Argument>();
        arguments = new LinkedList<Argument>();
    }
    /**
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java
@@ -63,19 +63,18 @@
    private static final String INDENT = "    ";
    /** The arguments that will be used to trigger the display of usage information for groups of sub-commands. */
    private final Map<Argument, Collection<SubCommand>> usageGroupArguments =
        new HashMap<Argument, Collection<SubCommand>>();
    private final Map<Argument, Collection<SubCommand>> usageGroupArguments = new HashMap<>();
    /** The set of global arguments defined for this parser, referenced by short ID. */
    private final Map<Character, Argument> globalShortIDMap = new HashMap<Character, Argument>();
    private final Map<Character, Argument> globalShortIDMap = new HashMap<>();
    /** The set of global arguments defined for this parser, referenced by long ID. */
    private final Map<String, Argument> globalLongIDMap = new HashMap<String, Argument>();
    private final Map<String, Argument> globalLongIDMap = new HashMap<>();
    /** The set of global arguments defined for this parser, referenced by argument name. */
    private final Map<String, Argument> globalArgumentMap = new HashMap<String, Argument>();
    private final Map<String, Argument> globalArgumentMap = new HashMap<>();
    /** The total set of global arguments defined for this parser. */
    private final List<Argument> globalArgumentList = new LinkedList<Argument>();
    private final List<Argument> globalArgumentList = new LinkedList<>();
    /** The set of subcommands defined for this parser, referenced by subcommand name. */
    private final SortedMap<String, SubCommand> subCommands = new TreeMap<String, SubCommand>();
    private final SortedMap<String, SubCommand> subCommands = new TreeMap<>();
    /**The subcommand requested by the user as part of the command-line arguments.     */
    private SubCommand subCommand;
@@ -1144,7 +1143,7 @@
        }
        // Model for a FreeMarker template.
        Map<String, Object> map = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        map.put("locale", Locale.getDefault().getLanguage());
        map.put("year", new SimpleDateFormat("yyyy").format(new Date()));
        map.put("name", scriptName);
@@ -1177,14 +1176,14 @@
            return "";
        }
        Map<String, Object> map = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        map.put("name", scriptName);
        map.put("info", getDocSubcommandsDescriptionSupplement());
        if (scriptName.equals("dsconfig")) {
            // Break dsconfig into multiple pages, so use only the list here.
            map.put("isItemizedList", true);
        }
        List<String> scUsageList = new ArrayList<String>();
        List<String> scUsageList = new ArrayList<>();
        for (SubCommand subCommand : subCommands) {
            if (scriptName.equals("dsconfig")) {
                scUsageList.add(getSubCommandListItem(scriptName, subCommand));
@@ -1206,7 +1205,7 @@
     * @return A DocBook XML ListItem element linking to the subcommand page.
     */
    private String getSubCommandListItem(String scriptName, SubCommand subCommand) {
        Map<String, Object> map = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        map.put("id", scriptName + "-" + subCommand.getName());
        map.put("name", scriptName + " " + subCommand.getName());
        map.put("description", eolToNewPara(subCommand.getDescription()));
@@ -1224,7 +1223,7 @@
     */
    private String toRefSect2(String scriptName, SubCommand subCommand) {
        // Model for a FreeMarker template.
        Map<String, Object> map = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        map.put("id", scriptName + "-" + subCommand.getName());
        final String name = scriptName + " " + subCommand.getName();
        map.put("name", name);
@@ -1252,7 +1251,7 @@
     */
    private void setSubCommandOptionsInfo(Map<String, Object> map, SubCommand subCommand) {
        if (!subCommand.getArguments().isEmpty()) {
            List<Map<String, Object>> options = new LinkedList<Map<String, Object>>();
            List<Map<String, Object>> options = new LinkedList<>();
            String nameOption = null;
            for (Argument a : subCommand.getArguments()) {
                // Return a generic FQDN for localhost as the default hostname
@@ -1261,11 +1260,11 @@
                    a.setDefaultValue("localhost.localdomain");
                }
                Map<String, Object> option = new HashMap<String, Object>();
                Map<String, Object> option = new HashMap<>();
                String optionSynopsis = getOptionSynopsis(a);
                option.put("synopsis", optionSynopsis);
                option.put("description", eolToNewPara(a.getDescription()));
                Map<String, Object> info = new HashMap<String, Object>();
                Map<String, Object> info = new HashMap<>();
                if (subCommandUsageHandler != null) {
                    if (!doesHandleProperties(a)) {
                        nameOption = "<option>" + optionSynopsis + "</option>";
@@ -1304,7 +1303,7 @@
     */
    private void appendSubCommandPages(StringBuilder builder, String scriptName, Collection<SubCommand> subCommands) {
        for (SubCommand subCommand : subCommands) {
            Map<String, Object> map = new HashMap<String, Object>();
            Map<String, Object> map = new HashMap<>();
            map.put("marker", "@@@" + scriptName + "-" + subCommand.getName() + "@@@");
            map.put("locale", Locale.getDefault().getLanguage());
            map.put("year", new SimpleDateFormat("yyyy").format(new Date()));
@@ -1333,15 +1332,15 @@
    private void appendSubCommandReference(StringBuilder builder,
                                           String scriptName,
                                           Collection<SubCommand> subCommands) {
        Map<String, Object> map = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<>();
        map.put("marker", "@@@" + scriptName + "-subcommands-ref" + "@@@");
        map.put("name", scriptName);
        map.put("locale", Locale.getDefault().getLanguage());
        map.put("title", REF_PART_TITLE_SUBCOMMANDS.get(scriptName));
        map.put("partintro", REF_PART_INTRO_SUBCOMMANDS.get(scriptName));
        List<Map<String, Object>> commands = new LinkedList<Map<String, Object>>();
        List<Map<String, Object>> commands = new LinkedList<>();
        for (SubCommand subCommand : subCommands) {
            Map<String, Object> scMap = new HashMap<String, Object>();
            Map<String, Object> scMap = new HashMap<>();
            scMap.put("id", scriptName + "-" + subCommand.getName());
            commands.add(scMap);
        }
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/TableBuilder.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package com.forgerock.opendj.cli;
@@ -46,22 +46,22 @@
    private int column;
    /** The current with of each column. */
    private List<Integer> columnWidths = new ArrayList<Integer>();
    private List<Integer> columnWidths = new ArrayList<>();
    /** The list of column headings. */
    private List<LocalizableMessage> header = new ArrayList<LocalizableMessage>();
    private List<LocalizableMessage> header = new ArrayList<>();
    /** The current number of rows in the table. */
    private int height;
    /** The list of table rows. */
    private List<List<String>> rows = new ArrayList<List<String>>();
    private List<List<String>> rows = new ArrayList<>();
    /** The linked list of sort keys comparators. */
    private List<Comparator<String>> sortComparators = new ArrayList<Comparator<String>>();
    private List<Comparator<String>> sortComparators = new ArrayList<>();
    /** The linked list of sort keys. */
    private List<Integer> sortKeys = new ArrayList<Integer>();
    private List<Integer> sortKeys = new ArrayList<>();
    /** The current number of columns in the table. */
    private int width;
@@ -263,7 +263,7 @@
        TableSerializer serializer = printer.getSerializer();
        // First sort the table.
        List<List<String>> sortedRows = new ArrayList<List<String>>(rows);
        List<List<String>> sortedRows = new ArrayList<>(rows);
        Comparator<List<String>> comparator = new Comparator<List<String>>() {
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/TextTablePrinter.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package com.forgerock.opendj.cli;
@@ -50,10 +50,10 @@
        /**The real column widths taking into account size constraints but
         not including padding or separators.*/
        private final List<Integer> columnWidths = new ArrayList<Integer>();
        private final List<Integer> columnWidths = new ArrayList<>();
        /** The cells in the current row. */
        private final List<String> currentRow = new ArrayList<String>();
        private final List<String> currentRow = new ArrayList<>();
        /** Width of the table in columns. */
        private int totalColumns;
@@ -307,7 +307,7 @@
    private boolean displayHeadings = true;
    /** Table indicating whether or not a column is fixed width. */
    private final Map<Integer, Integer> fixedColumns = new HashMap<Integer, Integer>();
    private final Map<Integer, Integer> fixedColumns = new HashMap<>();
    /** The number of characters the table should be indented. */
    private int indentWidth;
opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java
@@ -114,7 +114,7 @@
        // Check that the trailing arguments were retrieved correctly and
        // in the right order.
        if (args.length > 1) {
            List<String> scargs = new ArrayList<String>();
            List<String> scargs = new ArrayList<>();
            for (int i = 1; i < args.length; i++) {
                scargs.add(args[i]);
            }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/AbstractManagedObjectDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -64,68 +65,46 @@
    /** The parent managed object definition if applicable. */
    private final AbstractManagedObjectDefinition<? super C, ? super S> parent;
    /**
     * The set of constraints associated with this managed object
     * definition.
     */
    private final Collection<Constraint> constraints;
    /**
     * The set of property definitions applicable to this managed object
     * definition.
     */
    private final Map<String, PropertyDefinition<?>> propertyDefinitions;
    /**
     * The set of relation definitions applicable to this managed object
     * definition.
     */
    private final Map<String, RelationDefinition<?, ?>> relationDefinitions;
    /**
     * The set of relation definitions directly referencing this managed
     * object definition.
     */
    private final Set<RelationDefinition<C, S>> reverseRelationDefinitions;
    /** The set of constraints associated with this managed object definition. */
    private final Collection<Constraint> constraints = new LinkedList<>();
    /** The set of property definitions applicable to this managed object definition. */
    private final Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<>();
    /** The set of relation definitions applicable to this managed object definition. */
    private final Map<String, RelationDefinition<?, ?>> relationDefinitions = new HashMap<>();
    /** The set of relation definitions directly referencing this managed object definition. */
    private final Set<RelationDefinition<C, S>> reverseRelationDefinitions = new HashSet<>();
    /**
     * The set of all property definitions associated with this managed
     * object definition including inherited property definitions.
     */
    private final Map<String, PropertyDefinition<?>> allPropertyDefinitions;
    private final Map<String, PropertyDefinition<?>> allPropertyDefinitions = new HashMap<>();
    /**
     * The set of all relation definitions associated with this managed
     * object definition including inherited relation definitions.
     */
    private final Map<String, RelationDefinition<?, ?>> allRelationDefinitions;
    private final Map<String, RelationDefinition<?, ?>> allRelationDefinitions = new HashMap<>();
    /**
     * The set of aggregation property definitions applicable to this
     * managed object definition.
     */
    private final Map<String, AggregationPropertyDefinition<?, ?>> aggregationPropertyDefinitions;
    /** The set of aggregation property definitions applicable to this managed object definition. */
    private final Map<String, AggregationPropertyDefinition<?, ?>> aggregationPropertyDefinitions = new HashMap<>();
    /**
     * The set of aggregation property definitions directly referencing this
     * managed object definition.
     */
    private final Vector<AggregationPropertyDefinition<?, ?>> reverseAggregationPropertyDefinitions;
    /** The set of aggregation property definitions directly referencing this managed object definition. */
    private final Vector<AggregationPropertyDefinition<?, ?>> reverseAggregationPropertyDefinitions = new Vector<>();
    /**
     * The set of all aggregation property definitions associated with this
     * managed object definition including inherited relation definitions.
     */
    private final Map<String, AggregationPropertyDefinition<?, ?>> allAggregationPropertyDefinitions;
    private final Map<String, AggregationPropertyDefinition<?, ?>> allAggregationPropertyDefinitions = new HashMap<>();
    /** The set of tags associated with this managed object. */
    private final Set<Tag> allTags;
    private final Set<Tag> allTags = new HashSet<>();
    /** Options applicable to this definition. */
    private final Set<ManagedObjectOption> options;
    private final Set<ManagedObjectOption> options = EnumSet.noneOf(ManagedObjectOption.class);
    /** The set of managed object definitions which inherit from this definition. */
    private final Map<String, AbstractManagedObjectDefinition<? extends C, ? extends S>> children;
    private final Map<String, AbstractManagedObjectDefinition<? extends C, ? extends S>> children = new HashMap<>();
    /**
     * Create a new abstract managed object definition.
@@ -142,19 +121,6 @@
        AbstractManagedObjectDefinition<? super C, ? super S> parent) {
        this.name = name;
        this.parent = parent;
        this.constraints = new LinkedList<Constraint>();
        this.propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        this.relationDefinitions = new HashMap<String, RelationDefinition<?, ?>>();
        this.reverseRelationDefinitions = new HashSet<RelationDefinition<C, S>>();
        this.allPropertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        this.allRelationDefinitions = new HashMap<String, RelationDefinition<?, ?>>();
        this.aggregationPropertyDefinitions = new HashMap<String, AggregationPropertyDefinition<?, ?>>();
        this.reverseAggregationPropertyDefinitions = new Vector<AggregationPropertyDefinition<?, ?>>();
        this.allAggregationPropertyDefinitions = new HashMap<String, AggregationPropertyDefinition<?, ?>>();
        this.allTags = new HashSet<Tag>();
        this.options = EnumSet.noneOf(ManagedObjectOption.class);
        this.children = new HashMap<String, AbstractManagedObjectDefinition<? extends C, ? extends S>>();
        // If we have a parent definition then inherit its features.
        if (parent != null) {
@@ -169,10 +135,8 @@
            }
            for (AggregationPropertyDefinition<?, ?> apd : parent.getAllAggregationPropertyDefinitions()) {
                allAggregationPropertyDefinitions.put(apd.getName(), apd);
            }
            // Tag inheritance is performed during preprocessing.
        }
    }
@@ -186,8 +150,7 @@
     *         definition.
     */
    public final Collection<AbstractManagedObjectDefinition<? extends C, ? extends S>> getAllChildren() {
        List<AbstractManagedObjectDefinition<? extends C, ? extends S>> list =
            new ArrayList<AbstractManagedObjectDefinition<? extends C, ? extends S>>(children.values());
        List<AbstractManagedObjectDefinition<? extends C, ? extends S>> list = new ArrayList<>(children.values());
        for (AbstractManagedObjectDefinition<? extends C, ? extends S> child : children.values()) {
            list.addAll(child.getAllChildren());
@@ -206,9 +169,8 @@
     */
    public final Collection<Constraint> getAllConstraints() {
        // This method does not used a cached set of constraints because
        // constraints may be updated after child definitions have been
        // defined.
        List<Constraint> allConstraints = new LinkedList<Constraint>();
        // constraints may be updated after child definitions have been defined.
        List<Constraint> allConstraints = new LinkedList<>();
        if (parent != null) {
            allConstraints.addAll(parent.getAllConstraints());
@@ -253,10 +215,8 @@
     */
    public final Collection<RelationDefinition<? super C, ? super S>> getAllReverseRelationDefinitions() {
        // This method does not used a cached set of relations because
        // relations may be updated after child definitions have been
        // defined.
        List<RelationDefinition<? super C, ? super S>> rdlist =
            new LinkedList<RelationDefinition<? super C, ? super S>>();
        // relations may be updated after child definitions have been defined.
        List<RelationDefinition<? super C, ? super S>> rdlist = new LinkedList<>();
        if (parent != null) {
            rdlist.addAll(parent.getAllReverseRelationDefinitions());
@@ -289,12 +249,9 @@
     *         caller is free to modify the collection if required.
     */
    public final Collection<AggregationPropertyDefinition<?, ?>> getAllReverseAggregationPropertyDefinitions() {
        // This method does not used a cached set of aggregation properties
        // because
        // aggregation properties may be updated after child definitions have
        // been
        // defined.
        List<AggregationPropertyDefinition<?, ?>> apdlist = new LinkedList<AggregationPropertyDefinition<?, ?>>();
        // This method does not used a cached set of aggregation properties because
        // aggregation properties may be updated after child definitions have been defined.
        List<AggregationPropertyDefinition<?, ?>> apdlist = new LinkedList<>();
        if (parent != null) {
            apdlist.addAll(parent.getAllReverseAggregationPropertyDefinitions());
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/AggregationPropertyDefinition.java
@@ -214,7 +214,7 @@
                throw new IllegalStateException("Relation definition undefined");
            }
            return new AggregationPropertyDefinition<C, S>(d, propertyName, options, adminAction, defaultBehavior,
            return new AggregationPropertyDefinition<>(d, propertyName, options, adminAction, defaultBehavior,
                parentPathString, rdName, targetNeedsEnablingCondition, targetIsEnabledCondition);
        }
@@ -407,10 +407,10 @@
            ServerManagedObject<?> parent = context.getManagedObject(parentPath);
            // Create entries in the listener tables.
            List<ReferentialIntegrityDeleteListener> dlist = new LinkedList<ReferentialIntegrityDeleteListener>();
            List<ReferentialIntegrityDeleteListener> dlist = new LinkedList<>();
            deleteListeners.put(managedObject.getDN(), dlist);
            List<ReferentialIntegrityChangeListener> clist = new LinkedList<ReferentialIntegrityChangeListener>();
            List<ReferentialIntegrityChangeListener> clist = new LinkedList<>();
            changeListeners.put(managedObject.getDN(), clist);
            for (String name : managedObject.getPropertyValues(AggregationPropertyDefinition.this)) {
@@ -633,7 +633,7 @@
        @SuppressWarnings("unchecked")
        private <C1 extends ConfigurationClient> List<ManagedObject<? extends C1>> findInstances(
            ManagementContext context, AbstractManagedObjectDefinition<C1, ?> mod) throws LdapException {
            List<ManagedObject<? extends C1>> instances = new LinkedList<ManagedObject<? extends C1>>();
            List<ManagedObject<? extends C1>> instances = new LinkedList<>();
            if (mod == RootCfgDefn.getInstance()) {
                instances.add((ManagedObject<? extends C1>) context.getRootConfigurationManagedObject());
@@ -695,7 +695,7 @@
     */
    public static <C extends ConfigurationClient, S extends Configuration> Builder<C, S> createBuilder(
        AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
        return new Builder<C, S>(d, propertyName);
        return new Builder<>(d, propertyName);
    }
    private static final Logger debugLogger = LoggerFactory.getLogger(AggregationPropertyDefinition.class);
@@ -704,15 +704,13 @@
     * The active server-side referential integrity change listeners
     * associated with this property.
     */
    private final Map<DN, List<ReferentialIntegrityChangeListener>> changeListeners =
        new HashMap<DN, List<ReferentialIntegrityChangeListener>>();
    private final Map<DN, List<ReferentialIntegrityChangeListener>> changeListeners = new HashMap<>();
    /**
     * The active server-side referential integrity delete listeners
     * associated with this property.
     */
    private final Map<DN, List<ReferentialIntegrityDeleteListener>> deleteListeners =
        new HashMap<DN, List<ReferentialIntegrityDeleteListener>>();
    private final Map<DN, List<ReferentialIntegrityDeleteListener>> deleteListeners = new HashMap<>();
    /**
     * The name of the managed object which is the parent of the
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/BooleanPropertyDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -41,10 +42,8 @@
     * than the standard boolean string parser and supports common true/false
     * synonyms used in configuration.
     */
    private static final Map<String, Boolean> VALUE_MAP;
    private static final Map<String, Boolean> VALUE_MAP = new HashMap<>();
    static {
        VALUE_MAP = new HashMap<String, Boolean>();
        // We could have more possibilities but decided against in issue 1960.
        VALUE_MAP.put("false", Boolean.FALSE);
        VALUE_MAP.put("true", Boolean.TRUE);
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions copyright 2013 ForgeRock AS.
 *      Portions copyright 2013-2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -48,19 +48,15 @@
 */
public final class ClassPropertyDefinition extends PropertyDefinition<String> {
    /**
     * An interface for incrementally constructing class property definitions.
     */
    /** An interface for incrementally constructing class property definitions. */
    public static final class Builder extends AbstractBuilder<String, ClassPropertyDefinition> {
        /** List of interfaces which property values must implement. */
        private List<String> instanceOfInterfaces;
        private final List<String> instanceOfInterfaces = new LinkedList<>();
        /** Private constructor. */
        private Builder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
            super(d, propertyName);
            this.instanceOfInterfaces = new LinkedList<String>();
        }
        /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ConfigurationFramework.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions copyright 2012-2014 ForgeRock AS.
 *      Portions copyright 2012-2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -160,7 +160,7 @@
    }
    /** Set of registered Jar files. */
    private Set<File> jarFiles = new HashSet<File>();
    private Set<File> jarFiles = new HashSet<>();
    /**
     * Underlying class loader used to load classes and resources (null
@@ -205,7 +205,7 @@
        final File libPath = new File(instancePath, LIB_DIR);
        final File extensionsPath = new File(libPath, EXTENSIONS_DIR);
        final ArrayList<File> files = new ArrayList<File>(extensions.length);
        final ArrayList<File> files = new ArrayList<>(extensions.length);
        for (final String extension : extensions) {
            final File file = new File(extensionsPath, extension);
@@ -437,7 +437,7 @@
    public synchronized void reload() throws ConfigException {
        ensureInitialized();
        loader = null;
        jarFiles = new HashSet<File>();
        jarFiles = new HashSet<>();
        initialize0();
    }
@@ -459,7 +459,7 @@
    private void addExtension(final File... extensions) throws ConfigException {
        // First add the Jar files to the class loader.
        final List<JarFile> jars = new LinkedList<JarFile>();
        final List<JarFile> jars = new LinkedList<>();
        for (final File extension : extensions) {
            if (jarFiles.contains(extension)) {
                // Skip this file as it is already loaded.
@@ -713,8 +713,7 @@
     */
    private void loadDefinitionClasses(final InputStream is) throws ConfigException {
        final BufferedReader reader = new BufferedReader(new InputStreamReader(is));
        final List<AbstractManagedObjectDefinition<?, ?>> definitions =
                new LinkedList<AbstractManagedObjectDefinition<?, ?>>();
        final List<AbstractManagedObjectDefinition<?, ?>> definitions = new LinkedList<>();
        while (true) {
            String className;
            try {
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DefaultManagedObject.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -59,7 +60,7 @@
        private final ManagedObjectDefinition<C, S> definition;
        /** The string encoded default managed object's properties. */
        private final Map<String, List<String>> propertyStringValues = new HashMap<String, List<String>>();
        private final Map<String, List<String>> propertyStringValues = new HashMap<>();
        /**
         * Creates a new default managed object builder.
@@ -78,7 +79,7 @@
         * @return Returns the new default managed object.
         */
        public DefaultManagedObject<C, S> getInstance() {
            return new DefaultManagedObject<C, S>(definition, propertyStringValues);
            return new DefaultManagedObject<>(definition, propertyStringValues);
        }
        /**
@@ -142,7 +143,7 @@
        definition.getPropertyDefinition(pd.getName());
        // Do a defensive copy.
        SortedSet<T> values = new TreeSet<T>(pd);
        SortedSet<T> values = new TreeSet<>(pd);
        List<String> stringValues = propertyStringValues.get(pd.getName());
        if (stringValues != null) {
            for (String stringValue : stringValues) {
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DefinedDefaultBehaviorProvider.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -71,7 +72,7 @@
     *         default values.
     */
    public Collection<String> getDefaultValues() {
        return new ArrayList<String>(values);
        return new ArrayList<>(values);
    }
}
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationUnit.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -54,9 +55,8 @@
    WEEKS(7 * 24 * 60 * 60 * 1000, "w", "weeks");
    /** A lookup table for resolving a unit from its name. */
    private static final Map<String, DurationUnit> NAME_TO_UNIT;
    private static final Map<String, DurationUnit> NAME_TO_UNIT = new HashMap<>();
    static {
        NAME_TO_UNIT = new HashMap<String, DurationUnit>();
        for (DurationUnit unit : DurationUnit.values()) {
            NAME_TO_UNIT.put(unit.shortName, unit);
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/EnumPropertyDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -85,7 +86,7 @@
                throw new IllegalStateException("Enumeration class undefined");
            }
            return new EnumPropertyDefinition<E>(d, propertyName, options, adminAction, defaultBehavior, enumClass);
            return new EnumPropertyDefinition<>(d, propertyName, options, adminAction, defaultBehavior, enumClass);
        }
    }
@@ -104,7 +105,7 @@
     */
    public static <E extends Enum<E>> Builder<E> createBuilder(AbstractManagedObjectDefinition<?, ?> d,
        String propertyName) {
        return new Builder<E>(d, propertyName);
        return new Builder<>(d, propertyName);
    }
    /** The enumeration class. */
@@ -121,7 +122,7 @@
        this.enumClass = enumClass;
        // Initialize the decoding map.
        this.decodeMap = new HashMap<String, E>();
        this.decodeMap = new HashMap<>();
        for (E value : EnumSet.<E> allOf(enumClass)) {
            String s = value.toString().trim().toLowerCase();
            this.decodeMap.put(s, value);
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/InstantiableRelationDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -75,7 +76,7 @@
         * instantiable relation definition.
         */
        private final Map<String, DefaultManagedObject<? extends C, ? extends S>> defaultManagedObjects =
            new HashMap<String, DefaultManagedObject<? extends C, ? extends S>>();
            new HashMap<>();
        /**
         * Creates a new builder which can be used to incrementally build an
@@ -126,7 +127,7 @@
        /** {@inheritDoc} */
        @Override
        protected InstantiableRelationDefinition<C, S> buildInstance(Common<C, S> common) {
            return new InstantiableRelationDefinition<C, S>(common, pluralName, namingPropertyDefinition,
            return new InstantiableRelationDefinition<>(common, pluralName, namingPropertyDefinition,
                defaultManagedObjects);
        }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ManagedObjectDefinitionResource.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.config;
@@ -46,7 +46,7 @@
public final class ManagedObjectDefinitionResource {
    /** Mapping from definition to property tables. */
    private final Map<AbstractManagedObjectDefinition<?, ?>, Properties> properties;
    private final Map<AbstractManagedObjectDefinition<?, ?>, Properties> properties = new HashMap<>();
    /** The resource name prefix. */
    private final String prefix;
@@ -64,7 +64,6 @@
    /** Private constructor. */
    private ManagedObjectDefinitionResource(String prefix) {
        this.properties = new HashMap<AbstractManagedObjectDefinition<?, ?>, Properties>();
        this.prefix = prefix;
    }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ManagedObjectPath.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.forgerock.opendj.config;
@@ -244,7 +244,7 @@
        private static <C extends ConfigurationClient, S extends Configuration> InstantiableElement<C, S> create(
            InstantiableRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d,
            String name) {
            return new InstantiableElement<C, S>(r, d, name);
            return new InstantiableElement<>(r, d, name);
        }
        /** The name of the managed object. */
@@ -289,7 +289,7 @@
        /** Factory method. */
        private static <C extends ConfigurationClient, S extends Configuration> OptionalElement<C, S> create(
            OptionalRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d) {
            return new OptionalElement<C, S>(r, d);
            return new OptionalElement<>(r, d);
        }
        /** The optional relation. */
@@ -324,7 +324,7 @@
        /** Factory method. */
        private static <C extends ConfigurationClient, S extends Configuration> SetElement<C, S> create(
            SetRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d) {
            return new SetElement<C, S>(r, d);
            return new SetElement<>(r, d);
        }
        /** The set relation. */
@@ -358,7 +358,7 @@
        /** Factory method. */
        private static <C extends ConfigurationClient, S extends Configuration> SingletonElement<C, S> create(
            SingletonRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d) {
            return new SingletonElement<C, S>(r, d);
            return new SingletonElement<>(r, d);
        }
        /** The singleton relation. */
@@ -443,8 +443,7 @@
    /** Single instance of a root path. */
    private static final ManagedObjectPath<RootCfgClient, RootCfg> EMPTY_PATH =
        new ManagedObjectPath<RootCfgClient, RootCfg>(new LinkedList<Element<?, ?>>(), null,
            RootCfgDefn.getInstance());
        new ManagedObjectPath<>(new LinkedList<Element<?, ?>>(), null, RootCfgDefn.getInstance());
    /** A regular expression used to parse path elements. */
    private static final Pattern PE_REGEXP = Pattern.compile("^\\s*relation=\\s*([^+]+)\\s*"
@@ -479,7 +478,7 @@
        }
        // Parse the elements.
        LinkedList<Element<?, ?>> elements = new LinkedList<Element<?, ?>>();
        LinkedList<Element<?, ?>> elements = new LinkedList<>();
        Element<?, ?> lastElement = null;
        AbstractManagedObjectDefinition<?, ?> definition = RootCfgDefn.getInstance();
@@ -560,7 +559,7 @@
     */
    private static <C extends ConfigurationClient, S extends Configuration> ManagedObjectPath<C, S> create(
        LinkedList<Element<?, ?>> elements, Element<C, S> lastElement) {
        return new ManagedObjectPath<C, S>(elements, lastElement.getRelationDefinition(),
        return new ManagedObjectPath<>(elements, lastElement.getRelationDefinition(),
            lastElement.getManagedObjectDefinition());
    }
@@ -715,9 +714,9 @@
        if (name.trim().length() == 0) {
            throw new IllegalArgumentException("Empty or blank managed object names are not allowed");
        }
        LinkedList<Element<?, ?>> celements = new LinkedList<Element<?, ?>>(elements);
        LinkedList<Element<?, ?>> celements = new LinkedList<>(elements);
        celements.add(new InstantiableElement<M, N>(r, d, name));
        return new ManagedObjectPath<M, N>(celements, r, d);
        return new ManagedObjectPath<>(celements, r, d);
    }
    /**
@@ -764,9 +763,9 @@
     */
    public <M extends ConfigurationClient, N extends Configuration> ManagedObjectPath<M, N> child(
        OptionalRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d) {
        LinkedList<Element<?, ?>> celements = new LinkedList<Element<?, ?>>(elements);
        LinkedList<Element<?, ?>> celements = new LinkedList<>(elements);
        celements.add(new OptionalElement<M, N>(r, d));
        return new ManagedObjectPath<M, N>(celements, r, d);
        return new ManagedObjectPath<>(celements, r, d);
    }
    /**
@@ -809,9 +808,9 @@
     */
    public <M extends ConfigurationClient, N extends Configuration> ManagedObjectPath<M, N> child(
        SingletonRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d) {
        LinkedList<Element<?, ?>> celements = new LinkedList<Element<?, ?>>(elements);
        LinkedList<Element<?, ?>> celements = new LinkedList<>(elements);
        celements.add(new SingletonElement<M, N>(r, d));
        return new ManagedObjectPath<M, N>(celements, r, d);
        return new ManagedObjectPath<>(celements, r, d);
    }
    /**
@@ -856,9 +855,9 @@
     */
    public <M extends ConfigurationClient, N extends Configuration> ManagedObjectPath<M, N> child(
        SetRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d) {
        LinkedList<Element<?, ?>> celements = new LinkedList<Element<?, ?>>(elements);
        LinkedList<Element<?, ?>> celements = new LinkedList<>(elements);
        celements.add(new SetElement<M, N>(r, d));
        return new ManagedObjectPath<M, N>(celements, r, d);
        return new ManagedObjectPath<>(celements, r, d);
    }
    /**
@@ -1048,8 +1047,7 @@
            return emptyPath();
        }
        LinkedList<Element<?, ?>> celements =
            new LinkedList<Element<?, ?>>(elements.subList(0, elements.size() - offset));
        LinkedList<Element<?, ?>> celements = new LinkedList<>(elements.subList(0, elements.size() - offset));
        return create(celements, celements.getLast());
    }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/OptionalRelationDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -93,9 +94,8 @@
        /** {@inheritDoc} */
        @Override
        protected OptionalRelationDefinition<C, S> buildInstance(Common<C, S> common) {
            return new OptionalRelationDefinition<C, S>(common, defaultManagedObject);
            return new OptionalRelationDefinition<>(common, defaultManagedObject);
        }
    }
    /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/PropertyDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -89,7 +90,7 @@
            this.propertyName = propertyName;
            this.options = EnumSet.noneOf(PropertyOption.class);
            this.adminAction = new AdministratorAction(AdministratorAction.Type.NONE, d, propertyName);
            this.defaultBehavior = new UndefinedDefaultBehaviorProvider<T>();
            this.defaultBehavior = new UndefinedDefaultBehaviorProvider<>();
        }
        /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/PropertyDefinitionUsageBuilder.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions copyright 2014 ForgeRock AS.
 *      Portions copyright 2014-2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -155,7 +155,7 @@
                    return LocalizableMessage.raw(name.substring(i + 1).toUpperCase());
                }
            } else {
                Set<String> values = new TreeSet<String>();
                Set<String> values = new TreeSet<>();
                for (Object value : EnumSet.allOf(d.getEnumClass())) {
                    values.add(value.toString().trim().toLowerCase());
                }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/Reference.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -90,7 +91,7 @@
            throw new IllegalArgumentException("Unabled to decode the DN string: \"" + dnAsString + "\"");
        }
        return new Reference<C, S>(path, relationDef, name);
        return new Reference<>(path, relationDef, name);
    }
    /**
@@ -129,7 +130,7 @@
            throw new IllegalArgumentException("Empty names are not allowed");
        }
        return new Reference<C, S>(p, rd, s);
        return new Reference<>(p, rd, s);
    }
    /** The name of the referenced managed object. */
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/RelationDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -110,7 +111,7 @@
         */
        protected AbstractBuilder(AbstractManagedObjectDefinition<?, ?> pd, String name,
            AbstractManagedObjectDefinition<C, S> cd) {
            this.common = new Common<C, S>(pd, name, cd);
            this.common = new Common<>(pd, name, cd);
        }
        /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SetRelationDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -70,7 +71,7 @@
         * set relation definition.
         */
        private final Map<String, DefaultManagedObject<? extends C, ? extends S>> defaultManagedObjects =
            new HashMap<String, DefaultManagedObject<? extends C, ? extends S>>();
            new HashMap<>();
        /**
         * Creates a new builder which can be used to incrementally build a set
@@ -105,7 +106,7 @@
        /** {@inheritDoc} */
        @Override
        protected SetRelationDefinition<C, S> buildInstance(Common<C, S> common) {
            return new SetRelationDefinition<C, S>(common, pluralName, defaultManagedObjects);
            return new SetRelationDefinition<>(common, pluralName, defaultManagedObjects);
        }
    }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SingletonRelationDefinition.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -93,9 +94,8 @@
        /** {@inheritDoc} */
        @Override
        protected SingletonRelationDefinition<C, S> buildInstance(Common<C, S> common) {
            return new SingletonRelationDefinition<C, S>(common, defaultManagedObject);
            return new SingletonRelationDefinition<>(common, defaultManagedObject);
        }
    }
    /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SizeUnit.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -63,10 +64,8 @@
    TERA_BYTES(1000L * 1000 * 1000 * 1000, "tb", "terabytes");
    /** A lookup table for resolving a unit from its name. */
    private static final Map<String, SizeUnit> NAME_TO_UNIT;
    private static final Map<String, SizeUnit> NAME_TO_UNIT = new HashMap<>();
    static {
        NAME_TO_UNIT = new HashMap<String, SizeUnit>();
        for (SizeUnit unit : SizeUnit.values()) {
            NAME_TO_UNIT.put(unit.shortName, unit);
            NAME_TO_UNIT.put(unit.longName, unit);
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/Tag.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -45,7 +46,7 @@
public final class Tag implements Comparable<Tag> {
    /** All the tags. */
    private static final Map<String, Tag> TAGS = new HashMap<String, Tag>();
    private static final Map<String, Tag> TAGS = new HashMap<>();
    /**
     * Defines a new tag with the specified name.
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/MissingMandatoryPropertiesException.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.client;
@@ -75,16 +76,10 @@
    /** The causes of this exception. */
    private final Collection<PropertyException> causes;
    /**
     * Indicates whether the exception occurred during managed object
     * creation.
     */
    /** Indicates whether the exception occurred during managed object creation. */
    private final boolean isCreate;
    /**
     * The user friendly name of the component that caused this
     * exception.
     */
    /** The user friendly name of the component that caused this exception. */
    private final LocalizableMessage ufn;
    /**
@@ -105,7 +100,7 @@
        Collection<PropertyException> causes, boolean isCreate) {
        super(createMessage(causes));
        this.causes = new ArrayList<PropertyException>(causes);
        this.causes = new ArrayList<>(causes);
        this.ufn = ufn;
        this.isCreate = isCreate;
    }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/OperationRejectedException.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.client;
@@ -111,10 +112,7 @@
    /** The type of operation that caused this exception. */
    private final OperationType type;
    /**
     * The user friendly name of the component that caused this
     * exception.
     */
    /** The user friendly name of the component that caused this exception. */
    private final LocalizableMessage ufn;
    /**
@@ -146,7 +144,7 @@
        Collection<LocalizableMessage> messages) {
        super(getDefaultMessage(messages));
        this.messages = new ArrayList<LocalizableMessage>(messages);
        this.messages = new ArrayList<>(messages);
        this.type = type;
        this.ufn = ufn;
    }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/DNBuilder.java
@@ -21,7 +21,7 @@
 * CDDL HEADER END
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions copyright 2014 ForgeRock AS.
 *      Portions copyright 2014-2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.client.ldap;
@@ -108,7 +108,7 @@
    }
    /** The list of RDNs in big-endian order. */
    private final LinkedList<RDN> rdns;
    private final LinkedList<RDN> rdns = new LinkedList<>();
    private final LDAPProfile profile;
@@ -119,7 +119,6 @@
     *            The LDAP profile which should be used to construct DNs.
     */
    private DNBuilder(LDAPProfile profile) {
        this.rdns = new LinkedList<RDN>();
        this.profile = profile;
    }
@@ -158,7 +157,7 @@
     * @return rdns in big endian order
     */
    private List<RDN> getRdnsInBigEndianOrder(DN dn) {
        List<RDN> rdnsOfDn = new ArrayList<RDN>();
        List<RDN> rdnsOfDn = new ArrayList<>();
        for (RDN rdn : dn) {
            rdnsOfDn.add(rdn);
        }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPDriver.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.config.client.ldap;
@@ -181,16 +181,15 @@
            AbstractManagedObjectDefinition<C, S> d = path.getManagedObjectDefinition();
            ManagedObjectDefinition<? extends C, ? extends S> mod = getEntryDefinition(d, dn);
            ArrayList<String> attrIds = new ArrayList<String>();
            ArrayList<String> attrIds = new ArrayList<>();
            for (PropertyDefinition<?> pd : mod.getAllPropertyDefinitions()) {
                String attrId = profile.getAttributeName(mod, pd);
                attrIds.add(attrId);
                attrIds.add(profile.getAttributeName(mod, pd));
            }
            SearchResultEntry searchResultEntry =
                    connection.readEntry(dn, attrIds.toArray(new String[0]));
            // Build the managed object's properties.
            List<PropertyException> exceptions = new LinkedList<PropertyException>();
            List<PropertyException> exceptions = new LinkedList<>();
            PropertySet newProperties = new PropertySet();
            for (PropertyDefinition<?> pd : mod.getAllPropertyDefinitions()) {
                String attrID = profile.getAttributeName(mod, pd);
@@ -252,7 +251,7 @@
            Attribute attribute = resultEntry.getAttribute(attrID);
            // Decode the values.
            SortedSet<P> values = new TreeSet<P>(propertyDef);
            SortedSet<P> values = new TreeSet<>(propertyDef);
            if (attribute != null) {
                for (ByteString byteValue : attribute) {
                    P value = ValueDecoder.decode(propertyDef, byteValue);
@@ -286,7 +285,7 @@
    /** {@inheritDoc} */
    @Override
    public ManagedObject<RootCfgClient> getRootConfigurationManagedObject() {
        return new LDAPManagedObject<RootCfgClient>(this, RootCfgDefn.getInstance(), ManagedObjectPath.emptyPath(),
        return new LDAPManagedObject<>(this, RootCfgDefn.getInstance(), ManagedObjectPath.emptyPath(),
            new PropertySet(), true, null);
    }
@@ -308,7 +307,7 @@
        // Retrieve only those entries which are sub-types of the
        // specified definition.
        Filter filter = Filter.equality("objectClass", profile.getObjectClass(d));
        List<String> children = new ArrayList<String>();
        List<String> children = new ArrayList<>();
        try {
            for (DN child : listEntries(dn, filter)) {
                children.add(child.rdn().getFirstAVA().getAttributeValue().toString());
@@ -322,6 +321,7 @@
                throw e;
            }
        }
        return children.toArray(new String[children.size()]);
    }
@@ -343,7 +343,7 @@
        // Retrieve only those entries which are sub-types of the
        // specified definition.
        Filter filter = Filter.equality("objectClass", profile.getObjectClass(d));
        List<String> children = new ArrayList<String>();
        List<String> children = new ArrayList<>();
        try {
            for (DN child : listEntries(dn, filter)) {
                children.add(child.rdn().getFirstAVA().getAttributeValue().toString());
@@ -450,7 +450,7 @@
            InstantiableRelationDefinition<?, ?> ird = (InstantiableRelationDefinition<?, ?>) rd;
            pd = ird.getNamingPropertyDefinition();
        }
        return new LDAPManagedObject<M>(this, d, p.asSubType(d), properties, true, pd);
        return new LDAPManagedObject<>(this, d, p.asSubType(d), properties, true, pd);
    }
    /** Create a property using the provided string values. */
@@ -459,7 +459,7 @@
        PropertyException exception = null;
        // Get the property's active values.
        SortedSet<P> activeValues = new TreeSet<P>(propertyDef);
        SortedSet<P> activeValues = new TreeSet<>(propertyDef);
        if (attribute != null) {
            for (ByteString byteValue : attribute) {
                P value = ValueDecoder.decode(propertyDef, byteValue);
@@ -513,7 +513,7 @@
            throw new DefinitionDecodingException(d, Reason.NO_TYPE_INFORMATION);
        }
        final Set<String> objectClasses = new HashSet<String>();
        final Set<String> objectClasses = new HashSet<>();
        for (ByteString byteValue : objectClassAttr) {
            objectClasses.add(byteValue.toString().toLowerCase().trim());
        }
@@ -550,7 +550,7 @@
    }
    private Collection<DN> listEntries(DN dn, Filter filter) throws LdapException {
        List<DN> names = new LinkedList<DN>();
        List<DN> names = new LinkedList<>();
        ConnectionEntryReader reader =
                connection.search(dn.toString(), SearchScope.SINGLE_LEVEL, filter.toString());
        try {
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPManagedObject.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.forgerock.opendj.config.client.ldap;
@@ -280,7 +280,7 @@
    protected <M extends ConfigurationClient> ManagedObject<M> newInstance(ManagedObjectDefinition<M, ?> d,
            ManagedObjectPath<M, ?> path, PropertySet properties, boolean existsOnServer,
            PropertyDefinition<?> namingPropertyDefinition) {
        return new LDAPManagedObject<M>(driver, d, path, properties, existsOnServer, namingPropertyDefinition);
        return new LDAPManagedObject<>(driver, d, path, properties, existsOnServer, namingPropertyDefinition);
    }
    /** Encode a property into LDAP string values. */
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/AbstractManagedObject.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.forgerock.opendj.config.client.spi;
@@ -249,7 +249,7 @@
    public final void commit() throws ManagedObjectAlreadyExistsException, MissingMandatoryPropertiesException,
        ConcurrentModificationException, OperationRejectedException, LdapException {
        // First make sure all mandatory properties are defined.
        List<PropertyException> exceptions = new LinkedList<PropertyException>();
        List<PropertyException> exceptions = new LinkedList<>();
        for (PropertyDefinition<?> pd : definition.getAllPropertyDefinitions()) {
            Property<?> p = getProperty(pd);
@@ -264,7 +264,7 @@
        }
        // Now enforce any constraints.
        List<LocalizableMessage> messages = new LinkedList<LocalizableMessage>();
        List<LocalizableMessage> messages = new LinkedList<>();
        boolean isAcceptable = true;
        ManagementContext context = getDriver().getManagementContext();
@@ -442,24 +442,23 @@
    /** {@inheritDoc} */
    @Override
    public final <P> SortedSet<P> getPropertyDefaultValues(PropertyDefinition<P> pd) {
        return new TreeSet<P>(getProperty(pd).getDefaultValues());
        return new TreeSet<>(getProperty(pd).getDefaultValues());
    }
    /** {@inheritDoc} */
    @Override
    public final <P> P getPropertyValue(PropertyDefinition<P> pd) {
        Set<P> values = getProperty(pd).getEffectiveValues();
        if (values.isEmpty()) {
            return null;
        } else {
        if (!values.isEmpty()) {
            return values.iterator().next();
        }
        return null;
    }
    /** {@inheritDoc} */
    @Override
    public final <P> SortedSet<P> getPropertyValues(PropertyDefinition<P> pd) {
        return new TreeSet<P>(getProperty(pd).getEffectiveValues());
        return new TreeSet<>(getProperty(pd).getEffectiveValues());
    }
    /** {@inheritDoc} */
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/PropertySet.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.client.spi;
@@ -77,21 +78,18 @@
        public MyProperty(PropertyDefinition<T> pd, Collection<T> defaultValues, Collection<T> activeValues) {
            this.d = pd;
            SortedSet<T> sortedDefaultValues = new TreeSet<T>(pd);
            SortedSet<T> sortedDefaultValues = new TreeSet<>(pd);
            sortedDefaultValues.addAll(defaultValues);
            this.defaultValues = Collections.unmodifiableSortedSet(sortedDefaultValues);
            this.activeValues = new TreeSet<T>(pd);
            this.activeValues = new TreeSet<>(pd);
            this.activeValues.addAll(activeValues);
            // Initially the pending values is the same as the active
            // values.
            this.pendingValues = new TreeSet<T>(this.activeValues);
            // Initially the pending values is the same as the active values.
            this.pendingValues = new TreeSet<>(this.activeValues);
        }
        /**
         * Makes the pending values active.
         */
        /** Makes the pending values active. */
        public void commit() {
            activeValues.clear();
            activeValues.addAll(pendingValues);
@@ -171,13 +169,10 @@
    }
    /** The properties. */
    private final Map<PropertyDefinition<?>, MyProperty<?>> properties;
    private final Map<PropertyDefinition<?>, MyProperty<?>> properties = new HashMap<>();
    /**
     * Creates a new empty property set.
     */
    /** Creates a new empty property set. */
    public PropertySet() {
        this.properties = new HashMap<PropertyDefinition<?>, MyProperty<?>>();
    }
    /**
@@ -194,7 +189,7 @@
     *            The set of active values for the property.
     */
    public <T> void addProperty(PropertyDefinition<T> pd, Collection<T> defaultValues, Collection<T> activeValues) {
        MyProperty<T> p = new MyProperty<T>(pd, defaultValues, activeValues);
        MyProperty<T> p = new MyProperty<>(pd, defaultValues, activeValues);
        properties.put(pd, p);
    }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/conditions/ContainsCondition.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.config.conditions;
@@ -140,7 +140,7 @@
    /** Creates the new private implementation. */
    private <T> void buildImpl(PropertyDefinition<T> pd) {
        T value = pd.decodeValue(propertyStringValue);
        this.impl = new Impl<T>(pd, value);
        this.impl = new Impl<>(pd, value);
    }
    /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/CLIProfile.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.config.dsconfig;
@@ -74,7 +74,7 @@
        if (s.trim().length() == 0) {
            return Collections.emptySet();
        }
        return new LinkedHashSet<String>(Arrays.asList(s.split(",")));
        return new LinkedHashSet<>(Arrays.asList(s.split(",")));
    }
    /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java
@@ -162,16 +162,16 @@
                                  AbstractManagedObjectDefinition<?, ?> defn) {
            final LocalizableMessage placeholder = a.getValuePlaceholder();
            Map<String, Object> map = new HashMap<String, Object>();
            Map<String, Object> map = new HashMap<>();
            final LocalizableMessage name = defn.getUserFriendlyName();
            map.put("dependencies", REF_DSCFG_SUBTYPE_DEPENDENCIES.get(name, name, placeholder));
            map.put("typesIntro", REF_DSCFG_SUBTYPE_TYPES_INTRO.get(name));
            List<Map<String, Object>> children = new LinkedList<Map<String, Object>>();
            List<Map<String, Object>> children = new LinkedList<>();
            for (AbstractManagedObjectDefinition<?, ?> childDefn : getLeafChildren(defn)) {
                Map<String, Object> child = new HashMap<String, Object>();
                Map<String, Object> child = new HashMap<>();
                child.put("name", childDefn.getName());
                child.put("default", REF_DSCFG_CHILD_DEFAULT.get(placeholder, childDefn.getUserFriendlyName()));
@@ -205,10 +205,9 @@
            StringBuilder sb = new StringBuilder();
            for (AbstractManagedObjectDefinition<?, ?> childDefn : getLeafChildren(defn)) {
                final List<PropertyDefinition<?>> props =
                    new ArrayList<PropertyDefinition<?>>(childDefn.getAllPropertyDefinitions());
                final List<PropertyDefinition<?>> props = new ArrayList<>(childDefn.getAllPropertyDefinitions());
                Collections.sort(props);
                Map<String, Object> map = new HashMap<String, Object>();
                Map<String, Object> map = new HashMap<>();
                final String propPrefix = getScriptName() + "-" + sc.getName() + "-" + childDefn.getName();
                map.put("id", propPrefix);
                map.put("title", childDefn.getUserFriendlyName());
@@ -230,8 +229,7 @@
        private List<AbstractManagedObjectDefinition<?, ?>> getLeafChildren(
                AbstractManagedObjectDefinition<?, ?> defn) {
            final ArrayList<AbstractManagedObjectDefinition<?, ?>> results =
                    new ArrayList<AbstractManagedObjectDefinition<?, ?>>();
            final ArrayList<AbstractManagedObjectDefinition<?, ?>> results = new ArrayList<>();
            addIfLeaf(results, defn);
            Collections.sort(results, new Comparator<AbstractManagedObjectDefinition<?, ?>>() {
                @Override
@@ -270,11 +268,11 @@
        private String toVariableList(List<PropertyDefinition<?>> props, AbstractManagedObjectDefinition<?, ?> defn) {
            StringBuilder b = new StringBuilder();
            Map<String, Object> map = new HashMap<String, Object>();
            Map<String, Object> map = new HashMap<>();
            List<Map<String, Object>> properties = new LinkedList<Map<String, Object>>();
            List<Map<String, Object>> properties = new LinkedList<>();
            for (PropertyDefinition<?> prop : props) {
                Map<String, Object> property = new HashMap<String, Object>();
                Map<String, Object> property = new HashMap<>();
                property.put("term", prop.getName());
                property.put("descTitle", REF_TITLE_DESCRIPTION.get());
                property.put("description", getDescriptionString(prop));
@@ -300,7 +298,7 @@
        }
        private StringBuilder appendVarListEntry(StringBuilder b, String term, Object definition) {
            Map<String, Object> map = new HashMap<String, Object>();
            Map<String, Object> map = new HashMap<>();
            map.put("term", term);
            map.put("definition", definition);
            applyTemplate(b, "dscfgVarListEntry.ftl", map);
@@ -646,7 +644,7 @@
                userFriendlyPluralName = sr.getUserFriendlyPluralName();
            }
            final MenuBuilder<Integer> builder = new MenuBuilder<Integer>(app);
            final MenuBuilder<Integer> builder = new MenuBuilder<>(app);
            builder.setTitle(INFO_DSCFG_HEADING_COMPONENT_MENU_TITLE.get(userFriendlyName));
            builder.setPrompt(INFO_DSCFG_HEADING_COMPONENT_MENU_PROMPT.get());
@@ -803,7 +801,7 @@
    private SubCommandHandlerFactory handlerFactory;
    /** Mapping of sub-commands to their implementations. */
    private final Map<SubCommand, SubCommandHandler> handlers = new HashMap<SubCommand, SubCommandHandler>();
    private final Map<SubCommand, SubCommandHandler> handlers = new HashMap<>();
    /** Indicates whether or not a sub-command was provided. */
    private boolean hasSubCommand = true;
@@ -1013,8 +1011,8 @@
                }
            };
            Map<Tag, SortedSet<SubCommand>> groups = new TreeMap<Tag, SortedSet<SubCommand>>();
            SortedSet<SubCommand> allSubCommands = new TreeSet<SubCommand>(c);
            Map<Tag, SortedSet<SubCommand>> groups = new TreeMap<>();
            SortedSet<SubCommand> allSubCommands = new TreeSet<>(c);
            for (SubCommandHandler handler : handlerFactory.getAllSubCommandHandlers()) {
                SubCommand sc = handler.getSubCommand();
@@ -1025,7 +1023,7 @@
                for (Tag tag : handler.getTags()) {
                    SortedSet<SubCommand> group = groups.get(tag);
                    if (group == null) {
                        group = new TreeSet<SubCommand>(c);
                        group = new TreeSet<>(c);
                        groups.put(tag, group);
                    }
                    group.add(sc);
@@ -1187,18 +1185,13 @@
            }
        };
        final Set<RelationDefinition<?, ?>> relations = new TreeSet<RelationDefinition<?, ?>>(c);
        final Set<RelationDefinition<?, ?>> relations = new TreeSet<>(c);
        final Map<RelationDefinition<?, ?>, CreateSubCommandHandler<?, ?>> createHandlers
            = new HashMap<RelationDefinition<?, ?>, CreateSubCommandHandler<?, ?>>();
        final Map<RelationDefinition<?, ?>, DeleteSubCommandHandler> deleteHandlers
            = new HashMap<RelationDefinition<?, ?>, DeleteSubCommandHandler>();
        final Map<RelationDefinition<?, ?>, ListSubCommandHandler> listHandlers
            = new HashMap<RelationDefinition<?, ?>, ListSubCommandHandler>();
        final Map<RelationDefinition<?, ?>, GetPropSubCommandHandler> getPropHandlers
            = new HashMap<RelationDefinition<?, ?>, GetPropSubCommandHandler>();
        final Map<RelationDefinition<?, ?>, SetPropSubCommandHandler> setPropHandlers
            = new HashMap<RelationDefinition<?, ?>, SetPropSubCommandHandler>();
        final Map<RelationDefinition<?, ?>, CreateSubCommandHandler<?, ?>> createHandlers = new HashMap<>();
        final Map<RelationDefinition<?, ?>, DeleteSubCommandHandler> deleteHandlers = new HashMap<>();
        final Map<RelationDefinition<?, ?>, ListSubCommandHandler> listHandlers = new HashMap<>();
        final Map<RelationDefinition<?, ?>, GetPropSubCommandHandler> getPropHandlers = new HashMap<>();
        final Map<RelationDefinition<?, ?>, SetPropSubCommandHandler> setPropHandlers = new HashMap<>();
        for (final CreateSubCommandHandler<?, ?> ch : handlerFactory.getCreateSubCommandHandlers()) {
            relations.add(ch.getRelationDefinition());
@@ -1226,7 +1219,7 @@
        }
        // Main menu.
        final MenuBuilder<Integer> builder = new MenuBuilder<Integer>(app);
        final MenuBuilder<Integer> builder = new MenuBuilder<>(app);
        builder.setTitle(INFO_DSCFG_HEADING_MAIN_MENU_TITLE.get());
        builder.setPrompt(INFO_DSCFG_HEADING_MAIN_MENU_PROMPT.get());
@@ -1483,7 +1476,7 @@
    private String[] buildCommandArgs(List<String> initialArgs, String batchCommand) {
        final String[] commandArgs = toCommandArgs(batchCommand);
        final int length = commandArgs.length + initialArgs.size();
        final List<String> allArguments = new ArrayList<String>(length);
        final List<String> allArguments = new ArrayList<>(length);
        Collections.addAll(allArguments, commandArgs);
        allArguments.addAll(initialArgs);
        return allArguments.toArray(new String[length]);
@@ -1500,7 +1493,7 @@
    private List<String> removeBatchArgs(String[] args) {
        // Build a list of initial arguments,
        // removing the batch file option + its value
        final List<String> initialArgs = new ArrayList<String>();
        final List<String> initialArgs = new ArrayList<>();
        Collections.addAll(initialArgs, args);
        for (Iterator<String> it = initialArgs.iterator(); it.hasNext();) {
            final String elem = it.next();
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/GetPropSubCommandHandler.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.config.dsconfig;
@@ -257,7 +257,7 @@
        if (propertyNames.isEmpty()) {
            pdList = d.getAllPropertyDefinitions();
        } else {
            pdList = new LinkedList<PropertyDefinition<?>>();
            pdList = new LinkedList<>();
            for (String name : propertyNames) {
                try {
                    pdList.add(d.getPropertyDefinition(name));
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/ListSubCommandHandler.java
@@ -21,7 +21,7 @@
 * CDDL HEADER END
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2012-2014 ForgeRock AS.
 *      Portions Copyright 2012-2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.dsconfig;
@@ -247,7 +247,7 @@
        }
        ManagedObject<?> parent = result.getValue();
        SortedMap<String, ManagedObject<?>> children = new TreeMap<String, ManagedObject<?>>();
        SortedMap<String, ManagedObject<?>> children = new TreeMap<>();
        if (relation instanceof InstantiableRelationDefinition) {
            InstantiableRelationDefinition<?, ?> irelation = (InstantiableRelationDefinition<?, ?>) relation;
            try {
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/PropertyEditorModification.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.config.dsconfig;
@@ -57,8 +57,8 @@
    private PropertyDefinition<T> propertyDefinition;
    private Type type;
    private SortedSet<T> values;
    private SortedSet<T> originalValues;
    private final SortedSet<T> values;
    private final SortedSet<T> originalValues;
    /**
     * The private constructor of the PropertyEditorModification.
@@ -76,8 +76,8 @@
            SortedSet<T> originalValues) {
        this.propertyDefinition = propertyDefinition;
        this.type = type;
        this.values = new TreeSet<T>(values);
        this.originalValues = new TreeSet<T>(originalValues);
        this.values = new TreeSet<>(values);
        this.originalValues = new TreeSet<>(originalValues);
    }
    /**
@@ -93,7 +93,7 @@
     */
    static <T> PropertyEditorModification<T> createResetModification(PropertyDefinition<T> propertyDefinition,
            SortedSet<T> originalValues) {
        return new PropertyEditorModification<T>(propertyDefinition, Type.RESET, new TreeSet<T>(propertyDefinition),
        return new PropertyEditorModification<>(propertyDefinition, Type.RESET, new TreeSet<T>(propertyDefinition),
                originalValues);
    }
@@ -112,7 +112,7 @@
     */
    static <T> PropertyEditorModification<T> createAddModification(PropertyDefinition<T> propertyDefinition,
            SortedSet<T> addedValues, SortedSet<T> originalValues) {
        return new PropertyEditorModification<T>(propertyDefinition, Type.ADD, addedValues, originalValues);
        return new PropertyEditorModification<>(propertyDefinition, Type.ADD, addedValues, originalValues);
    }
    /**
@@ -130,7 +130,7 @@
     */
    static <T> PropertyEditorModification<T> createSetModification(PropertyDefinition<T> propertyDefinition,
            SortedSet<T> newValues, SortedSet<T> originalValues) {
        return new PropertyEditorModification<T>(propertyDefinition, Type.SET, newValues, originalValues);
        return new PropertyEditorModification<>(propertyDefinition, Type.SET, newValues, originalValues);
    }
    /**
@@ -148,11 +148,11 @@
     */
    static <T> PropertyEditorModification<T> createRemoveModification(PropertyDefinition<T> propertyDefinition,
            SortedSet<T> removedValues, SortedSet<T> originalValues) {
        return new PropertyEditorModification<T>(propertyDefinition, Type.REMOVE, removedValues, originalValues);
        return new PropertyEditorModification<>(propertyDefinition, Type.REMOVE, removedValues, originalValues);
    }
    /**
     * Retuns the property definition associated with this modification.
     * Returns the property definition associated with this modification.
     *
     * @return the property definition associated with this modification.
     */
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/PropertyValueEditor.java
@@ -233,21 +233,21 @@
                        PropertyDefinition<?> pd2 = mod.getPropertyDefinition(propertyName);
                        DefaultBehaviorQuery<?> query = query(pd2);
                        return new DefaultBehaviorQuery<T>(Type.INHERITED, query.getAliasDescription());
                        return new DefaultBehaviorQuery<>(Type.INHERITED, query.getAliasDescription());
                    }
                    /** {@inheritDoc} */
                    @Override
                    public DefaultBehaviorQuery<T> visitAlias(AliasDefaultBehaviorProvider<T> d,
                            PropertyDefinition<T> p) {
                        return new DefaultBehaviorQuery<T>(Type.ALIAS, d.getSynopsis());
                        return new DefaultBehaviorQuery<>(Type.ALIAS, d.getSynopsis());
                    }
                    /** {@inheritDoc} */
                    @Override
                    public DefaultBehaviorQuery<T> visitDefined(DefinedDefaultBehaviorProvider<T> d,
                            PropertyDefinition<T> p) {
                        return new DefaultBehaviorQuery<T>(Type.DEFINED, null);
                        return new DefaultBehaviorQuery<>(Type.DEFINED, null);
                    }
                    /** {@inheritDoc} */
@@ -259,14 +259,14 @@
                        PropertyDefinition<?> pd2 = mod.getPropertyDefinition(propertyName);
                        DefaultBehaviorQuery<?> query = query(pd2);
                        return new DefaultBehaviorQuery<T>(Type.INHERITED, query.getAliasDescription());
                        return new DefaultBehaviorQuery<>(Type.INHERITED, query.getAliasDescription());
                    }
                    /** {@inheritDoc} */
                    @Override
                    public DefaultBehaviorQuery<T> visitUndefined(UndefinedDefaultBehaviorProvider<T> d,
                            PropertyDefinition<T> p) {
                        return new DefaultBehaviorQuery<T>(Type.UNDEFINED, null);
                        return new DefaultBehaviorQuery<>(Type.UNDEFINED, null);
                    }
                };
@@ -374,7 +374,7 @@
        @Override
        public <C extends ConfigurationClient, S extends Configuration> MenuResult<Void> visitAggregation(
                AggregationPropertyDefinition<C, S> d, Void p) {
            MenuBuilder<String> builder = new MenuBuilder<String>(app);
            MenuBuilder<String> builder = new MenuBuilder<>(app);
            builder.setMultipleColumnThreshold(MULTI_COLUMN_THRESHOLD);
            InstantiableRelationDefinition<C, S> rd = d.getRelationDefinition();
@@ -388,7 +388,7 @@
            }
            // Create a list of possible names.
            Set<String> values = new TreeSet<String>(d);
            Set<String> values = new TreeSet<>(d);
            ManagedObjectPath<?, ?> path = d.getParentPath();
            try {
                values.addAll(Arrays.asList(context.listManagedObjects(path, rd)));
@@ -408,7 +408,7 @@
                LocalizableMessage option = getPropertyValues(d, Collections.singleton(value));
                builder.addNumberedOption(option, MenuResult.success(value));
            }
            MenuCallback<String> callback = new CreateComponentCallback<C, S>(d);
            MenuCallback<String> callback = new CreateComponentCallback<>(d);
            builder.addNumberedOption(
                    INFO_EDITOR_OPTION_CREATE_A_NEW_COMPONENT.get(rd.getUserFriendlyName()), callback);
@@ -429,7 +429,7 @@
                    return MenuResult.cancel();
                } else {
                    Collection<String> newValues = result.getValues();
                    SortedSet<String> oldValues = new TreeSet<String>(mo.getPropertyValues(d));
                    SortedSet<String> oldValues = new TreeSet<>(mo.getPropertyValues(d));
                    mo.setPropertyValues(d, newValues);
                    isLastChoiceReset = false;
                    registerModification(d, new TreeSet<String>(newValues), oldValues);
@@ -444,7 +444,7 @@
        /** {@inheritDoc} */
        @Override
        public MenuResult<Void> visitBoolean(BooleanPropertyDefinition d, Void p) {
            MenuBuilder<Boolean> builder = new MenuBuilder<Boolean>(app);
            MenuBuilder<Boolean> builder = new MenuBuilder<>(app);
            builder.setPrompt(INFO_EDITOR_PROMPT_SELECT_VALUE_SINGLE.get(d.getName()));
@@ -468,7 +468,7 @@
                    return MenuResult.cancel();
                } else {
                    Collection<Boolean> newValues = result.getValues();
                    SortedSet<Boolean> oldValues = new TreeSet<Boolean>(mo.getPropertyValues(d));
                    SortedSet<Boolean> oldValues = new TreeSet<>(mo.getPropertyValues(d));
                    mo.setPropertyValues(d, newValues);
                    isLastChoiceReset = false;
                    registerModification(d, new TreeSet<Boolean>(newValues), oldValues);
@@ -483,7 +483,7 @@
        /** {@inheritDoc} */
        @Override
        public <E extends Enum<E>> MenuResult<Void> visitEnum(EnumPropertyDefinition<E> d, Void x) {
            MenuBuilder<E> builder = new MenuBuilder<E>(app);
            MenuBuilder<E> builder = new MenuBuilder<>(app);
            builder.setMultipleColumnThreshold(MULTI_COLUMN_THRESHOLD);
            if (d.hasOption(PropertyOption.MULTI_VALUED)) {
@@ -493,7 +493,7 @@
                builder.setPrompt(INFO_EDITOR_PROMPT_SELECT_VALUE_SINGLE.get(d.getName()));
            }
            Set<E> values = new TreeSet<E>(d);
            Set<E> values = new TreeSet<>(d);
            values.addAll(EnumSet.allOf(d.getEnumClass()));
            for (E value : values) {
                LocalizableMessage option = getPropertyValues(d, Collections.singleton(value));
@@ -517,7 +517,7 @@
                    return MenuResult.cancel();
                } else {
                    Collection<E> newValues = result.getValues();
                    SortedSet<E> oldValues = new TreeSet<E>(mo.getPropertyValues(d));
                    SortedSet<E> oldValues = new TreeSet<>(mo.getPropertyValues(d));
                    mo.setPropertyValues(d, newValues);
                    isLastChoiceReset = false;
                    registerModification(d, new TreeSet<E>(newValues), oldValues);
@@ -538,7 +538,7 @@
            // Set the new property value(s).
            try {
                SortedSet<T> values = readPropertyValues(app, mo.getManagedObjectDefinition(), d);
                SortedSet<T> oldValues = new TreeSet<T>(mo.getPropertyValues(d));
                SortedSet<T> oldValues = new TreeSet<>(mo.getPropertyValues(d));
                mo.setPropertyValues(d, values);
                isLastChoiceReset = false;
                registerModification(d, values, oldValues);
@@ -613,7 +613,7 @@
                }
                // Create a list of possible names.
                final Set<String> values = new TreeSet<String>(d);
                final Set<String> values = new TreeSet<>(d);
                ManagedObjectPath<?, ?> path = d.getParentPath();
                try {
                    values.addAll(Arrays.asList(context.listManagedObjects(path, rd)));
@@ -637,7 +637,7 @@
                        @Override
                        public MenuResult<Boolean> invoke(ConsoleApplication app) throws ClientException {
                            MenuBuilder<String> builder = new MenuBuilder<String>(app);
                            MenuBuilder<String> builder = new MenuBuilder<>(app);
                            builder.setPrompt(INFO_EDITOR_PROMPT_SELECT_COMPONENTS_ADD.get(ufpn));
                            builder.setAllowMultiSelect(true);
@@ -647,7 +647,7 @@
                                LocalizableMessage svalue = getPropertyValues(d, Collections.singleton(value));
                                builder.addNumberedOption(svalue, MenuResult.success(value));
                            }
                            MenuCallback<String> callback = new CreateComponentCallback<C, S>(d);
                            MenuCallback<String> callback = new CreateComponentCallback<>(d);
                            builder.addNumberedOption(
                                    INFO_EDITOR_OPTION_CREATE_A_NEW_COMPONENT.get(rd.getUserFriendlyName()), callback);
@@ -694,7 +694,7 @@
                    @Override
                    public MenuResult<Boolean> invoke(ConsoleApplication app) throws ClientException {
                        MenuBuilder<String> builder = new MenuBuilder<String>(app);
                        MenuBuilder<String> builder = new MenuBuilder<>(app);
                        builder.setPrompt(INFO_EDITOR_PROMPT_SELECT_COMPONENTS_REMOVE.get(ufpn));
                        builder.setAllowMultiSelect(true);
@@ -776,7 +776,7 @@
                        @Override
                        public MenuResult<Boolean> invoke(ConsoleApplication app) throws ClientException {
                            MenuBuilder<T> builder = new MenuBuilder<T>(app);
                            MenuBuilder<T> builder = new MenuBuilder<>(app);
                            builder.setPrompt(INFO_EDITOR_PROMPT_SELECT_VALUES_ADD.get());
                            builder.setAllowMultiSelect(true);
@@ -830,7 +830,7 @@
                    @Override
                    public MenuResult<Boolean> invoke(ConsoleApplication app) throws ClientException {
                        MenuBuilder<T> builder = new MenuBuilder<T>(app);
                        MenuBuilder<T> builder = new MenuBuilder<>(app);
                        builder.setPrompt(INFO_EDITOR_PROMPT_SELECT_VALUES_REMOVE.get());
                        builder.setAllowMultiSelect(true);
@@ -910,9 +910,9 @@
                    @Override
                    public MenuResult<Boolean> invoke(ConsoleApplication app) throws ClientException {
                        app.println();
                        SortedSet<T> previousValues = new TreeSet<T>(currentValues);
                        SortedSet<T> previousValues = new TreeSet<>(currentValues);
                        readPropertyValues(app, mo.getManagedObjectDefinition(), d, currentValues);
                        SortedSet<T> addedValues = new TreeSet<T>(currentValues);
                        SortedSet<T> addedValues = new TreeSet<>(currentValues);
                        addedValues.removeAll(previousValues);
                        isLastChoiceReset = false;
                        return MenuResult.success(false);
@@ -925,7 +925,7 @@
                    @Override
                    public MenuResult<Boolean> invoke(ConsoleApplication app) throws ClientException {
                        MenuBuilder<T> builder = new MenuBuilder<T>(app);
                        MenuBuilder<T> builder = new MenuBuilder<>(app);
                        builder.setPrompt(INFO_EDITOR_PROMPT_SELECT_VALUES_REMOVE.get());
                        builder.setAllowMultiSelect(true);
@@ -1110,7 +1110,7 @@
                final SortedSet<T> defaultValues, final SortedSet<T> oldValues, final SortedSet<T> currentValues,
                MenuCallback<Boolean> addCallback, MenuCallback<Boolean> removeCallback) {
            // Construct a menu of actions.
            MenuBuilder<Boolean> builder = new MenuBuilder<Boolean>(app);
            MenuBuilder<Boolean> builder = new MenuBuilder<>(app);
            builder.setPrompt(INFO_EDITOR_PROMPT_MODIFY_MENU.get(d.getName()));
            // First option is for leaving the property unchanged or
@@ -1386,7 +1386,7 @@
        public <C extends ConfigurationClient, S extends Configuration> MenuResult<Boolean> visitAggregation(
                AggregationPropertyDefinition<C, S> d, Void p) {
            // Construct a menu of actions.
            MenuBuilder<String> builder = new MenuBuilder<String>(app);
            MenuBuilder<String> builder = new MenuBuilder<>(app);
            builder.setMultipleColumnThreshold(MULTI_COLUMN_THRESHOLD);
            builder.setPrompt(INFO_EDITOR_PROMPT_MODIFY_MENU.get(d.getName()));
@@ -1402,7 +1402,7 @@
            builder.setDefault(LocalizableMessage.raw("1"), MenuResult.<String> cancel());
            // Create a list of possible names.
            final Set<String> values = new TreeSet<String>(d);
            final Set<String> values = new TreeSet<>(d);
            ManagedObjectPath<?, ?> path = d.getParentPath();
            InstantiableRelationDefinition<C, S> rd = d.getRelationDefinition();
            try {
@@ -1435,7 +1435,7 @@
                builder.addNumberedOption(option, MenuResult.success(value));
            }
            MenuCallback<String> callback = new CreateComponentCallback<C, S>(d);
            MenuCallback<String> callback = new CreateComponentCallback<>(d);
            builder.addNumberedOption(INFO_EDITOR_OPTION_CREATE_A_NEW_COMPONENT.get(ufn), callback);
            // Third option is to reset the value back to its default.
@@ -1453,7 +1453,7 @@
        @Override
        public MenuResult<Boolean> visitBoolean(BooleanPropertyDefinition d, Void p) {
            // Construct a menu of actions.
            MenuBuilder<Boolean> builder = new MenuBuilder<Boolean>(app);
            MenuBuilder<Boolean> builder = new MenuBuilder<>(app);
            builder.setPrompt(INFO_EDITOR_PROMPT_MODIFY_MENU.get(d.getName()));
            DefaultBehaviorQuery<Boolean> query = DefaultBehaviorQuery.query(d);
@@ -1509,7 +1509,7 @@
        @Override
        public <E extends Enum<E>> MenuResult<Boolean> visitEnum(EnumPropertyDefinition<E> d, Void p) {
            // Construct a menu of actions.
            MenuBuilder<E> builder = new MenuBuilder<E>(app);
            MenuBuilder<E> builder = new MenuBuilder<>(app);
            builder.setMultipleColumnThreshold(MULTI_COLUMN_THRESHOLD);
            builder.setPrompt(INFO_EDITOR_PROMPT_MODIFY_MENU.get(d.getName()));
@@ -1525,7 +1525,7 @@
            builder.setDefault(LocalizableMessage.raw("1"), MenuResult.<E> cancel());
            // Create options for changing to other values.
            Set<E> values = new TreeSet<E>(d);
            Set<E> values = new TreeSet<>(d);
            values.addAll(EnumSet.allOf(d.getEnumClass()));
            for (E value : values) {
                if (value.equals(currentValue) && query.isDefined()) {
@@ -1562,7 +1562,7 @@
            displayPropertySyntax(app, d);
            // Construct a menu of actions.
            MenuBuilder<T> builder = new MenuBuilder<T>(app);
            MenuBuilder<T> builder = new MenuBuilder<>(app);
            builder.setPrompt(INFO_EDITOR_PROMPT_MODIFY_MENU.get(d.getName()));
            // First option is for leaving the property unchanged.
@@ -1685,9 +1685,9 @@
                // Both newValues and oldValues sets need to use the PropertyDefinition
                // as their comparator. Constructing a TreeSet<T> directly with the
                // values collection will fail if the values are e.g. InetAddresses.
                SortedSet<T> newValues = new TreeSet<T>(d);
                SortedSet<T> newValues = new TreeSet<>(d);
                newValues.addAll(values);
                SortedSet<T> oldValues = new TreeSet<T>(mo.getPropertyValues(d));
                SortedSet<T> oldValues = new TreeSet<>(mo.getPropertyValues(d));
                mo.setPropertyValues(d, values);
                // If there are no values when we do a reset.
@@ -1754,7 +1754,7 @@
            rows += sz % 2;
        }
        List<T> vl = new ArrayList<T>(values);
        List<T> vl = new ArrayList<>(values);
        for (int i = 0, j = rows; i < rows; i++, j++) {
            builder.startRow();
            builder.appendCell("*)");
@@ -1815,7 +1815,7 @@
    /** Read new values for a property. */
    private static <T> SortedSet<T> readPropertyValues(ConsoleApplication app, ManagedObjectDefinition<?, ?> d,
            PropertyDefinition<T> pd) throws ClientException {
        SortedSet<T> values = new TreeSet<T>(pd);
        SortedSet<T> values = new TreeSet<>(pd);
        readPropertyValues(app, d, pd, values);
        return values;
    }
@@ -1901,11 +1901,9 @@
    /**
     * The modifications performed: we assume that at most there is one modification per property definition.
     */
    private final List<PropertyEditorModification<?>> mods = new ArrayList<PropertyEditorModification<?>>();
    private final List<PropertyEditorModification<?>> mods = new ArrayList<>();
    /**
     * Whether the last type of choice made by the user in a menu is a reset.
     */
    /** Whether the last type of choice made by the user in a menu is a reset. */
    private boolean isLastChoiceReset;
    /**
@@ -1955,7 +1953,7 @@
        while (true) {
            // Construct the main menu.
            MenuBuilder<Boolean> builder = new MenuBuilder<Boolean>(app);
            MenuBuilder<Boolean> builder = new MenuBuilder<>(app);
            String ufn = mo.getManagedObjectPath().getName();
            if (ufn == null) {
@@ -2063,17 +2061,17 @@
                registerSetModification(pd, newValues, previousValues);
            } else {
                // Split into two operations: remove and add
                SortedSet<T> removedValues = new TreeSet<T>(previousValues);
                SortedSet<T> removedValues = new TreeSet<>(previousValues);
                removedValues.removeAll(newValues);
                PropertyEditorModification<T> removeMod = PropertyEditorModification.createRemoveModification(pd,
                        removedValues, previousValues);
                addModification(removeMod);
                SortedSet<T> retainedValues = new TreeSet<T>(previousValues);
                SortedSet<T> retainedValues = new TreeSet<>(previousValues);
                retainedValues.retainAll(newValues);
                SortedSet<T> addedValues = new TreeSet<T>(newValues);
                SortedSet<T> addedValues = new TreeSet<>(newValues);
                addedValues.removeAll(retainedValues);
                PropertyEditorModification<T> addMod = PropertyEditorModification.createAddModification(pd,
@@ -2098,11 +2096,11 @@
        PropertyEditorModification<?> mod = getModification(pd);
        SortedSet<T> originalValues;
        if (mod != null) {
            originalValues = new TreeSet<T>(pd);
            originalValues = new TreeSet<>(pd);
            castAndAddValues(originalValues, mod.getOriginalValues(), pd);
            removeModification(mod);
        } else {
            originalValues = new TreeSet<T>(previousValues);
            originalValues = new TreeSet<>(previousValues);
        }
        addModification(PropertyEditorModification.createResetModification(pd, originalValues));
@@ -2126,11 +2124,11 @@
        PropertyEditorModification<?> mod = getModification(pd);
        SortedSet<T> originalValues;
        if (mod != null) {
            originalValues = new TreeSet<T>(pd);
            originalValues = new TreeSet<>(pd);
            castAndAddValues(originalValues, mod.getOriginalValues(), pd);
            removeModification(mod);
        } else {
            originalValues = new TreeSet<T>(previousValues);
            originalValues = new TreeSet<>(previousValues);
        }
        addModification(PropertyEditorModification.createSetModification(pd, newValues, originalValues));
    }
@@ -2154,10 +2152,10 @@
        PropertyEditorModification<T> newMod;
        SortedSet<T> originalValues;
        if (mod != null) {
            originalValues = new TreeSet<T>(pd);
            originalValues = new TreeSet<>(pd);
            castAndAddValues(originalValues, mod.getOriginalValues(), pd);
            if (mod.getType() == PropertyEditorModification.Type.ADD) {
                SortedSet<T> addedValues = new TreeSet<T>(newValues);
                SortedSet<T> addedValues = new TreeSet<>(newValues);
                addedValues.removeAll(originalValues);
                newMod = PropertyEditorModification.createAddModification(pd, addedValues, originalValues);
            } else {
@@ -2166,8 +2164,8 @@
            }
            removeModification(mod);
        } else {
            originalValues = new TreeSet<T>(previousValues);
            SortedSet<T> addedValues = new TreeSet<T>(newValues);
            originalValues = new TreeSet<>(previousValues);
            SortedSet<T> addedValues = new TreeSet<>(newValues);
            addedValues.removeAll(originalValues);
            newMod = PropertyEditorModification.createAddModification(pd, addedValues, originalValues);
        }
@@ -2193,12 +2191,12 @@
        PropertyEditorModification<T> newMod;
        SortedSet<T> originalValues;
        if (mod != null) {
            originalValues = new TreeSet<T>(pd);
            originalValues = new TreeSet<>(pd);
            castAndAddValues(originalValues, mod.getOriginalValues(), pd);
            if (newValues.isEmpty()) {
                newMod = PropertyEditorModification.createRemoveModification(pd, originalValues, originalValues);
            } else if (mod.getType() == PropertyEditorModification.Type.REMOVE) {
                SortedSet<T> removedValues = new TreeSet<T>(originalValues);
                SortedSet<T> removedValues = new TreeSet<>(originalValues);
                removedValues.removeAll(newValues);
                newMod = PropertyEditorModification.createRemoveModification(pd, removedValues, originalValues);
            } else {
@@ -2207,8 +2205,8 @@
            }
            removeModification(mod);
        } else {
            originalValues = new TreeSet<T>(previousValues);
            SortedSet<T> removedValues = new TreeSet<T>(originalValues);
            originalValues = new TreeSet<>(previousValues);
            SortedSet<T> removedValues = new TreeSet<>(originalValues);
            removedValues.removeAll(newValues);
            newMod = PropertyEditorModification.createRemoveModification(pd, removedValues, originalValues);
        }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java
@@ -246,7 +246,7 @@
        while (true) {
            // Interactively set properties if applicable.
            if (app.isInteractive()) {
                SortedSet<PropertyDefinition<?>> properties = new TreeSet<PropertyDefinition<?>>();
                SortedSet<PropertyDefinition<?>> properties = new TreeSet<>();
                for (PropertyDefinition<?> pd : d.getAllPropertyDefinitions()) {
                    if (pd.hasOption(PropertyOption.HIDDEN)) {
                        continue;
@@ -678,8 +678,8 @@
        ManagedObject<?> child = result.getValue();
        ManagedObjectDefinition<?, ?> d = child.getManagedObjectDefinition();
        Map<String, ModificationType> lastModTypes = new HashMap<String, ModificationType>();
        Map<PropertyDefinition, Set> changes = new HashMap<PropertyDefinition, Set>();
        Map<String, ModificationType> lastModTypes = new HashMap<>();
        Map<PropertyDefinition, Set> changes = new HashMap<>();
        // Reset properties.
        for (String m : propertyResetArgument.getValues()) {
@@ -848,7 +848,7 @@
                }
                break;
            case SET:
                values = new TreeSet<T>(pd);
                values = new TreeSet<>(pd);
                values.add(value);
                break;
            }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SubCommandHandler.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.forgerock.opendj.config.dsconfig;
@@ -462,11 +462,9 @@
        }
        /** The list of naming arguments. */
        private final List<StringArgument> arguments = new LinkedList<StringArgument>();
        private final List<StringArgument> arguments = new LinkedList<>();
        /**
         * Any argument exception thrown when creating the naming arguments.
         */
        /** Any argument exception thrown when creating the naming arguments. */
        private ArgumentException e;
        /**
@@ -573,63 +571,36 @@
     */
    public static final int MULTI_COLUMN_THRESHOLD = 8;
    /**
     * The value for the long option property.
     */
    /** The value for the long option property. */
    private static final String OPTION_DSCFG_LONG_PROPERTY = "property";
    /**
     * The value for the long option record.
     */
    /** The value for the long option record. */
    private static final String OPTION_DSCFG_LONG_RECORD = "record";
    /**
     * The value for the long option unit-size.
     */
    /** The value for the long option unit-size. */
    private static final String OPTION_DSCFG_LONG_UNIT_SIZE = "unit-size";
    /**
     * The value for the long option unit-time.
     */
    /** The value for the long option unit-time. */
    private static final String OPTION_DSCFG_LONG_UNIT_TIME = "unit-time";
    /**
     * The value for the short option property.
     */
    /** The value for the short option property. */
    private static final Character OPTION_DSCFG_SHORT_PROPERTY = null;
    /**
     * The value for the short option record.
     */
    /** The value for the short option record. */
    private static final char OPTION_DSCFG_SHORT_RECORD = 'E';
    /**
     * The value for the short option unit-size.
     */
    /** The value for the short option unit-size. */
    private static final char OPTION_DSCFG_SHORT_UNIT_SIZE = 'z';
    /**
     * The value for the short option unit-time.
     */
    /** The value for the short option unit-time. */
    private static final char OPTION_DSCFG_SHORT_UNIT_TIME = 'm';
    /**
     * The argument which should be used to specify zero or more property names.
     */
    private StringArgument propertyArgument;
    /** The argument which should be used to request record mode. */
    private BooleanArgument recordModeArgument;
    /** The tags associated with this sub-command handler. */
    private final Set<Tag> tags = new HashSet<Tag>();
    /** The argument which should be used to request specific size units. */
    private StringArgument unitSizeArgument;
    /** The argument which should be used to request specific time units. */
    private StringArgument unitTimeArgument;
    /** The tags associated with this sub-command handler. */
    private final Set<Tag> tags = new HashSet<>();
    /** The command builder associated with this handler. */
    private CommandBuilder commandBuilder;
@@ -639,9 +610,7 @@
     */
    private boolean isCommandBuilderUseful = true;
    /**
     * Create a new sub-command handler.
     */
    /** Create a new sub-command handler. */
    protected SubCommandHandler() {
        // No implementation required.
    }
@@ -849,7 +818,7 @@
     */
    protected final List<String> getNamingArgValues(ConsoleApplication app, List<StringArgument> namingArgs)
            throws ArgumentException {
        ArrayList<String> values = new ArrayList<String>(namingArgs.size());
        ArrayList<String> values = new ArrayList<>(namingArgs.size());
        for (final StringArgument arg : namingArgs) {
            final String value = arg.getValue();
            if (value == null && !app.isInteractive()) {
@@ -867,7 +836,7 @@
     */
    protected final Set<String> getPropertyNames() {
        if (propertyArgument != null) {
            return new LinkedHashSet<String>(propertyArgument.getValues());
            return new LinkedHashSet<>(propertyArgument.getValues());
        }
        return Collections.emptySet();
    }
@@ -981,7 +950,7 @@
            System.out.println(String.format("An error occured %s", e.getMessage()));
        }
        SortedMap<String, String> children = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
        SortedMap<String, String> children = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
        for (String childName : childNames) {
            ManagedObject<?> child;
@@ -1069,7 +1038,7 @@
        }
        default: {
            // Display a menu.
            MenuBuilder<String> builder = new MenuBuilder<String>(app);
            MenuBuilder<String> builder = new MenuBuilder<>(app);
            builder.setMultipleColumnThreshold(MULTI_COLUMN_THRESHOLD);
            builder.setPrompt(INFO_DSCFG_FINDER_PROMPT_MANY.get(d.getUserFriendlyName()));
@@ -1237,8 +1206,7 @@
    static <C extends ConfigurationClient, S extends Configuration> SortedMap<String,
        ManagedObjectDefinition<? extends C, ? extends S>> getSubTypes(
            AbstractManagedObjectDefinition<C, S> d) {
        SortedMap<String, ManagedObjectDefinition<? extends C, ? extends S>> map;
        map = new TreeMap<String, ManagedObjectDefinition<? extends C, ? extends S>>();
        SortedMap<String, ManagedObjectDefinition<? extends C, ? extends S>> map = new TreeMap<>();
        // If the top-level definition is instantiable, we use the value
        // "generic" or "custom".
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SubCommandHandlerFactory.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.config.dsconfig;
@@ -138,32 +138,24 @@
    }
    /** The set of all available sub-commands. */
    private final SortedSet<SubCommandHandler> allHandlers = new TreeSet<SubCommandHandler>();
    private final SortedSet<SubCommandHandler> allHandlers = new TreeSet<>();
    /** The set of create-xxx available sub-commands. */
    private final SortedSet<CreateSubCommandHandler<?, ?>> createHandlers
        = new TreeSet<CreateSubCommandHandler<?, ?>>();
    private final SortedSet<CreateSubCommandHandler<?, ?>> createHandlers = new TreeSet<>();
    /** The set of delete-xxx available sub-commands. */
    private final SortedSet<DeleteSubCommandHandler> deleteHandlers = new TreeSet<DeleteSubCommandHandler>();
    /** Any exception that occurred whilst creating the sub-commands. */
    private ArgumentException exception;
    private final SortedSet<DeleteSubCommandHandler> deleteHandlers = new TreeSet<>();
    /** The set of get-xxx-prop available sub-commands. */
    private final SortedSet<GetPropSubCommandHandler> getPropHandlers = new TreeSet<GetPropSubCommandHandler>();
    private final SortedSet<GetPropSubCommandHandler> getPropHandlers = new TreeSet<>();
    /** The help sub-command handler. */
    private HelpSubCommandHandler helpHandler;
    /** The set of list-xxx available sub-commands. */
    private final SortedSet<ListSubCommandHandler> listHandlers = new TreeSet<ListSubCommandHandler>();
    private final SortedSet<ListSubCommandHandler> listHandlers = new TreeSet<>();
    /** The set of set-xxx-prop available sub-commands. */
    private final SortedSet<SetPropSubCommandHandler> setPropHandlers = new TreeSet<>();
    /** The sub-command argument parser. */
    private final SubCommandArgumentParser parser;
    /** The set of set-xxx-prop available sub-commands. */
    private final SortedSet<SetPropSubCommandHandler> setPropHandlers = new TreeSet<SetPropSubCommandHandler>();
    /** Any exception that occurred whilst creating the sub-commands. */
    private ArgumentException exception;
    /** The relation visitor. */
    private final Visitor visitor = new Visitor();
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigAddListenerAdaptor.java
@@ -227,7 +227,7 @@
        }
        // Let the add listener decide.
        List<LocalizableMessage> reasons = new LinkedList<LocalizableMessage>();
        List<LocalizableMessage> reasons = new LinkedList<>();
        if (listener.isConfigurationAddAcceptable(cachedManagedObject, reasons)) {
            return true;
        } else {
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigChangeListenerAdaptor.java
@@ -98,7 +98,7 @@
         */
        public static <T> void find(ManagedObjectPath<?, ?> path, PropertyDefinition<T> pd,
                Collection<DN> dependencies) {
            Visitor<T> v = new Visitor<T>(dependencies);
            Visitor<T> v = new Visitor<>(dependencies);
            DefaultBehaviorProvider<T> db = pd.getDefaultBehaviorProvider();
            db.accept(v, path);
        }
@@ -211,7 +211,7 @@
        // This change listener should be notified when dependent entries
        // are modified. Determine the dependencies and register change
        // listeners against them.
        this.dependencies = new HashSet<DN>();
        this.dependencies = new HashSet<>();
        this.dependencyListener = new ConfigChangeListener() {
            public ConfigChangeResult applyConfigurationChange(Entry configEntry) {
@@ -353,7 +353,7 @@
        }
        // Let the change listener decide.
        List<LocalizableMessage> reasons = new LinkedList<LocalizableMessage>();
        List<LocalizableMessage> reasons = new LinkedList<>();
        if (listener.isConfigurationChangeAcceptable(cachedManagedObject, reasons)) {
            return true;
        } else {
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigChangeResult.java
@@ -42,7 +42,7 @@
     * A set of messages describing the changes that were made, any
     * action that may be required, or any problems that were encountered.
     */
    private final List<LocalizableMessage> messages = new ArrayList<LocalizableMessage>();
    private final List<LocalizableMessage> messages = new ArrayList<>();
    /**
     * Indicates whether one or more of the changes requires
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigDeleteListenerAdaptor.java
@@ -221,7 +221,7 @@
            return false;
        }
        List<LocalizableMessage> reasons = new LinkedList<LocalizableMessage>();
        List<LocalizableMessage> reasons = new LinkedList<>();
        // Enforce any constraints.
        boolean isDeleteAllowed = true;
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConstraintViolationException.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.server;
@@ -100,7 +101,7 @@
        super(getDefaultMessage(messages));
        this.managedObject = managedObject;
        this.messages = new ArrayList<LocalizableMessage>(messages);
        this.messages = new ArrayList<>(messages);
    }
    /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagedObject.java
@@ -682,7 +682,7 @@
            ServerManagedObjectAddListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<M>(serverContext, path, d, listener);
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<>(serverContext, path, d, listener);
        registerAddListener(baseDN, adaptor);
    }
@@ -729,7 +729,7 @@
            ServerManagedObjectAddListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d).parent();
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<M>(serverContext, path, d, listener);
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<>(serverContext, path, d, listener);
        registerAddListener(baseDN, adaptor);
    }
@@ -776,7 +776,7 @@
            ServerManagedObjectAddListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<M>(serverContext, path, d, listener);
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<>(serverContext, path, d, listener);
        registerAddListener(baseDN, adaptor);
    }
@@ -797,8 +797,7 @@
     *            The server managed object change listener.
     */
    public void registerChangeListener(ServerManagedObjectChangeListener<? super S> listener) {
        ConfigChangeListener adaptor = new ConfigChangeListenerAdaptor<S>(serverContext, path, listener);
        ConfigChangeListener adaptor = new ConfigChangeListenerAdaptor<>(serverContext, path, listener);
        configRepository.registerChangeListener(configDN, adaptor);
        // TODO : go toward this
@@ -865,7 +864,7 @@
            ServerManagedObjectDeleteListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<M>(serverContext, path, d, listener);
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<>(serverContext, path, d, listener);
        registerDeleteListener(baseDN, adaptor);
    }
@@ -912,7 +911,7 @@
            ServerManagedObjectDeleteListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d).parent();
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<M>(serverContext, path, d, listener);
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<>(serverContext, path, d, listener);
        registerDeleteListener(baseDN, adaptor);
    }
@@ -959,7 +958,7 @@
            ServerManagedObjectDeleteListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<M>(serverContext, path, d, listener);
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<>(serverContext, path, d, listener);
        registerDeleteListener(baseDN, adaptor);
    }
@@ -994,7 +993,7 @@
    void ensureIsUsable() throws ConstraintViolationException {
        // Enforce any constraints.
        boolean isUsable = true;
        List<LocalizableMessage> reasons = new LinkedList<LocalizableMessage>();
        List<LocalizableMessage> reasons = new LinkedList<>();
        for (Constraint constraint : definition.getAllConstraints()) {
            for (ServerConstraintHandler handler : constraint.getServerConstraintHandlers()) {
                try {
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagementContext.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.config.server;
@@ -136,7 +136,7 @@
        @Override
        public Collection<T> visitDefined(DefinedDefaultBehaviorProvider<T> d, Void p) {
            Collection<String> stringValues = d.getDefaultValues();
            List<T> values = new ArrayList<T>(stringValues.size());
            List<T> values = new ArrayList<>(stringValues.size());
            for (String stringValue : stringValues) {
                try {
@@ -226,7 +226,7 @@
                List<String> attributeValues = getAttributeValues(mod, propDef2, configEntry);
                if (attributeValues.size() > 0) {
                    Collection<T> pvalues = new ArrayList<T>();
                    Collection<T> pvalues = new ArrayList<>();
                    for (String value : attributeValues) {
                        pvalues.add(ValueDecoder.decode(propDef1, value));
                    }
@@ -234,7 +234,7 @@
                } else {
                    // Recursively retrieve this property's default values.
                    Collection<T> tmp = find(target, propDef2);
                    Collection<T> pvalues = new ArrayList<T>(tmp.size());
                    Collection<T> pvalues = new ArrayList<>(tmp.size());
                    for (T value : tmp) {
                        propDef1.validateValue(value);
                        pvalues.add(value);
@@ -513,7 +513,7 @@
                rootObject = root;
                if (rootObject == null) {
                    root = rootObject =
                        new ServerManagedObject<RootCfg>(ManagedObjectPath.emptyPath(),
                        new ServerManagedObject<>(ManagedObjectPath.emptyPath(),
                                RootCfgDefn.getInstance(), Collections.<PropertyDefinition<?>,
                                SortedSet<?>> emptyMap(), null, this);
                }
@@ -552,7 +552,7 @@
        } catch (ConfigException e) {
            return new String[0];
        }
        List<String> names = new ArrayList<String>(children.size());
        List<String> names = new ArrayList<>(children.size());
        for (DN child : children) {
            // Assume that RDNs are single-valued and can be trimmed.
            String name = child.rdn().getFirstAVA().getAttributeValue().toString().trim();
@@ -646,8 +646,8 @@
        ManagedObjectDefinition<? extends C, ? extends S> mod = d.resolveManagedObjectDefinition(resolver);
        // Build the managed object's properties.
        List<PropertyException> exceptions = new LinkedList<PropertyException>();
        Map<PropertyDefinition<?>, SortedSet<?>> properties = new HashMap<PropertyDefinition<?>, SortedSet<?>>();
        List<PropertyException> exceptions = new LinkedList<>();
        Map<PropertyDefinition<?>, SortedSet<?>> properties = new HashMap<>();
        for (PropertyDefinition<?> propertyDef : mod.getAllPropertyDefinitions()) {
            List<String> attributeValues = getAttributeValues(mod, propertyDef, configEntry);
            try {
@@ -673,14 +673,14 @@
            ManagedObjectPath<? super C, ? super S> path, ManagedObjectDefinition<C, S> d,
            Map<PropertyDefinition<?>, SortedSet<?>> properties, DN configDN) {
        ManagedObjectPath<C, S> newPath = path.asSubType(d);
        return new ServerManagedObject<S>(newPath, d, properties, configDN, this);
        return new ServerManagedObject<>(newPath, d, properties, configDN, this);
    }
    /** Decode a property using the provided attribute values. */
    private <T> SortedSet<T> decodeProperty(ManagedObjectPath<?, ?> path, PropertyDefinition<T> propertyDef,
            List<String> attributeValues, Entry newConfigEntry) {
        PropertyException exception = null;
        SortedSet<T> pvalues = new TreeSet<T>(propertyDef);
        SortedSet<T> pvalues = new TreeSet<>(propertyDef);
        if (attributeValues.size() > 0) {
            // The property has values defined for it.
@@ -727,7 +727,7 @@
        String attrID = LDAPProfile.getInstance().getAttributeName(d, pd);
        AttributeType type = Schema.getDefaultSchema().getAttributeType(attrID);
        Iterable<Attribute> attributes = configEntry.getAllAttributes(AttributeDescription.create(type));
        List<String> values = new ArrayList<String>();
        List<String> values = new ArrayList<>();
        for (Attribute attribute : attributes) {
            for (ByteString byteValue : attribute) {
                values.add(byteValue.toString());
@@ -739,7 +739,7 @@
    /** Get the default values for the specified property. */
    private <T> Collection<T> getDefaultValues(ManagedObjectPath<?, ?> p, PropertyDefinition<T> pd,
            Entry newConfigEntry) {
        DefaultValueFinder<T> v = new DefaultValueFinder<T>(newConfigEntry);
        DefaultValueFinder<T> v = new DefaultValueFinder<>(newConfigEntry);
        return v.find(p, pd);
    }
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/ConfigurationMock.java
@@ -21,7 +21,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2013-2014 ForgeRock AS.
 *      Copyright 2013-2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -166,7 +166,7 @@
            PropertyDefinition<T> propertyDefinition = (PropertyDefinition<T>) getPropertyDefMethod.invoke(definition);
            DefaultBehaviorProvider<T> defaultBehaviorProvider = (DefaultBehaviorProvider<T>) propertyDefinition
                    .getClass().getMethod("getDefaultBehaviorProvider").invoke(propertyDefinition);
            MockProviderVisitor<T> visitor = new MockProviderVisitor<T>(propertyDefinition);
            MockProviderVisitor<T> visitor = new MockProviderVisitor<>(propertyDefinition);
            Collection<T> values = defaultBehaviorProvider.accept(visitor, null);
            if (values == null) {
@@ -211,7 +211,7 @@
         */
        @Override
        public Collection<T> visitDefined(DefinedDefaultBehaviorProvider<T> provider, Void p) {
            SortedSet<T> values = new TreeSet<T>();
            SortedSet<T> values = new TreeSet<>();
            for (String stringValue : provider.getDefaultValues()) {
                values.add(propertyDef.decodeValue(stringValue));
            }
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/RelativeInheritedDefaultBehaviorProviderTest.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -43,7 +44,7 @@
    @BeforeClass
    public void setUp() {
        parentDefinition = TestParentCfgDefn.getInstance();
        this.defaultBehaviorProvider = new RelativeInheritedDefaultBehaviorProvider<Boolean>(
        this.defaultBehaviorProvider = new RelativeInheritedDefaultBehaviorProvider<>(
            parentDefinition,
            parentDefinition.getMandatoryBooleanPropertyPropertyDefinition().getName(),
            OFFSET);
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/TestCfg.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config;
@@ -51,7 +52,7 @@
    /** Create a one-to-many relation for test-parent components. */
    static {
        InstantiableRelationDefinition.Builder<TestParentCfgClient, TestParentCfg> builder =
            new InstantiableRelationDefinition.Builder<TestParentCfgClient, TestParentCfg>(
            new InstantiableRelationDefinition.Builder<>(
                RootCfgDefn.getInstance(), "test-one-to-many-parent", "test-one-to-many-parents",
                TestParentCfgDefn.getInstance());
        RD_TEST_ONE_TO_MANY_PARENT = builder.getInstance();
@@ -60,7 +61,7 @@
    /** Create a one-to-many relation for test-parent components. */
    static {
        OptionalRelationDefinition.Builder<TestParentCfgClient, TestParentCfg> builder =
            new OptionalRelationDefinition.Builder<TestParentCfgClient, TestParentCfg>(
            new OptionalRelationDefinition.Builder<>(
                RootCfgDefn.getInstance(), "test-one-to-zero-or-one-parent", TestParentCfgDefn.getInstance());
        RD_TEST_ONE_TO_ZERO_OR_ONE_PARENT = builder.getInstance();
    }
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/TestChildCfgDefn.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.forgerock.opendj.config;
@@ -107,7 +107,7 @@
        builder.setOption(PropertyOption.MANDATORY);
        builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE,
                "mandatory-class-property"));
        DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>(
        DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<>(
                "org.opends.server.extensions.UserDefinedVirtualAttributeProvider");
        builder.setDefaultBehaviorProvider(provider);
        builder.addInstanceOf("org.opends.server.api.VirtualAttributeProvider");
@@ -138,7 +138,7 @@
        builder.setOption(PropertyOption.MULTI_VALUED);
        builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE,
                "optional-multi-valued-dn-property1"));
        DefaultBehaviorProvider<DN> provider = new RelativeInheritedDefaultBehaviorProvider<DN>(
        DefaultBehaviorProvider<DN> provider = new RelativeInheritedDefaultBehaviorProvider<>(
                TestParentCfgDefn.getInstance(), "optional-multi-valued-dn-property", 1);
        builder.setDefaultBehaviorProvider(provider);
        PROPDEF_OPTIONAL_MULTI_VALUED_DN_PROPERTY1 = builder.getInstance();
@@ -152,7 +152,7 @@
        builder.setOption(PropertyOption.MULTI_VALUED);
        builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE,
                "optional-multi-valued-dn-property2"));
        DefaultBehaviorProvider<DN> provider = new RelativeInheritedDefaultBehaviorProvider<DN>(
        DefaultBehaviorProvider<DN> provider = new RelativeInheritedDefaultBehaviorProvider<>(
                TestChildCfgDefn.getInstance(), "optional-multi-valued-dn-property1", 0);
        builder.setDefaultBehaviorProvider(provider);
        PROPDEF_OPTIONAL_MULTI_VALUED_DN_PROPERTY2 = builder.getInstance();
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/TestParentCfgDefn.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.forgerock.opendj.config;
@@ -93,7 +93,7 @@
        builder.setOption(PropertyOption.MANDATORY);
        builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE,
                "mandatory-class-property"));
        DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>(
        DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<>(
                "org.opends.server.extensions.SomeVirtualAttributeProvider");
        builder.setDefaultBehaviorProvider(provider);
        builder.addInstanceOf("org.opends.server.api.VirtualAttributeProvider");
@@ -124,7 +124,7 @@
        builder.setOption(PropertyOption.MULTI_VALUED);
        builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE,
                "optional-multi-valued-dn-property"));
        DefaultBehaviorProvider<DN> provider = new DefinedDefaultBehaviorProvider<DN>("dc=domain1,dc=com",
        DefaultBehaviorProvider<DN> provider = new DefinedDefaultBehaviorProvider<>("dc=domain1,dc=com",
                "dc=domain2,dc=com", "dc=domain3,dc=com");
        builder.setDefaultBehaviorProvider(provider);
        PD_OPTIONAL_MULTI_VALUED_DN_PROPERTY = builder.getInstance();
@@ -134,7 +134,7 @@
    /** Build the "test-children" relation definition. */
    static {
        InstantiableRelationDefinition.Builder<TestChildCfgClient, TestChildCfg> builder =
            new InstantiableRelationDefinition.Builder<TestChildCfgClient, TestChildCfg>(
            new InstantiableRelationDefinition.Builder<>(
                INSTANCE, "multiple-children", "test-children", TestChildCfgDefn.getInstance());
        RD_TEST_CHILDREN = builder.getInstance();
        INSTANCE.registerRelationDefinition(RD_TEST_CHILDREN);
@@ -143,7 +143,7 @@
    /** Build the "optional-test-child" relation definition. */
    static {
        OptionalRelationDefinition.Builder<TestChildCfgClient, TestChildCfg> builder =
            new OptionalRelationDefinition.Builder<TestChildCfgClient, TestChildCfg>(
            new OptionalRelationDefinition.Builder<>(
                INSTANCE, "optional-test-child", TestChildCfgDefn.getInstance());
        RD_OPTIONAL_TEST_CHILD = builder.getInstance();
        INSTANCE.registerRelationDefinition(RD_OPTIONAL_TEST_CHILD);
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/ValidateConfigDefinitionsTest.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS
 *      Portions copyright 2011-2015 ForgeRock AS
 */
package org.forgerock.opendj.config;
@@ -62,8 +62,7 @@
    @DataProvider
    Object[][] enumerateManageObjectDefns() throws Exception {
        TopCfgDefn topCfgDefn = TopCfgDefn.getInstance();
        List<AbstractManagedObjectDefinition<?, ?>> allCfgDefns =
            new ArrayList<AbstractManagedObjectDefinition<?, ?>>(topCfgDefn.getAllChildren());
        List<AbstractManagedObjectDefinition<?, ?>> allCfgDefns = new ArrayList<>(topCfgDefn.getAllChildren());
        Object[][] params = new Object[allCfgDefns.size()][];
        for (int i = 0; i < params.length; i++) {
@@ -202,7 +201,7 @@
                            + " is declared as mandatory in the schema.").append(EOL + EOL);
                }
                Set<AttributeType> allowedAttributes = new HashSet<AttributeType>(mandatoryAttributes);
                Set<AttributeType> allowedAttributes = new HashSet<>(mandatoryAttributes);
                allowedAttributes.addAll(configObjectClass.getOptionalAttributes());
                if (!allowedAttributes.contains(attrType)) {
                    errors.append(
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 *      Portions copyright 2014 ForgeRock AS.
 *      Portions copyright 2014-2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.client.ldap;
@@ -341,9 +341,8 @@
    /** Asserts that the actual set of DNs contains the expected values. */
    private void assertSetEquals(SortedSet<String> actual, String... expected) {
        SortedSet<String> values =
                new TreeSet<String>(TestChildCfgDefn.getInstance()
                        .getAggregationPropertyPropertyDefinition());
        SortedSet<String> values = new TreeSet<>(
            TestChildCfgDefn.getInstance().getAggregationPropertyPropertyDefinition());
        if (expected != null) {
            for (String value : expected) {
                values.add(value);
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.server;
@@ -109,7 +110,7 @@
            isProfileRegistered = true;
        }
        SingletonRelationDefinition.Builder<C, S> builder =
            new SingletonRelationDefinition.Builder<C, S>(RootCfgDefn.getInstance(), DUMMY_TEST_RELATION, d);
            new SingletonRelationDefinition.Builder<>(RootCfgDefn.getInstance(), DUMMY_TEST_RELATION, d);
        ManagedObjectPath<?, ?> root = ManagedObjectPath.emptyPath();
        return root.child(builder.getInstance());
    }
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/AggregationServerTest.java
@@ -620,7 +620,7 @@
    /** Asserts that the actual set of DNs contains the expected values. */
    private void assertSetEquals(SortedSet<String> actual, String... expected) {
        SortedSet<String> values =
            new TreeSet<String>(TestChildCfgDefn.getInstance().getAggregationPropertyPropertyDefinition());
            new TreeSet<>(TestChildCfgDefn.getInstance().getAggregationPropertyPropertyDefinition());
        if (expected != null) {
            for (String value : expected) {
                values.add(value);
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/DNBuilderTest.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS.
 */
package org.forgerock.opendj.config.server;
@@ -70,7 +71,7 @@
    @Test
    public void createWithSingletonRelationDefinition() throws Exception {
        SingletonRelationDefinition.Builder<TestChildCfgClient, TestChildCfg> builder =
            new SingletonRelationDefinition.Builder<TestChildCfgClient, TestChildCfg>(
            new SingletonRelationDefinition.Builder<>(
                TestParentCfgDefn.getInstance(), "singleton-test-child", TestChildCfgDefn.getInstance());
        final SingletonRelationDefinition<TestChildCfgClient, TestChildCfg> relationDef = builder.getInstance();
opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/DefaultBehaviorTest.java
@@ -416,7 +416,7 @@
    /** Make an entry by combining two lists. */
    static Entry makeEntryFrom(List<String> base, List<String> attrs) {
        List<String> ldif = new ArrayList<String>(base);
        List<String> ldif = new ArrayList<>(base);
        ldif.addAll(attrs);
        return makeEntry(ldif.toArray(new String[0]));
    }