summaryrefslogtreecommitdiffstats
path: root/text/src
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-04-13 15:30:18 -0700
committerElliott Hughes <enh@google.com>2010-04-13 15:30:18 -0700
commit5dc59cfad86607a8348c4561ec91584462aa058d (patch)
tree7178835795aee45791616b9ba15bcf27ccb31b0d /text/src
parent52554837a05839f6143c50b973b39ecc9cc30611 (diff)
downloadlibcore-5dc59cfad86607a8348c4561ec91584462aa058d.zip
libcore-5dc59cfad86607a8348c4561ec91584462aa058d.tar.gz
libcore-5dc59cfad86607a8348c4561ec91584462aa058d.tar.bz2
Use the same documentation in all the methods that take a format string.
Change-Id: I8e7d06df72a7b8db9edd17aa2748800329e837fa
Diffstat (limited to 'text/src')
-rw-r--r--text/src/main/java/java/text/MessageFormat.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/text/src/main/java/java/text/MessageFormat.java b/text/src/main/java/java/text/MessageFormat.java
index 1f3d24f..6c0a0cd 100644
--- a/text/src/main/java/java/text/MessageFormat.java
+++ b/text/src/main/java/java/text/MessageFormat.java
@@ -733,25 +733,24 @@ public class MessageFormat extends Format {
/**
* Formats the supplied objects using the specified message format pattern.
*
- * @param template
- * the pattern to use for formatting.
- * @param objects
- * the array of objects to format.
+ * @param format the format string (see {@link java.util.Formatter#format})
+ * @param args
+ * the list of arguments passed to the formatter. If there are
+ * more arguments than required by {@code format},
+ * additional arguments are ignored.
* @return the formatted result.
* @throws IllegalArgumentException
* if the pattern cannot be parsed.
*/
- public static String format(String template, Object... objects) {
- if (objects != null) {
- for (int i = 0; i < objects.length; i++) {
- if (objects[i] == null) {
- objects[i] = "null";
+ public static String format(String format, Object... args) {
+ if (args != null) {
+ for (int i = 0; i < args.length; i++) {
+ if (args[i] == null) {
+ args[i] = "null";
}
}
}
- // BEGIN android-changed
- return new MessageFormat(template).format(objects);
- // END android-changed
+ return new MessageFormat(format).format(args);
}
/**