void (OperationChain currentChain, List<OperationChain> result, ChainCompletionContext context, CompilerReferenceServiceEx referenceServiceEx) { RefChainOperation signature = currentChain.getHead(); // type cast + introduced qualifier: it's too complex chain if (currentChain.hasCast()) return; if (!context.getTarget().getClassQName().equals(signature.getQualifierRawName())) { Set<CompilerRef> references = context.getContextClassReferences(); boolean isRelevantQualifier = false; for (CompilerRef ref: references) { if (referenceServiceEx.mayHappen(signature.getQualifierDef(), ref, ChainSearchMagicConstants.VAR_PROBABILITY_THRESHOLD)) { isRelevantQualifier = true; break; } } if (references.isEmpty() || isRelevantQualifier) { addChainIfNotPresent(currentChain, result); } } }