diff options
author | Tor Norbye <tnorbye@google.com> | 2012-11-02 15:19:27 -0700 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-11-02 15:19:28 -0700 |
commit | 72c0af37222736a326865eb3155ef04bcd0c86c8 (patch) | |
tree | 2a73d92ae3be4a15f03300b76c51cafa79dce3a0 /lint/libs | |
parent | 3a40adfbfd450c1d10a416e88d4522ac0a8204fc (diff) | |
parent | 70fe541e71472cfcee236d40d2cce8a9b3f23b79 (diff) | |
download | sdk-72c0af37222736a326865eb3155ef04bcd0c86c8.zip sdk-72c0af37222736a326865eb3155ef04bcd0c86c8.tar.gz sdk-72c0af37222736a326865eb3155ef04bcd0c86c8.tar.bz2 |
Merge "Don't warn about missing classes before a build"
Diffstat (limited to 'lint/libs')
-rw-r--r-- | lint/libs/lint_checks/src/com/android/tools/lint/checks/MissingClassDetector.java | 4 | ||||
-rw-r--r-- | lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MissingClassDetectorTest.java | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/MissingClassDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/MissingClassDetector.java index fc9449a..2bcde0e 100644 --- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/MissingClassDetector.java +++ b/lint/libs/lint_checks/src/com/android/tools/lint/checks/MissingClassDetector.java @@ -250,7 +250,9 @@ public class MissingClassDetector extends LayoutDetector implements ClassScanner @Override public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) { - mHaveClasses = true; + if (!context.isFromClassLibrary()) { + mHaveClasses = true; + } String curr = classNode.name; if (mReferencedClasses != null && mReferencedClasses.containsKey(curr)) { mReferencedClasses.remove(curr); diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MissingClassDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MissingClassDetectorTest.java index 3c6e8cb..4edf345 100644 --- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MissingClassDetectorTest.java +++ b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MissingClassDetectorTest.java @@ -254,4 +254,17 @@ public class MissingClassDetectorTest extends AbstractCheckTest { "registration/Bar.java.txt=>src/test/pkg/Foo/Bar.java" )); } + + public void testNoClassesWithLibraries() throws Exception { + mScopes = null; + assertEquals( + "No warnings.", + + lintProject( + "bytecode/AndroidManifestWrongRegs.xml=>AndroidManifest.xml", + "bytecode/.classpath=>.classpath", + "bytecode/GetterTest.jar.data=>libs/foo.jar" + )); + } + } |