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

ludovicp
30.32.2010 f5abff29450dc88d7f4432dc93499bb5a05f2924
Fixes an issue with dsconfig --displayCommand sometime displaying a wrong command. It was using the friendly name and not the actual name. Most of the time, the 2 names are the same, but for the ones that are not, the displayed command would be incorrect.
1 files modified
25 ■■■■ changed files
opends/src/server/org/opends/server/tools/dsconfig/SubCommandHandler.java 25 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/SubCommandHandler.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2007-2009 Sun Microsystems, Inc.
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 */
package org.opends.server.tools.dsconfig;
@@ -1231,12 +1231,25 @@
            arg.addValue(children.get(children.firstKey()));
          } else {
            // Set relation: need the short type name.
            String longName = children.firstKey();
            try {
              AbstractManagedObjectDefinition<?,?> cd = d.getChild(longName);
            String friendlyName = children.firstKey();
            String shortName = children.get(friendlyName);
            try
            {
              AbstractManagedObjectDefinition<?, ?> cd = null;
              try
              {
                cd = d.getChild(shortName);
              }
              catch (IllegalArgumentException e)
              {
                // Last resource: try with friendly name
                cd = d.getChild(friendlyName);
              }
              arg.addValue(getShortTypeName(r.getChildDefinition(), cd));
            } catch (IllegalArgumentException e) {
              arg.addValue(children.get(children.firstKey()));
            }
            catch (IllegalArgumentException e)
            {
              arg.addValue(shortName);
            }
          }
          getCommandBuilder().addArgument(arg);