diff options
author | Xavier Ducrohet <xav@android.com> | 2011-01-11 13:12:23 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-01-11 13:12:23 -0800 |
commit | 64cc0e21c489faa2fa03187674c80a006481ea1e (patch) | |
tree | f1934b136001bd08c51aea76721ae75877373cf7 | |
parent | 9e7b1152a98eb77eeb96cecbfd0ea3e3abe7a58c (diff) | |
download | sdk-64cc0e21c489faa2fa03187674c80a006481ea1e.zip sdk-64cc0e21c489faa2fa03187674c80a006481ea1e.tar.gz sdk-64cc0e21c489faa2fa03187674c80a006481ea1e.tar.bz2 |
Remove error(tag, throwable) from LayoutLog.
We should never only log an exception with no associated
message.
Also, I've found several case in the layoutlib where there
is a message in place of the tag.
This new API makes it more clear that there's both a tag and a message
since both are required for error()
Change-Id: I6d5f45c07b1cb8df96311d930170526bb729fae6
4 files changed, 4 insertions, 29 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderLogger.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderLogger.java index bc89b24..1dc5b78 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderLogger.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderLogger.java @@ -96,23 +96,6 @@ class RenderLogger extends LayoutLog { } @Override - public void error(String tag, Throwable throwable) { - AdtPlugin.log(throwable, "%1$s: %2$s", mName, tag); - assert throwable != null; - mHaveExceptions = true; - - String message = throwable.getMessage(); - if (message == null) { - message = throwable.getClass().getName(); - } else if (tag == null && throwable instanceof ClassNotFoundException - && !message.contains(ClassNotFoundException.class.getSimpleName())) { - tag = ClassNotFoundException.class.getSimpleName(); - } - String description = describe(tag, message); - addError(description); - } - - @Override public void error(String tag, String message, Throwable throwable) { String description = describe(tag, message); AdtPlugin.log(throwable, "%1$s: %2$s", mName, description); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidTargetData.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidTargetData.java index b75d6fd..216502c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidTargetData.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidTargetData.java @@ -268,11 +268,6 @@ public class AndroidTargetData { } @Override - public void error(String tag, Throwable throwable) { - AdtPlugin.log(throwable, null); - } - - @Override public void warning(String tag, String message) { AdtPlugin.log(IStatus.WARNING, message); } diff --git a/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java index a961135..e1ce53b 100644 --- a/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java +++ b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java @@ -350,7 +350,7 @@ public class LayoutLibrary { } public void error(Throwable t) { - log.error(null, t); + log.error(null, "error!", t); } public void error(String message) { diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java b/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java index a735f81..979b873 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java @@ -18,13 +18,13 @@ package com.android.ide.common.rendering.api; public class LayoutLog { - public void error(String tag, String message) { + public void warning(String tag, String message) { } - public void error(String tag, Throwable t) { + public void fidelityWarning(String tag, String message, Throwable throwable) { } - public void warning(String tag, String message) { + public void error(String tag, String message) { } /** @@ -36,7 +36,4 @@ public class LayoutLog { } - public void fidelityWarning(String tag, String message, Throwable throwable) { - - } } |