Author: jverhaeg(a)redhat.com
Date: 2008-05-07 12:26:20 -0400 (Wed, 07 May 2008)
New Revision: 121
Modified:
trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java
trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties
Log:
DNA-59: Removed I18n.replaceParameters methods and replaced all usages with
StringUtil.createString, which now contains the same logic sans i18n stuff. The I18n
usage of createString modifies any thrown exception to include information identifying
where the exception occurred. Also added some test cases for createString to
StringUtilTest.
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java 2008-05-07
16:25:17 UTC (rev 120)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java 2008-05-07
16:26:20 UTC (rev 121)
@@ -34,21 +34,6 @@
// Make sure the following I18n.java-related fields are defined before all other
fields to ensure a valid error message is
// produced in the event of a missing/duplicate/unused property
- /**
- * Parameters:
- * <ol>
- * <li>{@link I18n#id() ID}</li>
- * <li>Number of supplied arguments</li>
- * <li>Localized text before parameter substitution</li>
- * <li>Localized text after parameter substitution</li>
- * </ol>
- */
- public static I18n i18nArgumentsMismatchedParameter;
- public static I18n i18nArgumentMismatchedParameters;
- public static I18n i18nArgumentsMismatchedParameters;
- public static I18n i18nReplaceArgumentsMismatchedParameter;
- public static I18n i18nReplaceArgumentMismatchedParameters;
- public static I18n i18nReplaceArgumentsMismatchedParameters;
public static I18n i18nClassInterface;
public static I18n i18nClassNotPublic;
public static I18n i18nFieldFinal;
@@ -56,26 +41,21 @@
public static I18n i18nFieldNotPublic;
public static I18n i18nFieldNotStatic;
public static I18n i18nLocalizationFileNotFound;
- public static I18n i18nLocalizationProblems;
+ public static I18n i18nLocalizationProblems;
+ public static I18n i18nRequiredToSuppliedParameterMismatch;
- /**
- * Parameters:
- * <ol>
- * <li>{@link I18n#id() Property}</li>
- * <li>Localization file URL</li>
- * </ol>
- */
+ /**
+ * Parameters:
+ * <ol>
+ * <li>{@link I18n#id() Property}</li>
+ * <li>Localization file URL</li>
+ * </ol>
+ */
public static I18n i18nPropertyDuplicate;
public static I18n i18nPropertyMissing;
public static I18n i18nPropertyUnused;
// Core-related fields
- public static I18n componentClassnameNotValid;
- public static I18n componentNotConfigured;
- public static I18n progressMonitorBeginTask;
- public static I18n progressMonitorStatus;
- public static I18n nullProgressMonitorTaskName;
-
public static I18n argumentMayNotBeNegative;
public static I18n argumentMayNotBePositive;
public static I18n argumentMustBeNegative;
@@ -94,14 +74,19 @@
public static I18n argumentDidNotContainObject;
public static I18n argumentDidNotContainKey;
public static I18n argumentMayNotContainNullValue;
-
+ public static I18n componentClassnameNotValid;
+ public static I18n componentNotConfigured;
public static I18n dateParsingFailure;
-
+ public static I18n initialProgressMonitorTaskName;
+ public static I18n nullProgressMonitorTaskName;
public static I18n pathAncestorDegreeIsInvalid;
public static I18n pathIsAlreadyAbsolute;
public static I18n pathIsNotAbsolute;
public static I18n pathIsNotRelative;
public static I18n pathCannotBeNormalized;
+ public static I18n progressMonitorBeginTask;
+ public static I18n progressMonitorStatus;
+ public static I18n requiredToSuppliedParameterMismatch;
static {
try {
@@ -112,14 +97,14 @@
}
public static Set<Locale> getLocalizationProblemLocales() {
- return I18n.getLocalizationProblemLocales(CommonI18n.class);
- }
+ return I18n.getLocalizationProblemLocales(CommonI18n.class);
+ }
public static Set<String> getLocalizationProblems() {
- return I18n.getLocalizationProblems(CommonI18n.class);
- }
+ return I18n.getLocalizationProblems(CommonI18n.class);
+ }
public static Set<String> getLocalizationProblems( Locale locale ) {
- return I18n.getLocalizationProblems(CommonI18n.class, locale);
- }
+ return I18n.getLocalizationProblems(CommonI18n.class, locale);
+ }
}
Modified: trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties
===================================================================
---
trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties 2008-05-07
16:25:17 UTC (rev 120)
+++
trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties 2008-05-07
16:26:20 UTC (rev 121)
@@ -1,12 +1,6 @@
# Make sure the following I18n.java-related properties are defined before all other
properties to ensure a valid error message is
# produced in the event of a missing/duplicate/unused property
-i18nArgumentsMismatchedParameter = {0} arguments were supplied to internationalization
object "{1}", but 1 parameter is required: "{2}" =>
"{3}"
-i18nArgumentMismatchedParameters = 1 argument was supplied to internationalization object
"{0}", but {1} parameters are required: "{2}" => "{3}"
-i18nArgumentsMismatchedParameters = {0} arguments were supplied to internationalization
object "{1}", but {2} parameters are required: "{3}" =>
"{4}"
-i18nReplaceArgumentsMismatchedParameter = {0} arguments were supplied, but 1 parameter is
required: "{1}" => "{2}"
-i18nReplaceArgumentMismatchedParameters = 1 argument was supplied, but {0} parameters are
required: "{1}" => "{2}"
-i18nReplaceArgumentsMismatchedParameters = {0} arguments were supplied, but {1}
parameters are required: "{2}" => "{3}"
i18nClassInterface = Internationalization class {0} must not be an interface.
i18nClassNotPublic = Internationalization {0} must be public.
i18nFieldFinal = Internationalization field "{0}" in {1} must not be final.
@@ -18,14 +12,9 @@
i18nPropertyDuplicate = Duplicate property values were found for property "{0}"
in localization file "{1}";
i18nPropertyMissing = Missing property "{0}" in localization file
"{1}".
i18nPropertyUnused = An unused property, "{0}", was found in localization file
"{1}".
+i18nRequiredToSuppliedParameterMismatch = Internationalization field "{0}" in
{1}: {2}
# Core-related fields
-componentClassnameNotValid = The class name {0} specified for {1} is not a valid Java
class name
-componentNotConfigured = The component {0} was not configured and will not be used
-progressMonitorBeginTask = Beginning {0} ({1})
-progressMonitorStatus = {0}
-nullProgressMonitorTaskName = Not available
-
argumentMayNotBeNegative = The {0} argument value, {1}, may not be negative
argumentMayNotBePositive = The {0} argument value, {1}, may not be positive
argumentMustBeNegative = The {0} argument value, {1}, must be negative
@@ -44,11 +33,16 @@
argumentDidNotContainObject = "The {0} argument did not contain the expected object
{1}
argumentDidNotContainKey = "The {0} argument did not contain the expected key {1}
argumentMayNotContainNullValue = The {0} argument may not contain a null value (first
null found at position {1})
-
+componentClassnameNotValid = The class name {0} specified for {1} is not a valid Java
class name
+componentNotConfigured = The component {0} was not configured and will not be used
+dateParsingFailure = Unable to parse the date "{0}" using the standard ISO 8601
format
+initialProgressMonitorTaskName =
+nullProgressMonitorTaskName = Not available
pathAncestorDegreeIsInvalid = Unable to obtain the {1} ancestor for {0}
pathIsAlreadyAbsolute = The path {0} is already an absolute path
pathIsNotAbsolute = The path {0} is not an absolute path
pathIsNotRelative = The path {0} is not a relative path
pathCannotBeNormalized = The path {0} is invalid and cannot be normalized
-
-dateParsingFailure = Unable to parse the date "{0}" using the standard ISO 8601
format
+progressMonitorBeginTask = Beginning {0} ({1})
+progressMonitorStatus = {0}
+requiredToSuppliedParameterMismatch = {0} parameter{1} supplied, but {2} parameter{3}
required: "{4}" => "{5}"
Show replies by date