Example usage for org.eclipse.jdt.internal.compiler.lookup Binding BINDING

List of usage examples for org.eclipse.jdt.internal.compiler.lookup Binding BINDING

Introduction

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

Prototype

BINDING

Source Link

Usage

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

License:Open Source License

/**
 * Does list of bindings contain a pair of callins, of which one overrides the other?
 * Signal a problem if so.//from   w  w  w.  ja  va2s  .co  m
 *
 * @param bindingNames
 */
private static void checkOverriding(NameReference[] bindingNames, Scope scope) {
    for (int i = 1; i < bindingNames.length; i++) {
        NameReference ref_i = bindingNames[i];
        if (ref_i.binding != null && ref_i.binding.kind() == Binding.BINDING) {
            for (int j = 0; j < i; j++) {
                NameReference ref_j = bindingNames[j];
                if (ref_j.binding != null && ref_j.binding.kind() == Binding.BINDING) {
                    CallinCalloutBinding callin_i = (CallinCalloutBinding) ref_i.binding;
                    CallinCalloutBinding callin_j = (CallinCalloutBinding) ref_j.binding;
                    if (!CharOperation.equals(callin_i.name, callin_j.name))
                        continue;
                    ReferenceBinding role_i = callin_i._declaringRoleClass;
                    ReferenceBinding role_j = callin_j._declaringRoleClass;
                    if (role_i.isCompatibleWith(role_j))
                        scope.problemReporter().precedenceForOverriding(ref_i, ref_j);
                    if (role_j.isCompatibleWith(role_i))
                        scope.problemReporter().precedenceForOverriding(ref_j, ref_i);
                }
            }
        }
    }
}

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.lookup.PrecedenceBinding.java

License:Open Source License

public char[] readableName() {
    char[][] names = new char[this.elements.length][];
    for (int i = 0; i < this.elements.length; i++) {
        if (this.elements[i] == null)
            names[i] = "<unresolved>".toCharArray(); //$NON-NLS-1$
        else if (this.elements[i].kind() == Binding.BINDING)
            names[i] = ((CallinCalloutBinding) this.elements[i]).name;
        else//w ww .j  a v  a2  s.c  o  m
            names[i] = ((ReferenceBinding) this.elements[i]).sourceName();
    }
    return CharOperation.concatWith(names, ',');
}