Index: pkg/analyzer/lib/src/generated/java_core.dart |
diff --git a/pkg/analyzer/lib/src/generated/java_core.dart b/pkg/analyzer/lib/src/generated/java_core.dart |
index 011c4ebc17a19b38013ba7151d6372a4ff41cca9..9c86f235667495c9323ed111382f96bf6bd7b38f 100644 |
--- a/pkg/analyzer/lib/src/generated/java_core.dart |
+++ b/pkg/analyzer/lib/src/generated/java_core.dart |
@@ -420,11 +420,14 @@ String format(String pattern, [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7]) |
* format('{0} are you {1}ing?', ['How', 'do']) = 'How are you doing?' |
* format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' |
*/ |
-String formatList(String pattern, List args) { |
+String formatList(String pattern, List<Object> arguments) { |
+ if (arguments == null || arguments.isEmpty) { |
+ return pattern; |
+ } |
return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { |
String indexStr = match.group(1); |
int index = int.parse(indexStr); |
- var arg = args[index]; |
+ Object arg = arguments[index]; |
return arg != null ? arg.toString() : null; |
}); |
} |