From 22585cb18c3666ab78fe6b02f44e7abf3b58ffea Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 23 Aug 2016 19:11:25 +0000 Subject: Use helper method for collecting transitive source jars. -- MOS_MIGRATED_REVID=131083264 --- .../com/google/devtools/build/lib/rules/java/JavaBinary.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src') diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java index 2e1d01f316..d476e9d46f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java @@ -221,7 +221,7 @@ public class JavaBinary implements RuleConfiguredTargetFactory { JavaCommon.getJavaBinSubstitution(ruleContext, launcher)); } - NestedSet transitiveSourceJars = collectTransitiveSourceJars(common, srcJar); + NestedSet transitiveSourceJars = common.collectTransitiveSourceJars(srcJar); // TODO(bazel-team): if (getOptions().sourceJars) then make this a dummy prerequisite for the // DeployArchiveAction ? Needs a few changes there as we can't pass inputs @@ -442,16 +442,6 @@ public class JavaBinary implements RuleConfiguredTargetFactory { } } - private NestedSet collectTransitiveSourceJars(JavaCommon common, Artifact srcJar) { - NestedSetBuilder builder = NestedSetBuilder.stableOrder(); - - builder.add(srcJar); - for (JavaSourceJarsProvider dep : common.getDependencies(JavaSourceJarsProvider.class)) { - builder.addTransitive(dep.getTransitiveSourceJars()); - } - return builder.build(); - } - /** * Collects the native libraries in the transitive closure of the deps. * -- cgit v1.2.3