From 7727c7f0960886b4302d60256576b2daac56354f Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 18 Jul 2024 15:36:32 -0700 Subject: Convert JavaInfoProvider to *JavaInfo Convert JavaInfoProvider to return a *JavaInfo instead of a JavaInfo. This will reduce copying when reading the provider, and also allows JavaInfo to recursively contain a depset of JavaInfos from dependencies. Bug: 308016794 Test: go test ./java/... Flag: EXEMPT refactor Change-Id: Ibf6d9b797f760ad1fe815d59839839fdfad91733 --- java/system_modules.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'java/system_modules.go') diff --git a/java/system_modules.go b/java/system_modules.go index 8e2d5d8ff..500d7fa25 100644 --- a/java/system_modules.go +++ b/java/system_modules.go @@ -162,8 +162,9 @@ func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleConte var jars android.Paths ctx.VisitDirectDepsWithTag(systemModulesLibsTag, func(module android.Module) { - dep, _ := android.OtherModuleProvider(ctx, module, JavaInfoProvider) - jars = append(jars, dep.HeaderJars...) + if dep, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok { + jars = append(jars, dep.HeaderJars...) + } }) system.headerJars = jars -- cgit v1.2.3-59-g8ed1b