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

Unified Diff: pkg/analyzer/test/generated/all_the_rest_test.dart

Issue 2329463002: Remove JavaPatternMatcher from java_core. (Closed)
Patch Set: Created 4 years, 3 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 | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/all_the_rest_test.dart
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index 26a373a83e5450c35cd8f8bd7d2ab216de8b22cc..7f471233210a3d97bbb2560c32663426dfd8c4ab 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -18,7 +18,6 @@ import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/sdk/sdk.dart' hide SdkLibrariesReader;
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/java_core.dart';
import 'package:analyzer/src/generated/java_engine_io.dart';
import 'package:analyzer/src/generated/java_io.dart';
import 'package:analyzer/src/generated/resolver.dart';
@@ -3044,16 +3043,9 @@ core.int value;''');
if (matchIndex == 0) {
return contents.indexOf(pattern);
}
- JavaPatternMatcher matcher =
- new JavaPatternMatcher(new RegExp(pattern), contents);
- int count = 0;
- while (matcher.find()) {
- if (count == matchIndex) {
- return matcher.start();
- }
- ++count;
- }
- return -1;
+ Iterable<Match> matches = new RegExp(pattern).allMatches(contents);
+ Match match = matches.toList()[matchIndex];
+ return match.start;
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698