|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.android.tools.lint.detector.api.Detector com.android.tools.lint.checks.JavaPerformanceDetector
public class JavaPerformanceDetector
Looks for performance issues in Java files, such as memory allocations during drawing operations and using HashMap instead of SparseArray.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.android.tools.lint.detector.api.Detector |
---|
com.android.tools.lint.detector.api.Detector.BinaryResourceScanner, com.android.tools.lint.detector.api.Detector.ClassScanner, com.android.tools.lint.detector.api.Detector.GradleScanner, com.android.tools.lint.detector.api.Detector.JavaScanner, com.android.tools.lint.detector.api.Detector.OtherFileScanner, com.android.tools.lint.detector.api.Detector.ResourceFolderScanner, com.android.tools.lint.detector.api.Detector.XmlScanner |
Field Summary | |
---|---|
static com.android.tools.lint.detector.api.Issue |
PAINT_ALLOC
Allocating objects during a paint method |
static com.android.tools.lint.detector.api.Issue |
USE_SPARSE_ARRAY
Using HashMaps where SparseArray would be better |
static com.android.tools.lint.detector.api.Issue |
USE_VALUE_OF
Using new Integer() instead of the more efficient Integer.valueOf |
Constructor Summary | |
---|---|
JavaPerformanceDetector()
Constructs a new JavaPerformanceDetector check |
Method Summary | |
---|---|
boolean |
appliesTo(com.android.tools.lint.detector.api.Context context,
java.io.File file)
|
lombok.ast.AstVisitor |
createJavaVisitor(com.android.tools.lint.detector.api.JavaContext context)
|
java.util.List<java.lang.Class<? extends lombok.ast.Node>> |
getApplicableNodeTypes()
|
static java.lang.String |
getReplacedType(java.lang.String message,
com.android.tools.lint.detector.api.TextFormat format)
For an error message for an USE_VALUE_OF issue reported by this detector,
returns the type being replaced. |
com.android.tools.lint.detector.api.Speed |
getSpeed()
|
Methods inherited from class com.android.tools.lint.detector.api.Detector |
---|
afterCheckFile, afterCheckLibraryProject, afterCheckProject, applicableSuperClasses, appliesTo, appliesToFolder, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkFolder, checkInstruction, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableElements, getApplicableFiles, getApplicableMethodNames, getSpeed, run, visitAttribute, visitBuildScript, visitConstructor, visitDocument, visitElement, visitElementAfter, visitMethod, visitResourceReference |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.android.tools.lint.detector.api.Detector.JavaScanner |
---|
applicableSuperClasses, appliesToResourceRefs, checkClass, getApplicableConstructorTypes, getApplicableMethodNames, visitConstructor, visitMethod, visitResourceReference |
Field Detail |
---|
public static final com.android.tools.lint.detector.api.Issue PAINT_ALLOC
public static final com.android.tools.lint.detector.api.Issue USE_SPARSE_ARRAY
public static final com.android.tools.lint.detector.api.Issue USE_VALUE_OF
new Integer()
instead of the more efficient Integer.valueOf
Constructor Detail |
---|
public JavaPerformanceDetector()
JavaPerformanceDetector
check
Method Detail |
---|
public boolean appliesTo(@NonNull com.android.tools.lint.detector.api.Context context, @NonNull java.io.File file)
appliesTo
in class com.android.tools.lint.detector.api.Detector
@NonNull public com.android.tools.lint.detector.api.Speed getSpeed()
getSpeed
in class com.android.tools.lint.detector.api.Detector
public java.util.List<java.lang.Class<? extends lombok.ast.Node>> getApplicableNodeTypes()
getApplicableNodeTypes
in interface com.android.tools.lint.detector.api.Detector.JavaScanner
getApplicableNodeTypes
in class com.android.tools.lint.detector.api.Detector
public lombok.ast.AstVisitor createJavaVisitor(@NonNull com.android.tools.lint.detector.api.JavaContext context)
createJavaVisitor
in interface com.android.tools.lint.detector.api.Detector.JavaScanner
createJavaVisitor
in class com.android.tools.lint.detector.api.Detector
@Nullable public static java.lang.String getReplacedType(@NonNull java.lang.String message, @NonNull com.android.tools.lint.detector.api.TextFormat format)
USE_VALUE_OF
issue reported by this detector,
returns the type being replaced. Intended to use for IDE quickfix implementations.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |