summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-01-16 17:17:11 -0800
committer Cole Faust <colefaust@google.com> 2024-01-17 07:45:35 +0000
commit028b94cdc5d89e3f5a84b25b39067f902ffa448a (patch)
treed3577999b259d9a5f172b7b001dc32cbdfbc61df
parent3905a6adbd827fe94d443baf5337918facfd87d8 (diff)
Promote the NewApi check to an error again
Now that all existing cases have been baselined. Ignore-AOSP-First: Requires a LSC that is difficult to do across branches. Bug: 268261262 Test: m lint-check Change-Id: I413f86ff7a1f33564465f3ba9cd52924a4242901
-rw-r--r--java/lint.go7
-rw-r--r--java/lint_test.go5
2 files changed, 3 insertions, 9 deletions
diff --git a/java/lint.go b/java/lint.go
index c3d723b40..91e22a491 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -319,12 +319,7 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext, rule *android.Ru
cmd.FlagWithInput("@",
android.PathForSource(ctx, "build/soong/java/lint_defaults.txt"))
- if l.compileSdkKind == android.SdkPublic {
- cmd.FlagForEachArg("--error_check ", l.extraMainlineLintErrors)
- } else {
- // TODO(b/268261262): Remove this branch. We're demoting NewApi to a warning due to pre-existing issues that need to be fixed.
- cmd.FlagForEachArg("--warning_check ", l.extraMainlineLintErrors)
- }
+ cmd.FlagForEachArg("--error_check ", l.extraMainlineLintErrors)
cmd.FlagForEachArg("--disable_check ", l.properties.Lint.Disabled_checks)
cmd.FlagForEachArg("--warning_check ", l.properties.Lint.Warning_checks)
cmd.FlagForEachArg("--error_check ", l.properties.Lint.Error_checks)
diff --git a/java/lint_test.go b/java/lint_test.go
index b7e6aad8e..11c999cea 100644
--- a/java/lint_test.go
+++ b/java/lint_test.go
@@ -91,9 +91,8 @@ func TestJavaLintUsesCorrectBpConfig(t *testing.T) {
t.Error("did not use the correct file for baseline")
}
- if !strings.Contains(*sboxProto.Commands[0].Command, "--warning_check NewApi") {
- // TODO(b/268261262): Change this to check for --error_check
- t.Error("should check NewApi warnings")
+ if !strings.Contains(*sboxProto.Commands[0].Command, "--error_check NewApi") {
+ t.Error("should check NewApi errors")
}
if !strings.Contains(*sboxProto.Commands[0].Command, "--error_check SomeCheck") {