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

Nicolas Capponi
26.31.2013 efa949b25f472d7e4c39733678d8f0e5229f8201
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/Reference.java
@@ -66,14 +66,13 @@
     *             relation.
     */
    public static <C extends ConfigurationClient, S extends Configuration> Reference<C, S> parseDN(
            ManagedObjectPath<?, ?> path, InstantiableRelationDefinition<C, S> relationDef, String dnAsString)
            throws IllegalArgumentException {
        ManagedObjectPath<?, ?> path, InstantiableRelationDefinition<C, S> relationDef, String dnAsString) {
        AbstractManagedObjectDefinition<?, ?> definition = path.getManagedObjectDefinition();
        RelationDefinition<?, ?> tmp = definition.getRelationDefinition(relationDef.getName());
        if (tmp != relationDef) {
            // TODO : i18n ?
            throw new IllegalArgumentException("The relation \"" + relationDef.getName()
                    + "\" is not associated with the definition \"" + definition.getName() + "\"");
                + "\" is not associated with the definition \"" + definition.getName() + "\"");
        }
        DN dn = DN.valueOf(dnAsString);
@@ -117,14 +116,13 @@
     *             definition, or if the provided name is empty.
     */
    public static <C extends ConfigurationClient, S extends Configuration> Reference<C, S> parseName(
            ManagedObjectPath<?, ?> p, InstantiableRelationDefinition<C, S> rd, String s)
            throws IllegalArgumentException {
        ManagedObjectPath<?, ?> p, InstantiableRelationDefinition<C, S> rd, String s) {
        // Sanity checks.
        AbstractManagedObjectDefinition<?, ?> d = p.getManagedObjectDefinition();
        RelationDefinition<?, ?> tmp = d.getRelationDefinition(rd.getName());
        if (tmp != rd) {
            throw new IllegalArgumentException("The relation \"" + rd.getName()
                    + "\" is not associated with the definition \"" + d.getName() + "\"");
                + "\" is not associated with the definition \"" + d.getName() + "\"");
        }
        if (s.trim().length() == 0) {
@@ -145,8 +143,7 @@
    private final InstantiableRelationDefinition<C, S> relation;
    // Private constructor.
    private Reference(ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> relation, String name)
            throws IllegalArgumentException {
    private Reference(ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> relation, String name) {
        this.relation = relation;
        this.name = name;
        this.path = parent.child(relation, name);