35
35
import com .google .devtools .build .lib .server .FailureDetails .Toolchain .Code ;
36
36
import com .google .devtools .build .skyframe .SkyFunction .Environment ;
37
37
import com .google .devtools .build .skyframe .SkyframeIterableResult ;
38
+ import com .google .devtools .build .skyframe .SkyframeLookupResult ;
38
39
import java .util .HashMap ;
39
40
import java .util .Map ;
40
41
import javax .annotation .Nullable ;
@@ -51,7 +52,7 @@ public static Map<ConfiguredTargetKey, PlatformInfo> getPlatformInfo(
51
52
return null ;
52
53
}
53
54
54
- SkyframeIterableResult values = env .getOrderedValuesAndExceptions (platformKeys );
55
+ SkyframeLookupResult values = env .getValuesAndExceptions (platformKeys );
55
56
boolean valuesMissing = env .valuesMissing ();
56
57
Map <ConfiguredTargetKey , PlatformInfo > platforms = valuesMissing ? null : new HashMap <>();
57
58
for (ConfiguredTargetKey key : platformKeys ) {
@@ -80,12 +81,13 @@ private static void validatePlatformKeys(
80
81
.map (PackageValue ::key )
81
82
.collect (toImmutableSet ());
82
83
83
- SkyframeIterableResult values = env .getOrderedValuesAndExceptions (packageKeys );
84
+ SkyframeLookupResult values = env .getValuesAndExceptions (packageKeys );
84
85
boolean valuesMissing = env .valuesMissing ();
85
86
Map <PackageIdentifier , Package > packages = valuesMissing ? null : new HashMap <>();
86
- while ( values . hasNext () ) {
87
+ for ( PackageValue . Key packageKey : packageKeys ) {
87
88
try {
88
- PackageValue packageValue = (PackageValue ) values .nextOrThrow (NoSuchPackageException .class );
89
+ PackageValue packageValue =
90
+ (PackageValue ) values .getOrThrow (packageKey , NoSuchPackageException .class );
89
91
if (!valuesMissing && packageValue != null ) {
90
92
packages .put (packageValue .getPackage ().getPackageIdentifier (), packageValue .getPackage ());
91
93
}
@@ -125,13 +127,13 @@ private static void validatePlatformKeys(
125
127
* InvalidPlatformException} is thrown.
126
128
*/
127
129
@ Nullable
128
- private static PlatformInfo findPlatformInfo (
129
- ConfiguredTargetKey key , SkyframeIterableResult values ) throws InvalidPlatformException {
130
-
130
+ private static PlatformInfo findPlatformInfo (ConfiguredTargetKey key , SkyframeLookupResult values )
131
+ throws InvalidPlatformException {
131
132
try {
132
133
ConfiguredTargetValue ctv =
133
134
(ConfiguredTargetValue )
134
- values .nextOrThrow (
135
+ values .getOrThrow (
136
+ key ,
135
137
ConfiguredValueCreationException .class ,
136
138
NoSuchThingException .class ,
137
139
ActionConflictException .class );
@@ -191,10 +193,6 @@ public InvalidPlatformException(Label label, ActionConflictException e) {
191
193
super (formatError (label , DEFAULT_ERROR ), e );
192
194
}
193
195
194
- InvalidPlatformException (Label label , String error ) {
195
- super (formatError (label , error ));
196
- }
197
-
198
196
@ Override
199
197
protected Code getDetailedCode () {
200
198
return Code .INVALID_PLATFORM_VALUE ;
0 commit comments