harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r450026 - in /incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java: java/text/ org/apache/harmony/text/internal/nls/
Date Tue, 26 Sep 2006 12:28:25 GMT
Author: tellison
Date: Tue Sep 26 05:28:24 2006
New Revision: 450026

URL: http://svn.apache.org/viewvc?view=rev&rev=450026
Log:
Apply patch HARMONY-1321 ([classlib][internationalization]Internationalization of the text module)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Annotation.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedCharacterIterator.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedString.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Bidi.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormat.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormatSymbols.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormat.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/FieldPosition.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/ParsePosition.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Annotation.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Annotation.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Annotation.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Annotation.java Tue Sep 26 05:28:24 2006
@@ -32,6 +32,6 @@
 	}
 
 	public String toString() {
-		return getClass().getName() + "[value=" + value + ']';
+		return getClass().getName() + "[value=" + value + ']'; //$NON-NLS-1$
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedCharacterIterator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedCharacterIterator.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedCharacterIterator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedCharacterIterator.java Tue Sep 26 05:28:24 2006
@@ -21,7 +21,7 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.text.internal.nls.Messages;
 
 /**
  * AttributedCharacterIterator
@@ -33,11 +33,11 @@
 		private static final long serialVersionUID = -9142742483513960612L;
 
 		public static final Attribute INPUT_METHOD_SEGMENT = new Attribute(
-				"input_method_segment");
+				"input_method_segment"); //$NON-NLS-1$
 
-		public static final Attribute LANGUAGE = new Attribute("language");
+		public static final Attribute LANGUAGE = new Attribute("language"); //$NON-NLS-1$
 
-		public static final Attribute READING = new Attribute("reading");
+		public static final Attribute READING = new Attribute("reading"); //$NON-NLS-1$
 
 		private String name;
 
@@ -61,14 +61,16 @@
 
 		protected Object readResolve() throws InvalidObjectException {
 			if (this.getClass() != Attribute.class)
-				throw new InvalidObjectException(Msg.getString("K000c"));
+                // text.0C=cannot resolve subclasses
+				throw new InvalidObjectException(Messages.getString("text.0C")); //$NON-NLS-1$
 			if (this.equals(INPUT_METHOD_SEGMENT))
 				return INPUT_METHOD_SEGMENT;
 			if (this.equals(LANGUAGE))
 				return LANGUAGE;
 			if (this.equals(READING))
 				return READING;
-			throw new InvalidObjectException(Msg.getString("K000d"));
+            // text.02=Unknown attribute
+			throw new InvalidObjectException(Messages.getString("text.02")); //$NON-NLS-1$
 		}
 
 		public String toString() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedString.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedString.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedString.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedString.java Tue Sep 26 05:28:24 2006
@@ -28,7 +28,7 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.text.internal.nls.Messages;
 
 /**
  * AttributedString
@@ -400,7 +400,8 @@
 
     public AttributedString(AttributedCharacterIterator iterator) {
         if (iterator.getBeginIndex() > iterator.getEndIndex()) {
-        	throw new IllegalArgumentException("Invalid substring range");
+            // text.0A=Invalid substring range
+        	throw new IllegalArgumentException(Messages.getString("text.0A")); //$NON-NLS-1$
         }
         StringBuffer buffer = new StringBuffer();
         for (int i = iterator.getBeginIndex(); i < iterator.getEndIndex(); i++) { 
@@ -490,7 +491,8 @@
             throw new NullPointerException();
         }
         if (value.length() == 0 && !attributes.isEmpty()) {
-            throw new IllegalArgumentException(Msg.getString("K000e"));
+            // text.0B=Cannot add attributes to empty string
+            throw new IllegalArgumentException(Messages.getString("text.0B")); //$NON-NLS-1$
         }
         text = value;
         attributeMap = new HashMap<Attribute, List<Range>>((attributes.size() * 4 / 3) + 1);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Bidi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Bidi.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Bidi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Bidi.java Tue Sep 26 05:28:24 2006
@@ -23,6 +23,7 @@
 
 import org.apache.harmony.text.BidiRun;
 import org.apache.harmony.text.BidiWrapper;
+import org.apache.harmony.text.internal.nls.Messages;
 
 
 /**
@@ -92,7 +93,8 @@
 	 */
 	public Bidi(AttributedCharacterIterator paragraph) {
         if (paragraph == null) {
-            throw new IllegalArgumentException("paragraph is null");
+            // text.14=paragraph is null
+            throw new IllegalArgumentException(Messages.getString("text.14")); //$NON-NLS-1$
         }
 
         int begin = paragraph.getBeginIndex();
@@ -189,13 +191,16 @@
 	public Bidi(char[] text, int textStart, byte[] embeddings, int embStart,
 			int paragraphLength, int flags) {
 		if (textStart < 0) {
-			throw new IllegalArgumentException("Negative textStart value " + textStart);  
+            // text.0D=Negative textStart value {0}
+			throw new IllegalArgumentException(Messages.getString("text.0D", textStart));   //$NON-NLS-1$
 		}
 		if (embStart < 0) {
-			throw new IllegalArgumentException("Negative embStart value " + embStart);  
+            // text.10=Negative embStart value {0}
+			throw new IllegalArgumentException(Messages.getString("text.10", embStart));   //$NON-NLS-1$
 		}
 		if (paragraphLength < 0) {
-			throw new IllegalArgumentException("Negative paragraph length " + paragraphLength);  
+            // text.11=Negative paragraph length {0}
+			throw new IllegalArgumentException(Messages.getString("text.11", paragraphLength));   //$NON-NLS-1$
 		}
 		long pBidi = createUBiDi(text, textStart, embeddings, embStart,
 				paragraphLength, flags);
@@ -338,7 +343,9 @@
 	 */
 	public Bidi createLineBidi(int lineStart, int lineLimit) {
 		if (lineStart < 0 || lineLimit < 0 || lineLimit > length || lineStart > lineLimit) {
-			throw new IllegalArgumentException("Invalid ranges (start=" + lineStart + ", limit=" + lineLimit + ", length=" + length + ")");
+			// text.12=Invalid ranges (start={0}, limit={1}, length={2})
+            throw new IllegalArgumentException(Messages.getString(
+                    "text.12", new Object[] { lineStart, lineLimit, length })); //$NON-NLS-1$
 		}
 		char[] text = new char[this.length];
 		Arrays.fill(text, 'a');
@@ -486,10 +493,10 @@
         if (count < 0 || levelStart < 0 || objectStart < 0
                 || count > levels.length - levelStart
                 || count > objects.length - objectStart) {
-            throw new IllegalArgumentException("Invalid ranges (levels="
-                    + levels.length + ", levelStart=" + levelStart
-                    + ", objects=" + objects.length + ", objectStart="
-                    + objectStart + ", count=" + count + ")");
+            // text.13=Invalid ranges (levels={0}, levelStart={1}, objects={2}, objectStart={3}, count={4})
+            throw new IllegalArgumentException(Messages.getString("text.13", //$NON-NLS-1$
+                    new Object[] { levels.length, levelStart, objects.length,
+                            objectStart, count }));
         }
         byte[] realLevels = new byte[count];
         System.arraycopy(levels, levelStart, realLevels, 0, count);
@@ -531,7 +538,7 @@
 	 * @return a string containing the internal message.
 	 */
 	public String toString() {
-		return super.toString() + "[direction: " + direction + " baselevel: " + baseLevel
-			 + " length: " + length + " runs: " + (unidirectional ? "null" : runs.toString()) + "]";
+		return super.toString() + "[direction: " + direction + " baselevel: " + baseLevel //$NON-NLS-1$ //$NON-NLS-2$
+			 + " length: " + length + " runs: " + (unidirectional ? "null" : runs.toString()) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormat.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormat.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormat.java Tue Sep 26 05:28:24 2006
@@ -23,7 +23,7 @@
 import java.util.ResourceBundle;
 import java.util.TimeZone;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.text.internal.nls.Messages;
 
 /**
  * DateFormat is the abstract superclass of formats which format and parse
@@ -317,7 +317,7 @@
 	public final static DateFormat getDateInstance(int style, Locale locale) {
 		checkDateStyle(style);
 		ResourceBundle bundle = getBundle(locale);
-		String pattern = bundle.getString("Date_" + getStyleName(style));
+		String pattern = bundle.getString("Date_" + getStyleName(style)); //$NON-NLS-1$
 		return new SimpleDateFormat(pattern, locale);
 	}
 
@@ -366,8 +366,8 @@
 		checkTimeStyle(timeStyle);
 		checkDateStyle(dateStyle);
 		ResourceBundle bundle = getBundle(locale);
-		String pattern = bundle.getString("Date_" + getStyleName(dateStyle))
-				+ " " + bundle.getString("Time_" + getStyleName(timeStyle));
+		String pattern = bundle.getString("Date_" + getStyleName(dateStyle)) //$NON-NLS-1$
+				+ " " + bundle.getString("Time_" + getStyleName(timeStyle)); //$NON-NLS-1$ //$NON-NLS-2$
 		return new SimpleDateFormat(pattern, locale);
 	}
 
@@ -394,19 +394,19 @@
 		String styleName;
 		switch (style) {
 		case SHORT:
-			styleName = "SHORT";
+			styleName = "SHORT"; //$NON-NLS-1$
 			break;
 		case MEDIUM:
-			styleName = "MEDIUM";
+			styleName = "MEDIUM"; //$NON-NLS-1$
 			break;
 		case LONG:
-			styleName = "LONG";
+			styleName = "LONG"; //$NON-NLS-1$
 			break;
 		case FULL:
-			styleName = "FULL";
+			styleName = "FULL"; //$NON-NLS-1$
 			break;
 		default:
-			styleName = "";
+			styleName = ""; //$NON-NLS-1$
 		}
 		return styleName;
 	}
@@ -447,7 +447,7 @@
 	public final static DateFormat getTimeInstance(int style, Locale locale) {
 		checkTimeStyle(style);
 		ResourceBundle bundle = getBundle(locale);
-		String pattern = bundle.getString("Time_" + getStyleName(style));
+		String pattern = bundle.getString("Time_" + getStyleName(style)); //$NON-NLS-1$
 		return new SimpleDateFormat(pattern, locale);
 	}
 
@@ -592,49 +592,49 @@
         
 		private static Hashtable<Integer, Field> table = new Hashtable<Integer, Field>();
 
-		public final static Field ERA = new Field("era", Calendar.ERA);
+		public final static Field ERA = new Field("era", Calendar.ERA); //$NON-NLS-1$
 
-		public final static Field YEAR = new Field("year", Calendar.YEAR);
+		public final static Field YEAR = new Field("year", Calendar.YEAR); //$NON-NLS-1$
 
-		public final static Field MONTH = new Field("month", Calendar.MONTH);
+		public final static Field MONTH = new Field("month", Calendar.MONTH); //$NON-NLS-1$
 
-		public final static Field HOUR_OF_DAY0 = new Field("hour of day",
+		public final static Field HOUR_OF_DAY0 = new Field("hour of day", //$NON-NLS-1$
 				Calendar.HOUR_OF_DAY);
 
-		public final static Field HOUR_OF_DAY1 = new Field("hour of day 1", -1);
+		public final static Field HOUR_OF_DAY1 = new Field("hour of day 1", -1); //$NON-NLS-1$
 
-		public final static Field MINUTE = new Field("minute", Calendar.MINUTE);
+		public final static Field MINUTE = new Field("minute", Calendar.MINUTE); //$NON-NLS-1$
 
-		public final static Field SECOND = new Field("second", Calendar.SECOND);
+		public final static Field SECOND = new Field("second", Calendar.SECOND); //$NON-NLS-1$
 
-		public final static Field MILLISECOND = new Field("millisecond",
+		public final static Field MILLISECOND = new Field("millisecond", //$NON-NLS-1$
 				Calendar.MILLISECOND);
 
-		public final static Field DAY_OF_WEEK = new Field("day of week",
+		public final static Field DAY_OF_WEEK = new Field("day of week", //$NON-NLS-1$
 				Calendar.DAY_OF_WEEK);
 
-		public final static Field DAY_OF_MONTH = new Field("day of month",
+		public final static Field DAY_OF_MONTH = new Field("day of month", //$NON-NLS-1$
 				Calendar.DAY_OF_MONTH);
 
-		public final static Field DAY_OF_YEAR = new Field("day of year",
+		public final static Field DAY_OF_YEAR = new Field("day of year", //$NON-NLS-1$
 				Calendar.DAY_OF_YEAR);
 
 		public final static Field DAY_OF_WEEK_IN_MONTH = new Field(
-				"day of week in month", Calendar.DAY_OF_WEEK_IN_MONTH);
+				"day of week in month", Calendar.DAY_OF_WEEK_IN_MONTH); //$NON-NLS-1$
 
-		public final static Field WEEK_OF_YEAR = new Field("week of year",
+		public final static Field WEEK_OF_YEAR = new Field("week of year", //$NON-NLS-1$
 				Calendar.WEEK_OF_YEAR);
 
-		public final static Field WEEK_OF_MONTH = new Field("week of month",
+		public final static Field WEEK_OF_MONTH = new Field("week of month", //$NON-NLS-1$
 				Calendar.WEEK_OF_MONTH);
 
-		public final static Field AM_PM = new Field("am pm", Calendar.AM_PM);
+		public final static Field AM_PM = new Field("am pm", Calendar.AM_PM); //$NON-NLS-1$
 
-		public final static Field HOUR0 = new Field("hour", Calendar.HOUR);
+		public final static Field HOUR0 = new Field("hour", Calendar.HOUR); //$NON-NLS-1$
 
-		public final static Field HOUR1 = new Field("hour 1", -1);
+		public final static Field HOUR1 = new Field("hour 1", -1); //$NON-NLS-1$
 
-		public final static Field TIME_ZONE = new Field("time zone", -1);
+		public final static Field TIME_ZONE = new Field("time zone", -1); //$NON-NLS-1$
 
 		/**
 		 * The Calendar field that this Field represents.
@@ -690,7 +690,8 @@
                         return result;
                     }
 				} catch (IllegalArgumentException e) {
-					throw new InvalidObjectException(Msg.getString("K000d"));
+                    // text.02=Unknown attribute
+					throw new InvalidObjectException(Messages.getString("text.02")); //$NON-NLS-1$
 				}
 			} else {
 				if (this.equals(TIME_ZONE)) {
@@ -703,17 +704,19 @@
                     return HOUR_OF_DAY1;
                 }
 			}
-
-			throw new InvalidObjectException(Msg.getString("K000d"));
+			// text.02=Unknown attribute
+			throw new InvalidObjectException(Messages.getString("text.02")); //$NON-NLS-1$
 		}
 	}
 
 	private static void checkDateStyle(int style) {
 		if (!(style == SHORT || style == MEDIUM || style ==  LONG || style ==  FULL || style == DEFAULT))
-			throw new IllegalArgumentException("Illegal date style: " + style);
+            // text.0E=Illegal date style: {0}
+			throw new IllegalArgumentException(Messages.getString("text.0E", style)); //$NON-NLS-1$
 	}
 	private static void checkTimeStyle(int style) {
 		if (!(style == SHORT || style == MEDIUM || style ==  LONG || style ==  FULL || style == DEFAULT))
-			throw new IllegalArgumentException("Illegal time style: " + style);
+            // text.0F=Illegal time style: {0}
+			throw new IllegalArgumentException(Messages.getString("text.0F", style)); //$NON-NLS-1$
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormatSymbols.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormatSymbols.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormatSymbols.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DateFormatSymbols.java Tue Sep 26 05:28:24 2006
@@ -52,14 +52,14 @@
 	 */
 	public DateFormatSymbols(Locale locale) {
 		ResourceBundle bundle = Format.getBundle(locale);
-		localPatternChars = bundle.getString("LocalPatternChars");
-		ampms = bundle.getStringArray("ampm");
-		eras = bundle.getStringArray("eras");
-		months = bundle.getStringArray("months");
-		shortMonths = bundle.getStringArray("shortMonths");
-		shortWeekdays = bundle.getStringArray("shortWeekdays");
-		weekdays = bundle.getStringArray("weekdays");
-		zoneStrings = (String[][]) bundle.getObject("timezones");
+		localPatternChars = bundle.getString("LocalPatternChars"); //$NON-NLS-1$
+		ampms = bundle.getStringArray("ampm"); //$NON-NLS-1$
+		eras = bundle.getStringArray("eras"); //$NON-NLS-1$
+		months = bundle.getStringArray("months"); //$NON-NLS-1$
+		shortMonths = bundle.getStringArray("shortMonths"); //$NON-NLS-1$
+		shortWeekdays = bundle.getStringArray("shortWeekdays"); //$NON-NLS-1$
+		weekdays = bundle.getStringArray("weekdays"); //$NON-NLS-1$
+		zoneStrings = (String[][]) bundle.getObject("timezones"); //$NON-NLS-1$
 	}
 
 	/**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormat.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormat.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormat.java Tue Sep 26 05:28:24 2006
@@ -27,6 +27,8 @@
 import java.util.Currency;
 import java.util.Locale;
 
+import org.apache.harmony.text.internal.nls.Messages;
+
 /**
  * DecimalFormat is used to format and parse numbers, both integers and
  * fractions, based on a pattern. The pattern characters used can be either
@@ -769,8 +771,7 @@
         this.serialVersionOnStream = fields.get("serialVersionOnStream", 0); //$NON-NLS-1$
 
         Locale locale = (Locale) getInternalField("locale", symbols); //$NON-NLS-1$
-        dform = new com.ibm.icu.text.DecimalFormat("", // pattern,
-                // //$NON-NLS-1$
+        dform = new com.ibm.icu.text.DecimalFormat("", // pattern, //$NON-NLS-1$
                 new com.ibm.icu.text.DecimalFormatSymbols(locale));
         setInternalField("useExponentialNotation", dform, new Boolean( //$NON-NLS-1$
                 useExponentialNotation));
@@ -797,7 +798,8 @@
                 || super.getMinimumIntegerDigits() > Integer.MAX_VALUE
                 || super.getMaximumFractionDigits() > Integer.MAX_VALUE
                 || super.getMinimumIntegerDigits() > Integer.MAX_VALUE) {
-            throw new InvalidObjectException("The deserialized date is invalid"); //$NON-NLS-1$
+            // text.09=The deserialized date is invalid
+            throw new InvalidObjectException(Messages.getString("text.09"));  //$NON-NLS-1$
         }
         if (serialVersionOnStream < 3) {
             setMaximumIntegerDigits(super.getMinimumIntegerDigits());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormatSymbols.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormatSymbols.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormatSymbols.java Tue Sep 26 05:28:24 2006
@@ -64,18 +64,18 @@
 	 */
 	public DecimalFormatSymbols(Locale locale) {
 		ResourceBundle bundle = Format.getBundle(locale);
-		patternChars = bundle.getString("DecimalPatternChars").toCharArray();
-		infinity = bundle.getString("Infinity");
-		NaN = bundle.getString("NaN");
+		patternChars = bundle.getString("DecimalPatternChars").toCharArray(); //$NON-NLS-1$
+		infinity = bundle.getString("Infinity"); //$NON-NLS-1$
+		NaN = bundle.getString("NaN"); //$NON-NLS-1$
 		this.locale = locale;
 		try {
 			currency = Currency.getInstance(locale);
 			currencySymbol = currency.getSymbol(locale);
 			intlCurrencySymbol = currency.getCurrencyCode();
 		} catch (IllegalArgumentException e) {
-			currency = Currency.getInstance("XXX");
-			currencySymbol = bundle.getString("CurrencySymbol");
-			intlCurrencySymbol = bundle.getString("IntCurrencySymbol");
+			currency = Currency.getInstance("XXX"); //$NON-NLS-1$
+			currencySymbol = bundle.getString("CurrencySymbol"); //$NON-NLS-1$
+			intlCurrencySymbol = bundle.getString("IntCurrencySymbol"); //$NON-NLS-1$
 		}
 	}
 
@@ -462,41 +462,41 @@
 	}
 
 	private static final ObjectStreamField[] serialPersistentFields = {
-			new ObjectStreamField("currencySymbol", String.class),
-			new ObjectStreamField("decimalSeparator", Character.TYPE),
-			new ObjectStreamField("digit", Character.TYPE),
-			new ObjectStreamField("exponential", Character.TYPE),
-			new ObjectStreamField("groupingSeparator", Character.TYPE),
-			new ObjectStreamField("infinity", String.class),
-			new ObjectStreamField("intlCurrencySymbol", String.class),
-			new ObjectStreamField("minusSign", Character.TYPE),
-			new ObjectStreamField("monetarySeparator", Character.TYPE),
-			new ObjectStreamField("NaN", String.class),
-			new ObjectStreamField("patternSeparator", Character.TYPE),
-			new ObjectStreamField("percent", Character.TYPE),
-			new ObjectStreamField("perMill", Character.TYPE),
-			new ObjectStreamField("serialVersionOnStream", Integer.TYPE),
-			new ObjectStreamField("zeroDigit", Character.TYPE),
-			new ObjectStreamField("locale", Locale.class),};
+			new ObjectStreamField("currencySymbol", String.class), //$NON-NLS-1$
+			new ObjectStreamField("decimalSeparator", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("digit", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("exponential", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("groupingSeparator", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("infinity", String.class), //$NON-NLS-1$
+			new ObjectStreamField("intlCurrencySymbol", String.class), //$NON-NLS-1$
+			new ObjectStreamField("minusSign", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("monetarySeparator", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("NaN", String.class), //$NON-NLS-1$
+			new ObjectStreamField("patternSeparator", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("percent", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("perMill", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("serialVersionOnStream", Integer.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("zeroDigit", Character.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("locale", Locale.class),}; //$NON-NLS-1$
 
 	private void writeObject(ObjectOutputStream stream) throws IOException {
 		ObjectOutputStream.PutField fields = stream.putFields();
-		fields.put("currencySymbol", currencySymbol);
-		fields.put("decimalSeparator", getDecimalSeparator());
-		fields.put("digit", getDigit());
-		fields.put("exponential", getExponential());
-		fields.put("groupingSeparator", getGroupingSeparator());
-		fields.put("infinity", infinity);
-		fields.put("intlCurrencySymbol", intlCurrencySymbol);
-		fields.put("minusSign", getMinusSign());
-		fields.put("monetarySeparator", getMonetaryDecimalSeparator());
-		fields.put("NaN", NaN);
-		fields.put("patternSeparator", getPatternSeparator());
-		fields.put("percent", getPercent());
-		fields.put("perMill", getPerMill());
-		fields.put("serialVersionOnStream", 1);
-		fields.put("zeroDigit", getZeroDigit());
-		fields.put("locale", locale);
+		fields.put("currencySymbol", currencySymbol); //$NON-NLS-1$
+		fields.put("decimalSeparator", getDecimalSeparator()); //$NON-NLS-1$
+		fields.put("digit", getDigit()); //$NON-NLS-1$
+		fields.put("exponential", getExponential()); //$NON-NLS-1$
+		fields.put("groupingSeparator", getGroupingSeparator()); //$NON-NLS-1$
+		fields.put("infinity", infinity); //$NON-NLS-1$
+		fields.put("intlCurrencySymbol", intlCurrencySymbol); //$NON-NLS-1$
+		fields.put("minusSign", getMinusSign()); //$NON-NLS-1$
+		fields.put("monetarySeparator", getMonetaryDecimalSeparator()); //$NON-NLS-1$
+		fields.put("NaN", NaN); //$NON-NLS-1$
+		fields.put("patternSeparator", getPatternSeparator()); //$NON-NLS-1$
+		fields.put("percent", getPercent()); //$NON-NLS-1$
+		fields.put("perMill", getPerMill()); //$NON-NLS-1$
+		fields.put("serialVersionOnStream", 1); //$NON-NLS-1$
+		fields.put("zeroDigit", getZeroDigit()); //$NON-NLS-1$
+		fields.put("locale", locale); //$NON-NLS-1$
 		stream.writeFields();
 	}
 
@@ -504,25 +504,25 @@
 			ClassNotFoundException {
 		ObjectInputStream.GetField fields = stream.readFields();
 		patternChars = new char[10];
-		currencySymbol = (String) fields.get("currencySymbol", "");
-		setDecimalSeparator(fields.get("decimalSeparator", '.'));
-		setDigit(fields.get("digit", '#'));
-		setGroupingSeparator(fields.get("groupingSeparator", ','));
-		infinity = (String) fields.get("infinity", "");
-		intlCurrencySymbol = (String) fields.get("intlCurrencySymbol", "");
-		setMinusSign(fields.get("minusSign", '-'));
-		NaN = (String) fields.get("NaN", "");
-		setPatternSeparator(fields.get("patternSeparator", ';'));
-		setPercent(fields.get("percent", '%'));
-		setPerMill(fields.get("perMill", '\u2030'));
-		setZeroDigit(fields.get("zeroDigit", '0'));
-		locale = (Locale)fields.get("locale", null);
-		if (fields.get("serialVersionOnStream", 0) == 0) {
+		currencySymbol = (String) fields.get("currencySymbol", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		setDecimalSeparator(fields.get("decimalSeparator", '.')); //$NON-NLS-1$
+		setDigit(fields.get("digit", '#')); //$NON-NLS-1$
+		setGroupingSeparator(fields.get("groupingSeparator", ',')); //$NON-NLS-1$
+		infinity = (String) fields.get("infinity", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		intlCurrencySymbol = (String) fields.get("intlCurrencySymbol", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		setMinusSign(fields.get("minusSign", '-')); //$NON-NLS-1$
+		NaN = (String) fields.get("NaN", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		setPatternSeparator(fields.get("patternSeparator", ';')); //$NON-NLS-1$
+		setPercent(fields.get("percent", '%')); //$NON-NLS-1$
+		setPerMill(fields.get("perMill", '\u2030')); //$NON-NLS-1$
+		setZeroDigit(fields.get("zeroDigit", '0')); //$NON-NLS-1$
+		locale = (Locale)fields.get("locale", null); //$NON-NLS-1$
+		if (fields.get("serialVersionOnStream", 0) == 0) { //$NON-NLS-1$
 			setMonetaryDecimalSeparator(getDecimalSeparator());
 			setExponential('E');
 		} else {
-			setMonetaryDecimalSeparator(fields.get("monetarySeparator", '.'));
-			setExponential(fields.get("exponential", 'E'));
+			setMonetaryDecimalSeparator(fields.get("monetarySeparator", '.')); //$NON-NLS-1$
+			setExponential(fields.get("exponential", 'E')); //$NON-NLS-1$
 			
 		}
 		try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/FieldPosition.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/FieldPosition.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/FieldPosition.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/FieldPosition.java Tue Sep 26 05:28:24 2006
@@ -159,8 +159,8 @@
 	 * @return the string representation of this FieldPosition
 	 */
 	public String toString() {
-		return getClass().getName() + "[attribute=" + myAttribute + ", field="
-				+ myField + ", beginIndex=" + beginIndex + ", endIndex="
-				+ endIndex + "]";
+		return getClass().getName() + "[attribute=" + myAttribute + ", field=" //$NON-NLS-1$ //$NON-NLS-2$
+				+ myField + ", beginIndex=" + beginIndex + ", endIndex=" //$NON-NLS-1$ //$NON-NLS-2$
+				+ endIndex + "]"; //$NON-NLS-1$
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java Tue Sep 26 05:28:24 2006
@@ -22,7 +22,7 @@
 import java.util.Locale;
 import java.util.ResourceBundle;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.text.internal.nls.Messages;
 
 /**
  * Format is the abstract superclass of classes which format and parse objects
@@ -58,7 +58,7 @@
         return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
             public ResourceBundle run() {
                 return ResourceBundle.getBundle(
-                        "org.apache.harmony.luni.internal.locale.Locale", locale);
+                        "org.apache.harmony.luni.internal.locale.Locale", locale); //$NON-NLS-1$
             }
         });
     }
@@ -80,12 +80,15 @@
 			else if (check
 					&& !quote
 					&& ((next >= 'a' && next <= 'z') || (next >= 'A' && next <= 'Z')))
-				throw new IllegalArgumentException(Msg.getString("K001c", String.valueOf(next), template));
+                // text.05=Invalid pattern char {0} in {1}
+                throw new IllegalArgumentException(Messages.getString(
+                        "text.05", String.valueOf(next), template)); //$NON-NLS-1$
 			else
 				output.append(next);
 		}
 		if (quote)
-			throw new IllegalArgumentException(Msg.getString("K0019"));
+            // text.04=Unterminated quote
+			throw new IllegalArgumentException(Messages.getString("text.04")); //$NON-NLS-1$
 		return output.toString();
 	}
 
@@ -221,8 +224,8 @@
 			}
 			buffer.append(ch);
 		}
-		// Unmatched braces in the pattern
-		throw new IllegalArgumentException(Msg.getString("K0346"));
+		// text.07=Unmatched braces in the pattern
+		throw new IllegalArgumentException(Messages.getString("text.07")); //$NON-NLS-1$
 	}
 
 	/**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java Tue Sep 26 05:28:24 2006
@@ -27,7 +27,7 @@
 import java.util.Locale;
 import java.util.Vector;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.text.internal.nls.Messages;
 
 /**
  * MessageFormat is used to format and parse arguments based on a pattern. The
@@ -106,8 +106,8 @@
 				if (offset >= length
 						|| (arg = (byte) Character.digit(template
 								.charAt(offset++), 10)) == -1) {
-                    throw new IllegalArgumentException(Msg
-							.getString("K001d"));
+                    // text.19=Invalid argument number
+                    throw new IllegalArgumentException(Messages.getString("text.19")); //$NON-NLS-1$
                 }
 				position.setIndex(offset);
 				localFormats.addElement(parseVariable(template, position));
@@ -654,18 +654,18 @@
 		char ch;
 		if (offset >= length
 				|| ((ch = string.charAt(offset++)) != '}' && ch != ',')) {
-            throw new IllegalArgumentException(Msg
-					.getString("K001e"));
+            // text.15=Missing element format
+            throw new IllegalArgumentException(Messages.getString("text.15")); //$NON-NLS-1$
         }
 		position.setIndex(offset);
 		if (ch == '}') {
             return null;
         }
-		int type = match(string, position, false, new String[] { "time",
-				"date", "number", "choice" });
+		int type = match(string, position, false, new String[] { "time", //$NON-NLS-1$
+				"date", "number", "choice" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		if (type == -1) {
-            throw new IllegalArgumentException(Msg
-					.getString("K001f"));
+            // text.16=Unknown element format
+            throw new IllegalArgumentException(Messages.getString("text.16")); //$NON-NLS-1$
         }
 		StringBuffer buffer = new StringBuffer();
 		ch = string.charAt(position.getIndex() - 1);
@@ -678,7 +678,7 @@
 						.getTimeInstance(DateFormat.DEFAULT, locale);
             }
 			int dateStyle = match(string, position, true, new String[] {
-					"full", "long", "medium", "short" });
+					"full", "long", "medium", "short" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 			if (dateStyle == -1) {
 				Format.upToWithQuotes(string, position, buffer, '}', '{');
 				return new SimpleDateFormat(buffer.toString(), locale);
@@ -704,7 +704,7 @@
                 return NumberFormat.getInstance();
             }
 			int numberStyle = match(string, position, true, new String[] {
-					"currency", "percent", "integer" });
+					"currency", "percent", "integer" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			if (numberStyle == -1) {
 				Format.upToWithQuotes(string, position, buffer, '}', '{');
 				return new DecimalFormat(buffer.toString(),
@@ -777,15 +777,15 @@
 	}
 
 	private String decodeDecimalFormat(StringBuffer buffer, Format format) {
-		buffer.append(",number");
+		buffer.append(",number"); //$NON-NLS-1$
 		if (format.equals(NumberFormat.getNumberInstance(locale))) {
 			// Empty block
 		} else if (format.equals(NumberFormat.getIntegerInstance(locale))) {
-            buffer.append(",integer");
+            buffer.append(",integer"); //$NON-NLS-1$
         } else if (format.equals(NumberFormat.getCurrencyInstance(locale))) {
-            buffer.append(",currency");
+            buffer.append(",currency"); //$NON-NLS-1$
         } else if (format.equals(NumberFormat.getPercentInstance(locale))) {
-            buffer.append(",percent");
+            buffer.append(",percent"); //$NON-NLS-1$
         } else {
 			buffer.append(',');
 			return ((DecimalFormat) format).toPattern();
@@ -796,30 +796,30 @@
 	private String decodeSimpleDateFormat(StringBuffer buffer, Format format) {
 		if (format.equals(DateFormat
 				.getTimeInstance(DateFormat.DEFAULT, locale))) {
-            buffer.append(",time");
+            buffer.append(",time"); //$NON-NLS-1$
         } else if (format.equals(DateFormat.getDateInstance(DateFormat.DEFAULT,
 				locale))) {
-            buffer.append(",date");
+            buffer.append(",date"); //$NON-NLS-1$
         } else if (format.equals(DateFormat.getTimeInstance(DateFormat.SHORT,
 				locale))) {
-            buffer.append(",time,short");
+            buffer.append(",time,short"); //$NON-NLS-1$
         } else if (format.equals(DateFormat.getDateInstance(DateFormat.SHORT,
 				locale))) {
-            buffer.append(",date,short");
+            buffer.append(",date,short"); //$NON-NLS-1$
         } else if (format.equals(DateFormat.getTimeInstance(DateFormat.LONG,
 				locale))) {
-            buffer.append(",time,long");
+            buffer.append(",time,long"); //$NON-NLS-1$
         } else if (format.equals(DateFormat.getDateInstance(DateFormat.LONG,
 				locale))) {
-            buffer.append(",date,long");
+            buffer.append(",date,long"); //$NON-NLS-1$
         } else if (format.equals(DateFormat.getTimeInstance(DateFormat.FULL,
 				locale))) {
-            buffer.append(",time,full");
+            buffer.append(",time,full"); //$NON-NLS-1$
         } else if (format.equals(DateFormat.getDateInstance(DateFormat.FULL,
 				locale))) {
-            buffer.append(",date,full");
+            buffer.append(",date,full"); //$NON-NLS-1$
         } else {
-			buffer.append(",date,");
+			buffer.append(",date,"); //$NON-NLS-1$
 			return ((SimpleDateFormat) format).toPattern();
 		}
 		return null;
@@ -839,15 +839,15 @@
 			Format format = formats[i];
 			String pattern = null;
 			if (format instanceof ChoiceFormat) {
-				buffer.append(",choice,");
+				buffer.append(",choice,"); //$NON-NLS-1$
 				pattern = ((ChoiceFormat) format).toPattern();
 			} else if (format instanceof DecimalFormat) {
 				pattern = decodeDecimalFormat(buffer, format);
 			} else if (format instanceof SimpleDateFormat) {
 				pattern = decodeSimpleDateFormat(buffer, format);
 			} else if (format != null) {
-                throw new IllegalArgumentException(Msg
-						.getString("K0020"));
+                // text.17=Unknown format
+                throw new IllegalArgumentException(Messages.getString("text.17")); //$NON-NLS-1$
             }
 			if (pattern != null) {
 				boolean quote = false;
@@ -865,7 +865,7 @@
 							if (count > 0) {
                                 count--;
                             } else {
-								buffer.append("'}");
+								buffer.append("'}"); //$NON-NLS-1$
 								ch = '\'';
 							}
 						}
@@ -896,20 +896,20 @@
 	}
 
 	private static final ObjectStreamField[] serialPersistentFields = {
-			new ObjectStreamField("argumentNumbers", int[].class),
-			new ObjectStreamField("formats", Format[].class),
-			new ObjectStreamField("locale", Locale.class),
-			new ObjectStreamField("maxOffset", Integer.TYPE),
-			new ObjectStreamField("offsets", int[].class),
-			new ObjectStreamField("pattern", String.class), };
+			new ObjectStreamField("argumentNumbers", int[].class), //$NON-NLS-1$
+			new ObjectStreamField("formats", Format[].class), //$NON-NLS-1$
+			new ObjectStreamField("locale", Locale.class), //$NON-NLS-1$
+			new ObjectStreamField("maxOffset", Integer.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("offsets", int[].class), //$NON-NLS-1$
+			new ObjectStreamField("pattern", String.class), }; //$NON-NLS-1$
 
 	private void writeObject(ObjectOutputStream stream) throws IOException {
 		ObjectOutputStream.PutField fields = stream.putFields();
-		fields.put("argumentNumbers", argumentNumbers);
+		fields.put("argumentNumbers", argumentNumbers); //$NON-NLS-1$
 		Format[] compatibleFormats = formats;
-		fields.put("formats", compatibleFormats);
-		fields.put("locale", locale);
-		fields.put("maxOffset", maxOffset);
+		fields.put("formats", compatibleFormats); //$NON-NLS-1$
+		fields.put("locale", locale); //$NON-NLS-1$
+		fields.put("maxOffset", maxOffset); //$NON-NLS-1$
 		int offset = 0;
 		int offsetsLength = maxOffset + 1;
 		int[] offsets = new int[offsetsLength];
@@ -922,20 +922,20 @@
 		if (maxOffset + 1 < strings.length) {
             pattern.append(strings[maxOffset + 1]);
         }
-		fields.put("offsets", offsets);
-		fields.put("pattern", pattern.toString());
+		fields.put("offsets", offsets); //$NON-NLS-1$
+		fields.put("pattern", pattern.toString()); //$NON-NLS-1$
 		stream.writeFields();
 	}
 
 	private void readObject(ObjectInputStream stream) throws IOException,
 			ClassNotFoundException {
 		ObjectInputStream.GetField fields = stream.readFields();
-		argumentNumbers = (int[]) fields.get("argumentNumbers", null);
-		formats = (Format[]) fields.get("formats", null);
-		locale = (Locale) fields.get("locale", null);
-		maxOffset = fields.get("maxOffset", 0);
-		int[] offsets = (int[]) fields.get("offsets", null);
-		String pattern = (String) fields.get("pattern", null);
+		argumentNumbers = (int[]) fields.get("argumentNumbers", null); //$NON-NLS-1$
+		formats = (Format[]) fields.get("formats", null); //$NON-NLS-1$
+		locale = (Locale) fields.get("locale", null); //$NON-NLS-1$
+		maxOffset = fields.get("maxOffset", 0); //$NON-NLS-1$
+		int[] offsets = (int[]) fields.get("offsets", null); //$NON-NLS-1$
+		String pattern = (String) fields.get("pattern", null); //$NON-NLS-1$
 		int length;
 		if (maxOffset < 0) {
             length = pattern.length() > 0 ? 1 : 0;
@@ -967,7 +967,7 @@
         
         private static final long serialVersionUID = 7899943957617360810L;
         
-		public static final Field ARGUMENT = new Field("message argument field");
+		public static final Field ARGUMENT = new Field("message argument field"); //$NON-NLS-1$
 
 		/**
 		 * Constructs a new instance of MessageFormat.Field with the given field
@@ -984,17 +984,17 @@
 		protected Object readResolve() throws InvalidObjectException {
 			String name = this.getName();
 			if (name == null) {
-                // "Not a valid {0}, subclass should override readResolve()"
-				throw new InvalidObjectException(
-						Msg.getString("K0344", "MessageFormat.Field"));
+                // text.18=Not a valid {0}, subclass should override readResolve()
+                throw new InvalidObjectException(Messages.getString(
+                        "text.18", "MessageFormat.Field")); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
-			if (name.equals(ARGUMENT.getName())) {
+            if (name.equals(ARGUMENT.getName())) {
                 return ARGUMENT;
             }
-
-			throw new InvalidObjectException(
-					Msg.getString("K0344", "MessageFormat.Field"));
+            // text.18=Not a valid {0}, subclass should override readResolve()
+            throw new InvalidObjectException(Messages.getString(
+                    "text.18", "MessageFormat.Field")); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java Tue Sep 26 05:28:24 2006
@@ -25,7 +25,7 @@
 import java.util.Locale;
 import java.util.ResourceBundle;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.text.internal.nls.Messages;
 
 /**
  * NumberFormat is the abstract superclass of Formats which format and parse
@@ -226,7 +226,7 @@
 	 * @return a NumberFormat
 	 */
 	public static NumberFormat getCurrencyInstance(Locale locale) {
-		return getInstance(locale, "Currency");
+		return getInstance(locale, "Currency"); //$NON-NLS-1$
 	}
 
 	/**
@@ -248,7 +248,7 @@
 	 * @return a NumberFormat
 	 */
 	public static NumberFormat getIntegerInstance(Locale locale) {
-		NumberFormat format = getInstance(locale, "Integer");
+		NumberFormat format = getInstance(locale, "Integer"); //$NON-NLS-1$
 		format.setParseIntegerOnly(true);
 		return format;
 	}
@@ -341,7 +341,7 @@
 	 * @return a NumberFormat
 	 */
 	public static NumberFormat getNumberInstance(Locale locale) {
-		return getInstance(locale, "Number");
+		return getInstance(locale, "Number"); //$NON-NLS-1$
 	}
 
 	static String getPattern(Locale locale, String type) {
@@ -368,7 +368,7 @@
 	 * @return a NumberFormat
 	 */
 	public static NumberFormat getPercentInstance(Locale locale) {
-		return getInstance(locale, "Percent");
+		return getInstance(locale, "Percent"); //$NON-NLS-1$
 	}
 
 	/**
@@ -564,75 +564,75 @@
 	}
 
 	private static final ObjectStreamField[] serialPersistentFields = {
-			new ObjectStreamField("groupingUsed", Boolean.TYPE),
-			new ObjectStreamField("maxFractionDigits", Byte.TYPE),
-			new ObjectStreamField("maximumFractionDigits", Integer.TYPE),
-			new ObjectStreamField("maximumIntegerDigits", Integer.TYPE),
-			new ObjectStreamField("maxIntegerDigits", Byte.TYPE),
-			new ObjectStreamField("minFractionDigits", Byte.TYPE),
-			new ObjectStreamField("minimumFractionDigits", Integer.TYPE),
-			new ObjectStreamField("minimumIntegerDigits", Integer.TYPE),
-			new ObjectStreamField("minIntegerDigits", Byte.TYPE),
-			new ObjectStreamField("parseIntegerOnly", Boolean.TYPE),
-			new ObjectStreamField("serialVersionOnStream", Integer.TYPE), };
+			new ObjectStreamField("groupingUsed", Boolean.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("maxFractionDigits", Byte.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("maximumFractionDigits", Integer.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("maximumIntegerDigits", Integer.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("maxIntegerDigits", Byte.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("minFractionDigits", Byte.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("minimumFractionDigits", Integer.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("minimumIntegerDigits", Integer.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("minIntegerDigits", Byte.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("parseIntegerOnly", Boolean.TYPE), //$NON-NLS-1$
+			new ObjectStreamField("serialVersionOnStream", Integer.TYPE), }; //$NON-NLS-1$
 
 	private void writeObject(ObjectOutputStream stream) throws IOException {
 		ObjectOutputStream.PutField fields = stream.putFields();
-		fields.put("groupingUsed", groupingUsed);
+		fields.put("groupingUsed", groupingUsed); //$NON-NLS-1$
 		fields
 				.put(
-						"maxFractionDigits",
+						"maxFractionDigits", //$NON-NLS-1$
 						maximumFractionDigits < Byte.MAX_VALUE ? (byte) maximumFractionDigits
 								: Byte.MAX_VALUE);
-		fields.put("maximumFractionDigits", maximumFractionDigits);
-		fields.put("maximumIntegerDigits", maximumIntegerDigits);
+		fields.put("maximumFractionDigits", maximumFractionDigits); //$NON-NLS-1$
+		fields.put("maximumIntegerDigits", maximumIntegerDigits); //$NON-NLS-1$
 		fields
 				.put(
-						"maxIntegerDigits",
+						"maxIntegerDigits", //$NON-NLS-1$
 						maximumIntegerDigits < Byte.MAX_VALUE ? (byte) maximumIntegerDigits
 								: Byte.MAX_VALUE);
 		fields
 				.put(
-						"minFractionDigits",
+						"minFractionDigits", //$NON-NLS-1$
 						minimumFractionDigits < Byte.MAX_VALUE ? (byte) minimumFractionDigits
 								: Byte.MAX_VALUE);
-		fields.put("minimumFractionDigits", minimumFractionDigits);
-		fields.put("minimumIntegerDigits", minimumIntegerDigits);
+		fields.put("minimumFractionDigits", minimumFractionDigits); //$NON-NLS-1$
+		fields.put("minimumIntegerDigits", minimumIntegerDigits); //$NON-NLS-1$
 		fields
 				.put(
-						"minIntegerDigits",
+						"minIntegerDigits", //$NON-NLS-1$
 						minimumIntegerDigits < Byte.MAX_VALUE ? (byte) minimumIntegerDigits
 								: Byte.MAX_VALUE);
-		fields.put("parseIntegerOnly", parseIntegerOnly);
-		fields.put("serialVersionOnStream", 1);
+		fields.put("parseIntegerOnly", parseIntegerOnly); //$NON-NLS-1$
+		fields.put("serialVersionOnStream", 1); //$NON-NLS-1$
 		stream.writeFields();
 	}
 
 	private void readObject(ObjectInputStream stream) throws IOException,
 			ClassNotFoundException {
 		ObjectInputStream.GetField fields = stream.readFields();
-		groupingUsed = fields.get("groupingUsed", true);
-		parseIntegerOnly = fields.get("parseIntegerOnly", false);
-		if (fields.get("serialVersionOnStream", 0) == 0) {
-			maximumFractionDigits = fields.get("maxFractionDigits", (byte) 3);
-			maximumIntegerDigits = fields.get("maxIntegerDigits", (byte) 40);
-			minimumFractionDigits = fields.get("minFractionDigits", (byte) 0);
-			minimumIntegerDigits = fields.get("minIntegerDigits", (byte) 1);
+		groupingUsed = fields.get("groupingUsed", true); //$NON-NLS-1$
+		parseIntegerOnly = fields.get("parseIntegerOnly", false); //$NON-NLS-1$
+		if (fields.get("serialVersionOnStream", 0) == 0) { //$NON-NLS-1$
+			maximumFractionDigits = fields.get("maxFractionDigits", (byte) 3); //$NON-NLS-1$
+			maximumIntegerDigits = fields.get("maxIntegerDigits", (byte) 40); //$NON-NLS-1$
+			minimumFractionDigits = fields.get("minFractionDigits", (byte) 0); //$NON-NLS-1$
+			minimumIntegerDigits = fields.get("minIntegerDigits", (byte) 1); //$NON-NLS-1$
 		} else {
-			maximumFractionDigits = fields.get("maximumFractionDigits", 3);
-			maximumIntegerDigits = fields.get("maximumIntegerDigits", 40);
-			minimumFractionDigits = fields.get("minimumFractionDigits", 0);
-			minimumIntegerDigits = fields.get("minimumIntegerDigits", 1);
+			maximumFractionDigits = fields.get("maximumFractionDigits", 3); //$NON-NLS-1$
+			maximumIntegerDigits = fields.get("maximumIntegerDigits", 40); //$NON-NLS-1$
+			minimumFractionDigits = fields.get("minimumFractionDigits", 0); //$NON-NLS-1$
+			minimumIntegerDigits = fields.get("minimumIntegerDigits", 1); //$NON-NLS-1$
 		}
 		if (minimumIntegerDigits > maximumIntegerDigits
 				|| minimumFractionDigits > maximumFractionDigits) {
-            throw new InvalidObjectException(org.apache.harmony.luni.util.Msg
-					.getString("K00fa"));
+            // text.00=min digits greater than max digits
+            throw new InvalidObjectException(Messages.getString("text.00")); //$NON-NLS-1$
         }
 		if (minimumIntegerDigits < 0 || maximumIntegerDigits < 0
 				|| minimumFractionDigits < 0 || maximumFractionDigits < 0) {
-            throw new InvalidObjectException(org.apache.harmony.luni.util.Msg
-					.getString("K00fb"));
+            // text.01=min or max digits negative
+            throw new InvalidObjectException(Messages.getString("text.01")); //$NON-NLS-1$
         }
 	}
 
@@ -649,29 +649,29 @@
         
         private static final long serialVersionUID = 7494728892700160890L;
 
-		public static final Field SIGN = new Field("sign");
+		public static final Field SIGN = new Field("sign"); //$NON-NLS-1$
 
-		public static final Field INTEGER = new Field("integer");
+		public static final Field INTEGER = new Field("integer"); //$NON-NLS-1$
 
-		public static final Field FRACTION = new Field("fraction");
+		public static final Field FRACTION = new Field("fraction"); //$NON-NLS-1$
 
-		public static final Field EXPONENT = new Field("exponent");
+		public static final Field EXPONENT = new Field("exponent"); //$NON-NLS-1$
 
-		public static final Field EXPONENT_SIGN = new Field("exponent sign");
+		public static final Field EXPONENT_SIGN = new Field("exponent sign"); //$NON-NLS-1$
 
-		public static final Field EXPONENT_SYMBOL = new Field("exponent symbol");
+		public static final Field EXPONENT_SYMBOL = new Field("exponent symbol"); //$NON-NLS-1$
 
 		public static final Field DECIMAL_SEPARATOR = new Field(
-				"decimal separator");
+				"decimal separator"); //$NON-NLS-1$
 
 		public static final Field GROUPING_SEPARATOR = new Field(
-				"grouping separator");
+				"grouping separator"); //$NON-NLS-1$
 
-		public static final Field PERCENT = new Field("percent");
+		public static final Field PERCENT = new Field("percent"); //$NON-NLS-1$
 
-		public static final Field PERMILLE = new Field("per mille");
+		public static final Field PERMILLE = new Field("per mille"); //$NON-NLS-1$
 
-		public static final Field CURRENCY = new Field("currency");
+		public static final Field CURRENCY = new Field("currency"); //$NON-NLS-1$
 
 		/**
 		 * Constructs a new instance of NumberFormat.Field with the given field
@@ -719,8 +719,8 @@
 			if (this.equals(SIGN)) {
                 return SIGN;
             }
-
-			throw new InvalidObjectException(Msg.getString("K000d"));
+			// text.02=Unknown attribute
+			throw new InvalidObjectException(Messages.getString("text.02")); //$NON-NLS-1$
 		}
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/ParsePosition.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/ParsePosition.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/ParsePosition.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/ParsePosition.java Tue Sep 26 05:28:24 2006
@@ -109,7 +109,7 @@
 	 * @return the string representation of this FieldPosition
 	 */
 	public String toString() {
-		return getClass().getName() + "[index=" + currentPosition
-				+ ", errorIndex=" + errorIndex + "]";
+		return getClass().getName() + "[index=" + currentPosition //$NON-NLS-1$
+				+ ", errorIndex=" + errorIndex + "]"; //$NON-NLS-1$ //$NON-NLS-2$
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java Tue Sep 26 05:28:24 2006
@@ -15,7 +15,7 @@
 
 package java.text;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.text.internal.nls.Messages;
 
 
 /**
@@ -59,7 +59,8 @@
             throw new NullPointerException();
         }
         if (rules.length() == 0) {
-            throw new ParseException(Msg.getString("K034e"), 0);
+            // text.06=Build rules empty
+            throw new ParseException(Messages.getString("text.06"), 0); //$NON-NLS-1$
         }
 
         try {
@@ -149,7 +150,8 @@
 	 */
 	public int compare(String source, String target) {
         if (source == null || target == null) {
-            throw new NullPointerException("one of arguments is null");
+            // text.08=one of arguments is null
+            throw new NullPointerException(Messages.getString("text.08")); //$NON-NLS-1$
         }
 		return this.icuColl.compare(source, target);
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java Tue Sep 26 05:28:24 2006
@@ -29,6 +29,8 @@
 import java.util.TimeZone;
 import java.util.Vector;
 
+import org.apache.harmony.text.internal.nls.Messages;
+
 /**
  * SimpleDateFormat is used to format and parse gregorian calendar dates and
  * times based on a pattern of date and time fields. Each date and time field is
@@ -41,7 +43,7 @@
 
 	private static final long serialVersionUID = 4774881970558875024L;
 
-	private static final String patternChars = "GyMdkHmsSEDFwWahKzZ";
+	private static final String patternChars = "GyMdkHmsSEDFwWahKzZ"; //$NON-NLS-1$
 
 	private String pattern;
 
@@ -136,8 +138,8 @@
 		int field = -1;
 		int index = patternChars.indexOf(format);
 		if (index == -1)
-			throw new IllegalArgumentException(org.apache.harmony.luni.util.Msg.getString(
-					"K002b", format));
+            // text.03=Unknown pattern character - '{0}'
+			throw new IllegalArgumentException(Messages.getString("text.03", format)); //$NON-NLS-1$
 
 		int beginPosition = buffer.length();
 		Field dateFormatField = null;
@@ -279,7 +281,7 @@
 					sign = '-';
 					offset = -offset;
 				}
-				buffer.append("GMT");
+				buffer.append("GMT"); //$NON-NLS-1$
 				buffer.append(sign);
 				appendNumber(buffer, 2, offset / 3600000);
 				buffer.append(':');
@@ -359,8 +361,8 @@
 	private static String defaultPattern() {
 		ResourceBundle bundle = getBundle(Locale.getDefault());
 		String styleName = getStyleName(SHORT);
-		return bundle.getString("Date_" + styleName) + " "
-				+ bundle.getString("Time_" + styleName);
+		return bundle.getString("Date_" + styleName) + " " //$NON-NLS-1$ //$NON-NLS-2$
+				+ bundle.getString("Time_" + styleName); //$NON-NLS-1$
 	}
 
 	/**
@@ -476,8 +478,8 @@
 	private void validateFormat(char format) {
 		int index = patternChars.indexOf(format);
 		if (index == -1)
-			throw new IllegalArgumentException(org.apache.harmony.luni.util.Msg.getString(
-					"K002b", format));
+            // text.03=Unknown pattern character - '{0}'
+			throw new IllegalArgumentException(Messages.getString("text.03", format)); //$NON-NLS-1$
 	}
 
 	/**
@@ -532,8 +534,8 @@
 			validateFormat((char) last);
 
 		if (quote)
-			throw new IllegalArgumentException(org.apache.harmony.luni.util.Msg
-					.getString("K0019"));
+            // text.04=Unterminated quote {0}
+			throw new IllegalArgumentException(Messages.getString("text.04")); //$NON-NLS-1$
 
 	}
 
@@ -649,8 +651,8 @@
 	private int parse(String string, int offset, char format, int count) {
 		int index = patternChars.indexOf(format);
 		if (index == -1)
-			throw new IllegalArgumentException(org.apache.harmony.luni.util.Msg.getString(
-					"K002b", format));
+            // text.03=Unknown pattern character - '{0}'
+			throw new IllegalArgumentException(Messages.getString("text.03", format)); //$NON-NLS-1$
 		int field = -1;
 		int absolute = 0;
 		if (count < 0) {
@@ -895,7 +897,7 @@
 
 	private int parseTimeZone(String string, int offset) {
 		String[][] zones = formatData.zoneStrings;
-		boolean foundGMT = string.regionMatches(offset, "GMT", 0, 3);
+		boolean foundGMT = string.regionMatches(offset, "GMT", 0, 3); //$NON-NLS-1$
 		if (foundGMT)
 			offset += 3;
 		char sign;
@@ -919,11 +921,11 @@
 				raw = (hour / 100 * 3600000) + (hour % 100 * 60000);
 			if (sign == '-')
 				raw = -raw;
-			calendar.setTimeZone(new SimpleTimeZone(raw, ""));
+			calendar.setTimeZone(new SimpleTimeZone(raw, "")); //$NON-NLS-1$
 			return position.getIndex();
 		}
 		if (foundGMT) {
-			calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
+			calendar.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$
 			return offset;
 		}
 		for (int i = 0; i < zones.length; i++) {
@@ -936,7 +938,7 @@
 					int raw = zone.getRawOffset();
 					if (j >= 3 && zone.useDaylightTime())
 						raw += 3600000;
-					calendar.setTimeZone(new SimpleTimeZone(raw, ""));
+					calendar.setTimeZone(new SimpleTimeZone(raw, "")); //$NON-NLS-1$
 					return offset + zones[i][j].length();
 				}
 			}
@@ -990,31 +992,31 @@
 	}
 
 	private static final ObjectStreamField[] serialPersistentFields = {
-			new ObjectStreamField("defaultCenturyStart", Date.class),
-			new ObjectStreamField("formatData", DateFormatSymbols.class),
-			new ObjectStreamField("pattern", String.class),
-			new ObjectStreamField("serialVersionOnStream", Integer.TYPE), };
+			new ObjectStreamField("defaultCenturyStart", Date.class), //$NON-NLS-1$
+			new ObjectStreamField("formatData", DateFormatSymbols.class), //$NON-NLS-1$
+			new ObjectStreamField("pattern", String.class), //$NON-NLS-1$
+			new ObjectStreamField("serialVersionOnStream", Integer.TYPE), }; //$NON-NLS-1$
 
 	private void writeObject(ObjectOutputStream stream) throws IOException {
 		ObjectOutputStream.PutField fields = stream.putFields();
-		fields.put("defaultCenturyStart", defaultCenturyStart);
-		fields.put("formatData", formatData);
-		fields.put("pattern", pattern);
-		fields.put("serialVersionOnStream", 1);
+		fields.put("defaultCenturyStart", defaultCenturyStart); //$NON-NLS-1$
+		fields.put("formatData", formatData); //$NON-NLS-1$
+		fields.put("pattern", pattern); //$NON-NLS-1$
+		fields.put("serialVersionOnStream", 1); //$NON-NLS-1$
 		stream.writeFields();
 	}
 
 	private void readObject(ObjectInputStream stream) throws IOException,
 			ClassNotFoundException {
 		ObjectInputStream.GetField fields = stream.readFields();
-		int version = fields.get("serialVersionOnStream", 0);
+		int version = fields.get("serialVersionOnStream", 0); //$NON-NLS-1$
 		Date date;
 		if (version > 0)
-			date = (Date) fields.get("defaultCenturyStart", new Date());
+			date = (Date) fields.get("defaultCenturyStart", new Date()); //$NON-NLS-1$
 		else
 			date = new Date();
 		set2DigitYearStart(date);
-		formatData = (DateFormatSymbols) fields.get("formatData", null);
-		pattern = (String) fields.get("pattern", "");
+		formatData = (DateFormatSymbols) fields.get("formatData", null); //$NON-NLS-1$
+		pattern = (String) fields.get("pattern", ""); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties?view=diff&rev=450026&r1=450025&r2=450026
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties Tue Sep 26 05:28:24 2006
@@ -14,3 +14,29 @@
 # 
 
 # messages for EN locale
+text.00=min digits greater than max digits
+text.01=min or max digits negative
+text.02=Unknown attribute
+text.03=Unknown pattern character - '{0}'
+text.04=Unterminated quote
+text.05=Invalid pattern char {0} in {1}
+text.07=Unmatched braces in the pattern
+text.06=Build rules empty
+text.08=one of arguments is null
+text.09=The deserialized date is invalid
+text.0A=Invalid substring range
+text.0B=Cannot add attributes to empty string
+text.0C=cannot resolve subclasses
+text.0E=Illegal date style: {0}
+text.0F=Illegal time style: {0}
+text.0D=Negative textStart value {0}
+text.10=Negative embStart value {0}
+text.11=Negative paragraph length {0}
+text.12=Invalid ranges (start={0}, limit={1}, length={2})
+text.13=Invalid ranges (levels={0}, levelStart={1}, objects={2}, objectStart={3}, count={4})
+text.14=paragraph is null
+text.19=Invalid argument number
+text.15=Missing element format
+text.16=Unknown element format
+text.17=Unknown format
+text.18=Not a valid {0}, subclass should override readResolve()



Mime
View raw message