From 78f4f7a1fffd72f2cd7dd3ac005f4011b2c1e4a6 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 12 Oct 2014 13:50:56 +0400 Subject: [PATCH] Add regex methods into java.lang.String. Add group index checking into java.util.regex.Matcher --- .../java/org/teavm/classlib/java/lang/TString.java | 13 +++++++++++++ .../teavm/classlib/java/util/regex/TMatcher.java | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java index e8dcf653f..b636dac46 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java @@ -22,6 +22,7 @@ import org.teavm.classlib.java.util.TArrays; import org.teavm.classlib.java.util.TComparator; import org.teavm.classlib.java.util.THashMap; import org.teavm.classlib.java.util.TMap; +import org.teavm.classlib.java.util.regex.TPattern; import org.teavm.dependency.PluggableDependency; import org.teavm.javascript.ni.InjectedBy; import org.teavm.javascript.ni.Rename; @@ -613,4 +614,16 @@ public class TString extends TObject implements TSerializable, TComparable matchResult.groupCount()) { + throw new IndexOutOfBoundsException("Index " + group + " if out of range [0; " + + matchResult.groupCount() + ")"); + } return matchResult.group(group); }