From 13a9dd604b1f2e813145156b129486761493ee4c Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Mon, 4 Nov 2019 10:26:47 +0000 Subject: [PATCH] Remove unnecessary constraint on previous_api The constraint requires the previous_api property to be specified unless validating nullness. However, there is no reason within the Soong code why that should be. The only use of previous_api is as the argument to the metalava --migrate-nullness option which is only added when previous_api is specified. So, there is no reason in the Soong code for the constraint. Metalava also does not require the --migrate-nullness option to be specified unless validating nullness. So, there is no reason in metalava for the constraint. It is therefore safe to remove the constraint. Bug: 142113521 Test: m checkbuild Change-Id: I189071e215e928fdf43a39a03d540732743b7a32 --- java/droiddoc.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/java/droiddoc.go b/java/droiddoc.go index 5d01b540f..c898498a8 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -1325,13 +1325,8 @@ func (d *Droidstubs) annotationsFlags(ctx android.ModuleContext, cmd *android.Ru validatingNullability := strings.Contains(d.Javadoc.args, "--validate-nullability-from-merged-stubs") || String(d.properties.Validate_nullability_from_list) != "" + migratingNullability := String(d.properties.Previous_api) != "" - - if !(migratingNullability || validatingNullability) { - ctx.PropertyErrorf("previous_api", - "has to be non-empty if annotations was enabled (unless validating nullability)") - } - if migratingNullability { previousApi := android.PathForModuleSrc(ctx, String(d.properties.Previous_api)) cmd.FlagWithInput("--migrate-nullness ", previousApi)