Example usage for org.eclipse.jdt.internal.compiler.lookup SourceTypeBinding addSyntheticBridgeMethod

List of usage examples for org.eclipse.jdt.internal.compiler.lookup SourceTypeBinding addSyntheticBridgeMethod

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.lookup SourceTypeBinding addSyntheticBridgeMethod.

Prototype

public SyntheticMethodBinding addSyntheticBridgeMethod(MethodBinding inheritedMethodToBridge,
            MethodBinding targetMethod) 

Source Link

Usage

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

License:Open Source License

private static boolean establishLateElementsCopied(RoleModel model) {
    boolean success = true;
    TypeDeclaration roleDecl = model.getAst();
    if (roleDecl != null) {
        success = CopyInheritance.copyLocalTypes(model);
        if (!roleDecl.isInterface()) {
            if (roleDecl.methods != null)
                for (AbstractMethodDeclaration method : roleDecl.methods)
                    if (method.isGenerated && method.model != null)
                        method.model.generateStatements();

            if (model.isBound()) {
                MethodBinding unimplementedGetBase = model.getInheritedUnimplementedGetBase();
                if (unimplementedGetBase != null) {
                    ReferenceBinding classBinding = model.getClassPartBinding();
                    if (classBinding != null && !classBinding.isBinaryBinding()) {
                        MethodBinding getBaseMethod = classBinding.getExactMethod(IOTConstants._OT_GETBASE,
                                Binding.NO_PARAMETERS, null);
                        SourceTypeBinding classSourceType = (SourceTypeBinding) classBinding;
                        classSourceType.addSyntheticBridgeMethod(unimplementedGetBase, getBaseMethod);
                    }/*from  w ww .  j  av a2s .  c om*/
                }
            }
        }
    }
    model.setState(STATE_LATE_ELEMENTS_COPIED);
    return success;
}