Example usage for org.eclipse.jdt.internal.compiler.ast TypeDeclaration resolve

List of usage examples for org.eclipse.jdt.internal.compiler.ast TypeDeclaration resolve

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast TypeDeclaration resolve.

Prototype

public void resolve(CompilationUnitScope upperScope) 

Source Link

Document

Resolve a top level type declaration

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.java

License:Open Source License

private static boolean ensureLateRoleUnitState(RoleModel model, int nextState) {
    // a unit-state has been requested for a late role
    TypeDeclaration roleDecl = model.getAst();
    if (roleDecl != null) {
        TypeDeclaration teamDecl = roleDecl.enclosingType;
        switch (nextState) {
        case STATE_ROLE_FILES_LINKED: // handled explicitly when role files are found
            break;
        case STATE_LENV_DONE_FIELDS_AND_METHODS:
            if (roleDecl.scope != null) {
                roleDecl.scope.checkParameterizedTypeBounds();
                roleDecl.scope.checkParameterizedSuperTypeCollisions();
                if (Config.getBuildFieldsAndMethods())
                    roleDecl.scope.buildFieldsAndMethodsForLateRole();
            }//from  ww  w.j av a 2s . co m
            break;
        case STATE_RESOLVED:
            if (teamDecl != null && teamDecl.scope != null)
                roleDecl.resolve(teamDecl.scope);
            break;
        case STATE_CODE_ANALYZED:
            if (teamDecl != null && teamDecl.scope != null)
                if (Config.getAnalyzeCode())
                    roleDecl.analyseCode(teamDecl.scope);
            break;
        default:
            if (roleDecl.isRoleFile()) {
                CompilationUnitDeclaration unit = roleDecl.compilationUnit;
                Pair<Boolean, Success> result = establishUnitState(unit, nextState, Success.OK, null);
                Success success = result.second;
                if (success != Success.NotReady)
                    StateHelper.setStateRecursive(unit, nextState, false);
                return success == Success.OK;
            }
        }
    }
    model.setState(nextState);
    model.setMemberState(nextState);
    return true;
}