diff options
author | Tor Norbye <tnorbye@google.com> | 2012-02-24 15:51:10 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-02-24 15:54:50 -0800 |
commit | 8a74e947c8ec79456d4f8011ee73b5fcefc03440 (patch) | |
tree | aac66ceb1ba9f1ae918206152ac760a0a6b8f04f /lint/cli | |
parent | 73013b8947af3d04f8c48031b51e013d05cb1b2e (diff) | |
download | sdk-8a74e947c8ec79456d4f8011ee73b5fcefc03440.zip sdk-8a74e947c8ec79456d4f8011ee73b5fcefc03440.tar.gz sdk-8a74e947c8ec79456d4f8011ee73b5fcefc03440.tar.bz2 |
Fix SuppressLint annotations in outer classes
This changeset makes @SuppressLint work for classfile based detectors
when the error is found in an inner class and the SuppressLint
annotations is on an outer class.
Innerclasses are actually separate classes from their outer classes,
so they are processed separately (each .class file is read and
analyzed independently).
This changeset processes the class files in alphabetical* order such
that it can maintain a stack of outerclasses when processing a
class. The suppress lint check can then visit the outer class'
annotations to see if the error should be suppressed. (*: The order
isn't exactly alphabetical: We want Foo$Bar.class to come after
Foo.class)
This changeset also tweaks the Add Annotation quickfix such that it
only offers per-method or per-class annotations, since class files do
not maintain annotation info for other granularities (such as on
variable declarations, so you cannot suppress classfile based issues
with annotations there.) We could make a lint check which ensures that
you don't try to put these annotations there :-)
(This is related to issue http://b.android.com/25948)
Change-Id: Ia9dbc39b1adc73a1b60e375edbf9b5618c7d2353
Diffstat (limited to 'lint/cli')
-rw-r--r-- | lint/cli/src/com/android/tools/lint/Main.java | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java index ccd713d..2621d0a 100644 --- a/lint/cli/src/com/android/tools/lint/Main.java +++ b/lint/cli/src/com/android/tools/lint/Main.java @@ -56,13 +56,7 @@ import java.util.Properties; import java.util.Set; /** - * Command line driver for the rules framework - * <p> - * TODO: - * <ul> - * <li>Offer priority or category sorting - * <li>Offer suppressing violations - * </ul> + * Command line driver for the lint framework */ public class Main extends LintClient { static final int MAX_LINE_WIDTH = 78; |