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

jvergara
12.01.2008 10cebdbfc498c606c5736862ec85d5d1bf0b66a9
Fix for issue 2919 (translation of version related properties causes error)

The issue comes because we are parsing the output of a command-line and this output is localized. Since the option we are using is not part of the public interface. This information can be used not only by the BuildInformation class but also by the support team so it is better not to localize it. The fix consists of removing these properties from the properties file and define some String constants in SetupUtils so that can be shared by BuildInformation and DirectoryServer classes.

4 files modified
132 ■■■■■ changed files
opends/src/messages/messages/core.properties 20 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/BuildInformation.java 23 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/DirectoryServer.java 51 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/SetupUtils.java 38 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/core.properties
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
#      Portions Copyright 2006-2008 Sun Microsystems, Inc.
#      Copyright 2006-2008 Sun Microsystems, Inc.
@@ -1764,21 +1764,5 @@
MILD_ERR_ADD_ENTRY_UNKNOWN_SUFFIX_697=The provided entry %s cannot be added \
 because its suffix is not defined as one of the suffixes within the \
 Directory Server
#Messages for start-ds -F option, the alignment matters
NOTICE_VERSION_698=%s
NOTICE_MAJOR_VERSION_699=Major Version:           %d
NOTICE_MINOR_VERSION_700=Minor Version:           %d
NOTICE_POINT_VERSION_701=Point Version:           %d
NOTICE_VERSION_QUALIFIER_702=Version Qualifier:       %s
NOTICE_BUILD_NUMBER_703=Build Number:                 %s
NOTICE_REVISION_NUMBER_704=Revision Number:         %d
NOTICE_FIX_IDS_705=Fix IDs:                           %s
NOTICE_DEBUG_BUILD_706=Debug Build:             %b
NOTICE_BUILD_OS_707=Build OS:                %s
NOTICE_BUILD_USER_708=Build User:              %s
NOTICE_UPGRADE_EVENTS_709=Upgrade Event IDs:       %s
NOTICE_BUILD_JAVA_VERSION_710=Build Java Version:      %s
NOTICE_BUILD_JAVA_VENDOR_711=Build Java Vendor:       %s
NOTICE_BUILD_JVM_VERSION_712=Build JVM Version:       %s
NOTICE_BUILD_JVM_VENDOR_713=Build JVM Vendor:        %s
NOTICE_BUILD_ID_714=Build ID:                 %s
NOTICE_BUILD_ID_699=Build ID:                 %s
opends/src/quicksetup/org/opends/quicksetup/BuildInformation.java
@@ -28,6 +28,7 @@
package org.opends.quicksetup;
import static org.opends.messages.QuickSetupMessages.*;
import static org.opends.server.util.SetupUtils.*;
import org.opends.quicksetup.util.Utils;
import org.opends.server.util.DynamicConstants;
@@ -57,27 +58,6 @@
  static private final Logger LOG =
          Logger.getLogger(BuildInformation.class.getName());
  // These string values must be synchronized with Directory
  // Server's main method.  These string values are considered
  // stable by the server team and not candidates for
  // internationalization.
  static private final String NAME = "Name";
  static private final String BUILD_ID = "Build ID";
  static private final String MAJOR_VERSION = "Major Version";
  static private final String MINOR_VERSION = "Minor Version";
  static private final String POINT_VERSION = "Point Version";
  static private final String REVISION_NUMBER = "Revision Number";
  static private final String VERSION_QUALIFIER = "Version Qualifier";
  static private final String INCOMPATIBILITY_EVENTS = "Upgrade Event IDs";
  static private final String FIX_IDS = "Fix IDs";
  static private final String DEBUG_BUILD = "Debug Build";
  static private final String BUILD_OS = "Build OS";
  static private final String BUILD_USER = "Build User";
  static private final String BUILD_JAVA_VERSION = "Build Java Version";
  static private final String BUILD_JAVA_VENDOR = "Build Java Vendor";
  static private final String BUILD_JVM_VERSION = "Build JVM Version";
  static private final String BUILD_JVM_VENDOR = "Build JVM Vendor";
  /**
   * Reads build information for a particular installation by reading the
   * output from invoking the start-ds tool with the full information option.
@@ -391,7 +371,6 @@
                INFO_ERROR_PROP_VALUE.get(prop), null);
      }
    }
  }
}
opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -9866,28 +9866,41 @@
  private static
  void printFullVersionInformation() {
    System.out.println(NOTE_VERSION.get(getVersionString()));
    System.out.println(NOTE_BUILD_ID.get(BUILD_ID));
    System.out.println(NOTE_MAJOR_VERSION.get(MAJOR_VERSION));
    System.out.println(NOTE_MINOR_VERSION.get(MINOR_VERSION));
    System.out.println(NOTE_POINT_VERSION.get(POINT_VERSION));
    System.out.println(NOTE_VERSION_QUALIFIER.get(VERSION_QUALIFIER));
    /**
     * This option is used by the upgrade to identify the server build and it
     * can eventually also be used to be sent to the support in case of an
     * issue.  Since this is not a public interface and since it is better
     * to always have it in English for the support team, the message is
     * not localized.
     */
    String separator = ": ";
    System.out.println(getVersionString());
    System.out.println(SetupUtils.BUILD_ID+separator+BUILD_ID);
    System.out.println(SetupUtils.MAJOR_VERSION+separator+MAJOR_VERSION);
    System.out.println(SetupUtils.MINOR_VERSION+separator+MINOR_VERSION);
    System.out.println(SetupUtils.POINT_VERSION+separator+POINT_VERSION);
    System.out.println(SetupUtils.VERSION_QUALIFIER+separator+
        VERSION_QUALIFIER);
    if (BUILD_NUMBER > 0)
    {
      System.out.println(NOTE_BUILD_NUMBER.get(
                     new DecimalFormat("000").format(BUILD_NUMBER)));
      System.out.println(SetupUtils.BUILD_NUMBER+separator+
                     new DecimalFormat("000").format(BUILD_NUMBER));
    }
    System.out.println(NOTE_REVISION_NUMBER.get(REVISION_NUMBER));
    System.out.println(NOTE_FIX_IDS.get(FIX_IDS));
    System.out.println(NOTE_DEBUG_BUILD.get(DEBUG_BUILD));
    System.out.println(NOTE_BUILD_OS.get(BUILD_OS));
    System.out.println(NOTE_BUILD_USER.get(BUILD_USER));
    System.out.println(NOTE_BUILD_JAVA_VERSION.get(BUILD_JAVA_VERSION));
    System.out.println(NOTE_BUILD_JAVA_VENDOR.get(BUILD_JAVA_VENDOR));
    System.out.println(NOTE_BUILD_JVM_VERSION.get(BUILD_JVM_VERSION));
    System.out.println(NOTE_BUILD_JVM_VENDOR.get(BUILD_JVM_VENDOR));
    System.out.println(NOTE_UPGRADE_EVENTS.get(StaticUtils.listToString(
                      VersionCompatibilityIssue.getAllEvents(), ",")));
    System.out.println(SetupUtils.REVISION_NUMBER+separator+REVISION_NUMBER);
    System.out.println(SetupUtils.FIX_IDS+separator+FIX_IDS);
    System.out.println(SetupUtils.DEBUG_BUILD+separator+DEBUG_BUILD);
    System.out.println(SetupUtils.BUILD_OS+separator+BUILD_OS);
    System.out.println(SetupUtils.BUILD_USER+separator+BUILD_USER);
    System.out.println(SetupUtils.BUILD_JAVA_VERSION+separator+
        BUILD_JAVA_VERSION);
    System.out.println(SetupUtils.BUILD_JAVA_VENDOR+separator+
        BUILD_JAVA_VENDOR);
    System.out.println(SetupUtils.BUILD_JVM_VERSION+separator+
        BUILD_JVM_VERSION);
    System.out.println(SetupUtils.BUILD_JVM_VENDOR+separator+BUILD_JVM_VENDOR);
    System.out.println(SetupUtils.INCOMPATIBILITY_EVENTS+separator+
        StaticUtils.listToString(
            VersionCompatibilityIssue.getAllEvents(), ","));
  }
}
opends/src/server/org/opends/server/util/SetupUtils.java
@@ -82,6 +82,44 @@
   */
  public static final String LIBRARIES_PATH_RELATIVE = "lib";
  /* These string values must be synchronized with Directory Server's main
   * method.  These string values are considered stable by the server team and
   * not candidates for internationalization. */
  /** Product name. */
  public static final String NAME = "Name";
  /** Build ID. */
  public static final String BUILD_ID = "Build ID";
  /** Major version. */
  public static final String MAJOR_VERSION = "Major Version";
  /** Minor version. */
  public static final String MINOR_VERSION = "Minor Version";
  /** Point version of the product. */
  public static final String POINT_VERSION = "Point Version";
  /** Revision number in SVN. */
  public static final String REVISION_NUMBER = "Revision Number";
  /** The version qualifier. */
  public static final String VERSION_QUALIFIER = "Version Qualifier";
  /** Incompatibilities found between builds (used by the upgrade tool). */
  public static final String INCOMPATIBILITY_EVENTS = "Upgrade Event IDs";
  /** Fix IDs associated with the build. */
  public static final String FIX_IDS = "Fix IDs";
  /** Debug build identifier. */
  public static final String DEBUG_BUILD = "Debug Build";
  /** The OS used during the build. */
  public static final String BUILD_OS = "Build OS";
  /** The user that generated the build. */
  public static final String BUILD_USER = "Build User";
  /** The java version used to generate the build. */
  public static final String BUILD_JAVA_VERSION = "Build Java Version";
  /** The java vendor of the JVM used to build. */
  public static final String BUILD_JAVA_VENDOR = "Build Java Vendor";
  /** The version of the JVM used to create the build. */
  public static final String BUILD_JVM_VERSION = "Build JVM Version";
  /** The vendor of the JVM used to create the build. */
  public static final String BUILD_JVM_VENDOR = "Build JVM Vendor";
  /** The build number. */
  public static final String BUILD_NUMBER = "Build Number";
  /**
   * Creates a MakeLDIF template file using the provided information.
   *