aboutsummaryrefslogtreecommitdiffstats
path: root/lint/libs/lint_checks/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix incorrect assertionTor Norbye2012-10-191-1/+1
|/ | | | Change-Id: Id110d90b173d052b952f90622bcbff64f5bedbe5
* 32849: Fix CRLF line ending handling in the partial formatterTor Norbye2012-10-172-2/+121
| | | | | | | | | | | | | | | | | | Fix the handling of \r characters in the code which applies formatting deltas into existing documents. It could end up inserting the formatted portion in the middle of a \r\n pair, which made Eclipse extremely confused (https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421) This fixes 32849: Eclipse android adt xml editing artifacting (unsynced) lines of text when changes are made in the graphical interface It also adds a lint check to identify *existing* files that already have these mangled line endings, along with a quickfix to make the correction. Change-Id: I1e7024f2786e4cb0233c2c6b98c3d3f942703ea0
* Warn about potentially accidentally overriding methodsTor Norbye2012-10-162-1/+273
| | | | Change-Id: Ic8d20a002f6225cb15f609b3b7582716904e9278
* Add lint support for checking frameworks/base/coreTor Norbye2012-10-162-9/+11
| | | | | | | | | | This changeset adds basic support for running lint against the AOSP frameworks/base/core codebase. It also makes the resource folder provided by the lint client. Change-Id: I7e38b0925cb032f776c54f975b924b91d6ab7a24
* Fix required attribute check for GridLayout childrenTor Norbye2012-10-161-6/+9
| | | | Change-Id: I58e67eb1acb6b8e5a503f1aa7822c97b545eac10
* Remove debug printlnTor Norbye2012-10-161-6/+0
| | | | Change-Id: Icae211bc8c95b1acfbd84f382754755487876af2
* Check for missing layout_width and layout_height attributesTor Norbye2012-10-166-45/+593
| | | | | | | | Also looks at style declarations and attributes on include tags to allow elements to either pick up sizes from styles or from the including context. Change-Id: I91a944805d8a906ff63b5a22f2faa876e7292c19
* Make view cast detector handle multiple typesTor Norbye2012-10-151-23/+57
| | | | Change-Id: I375ebc368a0173e78fd8aae1c6fc658c4ec5416d
* Look for missing android namespace prefix in manifest filesTor Norbye2012-10-151-5/+34
| | | | | | | | Extend the missing prefix checker such that it doesn't only look at layout files, but also complains in manifest files, menu files, drawable files, etc. Change-Id: Ifbd7635e3b73d662aa6c7a4e03e4c2894c6fe204
* Lint detector for missing menu titlesTor Norbye2012-10-152-1/+112
| | | | | | | As requested in 38022: Lint should warn when menus don't have a title Change-Id: I34688d7733d98ba9fa8cc10202a5470040962117
* 37329: lint checks for conflicting permission definitionTor Norbye2012-10-153-3/+71
| | | | Change-Id: I3b131872cc9938ceb5df271ab10ec60644d44b26
* Merge "Added a lint checker to flag permissions that are only granted to ↵Tor Norbye2012-10-102-1/+187
|\ | | | | | | system applications"
| * Added a lint checker to flag permissions that are only granted to system ↵Sebastian Porst2012-10-092-1/+187
| | | | | | | | | | | | applications Change-Id: If423ad3c477dbad9011b600e5c8d8773963d27b9
* | 38325: onClick XML attribute with @string resource not recognisedTor Norbye2012-10-101-1/+2
|/ | | | | | | | | | Don't flag onClick handlers as missing when they are using resource name indirections. Also make the Go To Declaration hyperlink work for tools:context links to activities. Change-Id: Ie26cefd2cebef32e955e3031da707654f3dc7e06
* Fix API check for theme references in XMLTor Norbye2012-10-051-1/+7
| | | | | | | Dots in resource names are replaced by underlines by aapt. Change-Id: Ica8244016c050327013103dfb4c60d960e9199c5
* Find mismatches between EditText inputType and nameTor Norbye2012-10-052-5/+217
| | | | | | | | | This adds a lint check which looks at the id of an EditText, and if it looks like it has a specific purpose (e.g. password or e-mail or number or phone etc) then it checks that the corresponding inputType matches. Change-Id: Ib40d3e47c88ea01ccbad61f3a24d9b9a4e79d5c6
* Check notification and action bar iconsTor Norbye2012-10-053-41/+499
| | | | | | | These icons should not use color (and in the case of notification icons, be white). Change-Id: I32b9422735830a01bb069b90a5ad5a76d7aeb5de
* Fix misc lint bugsTor Norbye2012-10-043-3/+14
| | | | | | | I ran lint over some large projects and manually verified the report; this uncovered a couple of false positives. Change-Id: I006d64a03119c6badc40e33df9ab4079e07dc7c5
* Fix lint bytecode to source code position mapping for innerclassesTor Norbye2012-10-031-0/+3
| | | | | | | | This fixes 38113: Lint doesn't show all NewApi errors in Eclipse, although it's showing on command line Change-Id: I0e1a8ffeac4d0ca085f59f80f86fd6eb7289ed4d
* 38002: Lint WakeLock Check Ignores Try-FinallyTor Norbye2012-10-011-3/+6
| | | | Change-Id: I4009ef5ffabedaa43158991657068edcaa6e80e0
* 38004: Lint Misreports API Compatibility of SQLiteCloseableTor Norbye2012-10-011-1/+7
| | | | Change-Id: I88cf62dec8671a8f053414f782bcb2cac617dc15
* Cache applicable issue lists per scope setTor Norbye2012-09-272-6/+80
| | | | | | | | | | Keep sets of applicable issues for each scope set. This should make incremental lint slightly more efficient. Also add a check that icon file extensions match the actual file format. Change-Id: I4a7f5e19b91aa3613480aa831ec42065528f02d3
* Add detector for fragments missing idsTor Norbye2012-09-262-1/+92
| | | | | | See issue 35959 for background. Change-Id: I8042b42e4649163cf8e6974d074ac05777685766
* 37861: Lint should warn when using mm or in unitsTor Norbye2012-09-262-4/+49
| | | | Change-Id: I220112559c1a7f30c505551b41004560b6e89891
* 37702: InconsistentArrays fails to identify inconsistent arraysTor Norbye2012-09-251-30/+37
| | | | Change-Id: I47d3757cac4b9204bdb15a84a8679921adc049a3
* Don't flag missing classes if project has not been built yetTor Norbye2012-09-241-1/+3
| | | | | | | | | | | | | | | The missing class detector in lint will warn if the manifest file contains references to class files and lint does not see those class files in the class output folder (or in any of the library jars). This is useful for catching typos and deleted classes. However, if you run lint on a project that has not yet been built, this can give misleading or confusing errors, since lint decides that a class exists by whether a .class file is actually there, not by whether a source file exists which would result in a class file getting produced with that name. Change-Id: I3105157a37f575e00b550ba90d883f24c02c16a9
* Fix missing class detector to work for incremental manifest editsTor Norbye2012-09-241-2/+3
| | | | | | | | | | | | | The missing manifest detector provides multiple issues; both the missing class detector (which requires not just manifest scope but also class scope), as well as some checks to ensure that for example inner classes are registered correctly, which only requires manifest scope. Because of this second issue, the detector runs in incremental manifest editing context, but the code to handle missing classes would also run. The check is simple; don't check missing class references unless we also have class scope. Change-Id: Iff83c372abf2335e3d8e991740702d6094fd65bd
* Add allowBackup lint security checkTor Norbye2012-09-212-1/+44
| | | | Change-Id: I3b79bef6981d880fe6a545429754e03bd384645c
* Rename ide_common to sdk_commonSiva Velusamy2012-09-181-1/+1
| | | | Change-Id: I1b39ee439a532f3f6758be35b569948e2e906665
* Add labelFor lint checkTor Norbye2012-09-172-1/+165
| | | | Change-Id: If2b905197d5d81c6f98315a0d48ff37091e8282b
* Code cleanupTor Norbye2012-09-172-2/+2
| | | | | | Replace "this.mFoo = foo" with just "mFoo = foo". Change-Id: I44d537ebb62cd7e5c8493a0b50dcb527cd20f91c
* Constants refactoring.Tor Norbye2012-09-1350-431/+431
| | | | | | | | | | | | | | | | This changeset moves most constants into the SdkConstants class, and gets rid of AndroidConstants and LintConstants. It also migrates all non-ADT specific constants from AdtConstants into SdkConstants. It furthermore moves various other constants (such as those in XmlUtils and ValuesDescriptors) into the constants class. It also fixes the modifier order to be the canonical modifier order (JLS 8.x). Finally, it removes redundancy and combines various constant aliases such that we don't have both NAME_ATTR and ATTR_NAME pointing to "name", etc. Change-Id: Ifd1755016f62ce2dd80e5c76130d6de4b0e32161
* Merge "Add unit test for lint CLI"Tor Norbye2012-09-111-0/+11
|\
| * Add unit test for lint CLITor Norbye2012-09-111-0/+11
| | | | | | | | Change-Id: I8434515179b8fd2ee3872506fc237c467a98db44
* | Work around missing DOM method implementation in Eclipe 3.6Tor Norbye2012-09-111-1/+1
|/ | | | Change-Id: I67b37a0511dfba210dbcef393ee7610cef8b56a2
* Fix false positives in field getter lint checkTor Norbye2012-09-101-0/+22
| | | | Change-Id: If341cde0f0600c5975c6e847e228d72f5deefb23
* Don't report unused resources in projects with errorsTor Norbye2012-09-101-1/+1
| | | | | | | | | | | | | | | | | | | If a project contains errors in the source code, lint won't be able to parse the source code, and in that case it might draw the wrong conclusions about unused resources. This can also happen if there's an actual bug in the Java parser, which is sometimes the case; see for example http://code.google.com/p/projectlombok/issues/detail?id=415 http://code.google.com/p/projectlombok/issues/detail?id=311 In both cases, when we encounter a failure to parse a Java file, we record the fact that not all Java files were properly processed, and rules, such as the UnusedResource detector, can (and now does) use this to for example skip reporting unused resources in this case since it is operating with incomplete data. Change-Id: I00991c10d05965ce151fb0dd322f32229dcd12cd
* 37001: Lint check: non existing Activity/Service/ReceiverTor Norbye2012-09-103-8/+317
| | | | Change-Id: I6c281183a176210a6991e81497d9fb242c3851bd
* Merge "36951: Lint API Level Warnings for Enums are Confusing"Tor Norbye2012-09-041-8/+167
|\
| * 36951: Lint API Level Warnings for Enums are ConfusingTor Norbye2012-09-041-8/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using switch statements on enums, the compiler will generate extra code to make the switch invocation efficient. For example, it generates a method which looks up all the values in the enum, calls ordinal() on each, and then creates an array which has all the enum values indexed by ordinal. The problem is that this helper code will end up referencing fields which may have a higher API requirement than is currently being used, and Lint would flag these as illegal API references. That's not correct in this case; as long as the corresponding jump table does not actually use these references, there's no problem. This changeset makes lint aware of this pattern, and when it encounters an invalid field reference inside one of these synthetic switch constant lookup methods, it will search for the corresponding table lookup, check whether the actual key is used, and only in that case complain. It also makes error messages associated with enums in general a bit better, when the whole enum class itself requires a higher API. (This would generate a message related to invocation of ordinal() which might not be obvious to everybody.) Finally, it cleans up class name formatting such that we never reference inner classes using "$" in error messages. Change-Id: I28a14084c160866e69f63f62b5bc8f21ee50215c
* | 36942: tools:ignore="DuplicateActivity" just doesn'tTor Norbye2012-09-035-8/+8
|/ | | | Change-Id: Iffd270a227a8a76636cbfa5d19c6e0330a8391fb
* Merge "Suggest using SparseIntArray instead of SparseArray<Integer>"Tor Norbye2012-08-301-1/+26
|\
| * Suggest using SparseIntArray instead of SparseArray<Integer>Tor Norbye2012-08-291-1/+26
| | | | | | | | Change-Id: I95bf3bc87e4378af6ef866df0a1ffb69f8fd7a41
* | Also check SimpleDateFormat calls for explicit localeTor Norbye2012-08-302-8/+57
|/ | | | | | | | | | | This changeset expands on the lint check for calling String convenience methods that are locale sensitive without an explicit locale (issue 36822). It checks whether a SimpleDateFormat constructor that uses the default locale is called, and if so suggests either specifying a locale or using one of the pre-configured locale sensitive instances of SimpleDateFormat. Change-Id: Ic4fcb72c2ee6b31d1534b4d909493fef7dcff867
* Add lint rule to find incorrect alias filesTor Norbye2012-08-292-1/+70
| | | | | | | This helps catch errors like http://code.google.com/p/android/issues/detail?id=36821 Change-Id: I1ceda3183d8b1e29510ba0be2523dc6eb9c7a23b
* Add lint check for potential string locale errors (issue 36822)Tor Norbye2012-08-295-10/+244
| | | | Change-Id: I320af69286e7f0bcee395419acfeea7ed8f8d384
* Minor tweaks and typosTor Norbye2012-08-281-1/+1
| | | | Change-Id: I46630c51a4f055222fb614d73419cb28272b87de
* Merge "Add lint rule which warns about View.setTag(int, Object)"Tor Norbye2012-08-282-1/+176
|\
| * Add lint rule which warns about View.setTag(int, Object)Tor Norbye2012-08-272-1/+176
| | | | | | | | | | | | | | | | | | | | | | This changeset adds a lint rule which looks for potential leaks when using View#setTag(int, Object) where the Object is likely to contain a strong reference to the context, such as views and view holders. http://code.google.com/p/android/issues/detail?id=26984 Change-Id: Ib606485d2b875d2129c339b9b89be0e444629408
* | Fix property sheet value completionTor Norbye2012-08-271-6/+8
|/ | | | | | | | | | | | | | | This changeset fixes the value completion such that you can add custom values into properties that also have enum fields. Rather than have separate completion routines for properties based on whether they contain an enum, a flag, a reference, etc., have a single completer which considers all the various formats and combines the results. In addition to combining results, this now also offers completion on dimensions, and offers theme attribute values for references as well. Change-Id: Idbc1799a34b3a3f14ea567654953925bf12afb8f