Migrate Executor-less Futures callback methods to the ones with an Executor, while applying MoreExecutors.directExecutor() for identical behavior.
// limitations under the License.
package com.google.devtools.build.lib.skyframe;
+import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static com.google.devtools.build.lib.pkgcache.FilteringPolicies.NO_FILTER;
import com.google.common.base.Function;
@@ -313,15 +314,19 @@ public class RecursivePackageProviderBackedTargetPatternResolver
}
}));
}
- return Futures.whenAllSucceed(futures).call(new Callable<Void>() {
+ return Futures.whenAllSucceed(futures)
+ .call(
+ new Callable<Void>() {
@Override
public Void call() throws TargetParsingException {
if (!foundTarget.get()) {
- throw new TargetParsingException("no targets found beneath '" + pathFragment + "'");
+ throw new TargetParsingException(
+ "no targets found beneath '" + pathFragment + "'");
}
return null;
}
- });
+ },
+ directExecutor());
}
private static <T> int calculateSize(Iterable<ResolvedTargets<T>> resolvedTargets) {
