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

Side by Side Diff: pkg/analyzer/lib/src/generated/java_engine.dart

Issue 325473002: Add intern support to analyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/interner.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library java.engine; 1 library java.engine;
2 2
3 import 'interner.dart';
3 import 'java_core.dart'; 4 import 'java_core.dart';
4 5
5 /** 6 /**
6 * A predicate is a one-argument function that returns a boolean value. 7 * A predicate is a one-argument function that returns a boolean value.
7 */ 8 */
8 typedef bool Predicate<E>(E argument); 9 typedef bool Predicate<E>(E argument);
9 10
10 class StringUtilities { 11 class StringUtilities {
11 static const String EMPTY = ''; 12 static const String EMPTY = '';
12 static const List<String> EMPTY_ARRAY = const <String>[]; 13 static const List<String> EMPTY_ARRAY = const <String>[];
13 static String intern(String s) => s; 14
15 static Interner INTERNER = new NullInterner();
16
17 static String intern(String string) => INTERNER.intern(string);
14 static bool isTagName(String s) { 18 static bool isTagName(String s) {
15 if (s == null || s.length == 0) { 19 if (s == null || s.length == 0) {
16 return false; 20 return false;
17 } 21 }
18 int sz = s.length; 22 int sz = s.length;
19 for (int i = 0; i < sz; i++) { 23 for (int i = 0; i < sz; i++) {
20 int c = s.codeUnitAt(i); 24 int c = s.codeUnitAt(i);
21 if (!Character.isLetter(c)) { 25 if (!Character.isLetter(c)) {
22 if (i == 0) { 26 if (i == 0) {
23 return false; 27 return false;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 if (cause != null) { 314 if (cause != null) {
311 buffer.write('Caused by '); 315 buffer.write('Caused by ');
312 cause._writeOn(buffer); 316 cause._writeOn(buffer);
313 } 317 }
314 } else { 318 } else {
315 buffer.writeln(exception.toString()); 319 buffer.writeln(exception.toString());
316 buffer.writeln(stackTrace.toString()); 320 buffer.writeln(stackTrace.toString());
317 } 321 }
318 } 322 }
319 } 323 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/interner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698