Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: editor/util/plugins/com.google.dart.java2dart/resources/java_engine.dart

Issue 294903015: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineExceptionProcessor.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/util/plugins/com.google.dart.java2dart/resources/java_engine.dart
diff --git a/editor/util/plugins/com.google.dart.java2dart/resources/java_engine.dart b/editor/util/plugins/com.google.dart.java2dart/resources/java_engine.dart
index 37cbe39866ba63829dd89647a5329ca53aa52c14..3c2d08ff0405bdb193f08d8f1902ba2cba3d8b72 100644
--- a/editor/util/plugins/com.google.dart.java2dart/resources/java_engine.dart
+++ b/editor/util/plugins/com.google.dart.java2dart/resources/java_engine.dart
@@ -158,6 +158,36 @@ class StringUtilities {
}
return last;
}
+
+ /**
+ * Produce a string containing all of the names in the given array, surrounded by single quotes,
+ * and separated by commas. The list must contain at least two elements.
+ *
+ * @param names the names to be printed
+ * @return the result of printing the names
+ */
+ static String printListOfQuotedNames(List<String> names) {
+ if (names == null) {
+ throw new IllegalArgumentException("The list must not be null");
+ }
+ int count = names.length;
+ if (count < 2) {
+ throw new IllegalArgumentException("The list must contain at least two names");
+ }
+ StringBuffer buffer = new StringBuffer();
+ buffer.write("'");
+ buffer.write(names[0]);
+ buffer.write("'");
+ for (int i = 1; i < count - 1; i++) {
+ buffer.write(", '");
+ buffer.write(names[i]);
+ buffer.write("'");
+ }
+ buffer.write(" and '");
+ buffer.write(names[count - 1]);
+ buffer.write("'");
+ return buffer.toString();
+ }
}
class FileNameUtilities {
« no previous file with comments | « no previous file | editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineExceptionProcessor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698