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

Side by Side Diff: pkg/analyzer-experimental/test/generated/test_support.dart

Issue 12328104: Change new List(n) to return fixed length list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.test_support; 4 library engine.test_support;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'package:analyzer-experimental/src/generated/java_core.dart'; 7 import 'package:analyzer-experimental/src/generated/java_core.dart';
8 import 'package:analyzer-experimental/src/generated/java_engine.dart'; 8 import 'package:analyzer-experimental/src/generated/java_engine.dart';
9 import 'package:analyzer-experimental/src/generated/java_junit.dart'; 9 import 'package:analyzer-experimental/src/generated/java_junit.dart';
10 import 'package:analyzer-experimental/src/generated/source.dart'; 10 import 'package:analyzer-experimental/src/generated/source.dart';
(...skipping 19 matching lines...) Expand all
30 * A list containing the errors that were collected. 30 * A list containing the errors that were collected.
31 */ 31 */
32 List<AnalysisError> _errors = new List<AnalysisError>(); 32 List<AnalysisError> _errors = new List<AnalysisError>();
33 /** 33 /**
34 * A table mapping sources to the line information for the source. 34 * A table mapping sources to the line information for the source.
35 */ 35 */
36 Map<Source, LineInfo> _lineInfoMap = new Map<Source, LineInfo>(); 36 Map<Source, LineInfo> _lineInfoMap = new Map<Source, LineInfo>();
37 /** 37 /**
38 * An empty array of errors used when no errors are expected. 38 * An empty array of errors used when no errors are expected.
39 */ 39 */
40 static List<AnalysisError> _NO_ERRORS = new List<AnalysisError>.fixedLength(0) ; 40 static List<AnalysisError> _NO_ERRORS = new List<AnalysisError>(0);
41 /** 41 /**
42 * Initialize a newly created error listener to collect errors. 42 * Initialize a newly created error listener to collect errors.
43 */ 43 */
44 GatheringErrorListener() : super() { 44 GatheringErrorListener() : super() {
45 _jtd_constructor_258_impl(); 45 _jtd_constructor_258_impl();
46 } 46 }
47 _jtd_constructor_258_impl() { 47 _jtd_constructor_258_impl() {
48 } 48 }
49 /** 49 /**
50 * Initialize a newly created error listener to collect errors. 50 * Initialize a newly created error listener to collect errors.
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 * Assert that the array of actual values contain exactly the same values as t hose in the array of 344 * Assert that the array of actual values contain exactly the same values as t hose in the array of
345 * expected value, with the exception that the order of the elements is not re quired to be the 345 * expected value, with the exception that the order of the elements is not re quired to be the
346 * same. 346 * same.
347 * @param expectedValues the values that are expected to be found 347 * @param expectedValues the values that are expected to be found
348 * @param actualValues the actual values that are being compared against the e xpected values 348 * @param actualValues the actual values that are being compared against the e xpected values
349 */ 349 */
350 static void assertEqualsIgnoreOrder(List<Object> expectedValues, List<Object> actualValues) { 350 static void assertEqualsIgnoreOrder(List<Object> expectedValues, List<Object> actualValues) {
351 JUnitTestCase.assertNotNull(actualValues); 351 JUnitTestCase.assertNotNull(actualValues);
352 int expectedLength = expectedValues.length; 352 int expectedLength = expectedValues.length;
353 JUnitTestCase.assertEquals(expectedLength, actualValues.length); 353 JUnitTestCase.assertEquals(expectedLength, actualValues.length);
354 List<bool> found = new List<bool>.fixedLength(expectedLength); 354 List<bool> found = new List<bool>(expectedLength);
355 for (int i = 0; i < expectedLength; i++) { 355 for (int i = 0; i < expectedLength; i++) {
356 found[i] = false; 356 found[i] = false;
357 } 357 }
358 for (Object actualValue in actualValues) { 358 for (Object actualValue in actualValues) {
359 bool wasExpected = false; 359 bool wasExpected = false;
360 for (int i = 0; i < expectedLength; i++) { 360 for (int i = 0; i < expectedLength; i++) {
361 if (!found[i] && expectedValues[i] == actualValue) { 361 if (!found[i] && expectedValues[i] == actualValue) {
362 found[i] = true; 362 found[i] = true;
363 wasExpected = true; 363 wasExpected = true;
364 break; 364 break;
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 return trampoline(target, arguments[0], arguments[1]); 613 return trampoline(target, arguments[0], arguments[1]);
614 case 3: 614 case 3:
615 return trampoline(target, arguments[0], arguments[1], arguments[2]); 615 return trampoline(target, arguments[0], arguments[1], arguments[2]);
616 case 4: 616 case 4:
617 return trampoline(target, arguments[0], arguments[1], arguments[2], argu ments[3]); 617 return trampoline(target, arguments[0], arguments[1], arguments[2], argu ments[3]);
618 default: 618 default:
619 throw new IllegalArgumentException("Not implemented for > 4 arguments"); 619 throw new IllegalArgumentException("Not implemented for > 4 arguments");
620 } 620 }
621 } 621 }
622 } 622 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698