Bug 1384829 - 3. No longer ignore certain exceptions; r?esawin
Bug 817386 added code to ignore IndexOutOfBoundsException when using
GeckoEditable because the code wasn't mature enough back then, and there
were many race conditions. I think the situation is a lot better now, so
we can try removing that code and see if we still need it. We can always
add it back if we do.
MozReview-Commit-ID: 4pirfaUuSNu
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoEditable.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoEditable.java
@@ -1452,42 +1452,18 @@ final class GeckoEditable extends IGecko
if (methodInterface == Editable.class ||
methodInterface == Appendable.class ||
methodInterface == Spannable.class) {
// Method alters the Editable; route calls to our implementation
target = this;
} else {
target = mText.getShadowText();
}
- Object ret;
- try {
- ret = method.invoke(target, args);
- } catch (InvocationTargetException e) {
- // Bug 817386
- // Most likely Gecko has changed the text while GeckoInputConnection is
- // trying to access the text. If we pass through the exception here, Fennec
- // will crash due to a lack of exception handler. Log the exception and
- // return an empty value instead.
- if (!(e.getCause() instanceof IndexOutOfBoundsException)) {
- // Only handle IndexOutOfBoundsException for now,
- // as other exceptions might signal other bugs
- throw e;
- }
- Log.w(LOGTAG, "Exception in GeckoEditable." + method.getName(), e.getCause());
- Class<?> retClass = method.getReturnType();
- if (retClass == Character.TYPE) {
- ret = '\0';
- } else if (retClass == Integer.TYPE) {
- ret = 0;
- } else if (retClass == String.class) {
- ret = "";
- } else {
- ret = null;
- }
- }
+
+ final Object ret = method.invoke(target, args);
if (DEBUG) {
StringBuilder log = new StringBuilder(method.getName());
log.append("(");
if (args != null) {
for (Object arg : args) {
debugAppend(log, arg).append(", ");
}
if (args.length > 0) {