Search in sources :

Example 1 with ExceptionInferenceFlowContext

use of org.eclipse.jdt.internal.compiler.flow.ExceptionInferenceFlowContext in project bazel-jdt-java-toolchain by salesforce.

the class LambdaExpression method analyzeExceptions.

private void analyzeExceptions() {
    ExceptionHandlingFlowContext ehfc;
    CompilerOptions compilerOptions = this.scope.compilerOptions();
    boolean oldAnalyseResources = compilerOptions.analyseResourceLeaks;
    compilerOptions.analyseResourceLeaks = false;
    try {
        this.body.analyseCode(this.scope, ehfc = new ExceptionInferenceFlowContext(null, this, Binding.NO_EXCEPTIONS, null, this.scope, FlowInfo.DEAD_END), UnconditionalFlowInfo.fakeInitializedFlowInfo(this.scope.outerMostMethodScope().analysisIndex, this.scope.referenceType().maxFieldCount));
        this.thrownExceptions = ehfc.extendedExceptions == null ? Collections.emptySet() : new HashSet<TypeBinding>(ehfc.extendedExceptions);
    } catch (Exception e) {
    // drop silently.
    } finally {
        compilerOptions.analyseResourceLeaks = oldAnalyseResources;
    }
}
Also used : ExceptionInferenceFlowContext(org.eclipse.jdt.internal.compiler.flow.ExceptionInferenceFlowContext) CompilerOptions(org.eclipse.jdt.internal.compiler.impl.CompilerOptions) ExceptionHandlingFlowContext(org.eclipse.jdt.internal.compiler.flow.ExceptionHandlingFlowContext) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet)

Aggregations

HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 ExceptionHandlingFlowContext (org.eclipse.jdt.internal.compiler.flow.ExceptionHandlingFlowContext)1 ExceptionInferenceFlowContext (org.eclipse.jdt.internal.compiler.flow.ExceptionInferenceFlowContext)1 CompilerOptions (org.eclipse.jdt.internal.compiler.impl.CompilerOptions)1