public class JavaPerformanceDetector
extends com.android.tools.lint.detector.api.Detector
implements com.android.tools.lint.detector.api.Detector.UastScanner
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.JavaPsiScanner, 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.UastScanner, com.android.tools.lint.detector.api.Detector.XmlScanner
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_CANVAS |
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 and Description |
---|
JavaPerformanceDetector()
Constructs a new
JavaPerformanceDetector check |
Modifier and Type | Method and Description |
---|---|
com.android.tools.lint.client.api.UElementHandler |
createUastHandler(com.android.tools.lint.detector.api.JavaContext context) |
java.util.List<java.lang.Class<? extends org.jetbrains.uast.UElement>> |
getApplicableUastTypes() |
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. |
afterCheckFile, afterCheckLibraryProject, afterCheckProject, applicableSuperClasses, appliesTo, appliesTo, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkClass, checkFolder, checkInstruction, createJavaVisitor, createPsiVisitor, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableElements, getApplicableFiles, getApplicableMethodNames, getApplicableNodeTypes, getApplicablePsiTypes, getApplicableReferenceNames, getSpeed, getSpeed, run, visitAttribute, visitBuildScript, visitClass, visitClass, visitConstructor, visitConstructor, visitConstructor, visitDocument, visitElement, visitElementAfter, visitMethod, visitMethod, visitMethod, visitReference, visitReference, visitResourceReference, visitResourceReference, visitResourceReference
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicableSuperClasses, appliesToResourceRefs, getApplicableConstructorTypes, getApplicableMethodNames, getApplicablePsiTypes, getApplicableReferenceNames, visitClass, visitClass, visitConstructor, visitMethod, visitReference, visitResourceReference
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
public static final java.lang.String CLASS_CANVAS
public JavaPerformanceDetector()
JavaPerformanceDetector
checkpublic java.util.List<java.lang.Class<? extends org.jetbrains.uast.UElement>> getApplicableUastTypes()
getApplicableUastTypes
in interface com.android.tools.lint.detector.api.Detector.UastScanner
getApplicableUastTypes
in class com.android.tools.lint.detector.api.Detector
public com.android.tools.lint.client.api.UElementHandler createUastHandler(@NonNull com.android.tools.lint.detector.api.JavaContext context)
createUastHandler
in interface com.android.tools.lint.detector.api.Detector.UastScanner
createUastHandler
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.