From 3d2a68c6da2a50a9e1bcf6615e83a43701cdf95d Mon Sep 17 00:00:00 2001 From: laurentlb Date: Fri, 30 Jun 2017 00:32:04 +0200 Subject: Automated conversion to Java 8 With a few manual fixes for readability. RELNOTES: None. PiperOrigin-RevId: 160582556 --- .../analysis/platform/PlatformProviderUtils.java | 28 +++------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/analysis/platform/PlatformProviderUtils.java') diff --git a/src/main/java/com/google/devtools/build/lib/analysis/platform/PlatformProviderUtils.java b/src/main/java/com/google/devtools/build/lib/analysis/platform/PlatformProviderUtils.java index 7a5d06d969..73664f7b04 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/platform/PlatformProviderUtils.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/platform/PlatformProviderUtils.java @@ -14,7 +14,6 @@ package com.google.devtools.build.lib.analysis.platform; -import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.devtools.build.lib.analysis.SkylarkProviderCollection; import com.google.devtools.build.lib.util.Preconditions; @@ -35,14 +34,7 @@ public class PlatformProviderUtils { /** Retrieves and casts {@link PlatformInfo} providers from the given targets. */ public static Iterable platforms( Iterable targets) { - return Iterables.transform( - targets, - new Function() { - @Override - public PlatformInfo apply(SkylarkProviderCollection target) { - return platform(target); - } - }); + return Iterables.transform(targets, PlatformProviderUtils::platform); } /** Retrieves and casts the {@link ConstraintSettingInfo} provider from the given target. */ @@ -58,14 +50,7 @@ public class PlatformProviderUtils { /** Retrieves and casts {@link ConstraintSettingInfo} providers from the given targets. */ public static Iterable constraintSettings( Iterable targets) { - return Iterables.transform( - targets, - new Function() { - @Override - public ConstraintSettingInfo apply(SkylarkProviderCollection target) { - return constraintSetting(target); - } - }); + return Iterables.transform(targets, PlatformProviderUtils::constraintSetting); } /** Retrieves and casts the {@link ConstraintValueInfo} provider from the given target. */ @@ -81,13 +66,6 @@ public class PlatformProviderUtils { /** Retrieves and casts {@link ConstraintValueInfo} providers from the given targets. */ public static Iterable constraintValues( Iterable targets) { - return Iterables.transform( - targets, - new Function() { - @Override - public ConstraintValueInfo apply(SkylarkProviderCollection target) { - return constraintValue(target); - } - }); + return Iterables.transform(targets, PlatformProviderUtils::constraintValue); } } -- cgit v1.2.3