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

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

Issue 667463004: Code clean-up (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/html.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | 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.core; 1 library java.core;
2 2
3 import "dart:math" as math; 3 import "dart:math" as math;
4 4
5 final Stopwatch nanoTimeStopwatch = new Stopwatch(); 5 final Stopwatch nanoTimeStopwatch = new Stopwatch();
6 6
7 const int LONG_MAX_VALUE = 0x7fffffffffffffff; 7 const int LONG_MAX_VALUE = 0x7fffffffffffffff;
8 8
9 class JavaSystem { 9 class JavaSystem {
10 static int currentTimeMillis() { 10 static int currentTimeMillis() {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 static int makeHashCode(List a) { 44 static int makeHashCode(List a) {
45 if (a == null) { 45 if (a == null) {
46 return 0; 46 return 0;
47 } 47 }
48 int result = 1; 48 int result = 1;
49 for (var element in a) { 49 for (var element in a) {
50 result = 31 * result + (element == null ? 0 : element.hashCode); 50 result = 31 * result + (element == null ? 0 : element.hashCode);
51 } 51 }
52 return result; 52 return result;
53 } 53 }
54 static List asList(List list) => list;
55 } 54 }
56 55
57 class Character { 56 class Character {
58 static const int MAX_VALUE = 0xffff; 57 static const int MAX_VALUE = 0xffff;
59 static const int MAX_CODE_POINT = 0x10ffff; 58 static const int MAX_CODE_POINT = 0x10ffff;
60 static const int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000; 59 static const int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000;
61 static const int MIN_LOW_SURROGATE = 0xDC00; 60 static const int MIN_LOW_SURROGATE = 0xDC00;
62 static const int MIN_HIGH_SURROGATE = 0xD800; 61 static const int MIN_HIGH_SURROGATE = 0xD800;
63 static bool isDigit(int c) { 62 static bool isDigit(int c) {
64 return c >= 0x30 && c <= 0x39; 63 return c >= 0x30 && c <= 0x39;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 bool javaStringRegionMatches(String t, int toffset, String o, int ooffset, int l en) { 386 bool javaStringRegionMatches(String t, int toffset, String o, int ooffset, int l en) {
388 if (toffset < 0) return false; 387 if (toffset < 0) return false;
389 if (ooffset < 0) return false; 388 if (ooffset < 0) return false;
390 var tend = toffset + len; 389 var tend = toffset + len;
391 var oend = ooffset + len; 390 var oend = ooffset + len;
392 if (tend > t.length) return false; 391 if (tend > t.length) return false;
393 if (oend > o.length) return false; 392 if (oend > o.length) return false;
394 return t.substring(toffset, tend) == o.substring(ooffset, oend); 393 return t.substring(toffset, tend) == o.substring(ooffset, oend);
395 } 394 }
396 395
397 bool javaBooleanOr(bool a, bool b) {
398 return a || b;
399 }
400
401 bool javaBooleanAnd(bool a, bool b) {
402 return a && b;
403 }
404
405 int javaByte(Object o) {
406 return (o as int) & 0xFF;
407 }
408
409 abstract class Enum<E extends Enum> implements Comparable<E> { 396 abstract class Enum<E extends Enum> implements Comparable<E> {
410 /// The name of this enum constant, as declared in the enum declaration. 397 /// The name of this enum constant, as declared in the enum declaration.
411 final String name; 398 final String name;
412 /// The position in the enum declaration. 399 /// The position in the enum declaration.
413 final int ordinal; 400 final int ordinal;
414 const Enum(this.name, this.ordinal); 401 const Enum(this.name, this.ordinal);
415 int get hashCode => ordinal; 402 int get hashCode => ordinal;
416 String toString() => name; 403 String toString() => name;
417 int compareTo(E other) => ordinal - other.ordinal; 404 int compareTo(E other) => ordinal - other.ordinal;
418 } 405 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' 443 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?'
457 */ 444 */
458 String formatList(String pattern, List args) { 445 String formatList(String pattern, List args) {
459 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { 446 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) {
460 String indexStr = match.group(1); 447 String indexStr = match.group(1);
461 int index = int.parse(indexStr); 448 int index = int.parse(indexStr);
462 var arg = args[index]; 449 var arg = args[index];
463 return arg != null ? arg.toString() : null; 450 return arg != null ? arg.toString() : null;
464 }); 451 });
465 } 452 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/html.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698