aboutsummaryrefslogtreecommitdiffstats
path: root/common/src
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-02-06 14:32:44 -0800
committerTor Norbye <tnorbye@google.com>2012-02-06 18:01:07 -0800
commit69067f399231dc28f4ff0aa02b60153ffd2d5831 (patch)
treefcb26e8f844d2819a6819a4e1741ea5f6e111533 /common/src
parent858b17c8539f9d9cb7202e6fa7e87bda35ca021c (diff)
downloadsdk-69067f399231dc28f4ff0aa02b60153ffd2d5831.zip
sdk-69067f399231dc28f4ff0aa02b60153ffd2d5831.tar.gz
sdk-69067f399231dc28f4ff0aa02b60153ffd2d5831.tar.bz2
Add support for suppressing lint via XML attributes
This changeset adds support for suppressing in XML files: (1) Lint will ignore errors found in attributes and elements if the element (or any surrounding parent elements) specifies a tools:ignore="id-list" attribute where the id-list matches the id of the reported issue (or "all"). The "tools" prefix can be any prefix bound to the namespace "http://schemas.android.com/tools" (2) There's a new quickfix shown for XML lint warnings which offers to add a lint suppress attribute for a given lint warning (setting the id to the id of the warning, and adding the tools namespace binding if necessary). (3) The XML formatter now handles namespaces a bit better: after the preferred attributes (id, name, style, layout params, etc) have been handled, attributes are sorted by namespace prefix before they are sorted by local name -- which effectively will sort any new tools:ignore attributes to the end. Change-Id: Id7474cde5665d9bd29bdd4e0d0cc89ed4d422aea
Diffstat (limited to 'common/src')
-rw-r--r--common/src/com/android/util/PositionXmlParser.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/src/com/android/util/PositionXmlParser.java b/common/src/com/android/util/PositionXmlParser.java
index 54146db..052348d 100644
--- a/common/src/com/android/util/PositionXmlParser.java
+++ b/common/src/com/android/util/PositionXmlParser.java
@@ -145,7 +145,7 @@ public class PositionXmlParser {
// (see http://en.wikipedia.org/wiki/Byte_order_mark) so here we'll
// just skip those up to the XML prolog beginning character, <
xml = xml.replaceFirst("^([\\W]+)<","<"); //$NON-NLS-1$ //$NON-NLS-2$
- return parse(xml, null, false);
+ return parse(xml, new InputSource(new StringReader(xml)), false);
}
throw e;
}