| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Element.getAttribute isn't supposed to return null, but in Eclipse it
sometimes does. It was common in 3.5.2, which we've dropped support
for, but issue 25668 shows that it can happen in Eclipse 3.7.1 too
though it's rare.
This changeset attempts to address the issue in two ways:
(1) Spotfix the specific NPE
(2) Hold the readlock on the XML document while the detectors are
using the DOM nodes (this is in case the nulls are related to
this, which is not certain given that the issue is rare and not
reproducible)
Change-Id: I14727531ea9e08abf45d70013248e702cf5a15eb
|
|
|
|
| |
Change-Id: Id62e675e467a4c9754515640194c836ab4cb9a83
|
|
|
|
| |
Change-Id: I79cbdf874cffe78eb62f9af2e22e6cc780853e6a
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This changeset splits the proguard.cfg into two halves:
(1) All the general Android settings go into
$ANDROID_SDK/proguard/proguard-android.txt.
This defines shrinking rules like keep custom views, etc. The
crucial point is that this information is maintained and updated
by Tools updates, so whenever new APIs are added to Android, or
whenever bugs are found in the configuration such as flags needed
to work with Dalvik, we can make the updates - we don't have old
snapshots living on in projects.
(2) Any project specific settings go to proguard-project.txt in the
project.
(3) The proguard.config property in project.properties now refers to a
*path* of configuration files, which are all passed to ProGuard in
the given order. The code which processes this setting will
substitute android.sdk.home and user.home variables, so the path
does not have to be hardcoded to point to the project-android.txt
file.
The default project templates have been updated to include a
commented out configuration setting up proguard as described
above.
The default proguard file name was changed from proguard.cfg to
proguard-project.txt such that it can be directly opened in Eclipse
and to make it clear it's an editable text file.
Lint was updated to find the Proguard file via the proguard.config
property as well as via the old and new default names for projects not
enabled with ProGuard.
A subsequent CL will add a lint check which identifies projects
containing the old setup (full local configuration) and offer to
replace it with the new setup.
Change-Id: I44b4c97a160114c2382f02f843c95486a0dc9d6b
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Android has various setColor methods (such as setTextColor) which take
an integer, where it expects RGB values in the bytes. Since this is
an integer, and since color resources are integers, sometimes code
incorrectly passes the color resource id rather than a resolved color
to the setter:
paint.setColor(R.color.red)
Obviously, the color should be "resolved" first via
getResource().getColor().
This changeset adds a lint detector which catches these kinds of bugs.
Change-Id: I2970e5220d24ad3b844a9f19fbe99b932d9f7fb4
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This changeset adds support for suppressing lint errors on
translations. For a missing translation, place the suppress attribute
on the default language key. For strings defined in other languages
but not the default locale, place the attribute on the extra
translation.
This required adding better location tracking (which is also
beneficial in that the translation warnings will show up as editor
underlines in Eclipse etc). Instead of having errors generated for
each locale ("the following strings are missing from locale X") it now
generates a unique error for each string, listing which locales it's
missing from. This also solves a different issue where the list of
missing strings was truncated when large; there's no more truncation
now.
Change-Id: If63e92a6a750a5314af2f11441347cf9fc0b0a15
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Take the folder version into account when checking the API level in
XML files. For example, even if minSdkVersion=5, it's okay to have a
<GridLayout> element in a layout if that layout is in a layout-v14 (or
higher) folder.
Change-Id: Idbd3647c1145e4b3d03f90626339ef7e6b10c827
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
TextView provides a number of attributes related to text editing.
However, these are generally intended for the EditText subclass of
EditText. This lint check looks for <TextView> elements in layouts
where one or more of the edit-related attributes (such as inputType)
are defined.
It also updates the deprecation detector to check various deprecated
attributes (it only checked for deprecated elements before this.)
Change-Id: I1b94902d906cd0bee6a6564368125a68b3c9bb2a
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If Lint cannot find the .class files for a project, it cannot run any
of the class-file based checks (such as the NewApi check).
This changeset adds a new category and issue id, "Lint Error", for
these types of issues. In HTML reports, these errors are listed at the
top. The issue explanation states that these errors don't represent
bugs in the user's code, but that lint was not able to check certain
things for the reasons given.
In the case of no .class files found, it asks whether the project
needs to be built first. It also uses these lint errors to emit
errors in processing lint.xml configuration files.
(Note that if you don't want to see these types of errors, you can
suppress it via --disable LintError.)
Change-Id: Ifc2f55566f3a0cd20189d43e4205201bc21ee280
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A lint.xml file in a library project should be able to suppress lint
errors in that project. This changeset fixes a couple of bugs which
prevented this from working: In Eclipse, the configuration was cached,
which meant a single lint run through multiple projects would just use
the configuration of the first encountered project. And from the
command line driver, the code to handle --check handling would
override configuration severity in one scenario.
Change-Id: Ib08e2b14582ab53e5ab89244738d1bd77839610e
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This changeset adds a lint rule checking that any named, non-abstract
classes which extend Activity, Service or ContentProvider have a
corresponding registration in the manifest file.
It also ensures that the registration is under the right kind of tag
(<activity>, <service>, <provider> or <receiver>).
Change-Id: Ifbb587ae7b3eb6529d5099b33245d0478d48c41f
|
|/
|
|
|
|
|
|
| |
This changeset makes the API lint detector look at XML attribute
values and XML value text nodes and check any references to @android
resources to ensure that they are available in all supported versions.
Change-Id: Iab0d23423c30381e06b32f54aa902a31cc1f9a1c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset adds is-suppressed checking to most of the remaining
XML detectors. These are detectors which do post processing on data in
order to compute the warnings, at which point they no longer have
access to the original DOM node context. This changeset adds various
checks to handle this, such as storing the DOM node in the location
handle client data and checking explicitly before using the handles.
It adds various unit tests for the suppress scenarios too.
There are now two remaining detectors which don't properly handle
suppression: the TranslateDetector, and the DuplicateIdDetector (in
cross layout scenarios). These will be addressed in a separate CL.
Change-Id: I53e792dd2f2802c7dce16beb73127f20d9b2dba8
|
|
|
|
| |
Change-Id: Id8f467c5a088101e6b50c33fa0703520e31bdede
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lint check makes sure that if a layout references
android:onClick="foo" then one of the Java classes provide a
public void foo(View)
method. It also looks for simple typos, and warns if the access
modifiers are not right.
(It also moves some ASM-related utility code out of specific detectors
and into the ClassContext class)
Change-Id: Ifb0820221175a0760b83992f54e99f761b4d7097
|
|
|
|
| |
Change-Id: If83a942f99da90d061529092feaab3be94a8e0ad
|
|
|
|
| |
Change-Id: Ia8f0c1aebb4e797352a0513b8113b5d6b75ef0dc
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Also adds a lint check for unused namespace declarations,
and migrates the TypoDetector code into this new namespace
detector.
Change-Id: I5ec2214ea4c59e14194f8eaecef422ea19baa35e
|
|/
|
|
| |
Change-Id: I6a68b28b610ebdfc31b779b7b66e49a70a5e1a01
|
|
|
|
| |
Change-Id: I4e37e68661007a825c97948e6258201babcd2b79
|
|
|
|
| |
Change-Id: Iecad10d5c33f6b7649e686633c9ff9f5541e9799
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset adds two new checks for Java performance suggestions:
(1) It identifies object allocation within draw methods
(onDraw(Canvas)) and warns that it's a bad idea. It also looks for
certain factory methods, such as Bitmap.createBitmap(), which have
the same issue.
The lint detector also checks to make sure that the allocation
isn't part of lazy initialization: if the return value is stored
into a field, it checks that the allocation is surrounded by a
null check on that field.
(2) It identifies usages of HashMap<Integer, X> and suggests replacing
it with SparseArray (or SparseIntArray or SparseBooleanArray,
depending on the second type variable of the map initialization).
Change-Id: I3bcbb182404b1eeaaa8c9e5209d889694d88f216
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A handful of lint checks still don't support per-node suppress
checking (because the computation does not have node information at
the time when the final warnigns are produced).
This checkin uses the new location client data facility to add scope
checking for a few more of the lint checks.
Change-Id: I0ca48e91441dcd753834ad4777959f728b74ac71
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This changeset adds a new severity, "Fatal", and shifts the abort-on-
export feature from using the Error severity to the Fatal severity.
This gives the user (and lint check developers) a bit more control
over which errors should fail a build. You can now leave some issues
as "error", but not have it block export. This can be useful for
checks which are extremely slow, or for checks that generally
represent errors but where the rule cannot know for sure (such as
attempts to figure out reflection calls in Java).
Change-Id: Ie44d5efcb605091ba8c1c67aa720edbbde416ca5
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This changeset adds a new lint detector which looks for typos in the
namespace declaration for Android. If it sees the prefix "android" it
ensures that the URI matches exactly (and case-sensitively)
http://schemas.android.com/apk/res/android
If the prefix is "a", it also checks for the above prefix, but only
warns if the difference is "close" (edit distance <= 3) such that
it belives it's a typo, not some unrelated prefix bound to "a".
(This was requested in http://b.android.com/25449)
Change-Id: Ic6dee77a300fc048cb9bee3e455f533b858ef6bb
|
|\ \ \
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This changeset adds a preprocessing state to the class handling.
Instead of processing each class sequentially, all the class byte
arrays are read in first, and then a lightweight class visitor
(skipping methods and debug symbols) skims through all the classes to
build up a superclass map up front.
The byte arrays are then processed sequentially as before, but the
detectors can now query the lint driver for class hierarchies.
A couple of lint checks are now taking advantage of this. For
eexample, the API checker can properly handle virtual methods where a
local class extends some other local (or library) class which
eventually extends an Android API class. (Until this checkin, only
classes directly extending an Android API class were supported).
Change-Id: I972172a61268dd2530979a93b2f289c1dcf94d63
|
|\ \ \
| |/ / |
|
| |/
| |
| |
| |
| |
| |
| | |
This changeset makes lint properly handle the jar dependency scope for
issues. It also tweaks the API in a few minor ways.
Change-Id: Ibd7b943c9d3ce361e091af8f1e990709bb94d183
|
|/
|
|
| |
Change-Id: I52662287ff86925629ea8f6f5bc13855d403b3e8
|
|\
| |
| |
| | |
settings"
|
| |
| |
| |
| | |
Change-Id: I9401318afe771d11ef6f211ee3f9cb6c62df8f83
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The string format lint check might be processing strings not intended
for String.format (but intended for example for
android.text.format.Time#format), in which case it will be wrong about
whether two conversions are incompatible. (This does not fix all
scenarios; if a date string looks like a String.format in the sense
that all of its formatting characters are defined by String.format
then the string will assume to be intended for String.format.)
This changeset attempts to recognize this, and also make the "is
incompatible" check a bit more nuanced: it will now consider "d"
compatible with "x" for example.
Change-Id: I63ce082f40169e4033809d25cae3cf116c9e2044
|
|\ \ |
|
| |/
| |
| |
| | |
Change-Id: I997ad6f1348e9884b56a60ef453cd02754c936bb
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset enables the button order check by default, and makes
the rule consider the minimum and target SDK more carefully.
* If both the min and target SDK >= 14, the rule enforces the new
button order.
* If both the min and target SDK <= 14, then the rule does nothing.
* Otherwise, if warns if the wrong button order is in a layout that is
in a layout*-v14 or higher folder, or if it's in a non-v14 folder
and there is no corresponding v14 layout.
Change-Id: Idf54f86d7a004fdb073486160e4d5ff5fd1cd45c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This addresses
25176: LINT: Incorrectly flags Action Bar icons as wrong size
Change-Id: I1309c60f48585dd118951d928e3cd3d06a1d2939
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- If specifying a report directory (rather than an HTML file name),
always write out an overview report. (Before this it only wrote an
overview report if issues were *found* in multiple projects).
- If checking *specific* issues (with the --check flag), don't write out
the list of suppressed issues.
- If no errors were found, write a message to that effect.
- Make some space between the explanation area and the More Info URL,
if any
- Code cleanup
Change-Id: I0c1a5cf14de15276904e8999323df443fc39dc9c
|