diff options
author | 2017-06-12 13:32:12 +0200 | |
---|---|---|
committer | 2017-06-12 17:39:50 +0200 | |
commit | 9c4c60d39204ad4bd1c2ef749221423f0d429e1c (patch) | |
tree | 8449be24e64fa038a8873dd9bb0f8c56dacfb5dc /src/main/java/com/google | |
parent | 1d45b5d1db749455f424aa0086577261e560fe7b (diff) |
Remove ErrorSensingEventHandler#resetErrors().
The call sites in QueryEnvironment implementations were not needed because QueryEnvironments are always made afresh.
RELNOTES: None.
PiperOrigin-RevId: 158698881
Diffstat (limited to 'src/main/java/com/google')
4 files changed, 6 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/events/ErrorSensingEventHandler.java b/src/main/java/com/google/devtools/build/lib/events/ErrorSensingEventHandler.java index 4057765073..db45066909 100644 --- a/src/main/java/com/google/devtools/build/lib/events/ErrorSensingEventHandler.java +++ b/src/main/java/com/google/devtools/build/lib/events/ErrorSensingEventHandler.java @@ -40,11 +40,4 @@ public final class ErrorSensingEventHandler extends DelegatingEventHandler { public boolean hasErrors() { return hasErrors; } - - /** - * Reset the error flag. Don't call this while other threads are accessing the same object. - */ - public void resetErrors() { - hasErrors = false; - } } diff --git a/src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java index b09abaef2e..361514b5e7 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java @@ -119,7 +119,6 @@ public class BlazeQueryEnvironment extends AbstractBlazeQueryEnvironment<Target> QueryExpression expr, ThreadSafeOutputFormatterCallback<Target> callback) throws QueryException, InterruptedException, IOException { - eventHandler.resetErrors(); resolvedTargetPatterns.clear(); QueryEvalResult queryEvalResult = super.evaluateQuery(expr, callback); return new DigraphQueryEvalResult<>( diff --git a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java index 551844e962..8a22522d26 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java @@ -388,10 +388,6 @@ public class SkyQueryEnvironment extends AbstractBlazeQueryEnvironment<Target> public QueryEvalResult evaluateQuery( QueryExpression expr, ThreadSafeOutputFormatterCallback<Target> callback) throws QueryException, InterruptedException, IOException { - // Some errors are reported as QueryExceptions and others as ERROR events (if --keep_going). The - // result is set to have an error iff there were errors emitted during the query, so we reset - // errors here. - eventHandler.resetErrors(); beforeEvaluateQuery(); // SkyQueryEnvironment batches callback invocations using a BatchStreamedCallback, created here diff --git a/src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java b/src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java index 66fd324743..7d8f38c570 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java +++ b/src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java @@ -133,6 +133,12 @@ public class ProtoOutputFormatter extends AbstractUnorderedFormatter { @Override public ThreadSafeOutputFormatterCallback<Target> createStreamCallback( OutputStream out, QueryOptions options, QueryEnvironment<?> env) { + return createStreamCallback(out, options); + } + + @VisibleForTesting + public ThreadSafeOutputFormatterCallback<Target> createStreamCallback( + OutputStream out, QueryOptions options) { return new SynchronizedDelegatingOutputFormatterCallback<>( createPostFactoStreamCallback(out, options)); } |