mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1058136 - Fix debug logging crash; r=cpeterson
This commit is contained in:
parent
b73e9eb75f
commit
19212821a7
@ -1039,11 +1039,13 @@ final class GeckoEditable
|
||||
if (DEBUG) {
|
||||
StringBuilder log = new StringBuilder(method.getName());
|
||||
log.append("(");
|
||||
for (Object arg : args) {
|
||||
debugAppend(log, arg).append(", ");
|
||||
}
|
||||
if (args.length > 0) {
|
||||
log.setLength(log.length() - 2);
|
||||
if (args != null) {
|
||||
for (Object arg : args) {
|
||||
debugAppend(log, arg).append(", ");
|
||||
}
|
||||
if (args.length > 0) {
|
||||
log.setLength(log.length() - 2);
|
||||
}
|
||||
}
|
||||
if (method.getReturnType().equals(Void.TYPE)) {
|
||||
log.append(")");
|
||||
|
@ -1024,21 +1024,23 @@ final class DebugGeckoInputConnection
|
||||
|
||||
StringBuilder log = new StringBuilder(mCallLevel);
|
||||
log.append("> ").append(method.getName()).append("(");
|
||||
for (Object arg : args) {
|
||||
// translate argument values to constant names
|
||||
if ("notifyIME".equals(method.getName()) && arg == args[0]) {
|
||||
log.append(GeckoEditable.getConstantName(
|
||||
GeckoEditableListener.class, "NOTIFY_IME_", arg));
|
||||
} else if ("notifyIMEContext".equals(method.getName()) && arg == args[0]) {
|
||||
log.append(GeckoEditable.getConstantName(
|
||||
GeckoEditableListener.class, "IME_STATE_", arg));
|
||||
} else {
|
||||
GeckoEditable.debugAppend(log, arg);
|
||||
if (args != null) {
|
||||
for (Object arg : args) {
|
||||
// translate argument values to constant names
|
||||
if ("notifyIME".equals(method.getName()) && arg == args[0]) {
|
||||
log.append(GeckoEditable.getConstantName(
|
||||
GeckoEditableListener.class, "NOTIFY_IME_", arg));
|
||||
} else if ("notifyIMEContext".equals(method.getName()) && arg == args[0]) {
|
||||
log.append(GeckoEditable.getConstantName(
|
||||
GeckoEditableListener.class, "IME_STATE_", arg));
|
||||
} else {
|
||||
GeckoEditable.debugAppend(log, arg);
|
||||
}
|
||||
log.append(", ");
|
||||
}
|
||||
if (args.length > 0) {
|
||||
log.setLength(log.length() - 2);
|
||||
}
|
||||
log.append(", ");
|
||||
}
|
||||
if (args.length > 0) {
|
||||
log.setLength(log.length() - 2);
|
||||
}
|
||||
log.append(")");
|
||||
Log.d(LOGTAG, log.toString());
|
||||
|
Loading…
Reference in New Issue
Block a user