From 4e4b17e2c838bee06043237a551fefbd39a43391 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Tue, 1 Feb 2022 12:58:20 -0800 Subject: [PATCH] Remove the @Beta annotations from the Lint APIs The API is not guaranteed to be stable, and a large part of lint's API surface is outside of our control (e.g. UAST, PSI, intellij-core), but we have bytecode verification of custom lint jars now which pinpoints incompatible changes, and we strive to not break APIs under our control, so flagging all API accesses as unstable seems like overkill. Test: N/A Bug: None Change-Id: I2b94ca37985f105ab78cd78b55a9d301f2c4e558 --- .../src/main/java/com/android/tools/lint/HtmlReporter.kt | 2 -- .../src/main/java/com/android/tools/lint/LintCliClient.kt | 2 -- .../src/main/java/com/android/tools/lint/LintCliFlags.java | 2 -- lint/cli/src/main/java/com/android/tools/lint/Main.java | 2 -- lint/cli/src/main/java/com/android/tools/lint/Reporter.kt | 2 -- .../src/main/java/com/android/tools/lint/SarifReporter.kt | 2 -- .../src/main/java/com/android/tools/lint/TextReporter.kt | 2 -- .../cli/src/main/java/com/android/tools/lint/XmlReporter.kt | 2 -- lint/cli/src/main/java/com/android/tools/lint/XmlWriter.kt | 2 -- lint/docs/api-guide/basics.md.html | 6 +++--- .../java/com/android/tools/lint/client/api/AsmVisitor.java | 2 -- .../tools/lint/client/api/CircularDependencyException.java | 2 -- .../java/com/android/tools/lint/client/api/Configuration.kt | 2 -- .../com/android/tools/lint/client/api/DefaultSdkInfo.kt | 2 -- .../java/com/android/tools/lint/client/api/IssueRegistry.kt | 2 -- .../java/com/android/tools/lint/client/api/LintClient.kt | 2 -- .../java/com/android/tools/lint/client/api/LintDriver.kt | 2 -- .../java/com/android/tools/lint/client/api/LintListener.kt | 2 -- .../java/com/android/tools/lint/client/api/LintRequest.kt | 2 -- .../android/tools/lint/client/api/LintXmlConfiguration.kt | 2 -- .../com/android/tools/lint/client/api/ResourceVisitor.java | 2 -- .../main/java/com/android/tools/lint/client/api/SdkInfo.kt | 3 --- .../java/com/android/tools/lint/client/api/UastParser.kt | 2 -- .../java/com/android/tools/lint/client/api/XmlParser.kt | 2 -- .../java/com/android/tools/lint/detector/api/Category.kt | 3 --- .../com/android/tools/lint/detector/api/ClassContext.kt | 2 -- .../java/com/android/tools/lint/detector/api/Context.kt | 2 -- .../com/android/tools/lint/detector/api/DefaultPosition.kt | 3 --- .../java/com/android/tools/lint/detector/api/Detector.kt | 2 -- .../com/android/tools/lint/detector/api/Implementation.java | 2 -- .../main/java/com/android/tools/lint/detector/api/Issue.kt | 2 -- .../com/android/tools/lint/detector/api/LayoutDetector.java | 2 -- .../java/com/android/tools/lint/detector/api/Location.kt | 2 -- .../java/com/android/tools/lint/detector/api/Platform.kt | 2 -- .../java/com/android/tools/lint/detector/api/Position.kt | 3 --- .../java/com/android/tools/lint/detector/api/Project.java | 2 -- .../com/android/tools/lint/detector/api/ResourceContext.kt | 2 -- .../tools/lint/detector/api/ResourceXmlDetector.java | 2 -- .../main/java/com/android/tools/lint/detector/api/Scope.kt | 2 -- .../java/com/android/tools/lint/detector/api/Severity.kt | 2 -- .../java/com/android/tools/lint/detector/api/Speed.java | 2 -- .../java/com/android/tools/lint/detector/api/XmlContext.kt | 2 -- .../tools/lint/checks/infrastructure/LintDetectorTest.java | 2 -- 43 files changed, 3 insertions(+), 91 deletions(-) diff --git a/lint/cli/src/main/java/com/android/tools/lint/HtmlReporter.kt b/lint/cli/src/main/java/com/android/tools/lint/HtmlReporter.kt index 7c89004a9d6..f8ac51a41f3 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/HtmlReporter.kt +++ b/lint/cli/src/main/java/com/android/tools/lint/HtmlReporter.kt @@ -30,7 +30,6 @@ import com.android.tools.lint.detector.api.describeCounts import com.android.utils.HtmlBuilder import com.android.utils.SdkUtils import com.android.utils.XmlUtils -import com.google.common.annotations.Beta import com.google.common.base.Charsets import com.google.common.base.Joiner import com.google.common.base.Splitter @@ -53,7 +52,6 @@ import kotlin.math.min * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta class HtmlReporter( client: LintCliClient, output: File, diff --git a/lint/cli/src/main/java/com/android/tools/lint/LintCliClient.kt b/lint/cli/src/main/java/com/android/tools/lint/LintCliClient.kt index 93337266d1e..74b58e0c3c2 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/LintCliClient.kt +++ b/lint/cli/src/main/java/com/android/tools/lint/LintCliClient.kt @@ -76,7 +76,6 @@ import com.android.tools.lint.helpers.DefaultUastParser import com.android.tools.lint.model.LintModelModuleType import com.android.utils.CharSequences import com.android.utils.StdLogger -import com.google.common.annotations.Beta import com.google.common.annotations.VisibleForTesting import com.google.common.base.Splitter import com.google.common.collect.Sets @@ -121,7 +120,6 @@ import kotlin.math.max * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta open class LintCliClient : LintClient { constructor(clientName: String) : super(clientName) { flags = LintCliFlags() diff --git a/lint/cli/src/main/java/com/android/tools/lint/LintCliFlags.java b/lint/cli/src/main/java/com/android/tools/lint/LintCliFlags.java index dbcd740065a..bf267af7b7a 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/LintCliFlags.java +++ b/lint/cli/src/main/java/com/android/tools/lint/LintCliFlags.java @@ -24,7 +24,6 @@ import com.android.tools.lint.detector.api.Category; import com.android.tools.lint.detector.api.Issue; import com.android.tools.lint.model.LintModelSeverity; -import com.google.common.annotations.Beta; import com.google.common.collect.Lists; import java.io.File; import java.util.ArrayList; @@ -40,7 +39,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta public class LintCliFlags { private final Set suppress = new HashSet<>(); private final Set enabled = new HashSet<>(); diff --git a/lint/cli/src/main/java/com/android/tools/lint/Main.java b/lint/cli/src/main/java/com/android/tools/lint/Main.java index e5d961661b1..ce606755332 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/Main.java +++ b/lint/cli/src/main/java/com/android/tools/lint/Main.java @@ -65,7 +65,6 @@ import com.android.tools.lint.model.PathVariables; import com.android.utils.SdkUtils; import com.android.utils.XmlUtils; -import com.google.common.annotations.Beta; import com.google.common.base.Charsets; import com.google.common.io.ByteStreams; import com.intellij.pom.java.LanguageLevel; @@ -107,7 +106,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta public class Main { static final int MAX_LINE_WIDTH = 78; private static final String ARG_ENABLE = "--enable"; diff --git a/lint/cli/src/main/java/com/android/tools/lint/Reporter.kt b/lint/cli/src/main/java/com/android/tools/lint/Reporter.kt index 9b494360d74..538401d697f 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/Reporter.kt +++ b/lint/cli/src/main/java/com/android/tools/lint/Reporter.kt @@ -104,7 +104,6 @@ import com.android.tools.lint.detector.api.Incident import com.android.tools.lint.detector.api.Issue import com.android.tools.lint.detector.api.Location import com.android.utils.SdkUtils -import com.google.common.annotations.Beta import java.io.File import java.io.IOException import java.io.UnsupportedEncodingException @@ -118,7 +117,6 @@ import java.net.URLEncoder * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class Reporter protected constructor( @JvmField protected val client: LintCliClient, diff --git a/lint/cli/src/main/java/com/android/tools/lint/SarifReporter.kt b/lint/cli/src/main/java/com/android/tools/lint/SarifReporter.kt index b22f8a955bc..d8d7dc70567 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/SarifReporter.kt +++ b/lint/cli/src/main/java/com/android/tools/lint/SarifReporter.kt @@ -40,7 +40,6 @@ import com.android.tools.lint.detector.api.getFileUri import com.android.tools.lint.detector.api.isParent import com.android.utils.SdkUtils import com.android.utils.SdkUtils.isBitmapFile -import com.google.common.annotations.Beta import com.google.common.hash.Hashing import com.google.common.io.Files import java.io.BufferedWriter @@ -68,7 +67,6 @@ import kotlin.text.Charsets.UTF_8 * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta class SarifReporter /** diff --git a/lint/cli/src/main/java/com/android/tools/lint/TextReporter.kt b/lint/cli/src/main/java/com/android/tools/lint/TextReporter.kt index a18038c0cfc..25cd7de01e5 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/TextReporter.kt +++ b/lint/cli/src/main/java/com/android/tools/lint/TextReporter.kt @@ -23,7 +23,6 @@ import com.android.tools.lint.detector.api.Severity import com.android.tools.lint.detector.api.TextFormat import com.android.tools.lint.detector.api.describeCounts import com.android.utils.SdkUtils -import com.google.common.annotations.Beta import com.google.common.base.Joiner import com.google.common.base.Splitter import java.io.File @@ -36,7 +35,6 @@ import java.io.Writer * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta class TextReporter( client: LintCliClient, private val flags: LintCliFlags, diff --git a/lint/cli/src/main/java/com/android/tools/lint/XmlReporter.kt b/lint/cli/src/main/java/com/android/tools/lint/XmlReporter.kt index d8f39da53ad..e637f0d7608 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/XmlReporter.kt +++ b/lint/cli/src/main/java/com/android/tools/lint/XmlReporter.kt @@ -18,7 +18,6 @@ package com.android.tools.lint import com.android.tools.lint.client.api.LintClient import com.android.tools.lint.detector.api.Incident -import com.google.common.annotations.Beta import java.io.File import java.io.IOException @@ -28,7 +27,6 @@ import java.io.IOException * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta class XmlReporter constructor( /** Client handling IO, path normalization and error reporting. */ client: LintCliClient, diff --git a/lint/cli/src/main/java/com/android/tools/lint/XmlWriter.kt b/lint/cli/src/main/java/com/android/tools/lint/XmlWriter.kt index 367210d2630..f4a0a53c11e 100644 --- a/lint/cli/src/main/java/com/android/tools/lint/XmlWriter.kt +++ b/lint/cli/src/main/java/com/android/tools/lint/XmlWriter.kt @@ -51,7 +51,6 @@ import com.android.tools.lint.detector.api.TargetSdkLessThan import com.android.tools.lint.detector.api.TextFormat import com.android.tools.lint.detector.api.assertionsEnabled import com.android.utils.XmlUtils -import com.google.common.annotations.Beta import com.google.common.base.Joiner import com.google.common.io.Files import com.intellij.psi.PsiMethod @@ -71,7 +70,6 @@ import kotlin.text.Charsets.UTF_8 * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta open class XmlWriter constructor( /** Client handling IO, path normalization and error reporting. */ private val client: LintCliClient, diff --git a/lint/docs/api-guide/basics.md.html b/lint/docs/api-guide/basics.md.html index a4fa963f93d..4f93d35d7cb 100644 --- a/lint/docs/api-guide/basics.md.html +++ b/lint/docs/api-guide/basics.md.html @@ -31,9 +31,9 @@ ### API Stability -Lint's APIs are still marked as @Beta, and we have made it very clear -all along that this is not a stable API, so custom lint checks may need -to be updated periodically to keep working. +Lint's APIs are not stable, and a large part of Lint's API surface is +not under our control (such as UAST and PSI). Therefore, custom lint +checks may need to be updated periodically to keep working. However, ”some APIs are more stable than others“. In particular, the detector API (described below) is much less likely to change than the diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/AsmVisitor.java b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/AsmVisitor.java index 6a631fe46c0..88f5aaca21b 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/AsmVisitor.java +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/AsmVisitor.java @@ -20,7 +20,6 @@ import com.android.tools.lint.detector.api.ClassContext; import com.android.tools.lint.detector.api.ClassScanner; import com.android.tools.lint.detector.api.Detector; -import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -54,7 +53,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta class AsmVisitor { /** * Number of distinct node types specified in {@link AbstractInsnNode}. Sadly there isn't a diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/CircularDependencyException.java b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/CircularDependencyException.java index 140837f1be3..c734e23a17c 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/CircularDependencyException.java +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/CircularDependencyException.java @@ -20,7 +20,6 @@ import com.android.annotations.Nullable; import com.android.tools.lint.detector.api.Location; import com.android.tools.lint.detector.api.Project; -import com.google.common.annotations.Beta; /** * Exception thrown when there is a circular dependency, such as a circular dependency of library @@ -29,7 +28,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta public class CircularDependencyException extends RuntimeException { @Nullable private Project project; diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/Configuration.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/Configuration.kt index 34cb3aee524..e7b9852b0fc 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/Configuration.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/Configuration.kt @@ -27,7 +27,6 @@ import com.android.tools.lint.detector.api.Project import com.android.tools.lint.detector.api.Severity import com.android.tools.lint.detector.api.TextFormat import com.android.tools.lint.detector.api.guessGradleLocation -import com.google.common.annotations.Beta import java.io.File /** @@ -38,7 +37,6 @@ import java.io.File * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class Configuration( val configurations: ConfigurationHierarchy ) { diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/DefaultSdkInfo.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/DefaultSdkInfo.kt index b5e0410276f..c9d56110303 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/DefaultSdkInfo.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/DefaultSdkInfo.kt @@ -61,7 +61,6 @@ import com.android.SdkConstants.VIEW_STUB import com.android.SdkConstants.VIEW_SWITCHER import com.android.SdkConstants.WEB_VIEW import com.android.SdkConstants.WIDGET_PKG_PREFIX -import com.google.common.annotations.Beta /** * Default simple implementation of an [SdkInfo] @@ -69,7 +68,6 @@ import com.google.common.annotations.Beta * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta internal class DefaultSdkInfo : SdkInfo() { override fun getParentViewName(name: String): String? { val rawType = getRawType(name) ?: return null diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/IssueRegistry.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/IssueRegistry.kt index 707b6eb5e2c..ec1ed91c54b 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/IssueRegistry.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/IssueRegistry.kt @@ -26,7 +26,6 @@ import com.android.tools.lint.detector.api.Scope import com.android.tools.lint.detector.api.Severity import com.android.tools.lint.detector.api.editDistance import com.android.tools.lint.detector.api.isApplicableTo -import com.google.common.annotations.Beta import com.google.common.collect.Maps import com.google.common.collect.Sets import java.util.ArrayList @@ -42,7 +41,6 @@ import java.util.HashSet * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class IssueRegistry protected constructor() { /** diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintClient.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintClient.kt index 15781b7e933..ca2d1fca675 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintClient.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintClient.kt @@ -64,7 +64,6 @@ import com.android.utils.CharSequences import com.android.utils.Pair import com.android.utils.XmlUtils import com.android.utils.findGradleBuildFile -import com.google.common.annotations.Beta import com.google.common.base.Splitter import com.google.common.collect.Lists import com.google.common.collect.Maps @@ -103,7 +102,6 @@ import kotlin.math.max * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class LintClient { protected constructor(clientName: String) { diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintDriver.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintDriver.kt index cb09454853f..eca5d9017e8 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintDriver.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintDriver.kt @@ -85,7 +85,6 @@ import com.android.tools.lint.detector.api.isXmlFile import com.android.tools.lint.model.PathVariables import com.android.utils.Pair import com.android.utils.SdkUtils.isBitmapFile -import com.google.common.annotations.Beta import com.google.common.annotations.VisibleForTesting import com.google.common.base.Objects import com.google.common.base.Splitter @@ -156,7 +155,6 @@ import kotlin.system.measureTimeMillis * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta class LintDriver( /** The [registry] containing issues to be checked. */ var registry: IssueRegistry, diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintListener.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintListener.kt index 528561ba640..1953bd38049 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintListener.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintListener.kt @@ -18,7 +18,6 @@ package com.android.tools.lint.client.api import com.android.tools.lint.detector.api.Context import com.android.tools.lint.detector.api.Project -import com.google.common.annotations.Beta /** * Interface implemented by listeners to be notified of lint events. @@ -26,7 +25,6 @@ import com.google.common.annotations.Beta * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta interface LintListener { /** The various types of events provided to lint listeners. */ enum class EventType { diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintRequest.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintRequest.kt index 93564a80379..6acab30f1af 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintRequest.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintRequest.kt @@ -19,7 +19,6 @@ package com.android.tools.lint.client.api import com.android.tools.lint.detector.api.Platform import com.android.tools.lint.detector.api.Project import com.android.tools.lint.detector.api.Scope -import com.google.common.annotations.Beta import java.io.File import java.util.EnumSet @@ -29,7 +28,6 @@ import java.util.EnumSet * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta open class LintRequest( /** * The lint client requesting the lint check diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintXmlConfiguration.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintXmlConfiguration.kt index ff652a4ea8d..f3ad7d1f445 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintXmlConfiguration.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/LintXmlConfiguration.kt @@ -38,7 +38,6 @@ import com.android.tools.lint.detector.api.Severity import com.android.tools.lint.detector.api.StringOption import com.android.utils.SdkUtils import com.android.utils.iterator -import com.google.common.annotations.Beta import com.google.common.base.Splitter import org.w3c.dom.Element import org.xmlpull.v1.XmlPullParser @@ -136,7 +135,6 @@ import kotlin.math.max * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta open class LintXmlConfiguration protected constructor( configurations: ConfigurationHierarchy, val configFile: File, diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/ResourceVisitor.java b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/ResourceVisitor.java index 7f4be6149b0..bf91b16982f 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/ResourceVisitor.java +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/ResourceVisitor.java @@ -22,7 +22,6 @@ import com.android.tools.lint.detector.api.ResourceContext; import com.android.tools.lint.detector.api.XmlContext; import com.android.tools.lint.detector.api.XmlScanner; -import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -56,7 +55,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta class ResourceVisitor { private final Map> elementToCheck = new HashMap<>(); private final Map> attributeToCheck = new HashMap<>(); diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/SdkInfo.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/SdkInfo.kt index 8d4025416e2..c5b0aef23e9 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/SdkInfo.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/SdkInfo.kt @@ -16,15 +16,12 @@ package com.android.tools.lint.client.api -import com.google.common.annotations.Beta - /** * Information about SDKs * * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class SdkInfo { /** * Returns true if the given child view is the same class or a sub diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/UastParser.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/UastParser.kt index b010ecdecb5..be397000088 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/UastParser.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/UastParser.kt @@ -18,7 +18,6 @@ package com.android.tools.lint.client.api import com.android.tools.lint.detector.api.JavaContext import com.android.tools.lint.detector.api.Location -import com.google.common.annotations.Beta import com.intellij.pom.java.LanguageLevel import com.intellij.psi.PsiElement import com.intellij.psi.PsiFile @@ -36,7 +35,6 @@ import java.io.File * **NOTE: This is not public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class UastParser { /** diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/XmlParser.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/XmlParser.kt index 1b6293b427d..596c574e7a0 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/XmlParser.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/client/api/XmlParser.kt @@ -25,7 +25,6 @@ import com.android.resources.ResourceType import com.android.tools.lint.detector.api.Location import com.android.tools.lint.detector.api.XmlContext import com.android.utils.iterator -import com.google.common.annotations.Beta import org.w3c.dom.Attr import org.w3c.dom.Document import org.w3c.dom.Element @@ -43,7 +42,6 @@ import javax.xml.parsers.ParserConfigurationException * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class XmlParser { /** * Parse the given XML content and returns as a Document diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Category.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Category.kt index 0656acf0d78..2804ed8eef9 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Category.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Category.kt @@ -16,15 +16,12 @@ package com.android.tools.lint.detector.api -import com.google.common.annotations.Beta - /** * A category is a container for related issues. * * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta data class Category /** * Creates a new [Category]. diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ClassContext.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ClassContext.kt index b6f88e238ab..5da1acdfaa7 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ClassContext.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ClassContext.kt @@ -25,7 +25,6 @@ import com.android.tools.lint.detector.api.Location.SearchDirection.BACKWARD import com.android.tools.lint.detector.api.Location.SearchDirection.EOL_BACKWARD import com.android.tools.lint.detector.api.Location.SearchDirection.FORWARD import com.android.tools.lint.detector.api.Location.SearchHints -import com.google.common.annotations.Beta import com.google.common.base.Splitter import com.intellij.psi.JavaPsiFacade import com.intellij.psi.PsiClass @@ -45,7 +44,6 @@ import java.io.File * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta class ClassContext( /** the driver running through the checks */ driver: LintDriver, diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Context.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Context.kt index acb446072b0..933b36c5511 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Context.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Context.kt @@ -31,7 +31,6 @@ import com.android.tools.lint.client.api.LintDriver.DriverMode import com.android.tools.lint.client.api.SdkInfo import com.android.utils.CharSequences import com.android.utils.CharSequences.indexOf -import com.google.common.annotations.Beta import com.google.common.annotations.VisibleForTesting import com.intellij.openapi.vfs.VfsUtilCore import com.intellij.psi.PsiElement @@ -55,7 +54,6 @@ import java.util.HashSet * *NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta open class Context( /** The driver running through the checks. */ val driver: LintDriver, diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/DefaultPosition.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/DefaultPosition.kt index ff8a40fbe57..da2ebdc1ebc 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/DefaultPosition.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/DefaultPosition.kt @@ -16,15 +16,12 @@ package com.android.tools.lint.detector.api -import com.google.common.annotations.Beta - /** * A simple offset-based position * * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta data class DefaultPosition( /** The line number (0-based where the first line is line 0) */ override val line: Int, diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Detector.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Detector.kt index 1673c10a898..45581c6a93d 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Detector.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Detector.kt @@ -22,7 +22,6 @@ import com.android.tools.lint.client.api.LintClient import com.android.tools.lint.client.api.LintDriver import com.android.tools.lint.client.api.UElementHandler import com.android.tools.lint.detector.api.interprocedural.CallGraphResult -import com.google.common.annotations.Beta import com.intellij.psi.JavaElementVisitor import com.intellij.psi.PsiClass import com.intellij.psi.PsiElement @@ -69,7 +68,6 @@ import java.util.EnumSet * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class Detector { /** * See [com.android.tools.lint.detector.api.SourceCodeScanner]; this diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Implementation.java b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Implementation.java index bea274a54a2..be11ea6d00d 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Implementation.java +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Implementation.java @@ -16,7 +16,6 @@ package com.android.tools.lint.detector.api; import com.android.annotations.NonNull; -import com.google.common.annotations.Beta; import java.util.EnumSet; /** @@ -27,7 +26,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta public class Implementation { private final Class detectorClass; private final EnumSet scope; diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Issue.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Issue.kt index 152eb06f06b..ab057bdee84 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Issue.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Issue.kt @@ -21,7 +21,6 @@ import com.android.tools.lint.client.api.Configuration import com.android.tools.lint.client.api.IssueRegistry import com.android.tools.lint.client.api.Vendor import com.android.tools.lint.detector.api.TextFormat.RAW -import com.google.common.annotations.Beta import java.util.ArrayList import java.util.EnumSet @@ -38,7 +37,6 @@ import java.util.EnumSet * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta class Issue private constructor( /** * Returns the unique id of this issue. These should not change diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/LayoutDetector.java b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/LayoutDetector.java index 0553f75760d..863dcaf8afb 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/LayoutDetector.java +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/LayoutDetector.java @@ -18,7 +18,6 @@ import com.android.annotations.NonNull; import com.android.resources.ResourceFolderType; -import com.google.common.annotations.Beta; /** * Abstract class specifically intended for layout detectors which provides some common utility @@ -27,7 +26,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta public abstract class LayoutDetector extends ResourceXmlDetector { @Override public boolean appliesTo(@NonNull ResourceFolderType folderType) { diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Location.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Location.kt index 21690016851..2f4a7c03054 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Location.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Location.kt @@ -23,7 +23,6 @@ import com.android.tools.lint.client.api.UastParser import com.android.utils.CharSequences.indexOf import com.android.utils.CharSequences.lastIndexOf import com.android.utils.CharSequences.startsWith -import com.google.common.annotations.Beta import org.jetbrains.uast.UIdentifier import org.jetbrains.uast.UMethod import java.io.File @@ -36,7 +35,6 @@ import kotlin.math.min * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta open class Location /** * (Private constructor, use one of the factory methods diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Platform.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Platform.kt index b5aec1a5e69..c6d5ab10c8f 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Platform.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Platform.kt @@ -16,7 +16,6 @@ package com.android.tools.lint.detector.api -import com.google.common.annotations.Beta import java.util.EnumSet /** @@ -29,7 +28,6 @@ import java.util.EnumSet * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta enum class Platform { /** * The analysis applies only to Android sources. Issues with this diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Position.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Position.kt index 175d642a38a..8e6b1f0292a 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Position.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Position.kt @@ -16,15 +16,12 @@ package com.android.tools.lint.detector.api -import com.google.common.annotations.Beta - /** * Information about a position in a file/document. * * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta abstract class Position { /** * Returns the line number (0-based where the first line is line 0) diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Project.java b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Project.java index 8d07960a18f..7ff2a05fd43 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Project.java +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Project.java @@ -67,7 +67,6 @@ import com.android.tools.lint.model.LintModelModuleType; import com.android.tools.lint.model.LintModelNamespacingMode; import com.android.tools.lint.model.LintModelVariant; -import com.google.common.annotations.Beta; import com.google.common.base.CharMatcher; import com.google.common.base.Splitter; import com.google.common.collect.Lists; @@ -98,7 +97,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta public class Project { protected final LintClient client; protected final File dir; diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ResourceContext.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ResourceContext.kt index 4cb93528b0f..bb83c966e5a 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ResourceContext.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ResourceContext.kt @@ -19,7 +19,6 @@ package com.android.tools.lint.detector.api import com.android.ide.common.resources.configuration.FolderConfiguration import com.android.resources.ResourceFolderType import com.android.tools.lint.client.api.LintDriver -import com.google.common.annotations.Beta import java.io.File /** @@ -41,7 +40,6 @@ import java.io.File * not a public or final API; if you rely on this be prepared * to adjust your code for the next tools release.** */ -@Beta open class ResourceContext( driver: LintDriver, project: Project, diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ResourceXmlDetector.java b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ResourceXmlDetector.java index dd423bd6a67..e8211ae1194 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ResourceXmlDetector.java +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/ResourceXmlDetector.java @@ -18,7 +18,6 @@ import com.android.annotations.NonNull; import com.android.resources.ResourceFolderType; -import com.google.common.annotations.Beta; /** * Specialized detector intended for XML resources. Detectors that apply to XML resources should @@ -27,7 +26,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta public abstract class ResourceXmlDetector extends Detector implements XmlScanner { /** diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Scope.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Scope.kt index 62f783f1589..4bc0ffc287f 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Scope.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Scope.kt @@ -29,7 +29,6 @@ import com.android.SdkConstants.DOT_XML import com.android.SdkConstants.FN_PROJECT_PROGUARD_FILE import com.android.SdkConstants.OLD_PROGUARD_FILE import com.android.SdkConstants.RES_FOLDER -import com.google.common.annotations.Beta import java.util.EnumSet /** @@ -41,7 +40,6 @@ import java.util.EnumSet * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta enum class Scope { /** * The analysis only considers a single XML resource file at a time. diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Severity.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Severity.kt index 26ffa7d6232..f4bdf5e1cbc 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Severity.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Severity.kt @@ -17,7 +17,6 @@ package com.android.tools.lint.detector.api import com.android.tools.lint.model.LintModelSeverity -import com.google.common.annotations.Beta import java.util.Locale /** @@ -26,7 +25,6 @@ import java.util.Locale * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta enum class Severity constructor( /** * A description of this severity suitable for display to the user. diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Speed.java b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Speed.java index 02c9f2e6630..b8a67fa5790 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Speed.java +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Speed.java @@ -17,7 +17,6 @@ package com.android.tools.lint.detector.api; import com.android.annotations.NonNull; -import com.google.common.annotations.Beta; /** * Enum which describes the different computation speeds of various detectors @@ -25,7 +24,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta public enum Speed { /** The detector can run very quickly */ FAST("Fast"), diff --git a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/XmlContext.kt b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/XmlContext.kt index 9b26a2bc34f..9e547657453 100644 --- a/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/XmlContext.kt +++ b/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/XmlContext.kt @@ -21,7 +21,6 @@ package com.android.tools.lint.detector.api import com.android.resources.ResourceFolderType import com.android.tools.lint.client.api.LintDriver import com.android.tools.lint.client.api.XmlParser -import com.google.common.annotations.Beta import org.w3c.dom.Attr import org.w3c.dom.Document import org.w3c.dom.Element @@ -34,7 +33,6 @@ import java.io.File * **NOTE: This is not a public or final API; if you rely on this be * prepared to adjust your code for the next tools release.** */ -@Beta open class XmlContext( /** the driver running through the checks */ driver: LintDriver, diff --git a/lint/libs/lint-tests/src/main/java/com/android/tools/lint/checks/infrastructure/LintDetectorTest.java b/lint/libs/lint-tests/src/main/java/com/android/tools/lint/checks/infrastructure/LintDetectorTest.java index 163f257a46f..7084e73a758 100644 --- a/lint/libs/lint-tests/src/main/java/com/android/tools/lint/checks/infrastructure/LintDetectorTest.java +++ b/lint/libs/lint-tests/src/main/java/com/android/tools/lint/checks/infrastructure/LintDetectorTest.java @@ -62,7 +62,6 @@ import com.android.tools.lint.detector.api.Scope; import com.android.tools.lint.detector.api.Severity; import com.android.tools.lint.detector.api.TextFormat; -import com.google.common.annotations.Beta; import com.google.common.collect.Lists; import com.intellij.openapi.util.Disposer; import com.intellij.pom.java.LanguageLevel; @@ -97,7 +96,6 @@ *

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your * code for the next tools release. */ -@Beta @SuppressWarnings("javadoc") public abstract class LintDetectorTest extends BaseLintDetectorTest { @Override