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

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

Issue 17009007: Tweak j2d for String.indexOf(s,int) semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 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/processor/ObjectSemanticProcessor.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_core.dart
diff --git a/editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart b/editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart
index 7e9024549251faa0749bd6e592c64112af5582ff..01ffd5d3315059e322a052a4f7057a83f33aec5f 100644
--- a/editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart
+++ b/editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart
@@ -154,6 +154,16 @@ class JavaString {
}
});
}
+ static int indexOf(String target, String str, int fromIndex) {
+ if (fromIndex > target.length) return -1;
+ if (fromIndex < 0) fromIndex = 0;
+ return target.indexOf(str, fromIndex);
+ }
+ static int lastIndexOf(String target, String str, int fromIndex) {
+ if (fromIndex > target.length) return -1;
+ if (fromIndex < 0) fromIndex = 0;
+ return target.lastIndexOf(str, fromIndex);
+ }
static bool startsWithBefore(String s, String other, int start) {
return s.indexOf(other, start) != -1;
}
« no previous file with comments | « no previous file | editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/ObjectSemanticProcessor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698