Unused method getPropertyByFieldReference() removed from JetScope and its implementations
This commit is contained in:
-6
@@ -211,12 +211,6 @@ public abstract class DeserializedMemberScope implements JetScope {
|
||||
throw new UnsupportedOperationException("Should not be called");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
throw new UnsupportedOperationException("Should not be called");
|
||||
}
|
||||
|
||||
private Collection<DeclarationDescriptor> computeAllDescriptors() {
|
||||
Collection<DeclarationDescriptor> result = new LinkedHashSet<DeclarationDescriptor>(0);
|
||||
|
||||
|
||||
@@ -291,12 +291,6 @@ public class LazyImportScope implements JetScope {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
|
||||
-5
@@ -245,11 +245,6 @@ public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, D
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
|
||||
@@ -38,14 +38,6 @@ public class WriteThroughScope extends WritableScopeWithImports {
|
||||
this.writableWorker = scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
checkMayRead();
|
||||
|
||||
return writableWorker.getPropertyByFieldReference(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Collection<DeclarationDescriptor> getDeclarationsByLabel(LabelName labelName) {
|
||||
|
||||
@@ -87,11 +87,6 @@ public abstract class AbstractScopeAdapter implements JetScope {
|
||||
return getWorkerScope().getDeclarationsByLabel(labelName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
return getWorkerScope().getPropertyByFieldReference(fieldName);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
|
||||
@@ -148,17 +148,6 @@ public class ChainedScope implements JetScope {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
for (JetScope jetScope : scopeChain) {
|
||||
PropertyDescriptor propertyByFieldReference = jetScope.getPropertyByFieldReference(fieldName);
|
||||
if (propertyByFieldReference != null) {
|
||||
return propertyByFieldReference;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
|
||||
@@ -103,11 +103,6 @@ public class FilteringScope implements JetScope {
|
||||
return Collections2.filter(workerScope.getDeclarationsByLabel(labelName), predicate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
return filterDescriptor(workerScope.getPropertyByFieldReference(fieldName));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getOwnDeclaredDescriptors() {
|
||||
|
||||
@@ -69,13 +69,6 @@ public interface JetScope {
|
||||
@NotNull
|
||||
Collection<DeclarationDescriptor> getDeclarationsByLabel(@NotNull LabelName labelName);
|
||||
|
||||
/**
|
||||
* @param fieldName includes the "$"
|
||||
* @return the property declaring this field, if any
|
||||
*/
|
||||
@Nullable
|
||||
PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName);
|
||||
|
||||
/**
|
||||
* All visible descriptors from current scope.
|
||||
*
|
||||
|
||||
@@ -71,11 +71,6 @@ public abstract class JetScopeImpl implements JetScope {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
|
||||
@@ -136,11 +136,6 @@ public class SubstitutingScope implements JetScope {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
|
||||
@@ -38,10 +38,6 @@ public class WritableScopeImpl extends WritableScopeWithImports {
|
||||
@NotNull
|
||||
private final DeclarationDescriptor ownerDeclarationDescriptor;
|
||||
|
||||
// FieldNames include "$"
|
||||
@Nullable
|
||||
private Map<Name, PropertyDescriptor> propertyDescriptorsByFieldNames;
|
||||
|
||||
@Nullable
|
||||
private SetMultimap<Name, FunctionDescriptor> functionGroups;
|
||||
|
||||
@@ -483,28 +479,6 @@ public class WritableScopeImpl extends WritableScopeWithImports {
|
||||
return implicitReceiverHierarchy;
|
||||
}
|
||||
|
||||
// @SuppressWarnings({"NullableProblems"})
|
||||
@NotNull
|
||||
private Map<Name, PropertyDescriptor> getPropertyDescriptorsByFieldNames() {
|
||||
if (propertyDescriptorsByFieldNames == null) {
|
||||
propertyDescriptorsByFieldNames = new HashMap<Name, PropertyDescriptor>();
|
||||
}
|
||||
return propertyDescriptorsByFieldNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
checkMayRead();
|
||||
|
||||
if (!fieldName.asString().startsWith("$")) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
PropertyDescriptor descriptor = getPropertyDescriptorsByFieldNames().get(fieldName);
|
||||
if (descriptor != null) return descriptor;
|
||||
return super.getPropertyByFieldReference(fieldName);
|
||||
}
|
||||
|
||||
public List<VariableDescriptor> getDeclaredVariables() {
|
||||
checkMayRead();
|
||||
|
||||
|
||||
@@ -139,11 +139,6 @@ public class ErrorUtils {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
return null; // TODO : review
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
@@ -223,12 +218,6 @@ public class ErrorUtils {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull Name fieldName) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||
|
||||
Reference in New Issue
Block a user