From 9ee3c0de6d9617f2ae828396ce169e21562fd512 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Fri, 28 Dec 2012 19:59:37 +0400 Subject: [PATCH] Renamed Matcher -> NavigationStrategy. Extracted anonymous classes. Renamed methods. --- .../plugin/libraries/JetSourceNavigationHelper.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/libraries/JetSourceNavigationHelper.java b/idea/src/org/jetbrains/jet/plugin/libraries/JetSourceNavigationHelper.java index 7999869709c..8667a4ddea2 100644 --- a/idea/src/org/jetbrains/jet/plugin/libraries/JetSourceNavigationHelper.java +++ b/idea/src/org/jetbrains/jet/plugin/libraries/JetSourceNavigationHelper.java @@ -160,7 +160,7 @@ public class JetSourceNavigationHelper { NamespaceDescriptor namespaceDescriptor = bindingContextAndNamespaceDescriptor.second; if (receiverType == null) { // non-extension property - for (Descr candidate : navigationStrategy.getCandidatesFromScope(namespaceDescriptor.getMemberScope(), entityNameAsName)) { + for (Descr candidate : navigationStrategy.getCandidateDescriptors(namespaceDescriptor.getMemberScope(), entityNameAsName)) { if (candidate.getReceiverParameter() == null) { if (navigationStrategy.declarationAndDescriptorMatch(decompiledDeclaration, candidate)) { return (JetDeclaration) BindingContextUtils.descriptorToDeclaration(bindingContext, candidate); @@ -171,7 +171,7 @@ public class JetSourceNavigationHelper { else { // extension property String expectedTypeString = receiverType.getText(); - for (Descr candidate : navigationStrategy.getCandidatesFromScope(namespaceDescriptor.getMemberScope(), entityNameAsName)) { + for (Descr candidate : navigationStrategy.getCandidateDescriptors(namespaceDescriptor.getMemberScope(), entityNameAsName)) { ReceiverParameterDescriptor receiverParameter = candidate.getReceiverParameter(); if (receiverParameter != null) { String thisReceiverType = DescriptorRenderer.TEXT.renderType(receiverParameter.getType()); @@ -206,7 +206,7 @@ public class JetSourceNavigationHelper { } ClassDescriptor expectedContainer = isClassObject ? classDescriptor.getClassObjectDescriptor() : classDescriptor; - for (Descr candidate : navigationStrategy.getCandidatesFromScope(memberScope, entityNameAsName)) { + for (Descr candidate : navigationStrategy.getCandidateDescriptors(memberScope, entityNameAsName)) { if (candidate.getContainingDeclaration() == expectedContainer) { JetDeclaration property = (JetDeclaration) BindingContextUtils.descriptorToDeclaration(bindingContext, candidate); if (property != null) { @@ -232,7 +232,7 @@ public class JetSourceNavigationHelper { private interface NavigationStrategy { boolean declarationAndDescriptorMatch(Decl declaration, Descr descriptor); - Collection getCandidatesFromScope(JetScope scope, Name name); + Collection getCandidateDescriptors(JetScope scope, Name name); } private static class FunctionNavigationStrategy implements NavigationStrategy { @@ -268,7 +268,7 @@ public class JetSourceNavigationHelper { } @Override - public Collection getCandidatesFromScope(JetScope scope, Name name) { + public Collection getCandidateDescriptors(JetScope scope, Name name) { return scope.getFunctions(name); } } @@ -280,7 +280,7 @@ public class JetSourceNavigationHelper { } @Override - public Collection getCandidatesFromScope(JetScope scope, Name name) { + public Collection getCandidateDescriptors(JetScope scope, Name name) { return scope.getProperties(name); } }