Example usage for org.eclipse.jdt.internal.compiler.flow FlowContext checkExceptionHandlers

List of usage examples for org.eclipse.jdt.internal.compiler.flow FlowContext checkExceptionHandlers

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.flow FlowContext checkExceptionHandlers.

Prototype

public void checkExceptionHandlers(TypeBinding[] raisedExceptions, ASTNode location, FlowInfo flowInfo,
            BlockScope scope) 

Source Link

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.ast.BaseCallMessageSend.java

License:Open Source License

public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
    flowInfo = super.analyseCode(currentScope, flowContext, flowInfo);
    MethodDeclaration callinMethod = getEnclosingCallinMethod(currentScope);
    LocalVariableBinding trackingVariable = callinMethod.baseCallTrackingVariable.binding;
    if (flowInfo.isDefinitelyAssigned(callinMethod.baseCallTrackingVariable))
        currentScope.problemReporter().definitelyDuplicateBasecall(this._wrappee);
    else if (flowInfo.isPotentiallyAssigned(trackingVariable))
        currentScope.problemReporter().potentiallyDuplicateBasecall(this._wrappee);
    else/*from   w w w  . jav a 2 s.c om*/
        flowInfo.markAsDefinitelyAssigned(trackingVariable);

    // check exceptions thrown by any bound base method:
    MethodScope methodScope = currentScope.methodScope();
    if (methodScope != null) {
        MethodModel methodModel = methodScope.referenceMethod().binding.model;
        if (methodModel != null && methodModel._baseExceptions != null) {
            for (ReferenceBinding exceptionType : methodModel._baseExceptions)
                flowContext.checkExceptionHandlers(exceptionType, this, flowInfo, currentScope);
        }
    }

    if (this.isSuperAccess)
        //    signal that the base call surrogate needs to handle super-access:
        MethodModel.addCallinFlag(currentScope.methodScope().referenceMethod(),
                IOTConstants.CALLIN_FLAG_BASE_SUPER_CALL);

    return flowInfo;
}