| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: Iba15f82cb00d19217382c78d8ff37dda1e97ea59
|
|
|
|
|
|
| |
This must be submitted with prebuilts/devtools' change I3d985ed0abf.
Change-Id: Icab479e0e8a5c126b0fdc213a792187a14a44f21
|
|
|
|
|
|
| |
Sources are now located in tools/base.git.
Change-Id: I9cbe1deb98f8c43e90f5fb04b668f664b9850620
|
|
|
|
|
|
|
|
|
|
|
| |
Requires prebuilds/devtools.git I913a29e5f40db99871701461aad6fc38483015d2
To update the prebuilts, you need tools/base.git and the
prebuilts/devtools/update_jars.sh script.
This is supposed to be an intermediary step as we switch to tools/base.
Change-Id: I3dcccfdd9dc243a22a5bfd9db6779d24285db1ac
|
|
|
|
| |
Change-Id: Ieedd879648883fb2d1a2eed571b690f3280a1850
|
|
|
|
|
|
|
|
| |
Fix missing dispose() call for manifest files, and add a method
to the TypographyDetector such that clients don't need a DOM node
to look up the suggested replacement.
Change-Id: If048a62a6b0b1c8af83a3e0b62a28876d4449764
|
|
|
|
|
|
|
|
|
|
|
| |
The other file visitor would unconditionally scan the full
project contents for each scope, even when project.getSubset()
(used for incremental analysis in IDEs) was non null.
Also avoid NPE when lint is scanning a java file without a
package declaration.
Change-Id: I74e813b41c2e32acac879b277dc974619156adbd
|
|
|
|
| |
Change-Id: Ibc54b1a23688217666b60ce7dc692f0bba00419a
|
|
|
|
|
|
|
|
|
|
| |
This adds a new scope, Scope.OTHER, which can be used to indicate
that the check wants to investigate files other than the ones
specially handled as XML, Java, manifest or ProGuard files.
The PrivateKeyDetector now uses this such that it doesn't have
to perform its own directory iteration.
Change-Id: Ic38bf2db656f00c01d94c0c4e0112bc77218ea08
|
|
|
|
| |
Change-Id: Ib923638c305105e84f79a18a79ece48d391129c5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, lint has hardcoded where the project resources are to be
found: in $project/res.
With the new build system this will no longer necessarily be the case;
there can be multiple resource folders, and the locations might not be
just res/.
Therefore, this CL generalizes lint's handling of resource folders: it
is now provided by the LintClient, and the command line lint tool uses
this to offer a new --resources flag which can be used to set the
resource directory/directories for a project.
Change-Id: I3717c6474141776ee5541d476f9bad5bb8e1a9c7
|
|
|
|
|
|
|
|
| |
Fix typos, remove redundant semicolons, fix incorrect names
(using an m prefix where they should be using s, turn fields
with constant names into actual constants), etc.
Change-Id: I44a5ab82c1158007d0803d43ce14b361aff240b8
|
|
|
|
|
|
| |
Also update constants to stay in sync with sdk/ version.
Change-Id: I8e454a03d83c81036bf8cc73609babc96a9c7739
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lint currently checks the .class files for field references and method
references to APIs that require a version higher than the
minSdkVersion in the manifest.
However, constants (such as final static integers) will be copied into
the .class file, so there is no reference to the original API and its
API version, which means lint can't flag these.
In some cases, such as referencing LayoutParams.MATCH_PARENT, that's
no problem; the constant value works on older versions, and there is
no problem, since the value rather than the reference is
used. However, in other cases this may lead to runtime crashes.
This CL updates lint to look at the source files and flag field
references. It excludes some constants that are known to be okay
(such as referencing say android.os.Build.VERSION_CODES.JELLY_BEAN_MR1
(which is typically done precisely to conditionally branch based on
the current device's version). It also ignores usages as case
constants or in conditional if checks. We may need to do additional
tweaks to this in the future, since unlike method and field references
there are probably many cases where referencing these constants are
fine on older devices, but there are also cases where it's
dangerous. For now, we're erring on the side of warning the developer
rather than being certain that it's not a problem.
Change-Id: Ieba4c15d7fdda02756b7b7f5a1b79f7698c1915b
|
|
|
|
| |
Change-Id: Ia43c2436e01032ace7e2b13e59d60d10f71e7004
|
|
|
|
|
|
|
|
| |
Ran some static analysis on the lint code and fixed
various issues - some typos, made some fields final, made
some methods static, sorted modifier order etc.
Change-Id: Ibdcdec5745f040eb7b0880cf6999c0f0ea7f7e6f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lint check looks for missing recycle() calls on resources such as
TypedArrays, MotionEvents, and Messages.
41140 New Lint Check: Check Recycling VelocityTracker
41138 New Lint Check: Check Recycling Message
41137 New Lint Check: Check Recycling MotionEvent
41136 New Lint Check: Check Recycling TypedArray
In addition, it also flags cases where a method is called on a resource
after the resource has been recycled.
Change-Id: Ia06a1779519971d5459f1cd98914a6aededc4b83
|
|
|
|
|
|
|
|
|
|
| |
Move folders around to match default gradle/maven
folder structure.
The custom structure confused some IDEs when importing
the project as a Gradle project.
Change-Id: I5c059cc6fdf0ac2444b03d435f83f853363cfa32
|
|
|
|
|
|
|
| |
Fix a couple of issues found by findbugs,
and some test stability fixes.
Change-Id: I97390ea606ea25d6a68e5b7f8245e5e689117995
|
|
|
|
|
|
|
|
|
|
| |
This lint detector finds method declarations which are likely
to clash and accidentally override framework classes defined
on newer platforms
Also, fix method position computation in class files.
Change-Id: If0d03feb55e44816f75938dae3164c53ed5b3183
|
|
|
|
|
|
|
| |
Also add XML editor quickfix to set the attribute on
an API violation.
Change-Id: Ife95d73659656e98a6fb1a322354f5fcfcef1888
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The inefficient weight detector looks for horizontal layouts with
weights where all the children are layouts. It didn't have a very good
heuristic for finding out whether all children are layouts; it just
looked for whether the tag name contains "Layout".
This changeset generalizes this a bit, adding other layouts, as well
as <fragment> tags to the lint check.
It also updates the Master/Detail template to set the baseline
alignment attribute to false (to avoid triggering the updated lint
check), as well as android:textIsSelectable to clear another recent
new lint rule.
Change-Id: I887962b5e29a9ad0c5b5c01970b0c66f884125d8
|
|
|
|
| |
Change-Id: Ie8ff6629a3e787587516f6fa88c70dfdb7a92d0d
|
|
|
|
| |
Change-Id: I306b753319d235b015f44c0927382578805898de
|
|
|
|
| |
Change-Id: I415c42e19573bf733de672625a1200e62204ec77
|
|
|
|
|
|
|
|
|
|
| |
Turns off the ability to use @SuppressWarnings with optional
errors is available, but off by default (see Eclipse issue 392875).
This turns that off, makes missing enums in switch statements a
warning, and synchronizes the settings file to all projects (except
tests.)
Change-Id: Iad7060523b6ee2cbbca97e0a6ffedb264b185222
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When you have a field initialization like this:
private int foo = new ForbiddenClass();
the actual code to perform the initialization lives in a method named
<init> (or for a static field, <clinit>).
If you tried to suppress lint errors here by adding an annotation on
the field, it would not be found by lint, since lint looks at method
level annotations and it's sitting on the field node instead.
To fix this, the suppress check needs to identify the field scenario,
and in that case (when checking whether an error is suppressed) look
up the field in the class and check annotations there.
There was a second bug: The lint check which looks for invalid
suppress annotation sites (since they're not allowed on local
variables for class based lint checks) incorrectly concluded that
these types of initializations were local variables rather than field
initializations.
This fixes issue
38626: ADT: Misleading lint rule: SimpleDateFormat
Change-Id: I254f3fb5a6132d6cbe39bd425ffe6d67ed7b84ed
|
|/
|
|
|
|
|
|
|
| |
Updated the groupId of most artifacts to be more
reflective of their sub-projects status in the SDK tools.
Added lint artifacts.
Change-Id: I900a165647a9b7d3c55b473f63c4ca4469762d7b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ic8d20a002f6225cb15f609b3b7582716904e9278
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
These icons should not use color (and in the case of notification
icons, be white).
Change-Id: I32b9422735830a01bb069b90a5ad5a76d7aeb5de
|
|
|
|
|
|
|
| |
I ran lint over some large projects and manually verified the report;
this uncovered a couple of false positives.
Change-Id: I006d64a03119c6badc40e33df9ab4079e07dc7c5
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Make incremental lint in source files use the Eclipse context
to find super classes.
Change-Id: I31af7a146c259875857026bc7721294205482a91
|
|
|
|
| |
Change-Id: If2b905197d5d81c6f98315a0d48ff37091e8282b
|
|
|
|
|
|
| |
Replace "this.mFoo = foo" with just "mFoo = foo".
Change-Id: I44d537ebb62cd7e5c8493a0b50dcb527cd20f91c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I8434515179b8fd2ee3872506fc237c467a98db44
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I88cfbb3c497cc65e3d16c3ba1fe9ceeaf2613103
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I320af69286e7f0bcee395419acfeea7ed8f8d384
|
|
|
|
| |
Change-Id: Ia51e3e2280c3d360496550df50a540571b9b7582
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Fix the commit prefs lint check such that it correctly identifies
scenarios where the innerclass "Editor" is referenced without its
qualifying top level class, SharedPreferences.
Change-Id: I3a22738508b66ce0b3e836feff91f816b2c368e8
|
|
|
|
|
|
|
|
|
| |
The explanation text for issues can now contain some simple
markup such as * around sentences for bold and ` for monospace.
In the HTML report this is converted to HTML markup using <b>
and <code> spans, as well as <a> for http:// links.
Change-Id: I875a55a0ab9a61c2e8bb493ad94d5e4d51dd1072
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset changes the default targetSdkVersion written into new
projects from being hardcoded to "15" to being the same level as the
build target's API level.
It also adds a new lint check which looks at the targetSdkVersion and
complains if it's not the same as the highest known version (currently
16). The issue explanation points to the javadocs for the
android.os.Build.VERSION_CODES class for details on how to upgrade the
app.
Change-Id: I00c2bd7cd8fa239b9fd1de9b2d35ff9faf87d25f
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The API checker needs to look up the corresponding source code source
range for a given bytecode method dispatch, and the line number
information found in the .class file is not accurate enough. Lint has
some heuristics to search for the corresponding source range, but this
did not work properly for cases where the method call was a parent
constructor, via the "super()" call.
It also fixes a bug in handling the default package.
Change-Id: I15bb07b6709ab9a53376398fe92715f6e6eba968
|