Merge "Remove non-actionable log statement."
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
index 02ca3b0..6ed677b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
@@ -471,8 +471,22 @@
File hprofConverter = new File(hprofConvLocation);
File traceview = new File(traceViewLocation);
- if (adb.isFile() == false || hprofConverter.isFile() == false ||
- traceview.isFile() == false) {
+ String missing = "";
+ if (adb.isFile() == false) {
+ missing += adb.getAbsolutePath() + " ";
+ }
+ if (hprofConverter.isFile() == false) {
+ missing += hprofConverter.getAbsolutePath() + " ";
+ }
+ if (traceview.isFile() == false) {
+ missing += traceview.getAbsolutePath() + " ";
+ }
+
+ if (missing.length() > 0) {
+ String msg = String.format("DDMS files not found: %1$s", missing);
+ Log.e("DDMS", msg);
+ Status status = new Status(IStatus.ERROR, PLUGIN_ID, msg, null /*exception*/);
+ getDefault().getLog().log(status);
return false;
}
@@ -734,6 +748,9 @@
String dateTag = getMessageTag(tag);
stream.print(dateTag);
+ if (!dateTag.endsWith(" ")) {
+ stream.print(" "); //$NON-NLS-1$
+ }
stream.println(message);
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSource.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSource.java
index 263bf15..112cf49 100755
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSource.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSource.java
@@ -27,6 +27,7 @@
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
@@ -660,6 +661,20 @@
// Parse the old document using a non namespace aware builder
factory.setNamespaceAware(false);
DocumentBuilder builder = factory.newDocumentBuilder();
+
+ // We don't want the default handler which prints errors to stderr.
+ builder.setErrorHandler(new ErrorHandler() {
+ public void warning(SAXParseException e) throws SAXException {
+ // pass
+ }
+ public void fatalError(SAXParseException e) throws SAXException {
+ throw e;
+ }
+ public void error(SAXParseException e) throws SAXException {
+ throw e;
+ }
+ });
+
doc = builder.parse(xml);
// Prepare a new document using a namespace aware builder
@@ -744,6 +759,19 @@
Validator validator = schema == null ? null : schema.newValidator();
+ // We don't want the default handler, which by default dumps errors to stderr.
+ validator.setErrorHandler(new ErrorHandler() {
+ public void warning(SAXParseException e) throws SAXException {
+ // pass
+ }
+ public void fatalError(SAXParseException e) throws SAXException {
+ throw e;
+ }
+ public void error(SAXParseException e) throws SAXException {
+ throw e;
+ }
+ });
+
return validator;
}