Example usage for org.eclipse.jdt.internal.compiler.lookup TypeBinding computeUniqueKey

List of usage examples for org.eclipse.jdt.internal.compiler.lookup TypeBinding computeUniqueKey

Introduction

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

Prototype

public char[] computeUniqueKey() 

Source Link

Usage

From source file:org.eclipse.recommenders.internal.chain.rcp.TypeBindingAnalyzer.java

License:Open Source License

private static Optional<TypeBinding> resolveReturnStatement(final InternalCompletionContext context) {
    final String expected = String.valueOf(context.getExpectedTypesKeys()[0]);
    final ObjectVector methods = context.getVisibleMethods();
    for (int i = 0; i < methods.size; ++i) {
        final TypeBinding type = ((MethodBinding) methods.elementAt(i)).returnType;
        final String key = String.valueOf(type.computeUniqueKey());
        if (key.equals(expected)) {
            return Optional.of(type);
        }// w  w w .  j  av a 2 s.com
    }
    return Optional.absent();
}