From e5bf3fb4c2ef475051ef74b29ef732118b8766bf Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 1 Jul 2022 19:39:14 +0000 Subject: Revert^2 "Fix erroneous "Field requires API level 33 (current min is 32)" warnings" This reverts commit 5d80d895b6e99e881454919e7b40f4ae78696582. Reason for revert: The issue that broke the build the first time this was submitted has been fixed in ag/19125702. Also the errorprone build was added to presubmit for changes to these files so we should hopefully catch any other issues at presubmit now: cl/458501206 Change-Id: I80ca08df49c58a1ad70de917822301368d49fc67 --- java/lint.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'java/lint.go') diff --git a/java/lint.go b/java/lint.go index 426a2af25..f09db955d 100644 --- a/java/lint.go +++ b/java/lint.go @@ -17,6 +17,7 @@ package java import ( "fmt" "sort" + "strconv" "strings" "github.com/google/blueprint/proptools" @@ -75,9 +76,9 @@ type linter struct { extraLintCheckJars android.Paths test bool library bool - minSdkVersion android.ApiLevel - targetSdkVersion android.ApiLevel - compileSdkVersion android.ApiLevel + minSdkVersion int + targetSdkVersion int + compileSdkVersion int compileSdkKind android.SdkKind javaLanguageLevel string kotlinLanguageLevel string @@ -299,8 +300,8 @@ func (l *linter) generateManifest(ctx android.ModuleContext, rule *android.RuleB Text(`echo "" &&`). Text(`echo "" &&`). - Textf(`echo " " &&`, - l.minSdkVersion.String(), l.targetSdkVersion.String()). + Textf(`echo " " &&`, + l.minSdkVersion, l.targetSdkVersion). Text(`echo ""`). Text(") >").Output(manifestPath) @@ -325,7 +326,7 @@ func (l *linter) lint(ctx android.ModuleContext) { return } - if l.minSdkVersion.CompareTo(l.compileSdkVersion) == -1 { + if l.minSdkVersion != l.compileSdkVersion { l.extraMainlineLintErrors = append(l.extraMainlineLintErrors, updatabilityChecks...) _, filtered := android.FilterList(l.properties.Lint.Warning_checks, updatabilityChecks) if len(filtered) != 0 { @@ -427,7 +428,7 @@ func (l *linter) lint(ctx android.ModuleContext) { FlagWithOutput("--html ", html). FlagWithOutput("--text ", text). FlagWithOutput("--xml ", xml). - FlagWithArg("--compile-sdk-version ", l.compileSdkVersion.String()). + FlagWithArg("--compile-sdk-version ", strconv.Itoa(l.compileSdkVersion)). FlagWithArg("--java-language-level ", l.javaLanguageLevel). FlagWithArg("--kotlin-language-level ", l.kotlinLanguageLevel). FlagWithArg("--url ", fmt.Sprintf(".=.,%s=out", android.PathForOutput(ctx).String())). -- cgit v1.2.3-59-g8ed1b