diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/QualifiedExpressionResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/QualifiedExpressionResolver.java index af046e11fce..1942bf71510 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/QualifiedExpressionResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/QualifiedExpressionResolver.java @@ -35,6 +35,13 @@ import java.util.Set; import static org.jetbrains.jet.lang.diagnostics.Errors.*; public class QualifiedExpressionResolver { + private static final Predicate CLASSIFIERS_AND_NAMESPACES = new Predicate() { + @Override + public boolean apply(@Nullable DeclarationDescriptor descriptor) { + return descriptor instanceof ClassifierDescriptor || descriptor instanceof NamespaceDescriptor; + } + }; + public enum LookupMode { // Only classifier and packages are resolved ONLY_CLASSES, @@ -306,13 +313,7 @@ public class QualifiedExpressionResolver { Collection filteredDescriptors; if (lookupMode == LookupMode.ONLY_CLASSES) { - filteredDescriptors = Collections2.filter(descriptors, new Predicate() { - @Override - public boolean apply(@Nullable DeclarationDescriptor descriptor) { - return (descriptor instanceof ClassifierDescriptor) || - (descriptor instanceof NamespaceDescriptor); - } - }); + filteredDescriptors = Collections2.filter(descriptors, CLASSIFIERS_AND_NAMESPACES); } else { filteredDescriptors = Sets.newLinkedHashSet(); @@ -322,14 +323,7 @@ public class QualifiedExpressionResolver { filteredDescriptors.addAll(lookupResult.descriptors); continue; } - filteredDescriptors.addAll(Collections2.filter(lookupResult.descriptors, new Predicate() { - @Override - public boolean apply(@Nullable DeclarationDescriptor descriptor) { - return (descriptor instanceof NamespaceDescriptor) || - (descriptor instanceof ClassifierDescriptor) || - (descriptor instanceof VariableDescriptorForObject); - } - })); + filteredDescriptors.addAll(Collections2.filter(lookupResult.descriptors, CLASSIFIERS_AND_NAMESPACES)); } } if (storeResult) { diff --git a/core/descriptors/src/org/jetbrains/jet/lang/descriptors/VariableDescriptorForObject.java b/core/descriptors/src/org/jetbrains/jet/lang/descriptors/VariableDescriptorForObject.java deleted file mode 100644 index 17267cf8f34..00000000000 --- a/core/descriptors/src/org/jetbrains/jet/lang/descriptors/VariableDescriptorForObject.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lang.descriptors; - -import org.jetbrains.annotations.NotNull; - -public interface VariableDescriptorForObject extends VariableDescriptor { - @NotNull - ClassDescriptor getObjectClass(); -} diff --git a/idea/src/org/jetbrains/jet/plugin/libraries/DecompiledNavigationUtils.java b/idea/src/org/jetbrains/jet/plugin/libraries/DecompiledNavigationUtils.java index f5bbd98eb30..a5b73e50887 100644 --- a/idea/src/org/jetbrains/jet/plugin/libraries/DecompiledNavigationUtils.java +++ b/idea/src/org/jetbrains/jet/plugin/libraries/DecompiledNavigationUtils.java @@ -83,12 +83,6 @@ public final class DecompiledNavigationUtils { return getEffectiveReferencedDescriptor(overriddenDescriptors.iterator().next()); } } - if (referencedDescriptor instanceof VariableDescriptorForObject) { - ClassDescriptor objectClass = ((VariableDescriptorForObject) referencedDescriptor).getObjectClass(); - if (objectClass.getKind() == ClassKind.OBJECT) { - return objectClass; - } - } return referencedDescriptor; }